![]() |
OGS
|
|
Namespaces | |
| namespace | Fluid |
| namespace | Fracture |
| namespace | PhysicalConstant |
| namespace | Solids |
Functions | |
| void | checkForWhitespaces (std::string_view const part) |
| auto | expandRange (int const start, int const end) |
| std::vector< int > | splitMaterialIdString (std::string const &material_id_string, char const separator) |
| std::vector< int > | parseMaterialIdString (std::string const &material_id_string, MeshLib::PropertyVector< int > const *const material_ids, char const separator, bool const validate) |
| template<typename T, typename CreateMedium> requires std::convertible_to< decltype(std::declval<CreateMedium>()(std::declval<int>())), std::shared_ptr<T>> | |
| void | createMediumForId (int const id, std::map< int, std::shared_ptr< T > > &media, std::vector< int > const &material_ids_of_this_medium, CreateMedium &&create_medium) |
| void MaterialLib::checkForWhitespaces | ( | std::string_view const | part | ) |
Checks that a string part contains no whitespace. Throws OGS_FATAL if any whitespace is found.
Definition at line 22 of file MediaCreation.cpp.
References OGS_FATAL.
Referenced by splitMaterialIdString().
| void MaterialLib::createMediumForId | ( | int const | id, |
| std::map< int, std::shared_ptr< T > > & | media, | ||
| std::vector< int > const & | material_ids_of_this_medium, | ||
| CreateMedium && | create_medium ) |
Creates a new entry for the material id in the media map by either calling the create_medium function and creating a new shared pointer, or by reusing the existing shared pointer.
Definition at line 51 of file MediaCreation.h.
References OGS_FATAL.
Referenced by MaterialLib::Solids::createConstitutiveRelationsGeneric(), and ProjectData::parseMedia().
| auto MaterialLib::expandRange | ( | int const | start, |
| int const | end ) |
Creates a range of integers from start to end (inclusive). Throws OGS_FATAL if end < start.
Definition at line 36 of file MediaCreation.cpp.
References OGS_FATAL.
Referenced by splitMaterialIdString().
| std::vector< int > MaterialLib::parseMaterialIdString | ( | std::string const & | material_id_string, |
| MeshLib::PropertyVector< int > const *const | material_ids, | ||
| char const | separator = ',', | ||
| bool const | validate = false ) |
Parses a comma separated list of integers or "*" string. Such lists occur in the medium definition in the OGS prj file. Range syntax is supported with colon separator, e.g., "1:5" expands to "1,2,3,4,5". For the "*" input a vector of all (unique) material ids is returned. Error messages in this function refer to this specific purpose. If validate is true and material_ids is not null, every parsed id must be present in material_ids, otherwise the function fails. Validation is opt-in so that existing callers (media, constitutive relations) keep tolerating ids that are absent from the current mesh, e.g. on a PETSc partition or a project file shared across several meshes.
Definition at line 110 of file MediaCreation.cpp.
References MeshLib::PropertyVector< PROP_VAL_TYPE >::begin(), DBUG(), MeshLib::PropertyVector< PROP_VAL_TYPE >::end(), OGS_FATAL, and splitMaterialIdString().
Referenced by MaterialLib::Solids::createConstitutiveRelationsGeneric(), ProjectData::parseMedia(), and parseOverwriteMeshData().
| std::vector< int > MaterialLib::splitMaterialIdString | ( | std::string const & | material_id_string, |
| char const | separator = ',' ) |
Parses a comma separated list of integers and/or ranges. Such lists occur in the medium definition in the OGS prj file. Range syntax is supported with colon separator, e.g., "1:5" expands to "1,2,3,4,5". Multiple entries are separated by comma, e.g., "-1:2,5,7:9" expands to "-1,0,1,2,5,7,8,9". Error messages in this function refer to this specific purpose.
Definition at line 48 of file MediaCreation.cpp.
References checkForWhitespaces(), expandRange(), OGS_FATAL, BaseLib::parseInteger(), BaseLib::splitString(), and BaseLib::trim().
Referenced by ProcessLib::HeatTransportBHE::createHeatTransportBHEProcess(), parseMaterialIdString(), and parseOutputMeshConfig().