Skip to content

Commit

Permalink
remove()
Browse files Browse the repository at this point in the history
  • Loading branch information
Mo Chen authored and Mo Chen committed Oct 13, 2022
1 parent 79f03e1 commit 6a92367
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 18 deletions.
4 changes: 1 addition & 3 deletions python/adjoint/optimization_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,7 @@ def calculate_gradient(self):

for dri in range(self.num_design_regions):
for i in range(3):
mp._delete_dft_chunk(
self.forward_design_region_monitors[dri][i].swigobj
)
self.forward_design_region_monitors[dri][i].remove()

# Cleanup list of lists
if len(self.gradient) == 1:
Expand Down
5 changes: 0 additions & 5 deletions python/meep.i
Original file line number Diff line number Diff line change
Expand Up @@ -877,11 +877,6 @@ void _get_gradient(PyObject *grad, double scalegrad,
}
%}

%inline %{
void _delete_dft_chunk(meep::dft_fields *field_chunks){
dft_fields::delete_dft_chunks(field_chunks);
}
%}

//--------------------------------------------------
// end typemaps needed for material grid
Expand Down
8 changes: 0 additions & 8 deletions src/dft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -881,14 +881,6 @@ void dft_fields::remove() {
}
}

void dft_fields::delete_dft_chunks(meep::dft_chunk *dft_chunks) {
while (dft_chunks) {
dft_chunk *nxt = dft_chunks->next_in_chunk;
delete dft_chunks;
dft_chunks = nxt;
}
}

dft_fields fields::add_dft_fields(component *components, int num_components, const volume where,
const double *freq, size_t Nfreq, bool use_centered_grid,
int decimation_factor, bool persist) {
Expand Down
2 changes: 0 additions & 2 deletions src/meep.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1438,8 +1438,6 @@ class dft_fields {

void remove();

void delete_dft_chunks(meep::dft_chunk *dft_chunks);

std::vector<double> freq;
dft_chunk *chunks;
volume where;
Expand Down

0 comments on commit 6a92367

Please sign in to comment.