OGS
|
Property manager on mesh items. Class Properties manages scalar, vector or matrix properties. For instance in groundwater flow porosity is a scalar property and permeabilty can be stored as a tensor property. Properties are assigned to mesh items, i.e. Node or Element objects. The createNewPropertyVector() method first creates a PropertyVector of template type T (scalar, vector or matrix). This class stores the PropertyVector, accessible by a combination of the name and the type of the mesh item (Node or Element).
Definition at line 35 of file Properties.h.
#include <Properties.h>
Public Member Functions | |
template<typename T > | |
PropertyVector< T > * | createNewPropertyVector (std::string_view name, MeshItemType mesh_item_type, std::size_t n_components=1) |
template<typename T > | |
PropertyVector< T > * | createNewPropertyVector (std::string const &name, std::size_t n_prop_groups, std::vector< std::size_t > const &item2group_mapping, MeshItemType mesh_item_type, std::size_t n_components=1) |
template<typename T > | |
bool | existsPropertyVector (std::string_view name) const |
template<typename T > | |
bool | existsPropertyVector (std::string_view name, MeshItemType const mesh_item_type, int const number_of_components) const |
template<typename T > | |
PropertyVector< T > const * | getPropertyVector (std::string_view name) const |
template<typename T > | |
PropertyVector< T > * | getPropertyVector (std::string_view name) |
template<typename T > | |
PropertyVector< T > const * | getPropertyVector (std::string_view name, MeshItemType const item_type, int const n_components) const |
template<typename T > | |
PropertyVector< T > * | getPropertyVector (std::string_view name, MeshItemType const item_type, int const n_components) |
void | removePropertyVector (std::string_view name) |
bool | hasPropertyVector (std::string_view name) const |
template<typename T > | |
bool | hasPropertyVector (std::string const &name, MeshItemType const item_type) const |
std::vector< std::string > | getPropertyVectorNames () const |
std::vector< std::string > | getPropertyVectorNames (MeshLib::MeshItemType t) const |
Properties | excludeCopyProperties (std::vector< std::size_t > const &exclude_elem_ids, std::vector< std::size_t > const &exclude_node_ids) const |
Properties | excludeCopyProperties (std::vector< MeshItemType > const &exclude_mesh_item_types) const |
Properties ()=default | |
Properties (Properties const &properties) | |
Properties (Properties &&properties)=default | |
Properties & | operator= (Properties const &properties) |
Properties & | operator= (Properties &&properties)=default |
~Properties () | |
std::map< std::string, PropertyVectorBase * >::const_iterator | begin () const |
std::map< std::string, PropertyVectorBase * >::const_iterator | end () const |
std::map< std::string, PropertyVectorBase * >::iterator | begin () |
std::map< std::string, PropertyVectorBase * >::iterator | end () |
std::map< std::string, PropertyVectorBase * >::size_type | size () const |
std::map< std::string, PropertyVectorBase * >::size_type | size (MeshItemType const mesh_item_type) const |
template<typename T > | |
PropertyVector< T > * | createNewPropertyVector (std::string_view name, MeshItemType mesh_item_type, std::size_t n_components) |
template<typename T > | |
PropertyVector< T > * | createNewPropertyVector (std::string const &name, std::size_t n_prop_groups, std::vector< std::size_t > const &item2group_mapping, MeshItemType mesh_item_type, std::size_t n_components) |
template<typename T > | |
bool | existsPropertyVector (std::string_view name) const |
template<typename T > | |
bool | existsPropertyVector (std::string_view name, MeshItemType const mesh_item_type, int const number_of_components) const |
template<typename T > | |
PropertyVector< T > const * | getPropertyVector (std::string_view name) const |
template<typename T > | |
PropertyVector< T > * | getPropertyVector (std::string_view name) |
template<typename T > | |
bool | hasPropertyVector (std::string const &name, MeshItemType const item_type) const |
template<typename T > | |
PropertyVector< T > const * | getPropertyVector (std::string_view name, MeshItemType const item_type, int const n_components) const |
template<typename T > | |
PropertyVector< T > * | getPropertyVector (std::string_view name, MeshItemType const item_type, int const n_components) |
template<typename T > | |
PropertyVector< T > const * | getPropertyVector (std::string_view name) const |
template<typename T > | |
PropertyVector< T > const * | getPropertyVector (std::string_view name, MeshItemType const item_type, int const n_components) const |
Private Attributes | |
std::map< std::string, PropertyVectorBase * > | _properties |
|
default |
MeshLib::Properties::Properties | ( | Properties const & | properties | ) |
Definition at line 103 of file Properties.cpp.
References _properties.
|
default |
MeshLib::Properties::~Properties | ( | ) |
Definition at line 132 of file Properties.cpp.
References _properties.
std::map< std::string, PropertyVectorBase * >::iterator MeshLib::Properties::begin | ( | ) |
Definition at line 152 of file Properties.cpp.
References _properties.
std::map< std::string, PropertyVectorBase * >::const_iterator MeshLib::Properties::begin | ( | ) | const |
PropertyVector< T > * MeshLib::Properties::createNewPropertyVector | ( | std::string const & | name, |
std::size_t | n_prop_groups, | ||
std::vector< std::size_t > const & | item2group_mapping, | ||
MeshItemType | mesh_item_type, | ||
std::size_t | n_components ) |
Definition at line 34 of file Properties-impl.h.
References ERR().
PropertyVector< T > * MeshLib::Properties::createNewPropertyVector | ( | std::string const & | name, |
std::size_t | n_prop_groups, | ||
std::vector< std::size_t > const & | item2group_mapping, | ||
MeshItemType | mesh_item_type, | ||
std::size_t | n_components = 1 ) |
Method creates a PropertyVector if a PropertyVector with the same name and the same type T was not already created before. In case there exists already such a PropertyVector a nullptr is returned. This method is used if only a small number of distinct property values in a property exist (e.g. mapping property groups to elements). In this case a mapping between mesh items and properties (stored on the heap), see the parameter item2group_mapping, is required.
T | type of the property value |
name | the name of the property |
n_prop_groups | number of distinct property groups |
item2group_mapping | the mapping between mesh item and the property group |
mesh_item_type | for instance node or element assigned properties |
n_components | number of components for each tuple |
Definition at line 35 of file Properties.h.
References createNewPropertyVector(), and createNewPropertyVector().
Referenced by createNewPropertyVector().
PropertyVector< T > * MeshLib::Properties::createNewPropertyVector | ( | std::string_view | name, |
MeshItemType | mesh_item_type, | ||
std::size_t | n_components ) |
Definition at line 16 of file Properties-impl.h.
References ERR().
PropertyVector< T > * MeshLib::Properties::createNewPropertyVector | ( | std::string_view | name, |
MeshItemType | mesh_item_type, | ||
std::size_t | n_components = 1 ) |
Method creates a PropertyVector if a PropertyVector with the same name and the same type T was not already created before. In case there exists already such a PropertyVector a nullptr is returned. There are two versions of this method. This method is used when every mesh item at hand has its own property value, i.e. \(n\) mesh item and \(n\) different property values. The user has to ensure the correct usage of the vector later on.
T | type of the property value |
name | the name of the property |
mesh_item_type | for instance node or element assigned properties |
n_components | number of components for each tuple |
Definition at line 17 of file Properties.h.
Referenced by CreateStructuredGridDialog::accept(), MeshLib::addPropertyToMesh(), ApplicationUtils::addVtkGhostTypeProperty(), castPropertyVectorToPropertyVector(), MeshToolsLib::RasterToMesh::convert(), MeshLib::VtkMeshConverter::convertTypedArray(), copyDoubleValuedFieldDataToPointCloud(), anonymous_namespace{MeshRevision.cpp}::copyProperties(), ApplicationUtils::copyPropertyVector(), createNewPropertyVector(), MeshToolsLib::MeshLayerMapper::createStaticLayers(), LayeredMeshGenerator::getMesh(), MeshLib::IO::Legacy::MeshIO::loadMeshFromFile(), main(), MeshToolsLib::MeshGenerator::VoxelGridFromMesh::mapArray(), FileIO::Gocad::GocadAsciiReader::parseProperties(), FileIO::Gocad::GocadAsciiReader::readData(), FileIO::GMSH::readGMSHMesh(), FileIO::GMSInterface::readMesh(), FileIO::SwmmInterface::readSwmmInputToLineMesh(), FileIO::TetGenInterface::readTetGenMesh(), MeshToolsLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh(), and writeDataToMesh().
std::map< std::string, PropertyVectorBase * >::iterator MeshLib::Properties::end | ( | ) |
Definition at line 157 of file Properties.cpp.
References _properties.
std::map< std::string, PropertyVectorBase * >::const_iterator MeshLib::Properties::end | ( | ) | const |
Properties MeshLib::Properties::excludeCopyProperties | ( | std::vector< MeshItemType > const & | exclude_mesh_item_types | ) | const |
copy all PropertyVector objects stored in the (internal) map but PropertyVector objects with the given MeshItemType are excluded.
Definition at line 81 of file Properties.cpp.
References _properties.
Properties MeshLib::Properties::excludeCopyProperties | ( | std::vector< std::size_t > const & | exclude_elem_ids, |
std::vector< std::size_t > const & | exclude_node_ids ) const |
copy all PropertyVector objects stored in the (internal) map but only those nodes/elements of a PropertyVector whose ids are not in the vectors exclude_*_ids.
Definition at line 57 of file Properties.cpp.
References _properties, MeshLib::Cell, and MeshLib::Node.
Referenced by MeshToolsLib::convertToLinearMesh(), MeshToolsLib::createQuadraticOrderMesh(), MeshToolsLib::removeElements(), and MeshToolsLib::removeNodes().
bool MeshLib::Properties::existsPropertyVector | ( | std::string_view | name | ) | const |
Definition at line 73 of file Properties-impl.h.
bool MeshLib::Properties::existsPropertyVector | ( | std::string_view | name | ) | const |
Checks if a property vector with given name
and the given type exists.
name | name of the requested property vector |
Definition at line 74 of file Properties.h.
Referenced by MeshLib::ElementStatus::ElementStatus(), ProcessLib::SolutionDependentDirichletBoundaryCondition::SolutionDependentDirichletBoundaryCondition(), MeshElementRemovalDialog::accept(), ProcessLib::addBulkMeshPropertyToSubMesh(), MeshToolsLib::addLayerToMesh(), ProcessLib::checkParametersOfDirichletBoundaryCondition(), copyDoubleValuedFieldDataToPointCloud(), anonymous_namespace{MeshRevision.cpp}::copyProperties(), MeshLib::getIntegrationPointMetaData(), MeshLib::getOrCreateMeshProperty(), getSurfaceIntegratedValuesForNodes(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::initializeConcreteProcess(), MeshToolsLib::Mesh2MeshPropertyInterpolation::interpolateElementPropertiesToNodeProperties(), main(), MeshElementRemovalDialog::on_scalarArrayComboBox_currentIndexChanged(), reorderProperty(), MeshLib::scaleMeshPropertyVector(), ProcessLib::setIPDataInitialConditions(), MeshToolsLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh(), MeshLib::IO::Legacy::MeshIO::write(), FileIO::TetGenInterface::write2dElements(), and MeshLib::IO::VtuInterface::writeVTU().
bool MeshLib::Properties::existsPropertyVector | ( | std::string_view | name, |
MeshItemType const | mesh_item_type, | ||
int const | number_of_components ) const |
Definition at line 86 of file Properties-impl.h.
References WARN().
bool MeshLib::Properties::existsPropertyVector | ( | std::string_view | name, |
MeshItemType const | mesh_item_type, | ||
int const | number_of_components ) const |
Checks if a property vector with given type T
, name
, mesh_item_type
, and number_of_components
exists.
Definition at line 87 of file Properties.h.
PropertyVector< T > * MeshLib::Properties::getPropertyVector | ( | std::string_view | name | ) |
Definition at line 131 of file Properties-impl.h.
References OGS_FATAL.
PropertyVector< T > * MeshLib::Properties::getPropertyVector | ( | std::string_view | name | ) |
Returns a property vector with given name
or aborts calling OGS_FATAL if no such property vector exists.
Definition at line 132 of file Properties.h.
PropertyVector< T > const * MeshLib::Properties::getPropertyVector | ( | std::string_view | name | ) | const |
Definition at line 123 of file Properties-impl.h.
References getPropertyVector().
PropertyVector< T > const * MeshLib::Properties::getPropertyVector | ( | std::string_view | name | ) | const |
Definition at line 124 of file Properties.h.
PropertyVector< T > const * MeshLib::Properties::getPropertyVector | ( | std::string_view | name | ) | const |
Returns a property vector with given name
or aborts calling OGS_FATAL if no such property vector exists.
Referenced by ProcessLib::LIE::PostProcessTool::PostProcessTool(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::SmallDeformationProcess(), ProcessLib::addBulkMeshPropertyToSubMesh(), MeshToolsLib::addLayerToMesh(), MeshLib::bulkElementIDs(), MeshLib::bulkNodeIDs(), castPropertyVectorToPropertyVector(), MeshToolsLib::ElementValueModification::condense(), anonymous_namespace{MeshRevision.cpp}::copyProperties(), copyPropertyVector(), ParameterLib::createGroupBasedParameter(), ParameterLib::createMeshElementParameter(), ParameterLib::createMeshNodeParameter(), ParameterLib::createRandomFieldMeshElementParameter(), extractMatGroup(), getPropertyVector(), getRegularElements(), getSurfaceIntegratedValuesForNodes(), MeshToolsLib::Mesh2MeshPropertyInterpolation::interpolateElementPropertiesToNodeProperties(), MeshToolsLib::MeshGenerator::VoxelGridFromMesh::mapArray(), MeshElementRemovalDialog::on_scalarArrayComboBox_currentIndexChanged(), FileIO::Gocad::GocadAsciiReader::parseElements(), FileIO::Gocad::GocadAsciiReader::parseLineSegments(), ApplicationUtils::NodeWiseMeshPartitioner::partitionOtherMesh(), ApplicationUtils::NodeWiseMeshPartitioner::renumberBulkIdsProperty(), reorderProperty(), MeshToolsLib::ElementValueModification::replace(), MeshGeoToolsLib::resetMeshElementProperty(), MeshLib::scaleMeshPropertyVector(), MeshLib::ElementSearch::searchByPropertyValueRange(), MeshToolsLib::ElementValueModification::setByElementType(), setMaterialIDs(), MeshToolsLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh(), anonymous_namespace{IdentifySubdomainMesh.cpp}::updateOrCheckExistingSubdomainProperty(), MeshLib::IO::Legacy::MeshIO::write(), FileIO::TetGenInterface::write2dElements(), FileIO::TetGenInterface::write3dElements(), and MeshLib::IO::VtuInterface::writeVTU().
PropertyVector< T > * MeshLib::Properties::getPropertyVector | ( | std::string_view | name, |
MeshItemType const | item_type, | ||
int const | n_components ) |
Definition at line 207 of file Properties-impl.h.
References OGS_FATAL.
PropertyVector< T > * MeshLib::Properties::getPropertyVector | ( | std::string_view | name, |
MeshItemType const | item_type, | ||
int const | n_components ) |
Non-const version of getPropertyVector returns a property vector with given name
, item_type
and number_of_components
or calls OGS_FATAL if no such property vector exists.
Definition at line 208 of file Properties.h.
PropertyVector< T > const * MeshLib::Properties::getPropertyVector | ( | std::string_view | name, |
MeshItemType const | item_type, | ||
int const | n_components ) const |
Definition at line 168 of file Properties-impl.h.
References OGS_FATAL.
PropertyVector< T > const * MeshLib::Properties::getPropertyVector | ( | std::string_view | name, |
MeshItemType const | item_type, | ||
int const | n_components ) const |
Definition at line 169 of file Properties.h.
PropertyVector< T > const * MeshLib::Properties::getPropertyVector | ( | std::string_view | name, |
MeshItemType const | item_type, | ||
int const | n_components ) const |
Returns a property vector with given name
, item_type
and number_of_components
or aborts calling OGS_FATAL if no such property vector exists.
std::vector< std::string > MeshLib::Properties::getPropertyVectorNames | ( | ) | const |
Definition at line 34 of file Properties.cpp.
References _properties.
Referenced by anonymous_namespace{MeshRevision.cpp}::copyProperties(), main(), and ProcessLib::Output::prepareSubmesh().
std::vector< std::string > MeshLib::Properties::getPropertyVectorNames | ( | MeshLib::MeshItemType | t | ) | const |
Definition at line 43 of file Properties.cpp.
References _properties.
bool MeshLib::Properties::hasPropertyVector | ( | std::string const & | name, |
MeshItemType const | item_type ) const |
Definition at line 151 of file Properties-impl.h.
References MeshLib::PropertyVectorBase::getMeshItemType().
bool MeshLib::Properties::hasPropertyVector | ( | std::string const & | name, |
MeshItemType const | item_type ) const |
Check if a PropertyVector accessible by the name and by the item type is already stored within the Properties object.
name | the name of the property, e.g. porosity. |
item_type | the type of mesh entity, e.g. CELL. |
Definition at line 152 of file Properties.h.
bool MeshLib::Properties::hasPropertyVector | ( | std::string_view | name | ) | const |
Check if a PropertyVector accessible by the name is already stored within the Properties object.
name | the name of the property (for instance porosity) |
Definition at line 29 of file Properties.cpp.
References _properties.
Referenced by ProcessLib::LIE::PostProcessTool::PostProcessTool(), ProcessLib::checkParametersOfDirichletBoundaryCondition(), and ApplicationUtils::NodeWiseMeshPartitioner::renumberBulkIdsProperty().
|
default |
Properties & MeshLib::Properties::operator= | ( | Properties const & | properties | ) |
Definition at line 113 of file Properties.cpp.
References _properties.
void MeshLib::Properties::removePropertyVector | ( | std::string_view | name | ) |
Definition at line 17 of file Properties.cpp.
References _properties, and WARN().
std::map< std::string, PropertyVectorBase * >::size_type MeshLib::Properties::size | ( | ) | const |
Definition at line 162 of file Properties.cpp.
References _properties.
Referenced by ApplicationUtils::writeProperties().
std::map< std::string, PropertyVectorBase * >::size_type MeshLib::Properties::size | ( | MeshItemType const | mesh_item_type | ) | const |
Definition at line 167 of file Properties.cpp.
|
private |
A mapping from property's name to the stored object of any type. See addProperty() and getProperty() documentation.
Definition at line 173 of file Properties.h.
Referenced by Properties(), ~Properties(), begin(), begin(), end(), end(), excludeCopyProperties(), excludeCopyProperties(), getPropertyVectorNames(), getPropertyVectorNames(), hasPropertyVector(), operator=(), removePropertyVector(), and size().