Skip to content

Commit

Permalink
remove verbose argument from meepgeom::set_materials_from_geometry (N…
Browse files Browse the repository at this point in the history
…anoComp#1000)

* remove verbose argument from meepgeom::set_materials_from_geometry

* fixes

* less verbose
  • Loading branch information
oskooi authored and stevengj committed Aug 28, 2019
1 parent b3e45b9 commit d522a88
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 15 deletions.
3 changes: 1 addition & 2 deletions python/meep.i
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,6 @@ meep::structure *create_structure_and_set_materials(vector3 cell_size,
geometric_object_list gobj_list,
vector3 center,
bool _ensure_periodicity,
bool verbose,
meep_geom::material_type _default_material,
meep_geom::absorber_list alist,
meep_geom::material_type_list extra_materials,
Expand All @@ -1628,7 +1627,7 @@ meep::structure *create_structure_and_set_materials(vector3 cell_size,

if (set_materials) {
meep_geom::set_materials_from_geometry(s, gobj_list, center, use_anisotropic_averaging, tol,
maxeval, _ensure_periodicity, verbose, _default_material,
maxeval, _ensure_periodicity, _default_material,
alist, extra_materials);
}

Expand Down
2 changes: 0 additions & 2 deletions python/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,6 @@ def _init_structure(self, k=False):
self.geometry,
self.geometry_center,
self.ensure_periodicity and not not self.k_point,
self.verbose,
self.default_material,
absorbers,
self.extra_materials,
Expand Down Expand Up @@ -1095,7 +1094,6 @@ def set_materials(self, geometry=None, default_material=None):
self.subpixel_tol,
self.subpixel_maxeval,
self.ensure_periodicity,
False,
default_material if default_material else self.default_material,
absorbers,
self.extra_materials
Expand Down
9 changes: 2 additions & 7 deletions src/meepgeom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,6 @@ class geom_epsilon : public meep::material_function {
void add_susceptibilities(meep::structure *s);
void add_susceptibilities(meep::field_type ft, meep::structure *s);

static bool verbose;

private:
void get_material_pt(material_type &material, const meep::vec &r);

Expand All @@ -368,7 +366,6 @@ class geom_epsilon : public meep::material_function {
};

/***********************************************************************/
bool geom_epsilon::verbose = false;

geom_epsilon::geom_epsilon(geometric_object_list g, material_type_list mlist,
const meep::volume &v) {
Expand Down Expand Up @@ -397,7 +394,7 @@ geom_epsilon::geom_epsilon(geometric_object_list g, material_type_list mlist,
geom_fix_object_list(geometry);
geom_box box = gv2box(v);
geometry_tree = create_geom_box_tree0(geometry, box);
if (meep::verbosity > 0 && verbose && meep::am_master()) {
if (meep::verbosity > 2 && meep::am_master()) {
master_printf("Geometric-object bounding-box tree:\n");
display_geom_box_tree(5, geometry_tree);

Expand Down Expand Up @@ -1475,11 +1472,9 @@ void add_absorbing_layer(absorber_list alist, double thickness, int direction, i
/***************************************************************/
void set_materials_from_geometry(meep::structure *s, geometric_object_list g, vector3 center,
bool use_anisotropic_averaging, double tol, int maxeval,
bool _ensure_periodicity, bool verbose,
bool _ensure_periodicity,
material_type _default_material, absorber_list alist,
material_type_list extra_materials) {
geom_epsilon::verbose = verbose;

// set global variables in libctlgeom based on data fields in s
geom_initialize();
geometry_center = center;
Expand Down
2 changes: 1 addition & 1 deletion src/meepgeom.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void set_materials_from_geometry(meep::structure *s, geometric_object_list g,
bool use_anisotropic_averaging = true,
double tol = DEFAULT_SUBPIXEL_TOL,
int maxeval = DEFAULT_SUBPIXEL_MAXEVAL,
bool ensure_periodicity = false, bool verbose = false,
bool ensure_periodicity = false,
material_type _default_material = vacuum, absorber_list alist = 0,
material_type_list extra_materials = material_type_list());

Expand Down
1 change: 0 additions & 1 deletion tests/absorber-1d-ll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ int main(int argc, char *argv[]) {
DEFAULT_SUBPIXEL_TOL, // tol
DEFAULT_SUBPIXEL_MAXEVAL, // maxeval
false, // ensure_periodicity
false, // verbose
meep_geom::vacuum, alist);

if (alist) meep_geom::destroy_absorber_list(alist);
Expand Down
3 changes: 1 addition & 2 deletions tests/user-defined-material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,9 @@ int main(int argc, char *argv[]) {
vector3 center = {0, 0, 0};
bool use_anisotropic_averaging = true;
bool ensure_periodicity = true;
bool verbose = false;
meep_geom::set_materials_from_geometry(&the_structure, g, center, use_anisotropic_averaging,
DEFAULT_SUBPIXEL_TOL, DEFAULT_SUBPIXEL_MAXEVAL,
ensure_periodicity, verbose, my_material);
ensure_periodicity, my_material);

fields f(&the_structure);

Expand Down

0 comments on commit d522a88

Please sign in to comment.