36 #include <ringmesh/ringmesh_tests_config.h> 57 std::string log_file( ringmesh_test_output_path );
58 log_file +=
"log.txt";
59 GEO::FileLogger* file_logger =
new GEO::FileLogger( log_file );
62 std::string file_name( ringmesh_test_data_path );
63 file_name +=
"modelA6.ml";
67 bool loaded_model_is_valid =
geomodel_load( geomodel, file_name );
69 if( !loaded_model_is_valid )
72 "Failed when building model ", geomodel.name(),
73 ": the model is not valid." );
76 #ifdef RINGMESH_WITH_TETGEN 79 tetrahedralize( geomodel,
"TetGen", NO_ID,
false );
80 for( index_t r :
range( geomodel.nb_regions() ) )
82 if( !geomodel.region( r ).is_meshed() )
85 "Failed when tetrahedralize model ", geomodel.name(),
86 " Region ", r,
" is not meshed ",
87 "maybe the Tetgen call have failed" );
92 std::string output_file_name( ringmesh_test_output_path );
93 output_file_name +=
"modelA6_tetgen.gm";
97 GeoModel3D reloaded_model;
98 bool reloaded_model_is_valid =
101 if( !reloaded_model_is_valid )
104 "Failed when tetrahedralize model ", geomodel.name(),
105 ": the model becomes invalid." );
115 catch(
const std::exception& e )
bool geomodel_load(GeoModel< DIMENSION > &geomodel, const std::string &filename)
static void err(const std::string &feature, const Args &... args)
static void out(const std::string &feature, const Args &... args)
static GEO::Logger * instance()
void geomodel_save(const GeoModel< DIMENSION > &geomodel, const std::string &filename)
const std::string & category() const
Classes to build GeoModel from various inputs.
void RINGMESH_API default_configure()