24#ifndef _GEMA_PLUGIN_FEM_PHYSICS_COMMON_MATERIAL_H_
25#define _GEMA_PLUGIN_FEM_PHYSICS_COMMON_MATERIAL_H_
53 _typeIndex = typeIndex;
55 _constModelEvalErrorWarnEnabled =
true;
96 assert(e); Q_UNUSED(e);
162 void registerMaterial(
int typeIndex,
QString typeName, MaterialObjCreator instanceFunction,
bool defaultMaterial =
false);
174 int typeIndex(
QString typeName)
const;
176 bool checkTypeMap()
const;
A class that implements several common functions required by GmpFemPhysics.
Definition gmpFemPhysicsCommon.h:41
A simple factory used to register material type names, their numeric indices and their instance funct...
Definition gmpFemPhysicsCommonMaterial.h:157
QString _defTypeName
The default material name.
Definition gmpFemPhysicsCommonMaterial.h:180
QMap< QString, QPair< int, MaterialObjCreator > > _factoryMap
The map associating material names with their instance functions / index numbers.
Definition gmpFemPhysicsCommonMaterial.h:179
int numMaterialTypes() const
Returns the number of materials registered in the factory. Equal to the greatest index number + 1 if ...
Definition gmpFemPhysicsCommonMaterial.h:169
QString defaultMaterialType() const
Returns the name of the default material type.
Definition gmpFemPhysicsCommonMaterial.h:172
A class that implements a common behaviour for physics materials.
Definition gmpFemPhysicsCommonMaterial.h:45
bool constModelEvalErrorWarnEnabled() const
Is the warning on constitutive model evaluation errors enabled?
Definition gmpFemPhysicsCommonMaterial.h:126
GmValueAccessor * nodeAc() const
Returns the accessor for retrieving node coordinates.
Definition gmpFemPhysicsCommonMaterial.h:103
const GmLogCategory & logger() const
Returns the material logger.
Definition gmpFemPhysicsCommonMaterial.h:67
QString typeName() const
Returns the material type name.
Definition gmpFemPhysicsCommonMaterial.h:64
QVector< GmValueAccessor * > _nodeAttrAccessors
List with node attribute accessors.
Definition gmpFemPhysicsCommonMaterial.h:142
bool constantProperty(int id) const
Returns true if the given cell property is not a function (so its value is unique for an element and ...
Definition gmpFemPhysicsCommonMaterial.h:114
bool _constModelEvalErrorWarnEnabled
Flag set to false if the user disabled warnings due to errors when evaluating constitutive models.
Definition gmpFemPhysicsCommonMaterial.h:138
GmValueAccessor * _nodeAccessor
An accessor for retrieving node coordinate values.
Definition gmpFemPhysicsCommonMaterial.h:145
virtual const QVariantMap * materialMetaDataMap()=0
Virtual function responsible for returning material associated properties.
void setConstModelEvalErrorWarnEnabled(bool enabled)
Turns on or of the warning returned by constModelEvalErrorWarnEnabled()
Definition gmpFemPhysicsCommonMaterial.h:129
GmpFemPhysicsCommonMaterial(int typeIndex, QString typeName, const GmLogCategory &logger)
Common material constructor. Receives its type name and index in order for a class to be able to hand...
Definition gmpFemPhysicsCommonMaterial.h:50
int _nodeDim
Node dimension.
Definition gmpFemPhysicsCommonMaterial.h:135
int nodeDim() const
Returns the node dimension (number of node coordinates)
Definition gmpFemPhysicsCommonMaterial.h:106
QVector< GmCellAccessor * > _cellAttrAccessors
List with cell attribute accessors.
Definition gmpFemPhysicsCommonMaterial.h:143
GmCellAccessor * propertyAc(int id) const
Returns the accessor for the given cell property.
Definition gmpFemPhysicsCommonMaterial.h:109
QString _typeName
The material type name.
Definition gmpFemPhysicsCommonMaterial.h:136
virtual bool checkLoadedData(const GmElement *e) const
Additional checking function, called after all attributes and accessors from physicsMetaDataMap() hav...
Definition gmpFemPhysicsCommonMaterial.h:94
QVector< bool > _constantProperties
List with flags defining if the properties in _propertyAccessors can have functions or not.
Definition gmpFemPhysicsCommonMaterial.h:141
int typeIndex() const
Returns the material type index.
Definition gmpFemPhysicsCommonMaterial.h:61
QVector< GmCellAccessor * > _propertyAccessors
List with property accessors.
Definition gmpFemPhysicsCommonMaterial.h:140
QVector< GmGaussAccessor * > _gaussAttrAccessors
List with Gauss attribute accessors.
Definition gmpFemPhysicsCommonMaterial.h:144
const GmLogCategory & _logger
The material logger.
Definition gmpFemPhysicsCommonMaterial.h:137
QVector< int > _savedGaussAccessorIds
The list with gauss accessor ids that need to be saved on addStateItemsToGroup()
Definition gmpFemPhysicsCommonMaterial.h:146
GmCellAccessor * cellAttrAc(int id) const
Returns the accessor for the given cell attribute.
Definition gmpFemPhysicsCommonMaterial.h:120
int _typeIndex
The material type index, used for indexing into the materials vector inside the physics.
Definition gmpFemPhysicsCommonMaterial.h:134
GmGaussAccessor * gaussAttrAc(int id) const
Returns the accessor for the given Gauss attribute.
Definition gmpFemPhysicsCommonMaterial.h:123
GmValueAccessor * nodeAttrAc(int id) const
Returns the accessor for the given node attribute.
Definition gmpFemPhysicsCommonMaterial.h:117
Declaration of useful configuration definitions for the plugin library.