![]() |
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 const &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 const &name) const |
template<typename T > | |
bool | existsPropertyVector (std::string const &name, MeshItemType const mesh_item_type, int const number_of_components) const |
template<typename T > | |
PropertyVector< T > const * | getPropertyVector (std::string const &name) const |
template<typename T > | |
PropertyVector< T > * | getPropertyVector (std::string const &name) |
template<typename T > | |
PropertyVector< T > const * | getPropertyVector (std::string const &name, MeshItemType const item_type, int const n_components) const |
template<typename T > | |
PropertyVector< T > * | getPropertyVector (std::string const &name, MeshItemType const item_type, int const n_components) |
void | removePropertyVector (std::string const &name) |
bool | hasPropertyVector (std::string const &name) 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 const &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 const &name) const |
template<typename T > | |
bool | existsPropertyVector (std::string const &name, MeshItemType const mesh_item_type, int const number_of_components) const |
template<typename T > | |
PropertyVector< T > const * | getPropertyVector (std::string const &name) const |
template<typename T > | |
PropertyVector< T > * | getPropertyVector (std::string const &name) |
template<typename T > | |
PropertyVector< T > const * | getPropertyVector (std::string const &name, MeshItemType const item_type, int const n_components) const |
template<typename T > | |
PropertyVector< T > * | getPropertyVector (std::string const &name, MeshItemType const item_type, int const n_components) |
Private Attributes | |
std::map< std::string, PropertyVectorBase * > | _properties |
|
default |
MeshLib::Properties::Properties | ( | Properties const & | properties | ) |
Definition at line 104 of file Properties.cpp.
References _properties.
|
default |
MeshLib::Properties::~Properties | ( | ) |
std::map< std::string, PropertyVectorBase * >::iterator MeshLib::Properties::begin | ( | ) |
Definition at line 155 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, |
MeshItemType | mesh_item_type, | ||
std::size_t | n_components | ||
) |
PropertyVector<T>* MeshLib::Properties::createNewPropertyVector | ( | std::string const & | 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 |
Referenced by CreateStructuredGridDialog::accept(), MeshLib::addPropertyToMesh(), ApplicationUtils::addVtkGhostTypeProperty(), castPropertyVectorToPropertyVector(), MeshLib::RasterToMesh::convert(), MeshLib::VtkMeshConverter::convertTypedArray(), MeshLib::MeshRevision::copyProperties(), ApplicationUtils::copyPropertyVector(), MeshLib::MeshLayerMapper::createStaticLayers(), LayeredMeshGenerator::getMesh(), MeshLib::IO::Legacy::MeshIO::loadMeshFromFile(), main(), mapArray(), FileIO::Gocad::GocadAsciiReader::parseProperties(), FileIO::Gocad::GocadAsciiReader::readData(), FileIO::GMSInterface::readGMS3DMMesh(), FileIO::GMSH::readGMSHMesh(), FileIO::SwmmInterface::readSwmmInputToLineMesh(), FileIO::TetGenInterface::readTetGenMesh(), MeshLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh(), and writeDataToMesh().
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 | ||
) |
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 |
std::map< std::string, PropertyVectorBase * >::iterator MeshLib::Properties::end | ( | ) |
Definition at line 160 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 82 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 58 of file Properties.cpp.
References _properties, MeshLib::Cell, and MeshLib::Node.
Referenced by MeshLib::convertToLinearMesh(), MeshLib::createQuadraticOrderMesh(), MeshLib::removeElements(), and MeshLib::removeNodes().
bool MeshLib::Properties::existsPropertyVector | ( | std::string const & | name | ) | const |
bool MeshLib::Properties::existsPropertyVector | ( | std::string const & | name | ) | const |
Checks if a property vector with given name
and the given type exists.
name | name of the requested property vector |
Referenced by MeshLib::ElementStatus::ElementStatus(), ProcessLib::SolutionDependentDirichletBoundaryCondition::SolutionDependentDirichletBoundaryCondition(), MeshElementRemovalDialog::accept(), MeshLib::addLayerToMesh(), ProcessLib::addProcessDataToMesh(), ProcessLib::checkParametersOfDirichletBoundaryCondition(), MeshLib::MeshRevision::copyProperties(), ProcessLib::getIntegrationPointMetaData(), MeshLib::getOrCreateMeshProperty(), getSurfaceIntegratedValuesForNodes(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::SmallDeformation::SmallDeformationProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::TH2M::TH2MProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::initializeConcreteProcess(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), MeshLib::Mesh2MeshPropertyInterpolation::interpolateElementPropertiesToNodeProperties(), MeshLib::materialIDs(), MeshElementRemovalDialog::on_scalarArrayComboBox_currentIndexChanged(), MeshLib::scaleMeshPropertyVector(), MeshLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh(), MeshLib::IO::Legacy::MeshIO::write(), and FileIO::TetGenInterface::write2dElements().
bool MeshLib::Properties::existsPropertyVector | ( | std::string const & | name, |
MeshItemType const | mesh_item_type, | ||
int const | number_of_components | ||
) | const |
bool MeshLib::Properties::existsPropertyVector | ( | std::string const & | 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.
PropertyVector<T>* MeshLib::Properties::getPropertyVector | ( | std::string const & | name | ) |
Definition at line 139 of file Properties-impl.h.
References MaterialPropertyLib::name, and OGS_FATAL.
PropertyVector<T>* MeshLib::Properties::getPropertyVector | ( | std::string const & | name | ) |
Returns a property vector with given name
or aborts calling OGS_FATAL if no such property vector exists.
PropertyVector<T> const* MeshLib::Properties::getPropertyVector | ( | std::string const & | name | ) | const |
Definition at line 119 of file Properties-impl.h.
References MaterialPropertyLib::name, and OGS_FATAL.
PropertyVector<T> const* MeshLib::Properties::getPropertyVector | ( | std::string const & | name | ) | const |
Returns a property vector with given name
or aborts calling OGS_FATAL if no such property vector exists.
Referenced by ProcessLib::ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition(), MeshLib::ElementStatus::ElementStatus(), ProcessLib::LIE::PostProcessTool::PostProcessTool(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::SmallDeformationProcess(), MeshLib::addLayerToMesh(), ProcessLib::addProcessDataToMesh(), castPropertyVectorToPropertyVector(), MeshLib::ElementValueModification::condense(), MeshLib::MeshRevision::copyProperties(), ParameterLib::createGroupBasedParameter(), ParameterLib::createMeshElementParameter(), ParameterLib::createMeshNodeParameter(), ParameterLib::createRandomFieldMeshElementParameter(), extractMatGroup(), ProcessLib::PythonBoundaryCondition::getEssentialBCValues(), getSurfaceIntegratedValuesForNodes(), anonymous_namespace{IdentifySubdomainMesh.cpp}::identifySubdomainMeshElements(), MeshLib::Mesh2MeshPropertyInterpolation::interpolateElementPropertiesToNodeProperties(), mapArray(), markFaults(), MeshElementRemovalDialog::on_scalarArrayComboBox_currentIndexChanged(), FileIO::Gocad::GocadAsciiReader::parseElements(), FileIO::Gocad::GocadAsciiReader::parseLineSegments(), ApplicationUtils::NodeWiseMeshPartitioner::partitionOtherMesh(), MeshLib::ElementValueModification::replace(), MeshGeoToolsLib::resetMeshElementProperty(), MeshLib::scaleMeshPropertyVector(), MeshLib::ElementSearch::searchByPropertyValueRange(), MeshLib::ElementValueModification::setByElementType(), setMaterialIDs(), MeshLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh(), MeshLib::IO::Legacy::MeshIO::write(), FileIO::TetGenInterface::write2dElements(), and FileIO::TetGenInterface::write3dElements().
PropertyVector<T>* MeshLib::Properties::getPropertyVector | ( | std::string const & | name, |
MeshItemType const | item_type, | ||
int const | n_components | ||
) |
Definition at line 197 of file Properties-impl.h.
References MaterialPropertyLib::name, OGS_FATAL, and MaterialLib::Solids::MFront::toString().
PropertyVector<T>* MeshLib::Properties::getPropertyVector | ( | std::string const & | 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.
PropertyVector<T> const* MeshLib::Properties::getPropertyVector | ( | std::string const & | name, |
MeshItemType const | item_type, | ||
int const | n_components | ||
) | const |
Definition at line 159 of file Properties-impl.h.
References MaterialPropertyLib::name, OGS_FATAL, and MaterialLib::Solids::MFront::toString().
PropertyVector<T> const* MeshLib::Properties::getPropertyVector | ( | std::string const & | 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 35 of file Properties.cpp.
References _properties.
Referenced by MeshLib::MeshRevision::copyProperties().
std::vector< std::string > MeshLib::Properties::getPropertyVectorNames | ( | MeshLib::MeshItemType | t | ) | const |
bool MeshLib::Properties::hasPropertyVector | ( | std::string const & | 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 30 of file Properties.cpp.
References _properties, and MaterialPropertyLib::name.
Referenced by ProcessLib::LIE::PostProcessTool::PostProcessTool().
|
default |
Properties & MeshLib::Properties::operator= | ( | Properties const & | properties | ) |
void MeshLib::Properties::removePropertyVector | ( | std::string const & | name | ) |
Definition at line 17 of file Properties.cpp.
References _properties, MaterialPropertyLib::name, and WARN().
std::map< std::string, PropertyVectorBase * >::size_type MeshLib::Properties::size | ( | ) | const |
Definition at line 165 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 170 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 165 of file Properties.h.
Referenced by Properties(), ~Properties(), begin(), end(), excludeCopyProperties(), getPropertyVectorNames(), hasPropertyVector(), operator=(), removePropertyVector(), and size().