36 #include <ringmesh/ringmesh_tests_config.h> 49 template <
typename GME >
51 const std::set< GME >& to_compare,
52 const std::set< GME >& with,
53 const std::string& set_name )
55 if( to_compare != with )
58 for(
const GME& cur_gme_id : to_compare )
60 if(
find( with.begin(), with.end(), cur_gme_id ) == with.end() )
63 " ", cur_gme_id.index(),
" is not in the ", set_name,
"." );
71 const std::set< gmme_id >& solution_gmme_id,
72 const std::set< gmge_id >& solution_gmge_id,
73 const std::string& to_insert_type,
74 index_t to_insert_id )
76 const GeoModelBuilder3D model_builder( geomodel );
77 std::set< gmme_id > in_mesh_entities;
78 std::set< gmge_id > in_geological_entities;
81 if( geomodel.entity_type_manager().mesh_entity_manager.is_valid_type(
84 in_mesh_entities.insert( { mesh_type, to_insert_id } );
90 geomodel.entity_type_manager()
91 .geological_entity_manager.is_valid_type( geological_type ) );
92 in_geological_entities.insert( { geological_type, to_insert_id } );
95 const GeoModelBuilder3D geomodel_builder( geomodel );
96 geomodel_builder.topology.get_dependent_entities(
97 in_mesh_entities, in_geological_entities );
98 check_element_of_a_set_are_in_another_set< gmme_id >(
99 in_mesh_entities, solution_gmme_id,
"solution" );
100 check_element_of_a_set_are_in_another_set< gmge_id >(
101 in_geological_entities, solution_gmge_id,
"solution" );
102 check_element_of_a_set_are_in_another_set< gmme_id >(
103 solution_gmme_id, in_mesh_entities,
"output" );
104 check_element_of_a_set_are_in_another_set< gmge_id >(
105 solution_gmge_id, in_geological_entities,
"output" );
116 std::set< gmme_id > solution_gmme_id = { { Corner3D::type_name_static(),
118 { Corner3D::type_name_static(), 33 },
119 { Corner3D::type_name_static(), 54 },
120 { Corner3D::type_name_static(), 55 },
121 { Corner3D::type_name_static(), 56 },
122 { Corner3D::type_name_static(), 57 },
123 { Corner3D::type_name_static(), 58 },
124 { Corner3D::type_name_static(), 93 },
125 { Corner3D::type_name_static(), 118 },
126 { Corner3D::type_name_static(), 128 },
127 { Corner3D::type_name_static(), 129 },
128 { Line3D::type_name_static(), 41 }, { Line3D::type_name_static(), 43 },
129 { Line3D::type_name_static(), 68 }, { Line3D::type_name_static(), 69 },
130 { Line3D::type_name_static(), 70 }, { Line3D::type_name_static(), 71 },
131 { Line3D::type_name_static(), 72 }, { Line3D::type_name_static(), 73 },
132 { Line3D::type_name_static(), 131 },
133 { Line3D::type_name_static(), 135 },
134 { Line3D::type_name_static(), 144 },
135 { Line3D::type_name_static(), 177 },
136 { Line3D::type_name_static(), 182 },
137 { Line3D::type_name_static(), 203 },
138 { Line3D::type_name_static(), 205 },
139 { Line3D::type_name_static(), 207 },
140 { Line3D::type_name_static(), 210 },
141 { Line3D::type_name_static(), 233 },
142 { Line3D::type_name_static(), 234 },
143 { Line3D::type_name_static(), 238 },
144 { Surface3D::type_name_static(), 11 },
145 { Surface3D::type_name_static(), 37 },
146 { Surface3D::type_name_static(), 40 },
147 { Surface3D::type_name_static(), 60 },
148 { Surface3D::type_name_static(), 85 },
149 { Surface3D::type_name_static(), 91 },
150 { Surface3D::type_name_static(), 99 },
151 { Surface3D::type_name_static(), 110 },
152 { Surface3D::type_name_static(), 114 },
153 { Region3D::type_name_static(), 4 } };
159 std::set< gmge_id > solution_gmge_id = {
160 { Contact3D::type_name_static(), 26 },
161 { Contact3D::type_name_static(), 27 },
162 { Contact3D::type_name_static(), 28 },
163 { Contact3D::type_name_static(), 78 },
164 { Contact3D::type_name_static(), 79 },
165 { Contact3D::type_name_static(), 83 },
166 { Interface3D::type_name_static(), 21 },
167 { Layer3D::type_name_static(), 0 },
171 Region3D::type_name_static().
string(), 4 );
175 GeoModel3D& geomodel )
182 std::set< gmme_id > solution_gmme_id = { { Line3D::type_name_static(), 98 },
183 { Surface3D::type_name_static(), 24 } };
189 std::set< gmge_id > solution_gmge_id = { { Contact3D::type_name_static(),
191 { Interface3D::type_name_static(), 3 } };
194 Surface3D::type_name_static().
string(), 24 );
204 std::set< gmme_id > solution_gmme_id = { { Line3D::type_name_static(),
206 { Line3D::type_name_static(), 165 },
207 { Line3D::type_name_static(), 166 },
208 { Line3D::type_name_static(), 168 },
209 { Surface3D::type_name_static(), 52 },
210 { Surface3D::type_name_static(), 53 },
211 { Surface3D::type_name_static(), 54 },
212 { Surface3D::type_name_static(), 55 },
213 { Surface3D::type_name_static(), 56 },
214 { Surface3D::type_name_static(), 57 } };
220 std::set< gmge_id > solution_gmge_id = { { Contact3D::type_name_static(),
222 { Interface3D::type_name_static(), 8 } };
225 Interface3D::type_name_static().
string(), 8 );
235 std::set< gmme_id > solution_gmme_id = { { Corner3D::type_name_static(),
242 std::set< gmge_id > solution_gmge_id;
245 Corner3D::type_name_static().
string(), 135 );
256 std::set< gmme_id > solution_gmme_id = { { Corner3D::type_name_static(),
258 { Corner3D::type_name_static(), 33 },
259 { Corner3D::type_name_static(), 54 },
260 { Corner3D::type_name_static(), 55 },
261 { Corner3D::type_name_static(), 56 },
262 { Corner3D::type_name_static(), 57 },
263 { Corner3D::type_name_static(), 58 },
264 { Corner3D::type_name_static(), 93 },
265 { Corner3D::type_name_static(), 118 },
266 { Corner3D::type_name_static(), 128 },
267 { Corner3D::type_name_static(), 129 },
268 { Line3D::type_name_static(), 41 }, { Line3D::type_name_static(), 43 },
269 { Line3D::type_name_static(), 68 }, { Line3D::type_name_static(), 69 },
270 { Line3D::type_name_static(), 70 }, { Line3D::type_name_static(), 71 },
271 { Line3D::type_name_static(), 72 }, { Line3D::type_name_static(), 73 },
272 { Line3D::type_name_static(), 131 },
273 { Line3D::type_name_static(), 135 },
274 { Line3D::type_name_static(), 144 },
275 { Line3D::type_name_static(), 177 },
276 { Line3D::type_name_static(), 182 },
277 { Line3D::type_name_static(), 203 },
278 { Line3D::type_name_static(), 205 },
279 { Line3D::type_name_static(), 207 },
280 { Line3D::type_name_static(), 210 },
281 { Line3D::type_name_static(), 233 },
282 { Line3D::type_name_static(), 234 },
283 { Line3D::type_name_static(), 238 },
284 { Surface3D::type_name_static(), 11 },
285 { Surface3D::type_name_static(), 37 },
286 { Surface3D::type_name_static(), 40 },
287 { Surface3D::type_name_static(), 60 },
288 { Surface3D::type_name_static(), 85 },
289 { Surface3D::type_name_static(), 91 },
290 { Surface3D::type_name_static(), 99 },
291 { Surface3D::type_name_static(), 110 },
292 { Surface3D::type_name_static(), 114 },
293 { Region3D::type_name_static(), 4 } };
299 std::set< gmge_id > solution_gmge_id = {
300 { Contact3D::type_name_static(), 26 },
301 { Contact3D::type_name_static(), 27 },
302 { Contact3D::type_name_static(), 28 },
303 { Contact3D::type_name_static(), 78 },
304 { Contact3D::type_name_static(), 79 },
305 { Contact3D::type_name_static(), 83 },
306 { Interface3D::type_name_static(), 21 },
307 { Layer3D::type_name_static(), 0 },
311 Layer3D::type_name_static().
string(), 0 );
325 std::string file_name{ ringmesh_test_data_path };
326 file_name +=
"CloudSpin_fixed.ml";
329 auto init_model_is_valid =
geomodel_load( geomodel, file_name );
330 if( !init_model_is_valid )
333 geomodel.name(),
" must be valid." );
343 "TEST",
"Test GeoModelBuilderTopology::get_dependent_entities" );
354 catch(
const std::exception& e )
void test_on_fault_not_connected_to_any_surface(GeoModel3D &geomodel)
void run_tests(GeoModel3D &geomodel)
The GeologicalEntityType described the type of the Geological entities User can defined there own Geo...
void check_element_of_a_set_are_in_another_set(const std::set< GME > &to_compare, const std::set< GME > &with, const std::string &set_name)
void test_on_top_region(GeoModel3D &geomodel)
bool geomodel_load(GeoModel< DIMENSION > &geomodel, const std::string &filename)
void test_template(GeoModel3D &geomodel, const std::set< gmme_id > &solution_gmme_id, const std::set< gmge_id > &solution_gmge_id, const std::string &to_insert_type, index_t to_insert_id)
index_t find(const container &in, const T &value)
Returns the position of the first entity matching.
static void err(const std::string &feature, const Args &... args)
void test_on_corner_on_botom_corner_voi(GeoModel3D &geomodel)
static void out(const std::string &feature, const Args &... args)
void test_on_top_layer(GeoModel3D &geomodel)
void test_on_surface_within_bottom_region_partially_connected_to_voi(GeoModel3D &geomodel)
void load_geomodel(GeoModel3D &geomodel)
#define ringmesh_assert(x)
const std::string & category() const
The MeshEntityType described the type of the meshed entities There are 4 MeshEntityTypes correspondin...
Classes to build GeoModel from various inputs.
void RINGMESH_API default_configure()
#define ringmesh_assert_not_reached