43 #include <ringmesh/ringmesh_tests_config.h> 50 "RockFeature",
"Test RockFeature building and editing" );
56 "Test",
"Failed when testing RockFeature::get_rock_type()" );
62 "Test",
"Failed when changing RockFeature type" );
69 "Test",
"Failed when testing RockFeature::get_name() " );
71 rock_two.
set_name(
"rock2_renamed" );
72 if( rock_two.
get_name() !=
"rock2_renamed" )
75 "Test",
"Failed when renaming the RockFeature" );
82 "StratigraphicUnit",
"Test StratigraphicUnit building" );
86 dynamic_cast< const Interface3D& >(
87 in.geological_entity( Interface3D::type_name_static(), 1 ) ),
88 dynamic_cast< const Interface3D& >(
89 in.geological_entity( Interface3D::type_name_static(), 0 ) ),
90 dynamic_cast< const Layer3D& >(
91 in.geological_entity( Layer3D::type_name_static(), 0 ) ),
93 if( test_strat_unit.
get_name() !=
"strat unit" )
96 "Test",
"Failed when testing StratigraphicUnit::get_name()" );
101 "Failed when testing StratigraphicUnit::is_conformable_base()" );
106 "Failed when testing StratigraphicUnit::is_conformable_top()" );
112 "Failed when testing StratigraphicUnit::get_relation_base()" );
117 "Failed when testing StratigraphicUnit::get_relation_top()" );
122 "Test",
"Failed when testing StratigraphicUnit::get_min_thick()" );
127 "Test",
"Failed when testing StratigraphicUnit::get_max_thick()" );
134 "StratigraphicColumn",
"Test StratigraphicColumn building" );
136 "StratigraphicColumn",
"Init RockFeature and StratigraphicUnit" );
140 std::string one_name =
"one";
141 std::string two_name =
"two";
142 std::string three_name =
"three";
143 std::string four_name =
"four";
146 dynamic_cast< const Interface3D& >(
147 in.geological_entity( Interface3D::type_name_static(), 1 ) ),
148 dynamic_cast< const Interface3D& >(
149 in.geological_entity( Interface3D::type_name_static(), 0 ) ),
150 dynamic_cast< const Layer3D& >(
151 in.geological_entity( Layer3D::type_name_static(), 0 ) ),
154 dynamic_cast< const Interface3D& >(
155 in.geological_entity( Interface3D::type_name_static(), 2 ) ),
156 dynamic_cast< const Interface3D& >(
157 in.geological_entity( Interface3D::type_name_static(), 1 ) ),
158 dynamic_cast< const Layer3D& >(
159 in.geological_entity( Layer3D::type_name_static(), 1 ) ),
162 dynamic_cast< const Interface3D& >(
163 in.geological_entity( Interface3D::type_name_static(), 3 ) ),
164 dynamic_cast< const Interface3D& >(
165 in.geological_entity( Interface3D::type_name_static(), 2 ) ),
166 dynamic_cast< const Layer3D& >(
167 in.geological_entity( Layer3D::type_name_static(), 2 ) ),
170 dynamic_cast< const Interface3D& >(
171 in.geological_entity( Interface3D::type_name_static(), 11 ) ),
172 dynamic_cast< const Interface3D& >(
173 in.geological_entity( Interface3D::type_name_static(), 3 ) ),
174 dynamic_cast< const Layer3D& >(
175 in.geological_entity( Layer3D::type_name_static(), 3 ) ),
179 "First building with a vector of StratigraphicUnit" );
181 std::vector< const StratigraphicUnit* > units;
182 units.push_back( &one );
183 units.push_back( &two );
184 units.push_back( &three );
185 units.push_back( &four );
192 "Failed when testing StratigraphicColumn::get_unit_above()" );
198 "Failed when testing StratigraphicColumn::get_unit_below()" );
205 "Test",
"Failed when testing StratigraphicColumn::remove_unit()" );
212 "Failed when testing StratigraphicColumn::insert_unit_below()" );
218 "Test",
"Failed when testing StratigraphicColumn::get_top_unit()" );
224 "Failed when testing StratigraphicColumn::get_base_unit()" );
228 "Second building with a vector of StratigraphicUnit" );
237 "Failed when testing StratigraphicColumn::insert_top_unit()" );
244 "Failed when testing StratigraphicColumn::insert_base_unit()" );
250 "Test",
"Failed when testing StratigraphicColumn::get_unit()" );
254 "StratigraphicColumn",
"Third building a mixed StratigraphicColumn" );
256 std::vector< const StratigraphicUnit* > mixed;
257 mixed.push_back( &one );
258 mixed.push_back( &two );
259 std::vector< const StratigraphicUnit* > sub_units;
261 sub_units.push_back( &three );
262 sub_units.push_back( &four );
264 "subdivided", rocks, sub_units );
265 mixed.push_back( &subdivided_unit );
272 "Failed when testing StratigraphicColumn::is_conformable_base()" );
278 "Failed when testing StratigraphicColumn::is_conformable_top()" );
284 "Failed when testing StratigraphicColumn::get_relation_base()" );
290 "Failed when testing StratigraphicColumn::get_relation_top()" );
296 "Failed when testing StratigraphicColumn::get_column_min_thick()" );
302 "Failed when testing StratigraphicColumn::get_column_max_thick()" );
308 "Failed when testing StratigraphicColumn::get_unit_above()" );
314 "Failed when testing StratigraphicColumn::get_unit_below()" );
321 "Test",
"Failed when testing StratigraphicColumn::remove_unit()" );
328 "Failed when testing StratigraphicColumn::insert_unit_below()" );
334 "Test",
"Failed when testing StratigraphicColumn::get_top_unit()" );
340 "Failed when testing StratigraphicColumn::get_base_unit()" );
346 std::string input_geomodel_file_name( ringmesh_test_data_path );
347 input_geomodel_file_name +=
"CloudSpin_fixed.ml";
351 std::string input_column_file_name( RINGMesh::ringmesh_test_data_path );
352 input_column_file_name +=
"CloudSpin.xml";
357 column, in, input_column_file_name );
370 std::string log_file( ringmesh_test_output_path );
371 log_file +=
"log.txt";
372 GEO::FileLogger* file_logger =
new GEO::FileLogger( log_file );
376 std::string input_model_file_name( ringmesh_test_data_path );
377 input_model_file_name +=
"CloudSpin_fixed.ml";
398 catch(
const std::exception& e )
void test_stratigraphic_unit(const GeoModel3D &in)
const StratigraphicUnit * get_base_unit() const
RELATION get_relation_base()
get_relation_base for the Stratigraphic Column
RELATION get_relation_top()
get_relation_top for the Stratigraphic Column
bool is_conformable_top() const final
double get_min_thick() const final
Manages the RockFeature, which contains a RockType and more informations.
void insert_top_unit(const StratigraphicUnit &to_add)
Declarations of a stratigraphic column, stratigraphic unit, rock features and so on.
const StratigraphicUnit * get_unit(const index_t index) const
void set_name(const std::string &name)
const StratigraphicUnit * get_unit_below(const StratigraphicUnit &unit) const
void remove_unit(const StratigraphicUnit &unit)
void test_load_from_gocad_xml_file()
bool is_conformable_base() const final
virtual const std::string & get_name() const
const StratigraphicUnit * get_unit_above(const StratigraphicUnit &unit) const
bool geomodel_load(GeoModel< DIMENSION > &geomodel, const std::string &filename)
double get_column_min_thick() const
RELATION get_relation_base() const final
static void err(const std::string &feature, const Args &... args)
static void out(const std::string &feature, const Args &... args)
static GEO::Logger * instance()
A stratigraphic column is composed of several stratigraphic units.
const ROCKTYPE & get_rock_type() const
void test_stratigraphic_column_building(const GeoModel3D &in)
void set_rock_type(ROCKTYPE type)
bool is_conformable_base() const
is_conformable_base for the Stratigraphic Column
const std::string & category() const
const std::string & get_name() const
double get_column_max_thick() const
void insert_base_unit(const StratigraphicUnit &to_add)
void load_file() override
bool is_conformable_top() const
is_conformable_top for the Stratigraphic Column
double get_max_thick() const final
Classes to build GeoModel from various inputs.
RELATION get_relation_top() const final
void insert_unit_below(const StratigraphicUnit &above, const StratigraphicUnit &unit_to_add)
void RINGMESH_API default_configure()
const StratigraphicUnit * get_top_unit() const