Skip to content

Commit

Permalink
Fix for Issue NanoComp#1834 (NanoComp#1840)
Browse files Browse the repository at this point in the history
* Fix memory leaks

* Add kkg to authors list

* Expose set_default_material and use it in libpympb/pympb.cpp
  • Loading branch information
kkg4theweb authored and Mo Chen committed Feb 22, 2022
1 parent 404d1d9 commit 87e1b3a
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/meepgeom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2933,26 +2933,10 @@ void material_grids_addgradient(double *v, size_t ng, std::complex<meep::realnum
size_t idx_fields = IVEC_LOOP_COUNTER;
meep::ivec ip = gv.iloc(adjoint_c,idx);
meep::vec p = gv.loc(adjoint_c,idx);
<<<<<<< HEAD
<<<<<<< HEAD
std::complex<double> adj = GET_FIELDS(fields_a, ci_adjoint, f_i, idx_fields);
material_type md;
geps->get_material_pt(md, p);
if (!md->trivial) adj *= cond_cmp(adjoint_c,p,frequencies[f_i], geps);
=======
std::complex<double> adj = GET_FIELDS(fields_a,ci_adjoint,f_i,idx_fields);

material_type md;
geps->get_material_pt(md, p);
if (!md->trivial) adj *= cond_cmp(adjoint_c,p,frequencies[f_i], geps);

>>>>>>> Fix adjoint gradient with conductivities (#1830)
=======
std::complex<double> adj = GET_FIELDS(fields_a, ci_adjoint, f_i, idx_fields);
material_type md;
geps->get_material_pt(md, p);
if (!md->trivial) adj *= cond_cmp(adjoint_c,p,frequencies[f_i], geps);
>>>>>>> support for single-precision floating point for fields array functions (#1833)
double cyl_scale;
int ci_forward = 0;
FOR_MY_COMPONENTS(forward_c) {
Expand Down Expand Up @@ -2995,11 +2979,7 @@ void material_grids_addgradient(double *v, size_t ng, std::complex<meep::realnum
to the same two nodes (which requires another factor of 0.5).
Then we perform our inner product at these nodes.
*/
<<<<<<< HEAD
std::complex<double> fwd_avg, fwd1, fwd2;
=======
std::complex<double> fwd_avg, fwd1, fwd2, prod;
>>>>>>> support for single-precision floating point for fields array functions (#1833)
ptrdiff_t fwd1_idx, fwd2_idx;

//identify the first corner of the forward fields
Expand Down

0 comments on commit 87e1b3a

Please sign in to comment.