![]() |
FemProcess
The GeMA Fem Process Plugin
|
A class that implements several common functions required by GmpFemPhysics. More...
#include <gmpFemPhysicsCommon.h>
Classes | |
struct | Attribute |
A structure used to define attributes interpreted by the physics. More... | |
struct | Bc |
A QList<Value> that can be implicitely converted to a QVariant. More... | |
struct | HistoryValue |
A specialization of the Value structure for obtaining accessor for old attribute states. More... | |
struct | MaterialTranslationInfo |
Auxiliary structure used to keep information about material translation names. More... | |
struct | MatrixValue |
A specialization of the Value structure for MATRIX values. More... | |
struct | RequiredIf |
A structure used to define if a value is required or not, being able to specify conditional situations. More... | |
struct | ScalarValue |
A specialization of the Value structure for SCALAR values. More... | |
struct | Size |
A structure to define a size (number of lines / columns) More... | |
class | TList |
A wrapper over a QList<T> that knows how to convert itself into a QVariant, provided that the resulting type has been registered with Q_DECLARE_METATYPE. More... | |
struct | Value |
A structure used to specify value accessors needed by the physics. More... | |
struct | ValueType |
A structure used to specify if a value should be a scalar, a vector or a matrix and their dimensions. More... | |
struct | VectorValue |
A specialization of the Value structure for VECTOR values. More... | |
Public Types | |
enum | DiscSetRequiredMode { DS_IGNORED, DS_REQUIRED, DS_OPTIONAL } |
A QList<Bc> that can be implicitely converted to a QVariant. More... | |
enum | DerivedResultsRecoveryMode { RECOVER_AT_GAUSS = 0x01, RECOVER_AT_NODES = 0x02, DIRECT_NODE_EVAL = 0x04, ADD_RESULTS = 0x08, IP_ONLY = 0x10, GAUSS_FILLED = 0x20 } |
Enumeration used to specify the behavior of a call to calcDerivedResults() More... | |
typedef TList< int > | IntList |
typedef TList< Attribute > | AttributeList |
A QList<int> that can be implicitely converted to a QVariant. | |
typedef TList< Value > | ValueList |
A QList<Attribute> that can be implicitely converted to a QVariant. | |
typedef TList< Bc > | BcList |
![]() | |
enum | FemResultType { FEM_RESULT_OK, FEM_ERROR_FI, FEM_ERROR } |
Result type for local matrix calculation methods. More... | |
enum | FemSupportedParallelMethods { FEM_PARALLEL_FILL_ELEMENT_DATA = 0x01 } |
Enum used to specify which physics plugin methods can be called in parallel. Values can be ored together. More... | |
Public Member Functions | |
GmpFemPhysicsCommon (GmSimulationData *simulation, QString id, QString description, const GmpFemPhysicsCommonMaterialFactory *matFactory, const GmLogCategory &logger) | |
Constructor. More... | |
virtual | ~GmpFemPhysicsCommon () |
Virtual destructor. | |
void | printParameters (const GmLogCategory &logger) |
Asks the object to print its parameters using the provided logger. | |
virtual const QVariantMap * | physicsMetaDataMap ()=0 |
A virtual function that MUST be implemented by every derived class to return the map defining the physics behaviour and required state vars, attributes, properties and boundary conditions. More... | |
const QVariant & | attribute (int id) const |
Returns the value of the given attribute. | |
GmValueAccessor * | nodeAc () const |
Returns the accessor for retrieving node coordinates. | |
int | nodeDim () const |
Returns the node dimension (number of node coordinates) | |
bool | isoParametric () const |
Is this an iso-parametric or a super-parametric element setting? | |
int | svCount () const |
Returns the number of state vars supported by this physics. | |
GmValueAccessor * | svAc (int id) const |
Returns the accessor for the given state var. | |
int | baseDof (int id) const |
Returns the base dof for the given state var. | |
GmCellAccessor * | propertyAc (int id) const |
Returns the accessor for the given cell property. | |
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 does not need to be evaluated for each Gauss point) | |
GmValueAccessor * | nodeAttrAc (int id) const |
Returns the accessor for the given node attribute. | |
GmGaussAccessor * | gaussAttrAc (int id) const |
Returns the accessor for the given Gauss attribute. | |
const GmBoundaryCondition * | boundaryCondition (int id) const |
Returns the boundary condition object for the given bc type id. | |
const GmContactBoundaryCondition * | contactCondition (int id) const |
Returns the contact boundary condition object for the given bc type id. | |
GmBoundaryConditionAccessor * | bcAc (int id) const |
Returns the accessor for the given boundary condition value. | |
GmContactBoundaryConditionAccessor * | contactAc (int id) const |
Returns the accessor for the given contact boundary condition value. | |
bool | constantBc (int id) const |
Returns true if the given boundary condition property is not a function (so its value does not change over time) | |
bool | constantContactBc (int id) const |
Returns true if the given contact boundary condition property is not a function (so its value does not change over time) | |
const QVector< const GmBoundaryCondition * > & | calcBoundaryConditions () const |
Returns a list of boundary conditions that affect the matrix/vector calculations. | |
GmValueAccessor * | loadAc (int loadId) const |
Returns the accessor for retrieving external load nodal values for the given load type. | |
GmDiscontinuityAccessor * | discontinuityAc (int discId) const |
Returns the accessor for retrieving discontinuity set property / cell attributes for the given id. | |
GmSegmentCell2DIntersectionCoordAccessor * | discontinuity2dIntersectionCoordAc () const |
Returns the appropriate accessor for retrieving intersection coordinates for a 2d cell-discontinuity intersection segment. | |
GmValueAccessor * | cloneSvAcWithDifferentUnit (int id, QString unitSystemName, QString defUnit) const |
Returns a NEW accessor to the same data referenced by id, but using a different unit. The unitSystemName should be the name used to define the unit in the unit system. If that entry is missing from the unit system table, returns the accessor in the default unit. More... | |
GmCellAccessor * | clonePropertyAcWithDifferentUnit (int id, QString unitSystemName, QString defUnit) const |
See description in cloneSvAcWithDifferentUnit() | |
GmValueAccessor * | cloneNodeAttrAcWithDifferentUnit (int id, QString unitSystemName, QString defUnit) const |
See description in cloneSvAcWithDifferentUnit() | |
GmGaussAccessor * | cloneGaussAttrAcWithDifferentUnit (int id, QString unitSystemName, QString defUnit) const |
See description in cloneSvAcWithDifferentUnit() | |
const GmpFemPhysicsCommonMaterial * | material (const GmElement *e) const |
Returns the material object associated with the given element or NULL if not found (emmiting a warning) | |
const QVector< GmpFemPhysicsCommonMaterial * > & | materialList () const |
Returns the internal material list. It can contain NULL values if the material is not used by this physics instance. | |
bool | calcDerivedResult (int recoveryMode, GmValueAccessor *nodeAc, GmGaussAccessor *gaussAc, int resultId=-1) |
Auxilliary function to help recovering derived results either on Gauss points or on element nodes (or both). More... | |
void | fillElementNodeValues (const GmValueAccessor *ac, const GmElement *e, GmVector &v, int nv=-1) const |
Given an element, fills the vector v with nodal values from the given accessor. More... | |
bool | fillMissingNodeValues (GmValueAccessor *ac) |
For a super-parametric analysis, only "linear" nodes are been calculated for the given variable. Fills the remaining node values with a linear interpolated value. Receives an accessor instead of a state var id to enable its use for aditional node attributes. | |
bool | fillScalarFixedNodalBcLists (int bcId, int propertyId, int dofId, QList< int > &nodes, QList< int > &dof, QList< double > &values, bool *constantValues) const |
Auxiliary function that can be used to fill boundary condition lists returned by fixedNodalForcesBc() and fixedNodalDofsBc() for a scalar value associated with a scalar state variable (dof). More... | |
bool | fillVectorFixedNodalBcLists (int bcId, int propertyId, int dofId, bool ignoreZeroValues, bool ignoreDefValues, QList< int > &nodes, QList< int > &dof, QList< double > &values, bool *constantValues) const |
Auxiliary function that can be used to fill boundary condition lists returned by fixedNodalForcesBc() and fixedNodalDofsBc() for a vector value associated with a vector state variable with the same dimension. More... | |
bool | fillMultiScalarFixedNodalBcLists (int bcId, const QList< int > &propertyIds, int dofId, bool ignoreZeroValues, bool ignoreDefValues, QList< int > &nodes, QList< int > &dof, QList< double > &values, bool *constantValues) const |
Auxiliary function that can be used to fill boundary condition lists returned by fixedNodalForcesBc() and fixedNodalDofsBc() for a set of scalar values associated with a vector state variable whose dimension is equal to the number of scalar values. More... | |
virtual void | calcElementDerivedResultAtPoints (const GmElement *e, int resultId, const GmMatrix &evalPoints, bool evalAtIp, GmMatrix &result) |
Virtual function called by calcDerivedResult() to evaluate results for an element directly at the provided points, which typically are node coordinates or Gauss points. More... | |
virtual bool | checkLoadedData () |
Additional checking function, called after all attributes and accessors from physicsMetaDataMap() have already been loaded and validated. Should be implemented in derived classes for conducting additional checks that can't be expressed by the options on the tables in physicsMetaDataMap(). | |
void | addMaterialTranslation (const char *modelName, const char *physicsName, int modelIndex, bool defaultMaterial) |
Adds a new entry in the material translation map. More... | |
GmpFemPhysicsCommonMaterial * | material (QString modelName) const |
Given a material model name, registered with a call to addMaterialTranslation, returns the associated physics material (or NULL for unregistered materials). More... | |
![]() | |
GmpFemPhysics (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger) | |
Constructor. More... | |
virtual | ~GmpFemPhysics () |
Virtual destructor. | |
GmElementMesh * | mesh () const |
Returns the element mesh that this physics object is tied to. | |
const GmCellGroupSet * | meshGroupSet () const |
Returns the element group set used to traverse mesh elements belonging to the element groups that together define the physics spatial domain. More... | |
int | numSupportedExternalLoads () const |
Returns the number of supported external load types by this physics. Based on the list returned by supportedExternalLoads() | |
const GmCellGroupSet * | externalLoadGroupSet (int loadId) const |
Returns the element group set used to traverse mesh elements tied to the given external loads id. More... | |
const QMap< QString, const GmBoundaryCondition * > & | boundaryConditions () const |
Returns a reference to the map storing contact boundary conditions associated to this physics, keyed by bc type. | |
const QMap< QString, const GmContactBoundaryCondition * > & | contactBoundaryConditions () const |
GmDiscontinuitySet * | discontinuitySet () const |
Returns the associated discontinuity set, NULL if there is none. | |
virtual bool | checkPhysicsDependencies (const QList< GmpFemPhysics * > &physicsList, int index) |
A function called by the Fem solver, at its initialization, to let a physics check that it is compatible with the remaining physics used by the solver. More... | |
virtual bool | dofByElement (bool *fixed=NULL, bool *addOnly=NULL, bool *trackChanges=NULL) const |
Returns false if degrees of freedom are mapped to nodes depending only on the element type, or true if elements of the same type can have different dof mappings. More... | |
virtual const GmElementDof * | dofMapping (const GmElement *e) const |
Returns the mapping of node degrees of freedom for the given element or NULL if this physics object does not know how to handle it. More... | |
virtual bool | beforeElementStiffnessLoop (const GmpFemMatrixSet &elemMatrices, const GmpFemVectorSet &elemVectors) |
Method called by the Fem process to notify the physical object that the assembly process will start. More... | |
virtual void | afterElementStiffnessLoop () |
Method called by the Fem process to notify the physical object that the assembly process has ended. | |
virtual FemResultType | fillElementData (const GmElement *e, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors)=0 |
Method called by the FEM process, during the global matrix / vector assembly procedure to ask a physics object for the local contribution of the element 'e'. More... | |
virtual FemResultType | fillElementDataForBc (const GmElement *e, const GmBoundaryCondition *bc, int bcIndex, int bcListIndex, int border, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors) |
Method called by the FEM process in a similar way as the call to fillElementData() for the physics to supply local element matrix and/or vector contributions due to the supplied boundary condition. More... | |
virtual bool | fixedNodalForcesBc (QList< int > &nodes, QList< int > &dof, QList< double > &values) const |
Method called by the FEM process asking the physics to provide prescribed nodal force values that will be added to the global force vector f (the f vector in the global equation K.u = f). More... | |
virtual bool | fixedNodalDofsBc (QList< int > &nodes, QList< int > &dof, QList< double > &values, bool *constantValues) const |
Method called by the FEM process asking the physics to provide fixed dof (state variable) values used to remove degrees of freedom from the system. Those fixed values correspond to fixed u values in the global equation K.u = f. More... | |
virtual FemResultType | fillContactData (const GmContactBoundaryCondition *cbc, int bcIndex1, int bcIndex2, GmMatrixDof &dofMap, GmpFemMatrixSet &matrixSet, GmpFemVectorSet &vecSet) |
Method called by the FEM process in a similar way as the call to fillElementData() for the physics to supply local matrix and vector contributions due to the supplied contact pair. More... | |
virtual FemResultType | fillElementDataForLoads (const GmElement *e, int loadId, GmpFemVectorSet &elemVectors) |
Method called by the FEM process in a similar way as the call to fillElementData() for the physics to supply local element vector contributions due to the supplied external load. More... | |
virtual bool | calcDerivedResults (bool nonLinearSolver) |
Method called after the the system solution asking each physics to calculate derived results based on the solution (which has already been saved to the appropriate state variables) More... | |
virtual bool | supportsStateDumping () |
Method called by the solver to check if this physics supports state dumping and restoring. For this to be true, the physics must be able to save all its needed internal state upon a dump and recover it later using the next virtual calls. | |
virtual bool | addStateItemsToGroup (GmStateDump *state, bool fixedHint, int groupId) |
Initialization method, called once, allowing the object to add its state items to the given group of the sate dump object. More... | |
virtual bool | fillStateControlMapData (QVariantMap *map) |
Virtual method called just before the solver control map is saved to the state. Should be used to fill the map with the needed physics data. Returning false aborts the operation. | |
virtual bool | stateControlMapDataLoaded (QVariantMap *map) |
Virtual method called just after the solver control map was loaded from the state. Should be used to load map data into the physics. Differently from stateLoaded(), which is called after the whole dump file was processed, this method is called just after the control map was read, and before any other solve dump items are read. Returning false aborts the operation. | |
virtual bool | stateAboutToBeSaved (GmStateDump *state) |
Virtual method called just before starting a save operation on the given state. Returning false aborts the operation. | |
virtual bool | stateSaved (GmStateDump *state) |
Virtual method called just after succesfully completing a save operation on the given state. Returning false aborts the operation. | |
virtual bool | stateAboutToBeLoaded (GmStateDump *state) |
Virtual method called just before starting a load operation on the given state. Returning false aborts the operation. | |
virtual bool | stateLoaded (GmStateDump *state) |
Virtual method called just after succesfully completing a load operation on the given state. Returning false aborts the operation. | |
virtual QList< int > | changedElements () const |
Method called by the assembler to obtain the list of elements that had their dofs changed since the physics was created or the last call to clearChangedElements(). In the list, elements are represented by their ids. More... | |
virtual void | clearChangedElements () |
Method called by the assembler to clear the internal list used to track dof changes. See comments on changedElements(). | |
const GmIntegrationRule * | elementIntegrationRule (GmCellType type) const |
Returns the integration rule associated with the received element type. | |
const GmBorderIntegrationRule * | borderIntegrationRule (GmCellType type, int borderIndex) const |
Returns the integration rule associated with a border (face / edge) of the received element type. More... | |
const GmBorderIntegrationRule * | faceIntegrationRule (GmCellType type, int faceIndex) const |
Returns the face integration rule associated with the received element type. | |
const GmBorderIntegrationRule * | edgeIntegrationRule (GmCellType type) const |
Returns the edge integration rule associated with the received element type. | |
int | integrationRuleSet () const |
Returns the integration rule set in use by this physics object. | |
bool | setIntegrationRuleSet (int ruleSet) |
Sets the integration rule set used by this physics. Returns true if the named ruleSet doesn't exists in the mesh. | |
virtual bool | loadPrivateData (LuaTable &table) |
Reimplements loadPrivateData() to parse attributes common to all FEM physics objects, calling an extra set of virtual functions as needed. More... | |
![]() | |
GmPhysics (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger) | |
virtual const char * | pluginCategory () const |
GmCellAccessor * | propertyAccessor (GmCellMesh *mesh, QString stdPropertyName, QString msgDescription, LuaTable &table, Unit desiredUnit, bool required, int type=-1, int nlin=-1, int ncol=-1, bool canBeFunction=true, bool ignoreWarnings=false) |
GmCellAccessor * | extPropertyAccessor (GmCellMesh *mesh, QString stdPropertyName, QString msgDescription, LuaTable &table, Unit desiredUnit, bool required, int type=-1, int nlin=-1, int ncol=-1, bool canBeFunction=true, bool ignoreWarnings=false) |
GmDiscontinuityAccessor * | discontinuityPropertyAccessor (GmDiscontinuitySet *discSet, QString stdPropertyName, QString msgDescription, LuaTable &table, Unit desiredUnit, bool required, int type=-1, int nlin=-1, int ncol=-1, bool ignoreWarnings=false) |
GmDiscontinuityAccessor * | extDiscontinuityPropertyAccessor (GmDiscontinuitySet *discSet, QString stdPropertyName, QString msgDescription, LuaTable &table, Unit desiredUnit, bool required, int type=-1, int nlin=-1, int ncol=-1, bool ignoreWarnings=false) |
![]() | |
GmPluginObject (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger) | |
QString | id () const |
QString | description () const |
QString | pluginTypeName () const |
virtual const char * | pluginName () const=0 |
virtual const char * | pluginType () const=0 |
Static Public Member Functions | |
template<class T > | |
static T | listFromVariant (const QVariant &v) |
Auxiliary function returning a T list from a QVariant that contains either T or a T::listType. | |
static void | fillMatrixFromPropertyAc (GmCellAccessor *ac, const GmElement *e, const GmVector *coord, int ip, GmMatrix &K) |
Given a property accessor that can hold either a scalar, a vector with size 'd' or a matrix with size 'd x d', where d is the problem dimension, fills the K matrix (also d x d). More... | |
Protected Member Functions | |
virtual bool | supportsCellType (GmCellType type) const |
Returns true if the type is supported by this physics object. More... | |
virtual bool | supportsParallel (FemSupportedParallelMethods methodType) const |
Returns true if this physics object supports multiple calls in parallel (by multiple threads) to the referenced method. Returns false otherwise. | |
virtual const GmElementDof * | dofMapping (GmCellType type) const |
Returns the list of node dofs for the given type based on the the "stateVars" entry of the physics description map. The order of state vars in the map defines the order that they should appear in local matrices. More... | |
virtual Unit | dofUnit (int dof) const |
Returns the unit in which the dof is calculated by the physics based on the supplied unit on the "stateVars" entry of the physics description map. | |
virtual Unit | timeUnit () const |
Returns the unit in which the physics handles time. Returns Unit() if not relevant to the physics. | |
virtual const QList< QPair< int, GmValueAccessor * > > & | dofForceAttributes () const |
Returns a list that associates degrees of freedom handled by this physics with their associated force attributes. More... | |
virtual const QStringList & | supportedBcTypes () const |
A list with names for the known boundary condition types supported by this physics. More... | |
virtual const QStringList & | supportedContactBcTypes () const |
A list with names for the known contact boundary condition types supported by this physics. More... | |
virtual bool | bcAffectsCalc (const GmBoundaryCondition *bc) const |
Returns true if the given boundary condition affects the element matrix/vector calculations as specified in the "bc" entries of the physics description map. | |
virtual const QStringList & | supportedExternalLoads () const |
A list with names for the known external load conditions supported by this physics. More... | |
virtual bool | checkAndLoadPrivateData (LuaTable &table) |
Check and load physics attributes for the values described in the "attributes" entry of the physics description map. Also loads the node coordinate accessor, the user unit system definied in the unitSystem subtable and creates material objects. | |
virtual bool | checkMeshDimension (int ndim) |
Checks that the mesh dimension agrees with the value given in the "dimension" entry of the physics description map. | |
virtual bool | checkAndLoadDofMapping (LuaTable &table) |
Prepares the list of degrees of freedom evaluated by this physics object based on the "stateVars" entry of the physics description map. The order of state vars in the map defines the order that they should appear in local matrices. | |
virtual bool | checkAndLoadPropertyAccessors (LuaTable &table) |
Check and load property accessors for the values described in the "properties" entry of the physics description map. | |
virtual bool | checkAndLoadAttributeAccessors (LuaTable &nodeTable, LuaTable &gaussTable) |
Check and load node and gauss attribute accessors for the values described in the "nodeAttributes" and "gaussAttributes" entries of the physics description map. | |
virtual bool | checkAndLoadExternalLoadAccessors (LuaTable &loadsTable) |
Check and load external load node accessors for the values described in the "externalLoads" entry of the physics description map. | |
virtual bool | checkAndLoadBcAccessors () |
Check and load boundary condition accessors for the values described in the "bc" entry of the physics description map. | |
virtual bool | checkAndLoadContactBcAccessors () |
Check and load contact boundary condition accessors for the values described in the "cbc" entry of the physics description map. | |
virtual bool | checkAndLoadDiscontinuitySetAccessors (LuaTable &table) |
Check discontinuity set existance against the dsMode and dsElements attributes. Also loads discontinuity accessors for discontinuity set properties. More... | |
template<class T > | |
QString | accessorNameList (const QVector< T * > list) const |
Helper function to return a string with the names and units of the accessors in the given vector. | |
bool | checkAndLoadPropertyAccessorsAux (LuaTable &table, const QList< Value > &defList, QVector< GmCellAccessor * > &accessors, QVector< bool > &constants) |
An auxilliary function that does the job for checkAndLoadPropertyAccessors() storing the accessors at the provided vectors. | |
template<class T , class Ac > | |
bool | checkAndLoadBcAccessorsAux (QString attrName, QString msgPrefix, QMap< QString, const T * > &bcMap, QVector< const T * > &boundaryConditions, QVector< Ac * > &bcAccessors, QVector< bool > &constantBcValues, QStringList &boundaryConditionTypes, QVector< const T * > *calcBoundaryConditions, Ac *(GmPhysics::*acGetFn)(const T *, QString, QString, Unit, bool, int, int, int, bool, bool)) |
Aux function implementing the body of both checkAndLoadBcAccessors() and checkAndLoadContactBcAccessors() | |
bool | checkAndLoadNodeAttributeAccessors (LuaTable &table, const QList< Value > &naList, QVector< GmValueAccessor * > &accessors, GmpFemPhysicsCommonMaterial *m=NULL) |
An auxilliary function that does the job of loading node attribute accessors for checkAndLoadAttributeAccessors(), storing the accessors at the provided vector. It will also accept state vars instead of node attributes! | |
bool | checkAndLoadGaussAttributeAccessors (LuaTable &table, const QList< Value > &gaList, QVector< GmGaussAccessor * > &accessors, GmpFemPhysicsCommonMaterial *m=NULL) |
An auxilliary function that does the job of loading Gauss attribute accessors for checkAndLoadAttributeAccessors(), storing the accessors at the provided vector. | |
bool | checkAndLoadSavedGaussAttributes (const QList< int > &attrIdList, QString prefix, int numGaussAttributes, QVector< int > &savedIdList) |
Check and load saved gauss attribute ids for the values described in the "savedGaussAttributes" entry of the physics/material description map. | |
bool | createMaterials (LuaTable &table) |
If this physics uses material objects, loads the set of requested materials from the table pointed to by the "materialTable" attribute. Checks that the requested materials exist and creates them. More... | |
bool | loadAttributes (LuaTable &table) |
Loads physics attribute values from the given Lua table. | |
void | loadUnitSystemData (LuaTable &table) |
Loads the user unit system definition from subtable "unitSystem" if "userUnitSystem" is set to true. | |
QString | getUnit (QString id, QString defUnit) const |
If there is no user unit system, returns defUnit. If there is a user unit system, looks for the id in the unit system. If found, returns that unit (emits a warning if the found unit is incompatible with defUnit). If not found, emits a warning and returns an empty unit. | |
bool | loadAdditionalPrivateData (LuaTable &table, GmpFemPhysicsData &elemData) |
This function is called by checkAndLoadPrivateData() to load additional data required by composite and embedded fracture formulations. More... | |
bool | loadNodeData (LuaTable &table, GmpFemPhysicsData &elemData) |
This function is called by loadAdditionalPrivateData() to load additional nodes. If errors are found that prevent the use of the physics object, this function should return false. More... | |
bool | loadElementData (LuaTable &table, GmpFemPhysicsData &elemData) |
This function is called by loadAdditionalPrivateData() to load embedded element Data. If errors are found that prevent the use of the physics object, this function should return false. More... | |
bool | loadNeuralNetworkData (LuaTable &table, const char *name, GmpFemNeuralNetwork *netData) |
This function is called by checkAndLoadPrivateData() to load neural network data required by em physics and materials. More... | |
![]() | |
GmGaussAccessor * | gaussAttributeAccessor (GmElementMesh *mesh, QString stdAttributeName, QString msgDescription, LuaTable &table, Unit desiredUnit, bool required, int type=-1, int nlin=-1, int ncol=-1, int history=-1, bool canBeFunction=true, bool create=false, QString createFormat="", int createHistory=-1, bool ignoreWarnings=false) |
Similar to GmPhysics::propertyAccessor() returning a Gauss point attribute. The history parameter defines a restriction on the attribute history value (a -1 means that any history type is allowed). If the last parameter (create) is true, the attribute is required and if not found in the mesh, it will be created by the function (and its numeric format will be set to the value given by createFormat if not empty, using createHistory states) More... | |
virtual GmGaussAccessor * | createGaussAttributeAccessor (GmElementMesh *mesh, QString id, int snum, bool locked, Unit desiredUnit, const GmLogCategory &logger) const |
A virtual function called by gaussAttributeAccessor() to get the returned Gauss accessor. Exists to allow derived classes to work with a different accessor class derived from GmGaussAccessor. This is particulary important for the XFem plugin. | |
![]() | |
GmCellAccessor * | elementAttributeAccessor (GmCellMesh *mesh, QString stdAttributeName, QString msgDescription, LuaTable &table, Unit desiredUnit, bool required, int type=-1, int nlin=-1, int ncol=-1, int history=-1, bool canBeFunction=true, bool create=false, QString createFormat="", int createHistory=-1, bool ignoreWarnings=false) |
GmValueAccessor * | nodeAttributeAccessor (GmCellMesh *mesh, QString stdAttributeName, QString msgDescription, LuaTable &table, Unit desiredUnit, bool required, int type=-1, int nlin=-1, int ncol=-1, int history=-1, bool canBeFunction=true, bool create=false, QString createFormat="", int createHistory=-1, bool ignoreWarnings=false) |
GmValueAccessor * | nodeDataAccessor (GmCellMesh *mesh, QString stdAttributeName, QString msgDescription, LuaTable &table, Unit desiredUnit, bool required, int type=-1, int nlin=-1, int ncol=-1, int history=-1, bool canBeFunction=true, bool ignoreWarnings=false) |
GmBoundaryConditionAccessor * | boundaryAccessor (const GmBoundaryCondition *bc, QString stdPropertyName, QString msgDescription, Unit desiredUnit, bool required, int type=-1, int nlin=-1, int ncol=-1, bool canBeFunction=true, bool ignoreWarnings=false) |
GmContactBoundaryConditionAccessor * | contactAccessor (const GmContactBoundaryCondition *bc, QString stdPropertyName, QString msgDescription, Unit desiredUnit, bool required, int type=-1, int nlin=-1, int ncol=-1, bool canBeFunction=true, bool ignoreWarnings=false) |
QString | dofFromStateVar (const GmCellMesh *mesh, QString stdStateVarName, QString msgDescription, LuaTable &table, QList< int > &dofList, Unit resultUnit, bool required, int type=-1, int nlin=-1, int ncol=-1, bool ignoreWarnings=false) |
![]() | |
virtual const GmLogCategory & | logger () const |
GmSimulationData * | simulationData () const |
Protected Attributes | |
GmElementDof * | _dofMap [GM_NUM_CELL_TYPES] |
The list with maps of dof per element type. | |
![]() | |
GmElementMesh * | _mesh |
The mesh that this physics is bound to. | |
const GmCellGroupSet * | _gs |
The element group set used to traverse the mesh elements that form the physics spatial domain. | |
int | _intRuleSet |
The integration rule set used by this physics. | |
GmDiscontinuitySet * | _discSet |
The discontinuity set, NULL if none was associated. | |
QMap< QString, const GmBoundaryCondition * > | _bcMap |
A map storing boundary conditions associated to this physics, keyed by bc type. | |
QMap< QString, const GmContactBoundaryCondition * > | _cbcMap |
A map storing contact boundary conditions associated to this physics, keyed by bc type. | |
QVector< const GmCellGroupSet * > | _externalLoadGroupSets |
Element group sets for each active external loads or NULL for inactive ones. Indexed in the same order as the names returned by supportedExternalLoads(). Contains NULL if an external load is not configured for this physics. | |
Private Attributes | |
const QVariantMap * | _attrMap |
Map describing the physics behaviour and required characteristics. | |
const GmpFemPhysicsCommonMaterialFactory * | _matFactory |
Material factory. NULL if material abstraction is not needed. | |
QVector< QVariant > | _attributes |
List with physics private attributes. | |
int | _nodeDim |
Node dimension. | |
bool | _iso |
Iso parametric (true) or super parametric (false) element? | |
bool | _supportedTypes [GM_NUM_CELL_TYPES] |
Supported element types for this physics. | |
unsigned int | _parallelMethods |
An or of FemSupportedParallelMethods entries specifying which physics methods can be called in parallel. | |
QList< QPair< int, GmValueAccessor * > > | _dofForceAttributes |
List mapping state vars to their force attribute accessors. | |
QVector< GmValueAccessor * > | _svAccessors |
List with state var acessors. | |
QVector< int > | _svDof |
List with the base dof number for each accessor in _svAccessors. | |
GmValueAccessor * | _nodeAccessor |
An accessor for retrieving node coordinate values. | |
QVector< GmCellAccessor * > | _propertyAccessors |
List with property accessors. | |
QVector< bool > | _constantProperties |
List with flags defining if the properties in _propertyAccessors can have functions or not. | |
QVector< GmValueAccessor * > | _nodeAttrAccessors |
List with node attribute accessors. | |
QVector< GmGaussAccessor * > | _gaussAttrAccessors |
List with Gauss attribute accessors. | |
QVector< const GmBoundaryCondition * > | _boundaryConditions |
List with boundary conditions. | |
QVector< const GmContactBoundaryCondition * > | _contactConditions |
List with contact boundary conditions. | |
QStringList | _boundaryConditionTypes |
List with the names of the supported boundary condition types. | |
QStringList | _contactConditionTypes |
List with the names of the supported contact boundary condition types. | |
QVector< const GmBoundaryCondition * > | _calcBoundaryConditions |
List with boundary conditions that affect element matrix/vector calculations. | |
QVector< GmBoundaryConditionAccessor * > | _bcAccessors |
List with acessors for boundary condition values. | |
QVector< GmContactBoundaryConditionAccessor * > | _contactAccessors |
List with acessors for contact boundary condition values. | |
QVector< bool > | _constantBcValues |
List with flags defining if the properties in _bcAccessors can have functions or not. | |
QVector< bool > | _constantContactBcValues |
List with flags defining if the properties in _contactAccessors can have functions or not. | |
QVector< GmValueAccessor * > | _loadAccessors |
List with node acessors suplying external load data. | |
QStringList | _externalLoadsList |
List storing the names of the supported external load types. | |
DiscSetRequiredMode | _discSetMode |
Defines whether a discontinuity set association is required, optional or ignored. | |
bool | _discSetElementMode |
When _disSetMode is Required or Optional, does it require that elements be added for intersections? | |
QVector< GmDiscontinuityAccessor * > | _discSetPropertyAccessors |
List with property accessors for the discontinuity set. | |
GmSegmentCell2DIntersectionCoordAccessor * | _discSet2DInterCoordAc |
The coordinate accessor for intersection data for 2d polyline discontinuity sets. | |
QMap< QString, QString > | _unitSystem |
The user given unit system or empty for using the default one. | |
Unit | _timeUnit |
The physics time unit. | |
QVector< GmpFemPhysicsCommonMaterial * > | _materials |
The set of materials in use by this physics. | |
GmCellAccessor * | _materialIndex |
The accessor used for retrieving an element material index. | |
int | _defaultMaterialIndex |
The index in _materials for retrieving an element material when _materialIndex is NULL. | |
QMap< QString, MaterialTranslationInfo > | _materialTranslationMap |
Map used to translate material names and indices. | |
int | _largestModelMaterialIndex |
Largest value in MaterialTranslationInfo::_modelIndex or -1 if the map is unused. | |
QString | _defaultModelMaterialName |
The name of the default material when the translation map is used. | |
Friends | |
class | GmpFemPhysicsCoupled |
A class that implements several common functions required by GmpFemPhysics.
Enumeration used to specify the behavior of a call to calcDerivedResults()
Enumerator | |
---|---|
RECOVER_AT_GAUSS | Values should be recovered at Gauss points. |
RECOVER_AT_NODES | Values should be recovered at element nodes. |
DIRECT_NODE_EVAL | Use direct node eveluation when recovering values at nodes (used only if RECOVER_AT_NODES is also set) |
ADD_RESULTS | When calculated, results should be added to the current value at nodes/Gauss points. |
IP_ONLY | When set, means that calcElementDerivedResultAtPoints() can only calculate values at integration points. Can not be mixed with DIRECT_NODE_EVAL. |
GAUSS_FILLED | When set, means that the value at Gauss points is already filled. |
A QList<Bc> that can be implicitely converted to a QVariant.
Mode for handling discontinuity sets
GmpFemPhysicsCommon::GmpFemPhysicsCommon | ( | GmSimulationData * | simulation, |
QString | id, | ||
QString | description, | ||
const GmpFemPhysicsCommonMaterialFactory * | matFactory, | ||
const GmLogCategory & | logger | ||
) |
Constructor.
simulation | Reference to the simulation object. |
id | Physics id. |
description | Physics description. |
matFactory | The material factory used to create material objects when this support is enabled |
logger | Plugin logger object used to emmit messages |
void GmpFemPhysicsCommon::addMaterialTranslation | ( | const char * | modelName, |
const char * | physicsName, | ||
int | modelIndex, | ||
bool | defaultMaterial | ||
) |
Adds a new entry in the material translation map.
modelName | The material name used by the model |
physicsName | The equivalent material name for this physics |
modelIndex | The material index equivalent to the modelName |
defaultMaterial | Is this the default model material? |
bool GmpFemPhysicsCommon::calcDerivedResult | ( | int | recoveryMode, |
GmValueAccessor * | nodeAc, | ||
GmGaussAccessor * | gaussAc, | ||
int | resultId = -1 |
||
) |
Auxilliary function to help recovering derived results either on Gauss points or on element nodes (or both).
This function implements the common behaviour for recovering derived results, delegating the real calculations for the calcElementDerivedResultAtPoints() virtual function that must be reimplemented on a derived class.
Results can be calculated on Gauss points, on nodes or in both, depending on the mode parameter. Node values can be recovered directly on the nodes or can be extrapolated from recovered Gauss points (usually better). Either way, the current implementation does a simple average to merge node contributions from several elements.
The recoveryMode parameter controls the function behavior. It is an 'or' of DerivedResultsRecoveryMode flags. Flags RECOVER_AT_GAUSS and RECOVER_AT_NODES control where results will be calculated. To specify both just add both flags to the mode.
The DIRECT_NODE_EVAL flag controls, when recovering data for node values, if they are calculated directly at the nodes or extrapolated from Gauss data (the default). Even if this flag is not set, results might be calculated directly at nodes if there is no extrapolation matrix, for the current integration rule, for carrying data at Gauss points to nodal values. Keep in mind that for an heterogeneous mesh, if one elment type does not support extrapolation matrices, direct node evaluation will be used for all of them.
If IP_ONLY is set to true, indicates that the calcElementDerivedResultAtPoints() function accepts only element integration points as the calculation target. In that case, the DIRECT_NODE_EVAL flag will be ignored and node value retrieval will be possible only if the element supports extrapolation matrices.
If the ADD_RESULTS flag is specified, calculated values will be added to the existing values both on the nodes and on Gauss points.
If the GAUSS_FILLED flag is set to true, this function will assume that values at Gauss points where already calculated. In this case, the RECOVER_AT_GAUSS flag will be ignored and the current Gauss point values will be used as a base to recover node values (unless direct node recovery is enabled or there is no compatible element extrapolation matrix).
IMPORTANT: The current implementation assumes that the same integration rule is used for all elements of the same type and is optimized for this pattern, thus rendering the current auxilliary function useless for scenarios, such as the XFEM implementation, where different rules are bound to each element.
recoveryMode | The recovery mode. It is an or of DerivedResultsRecoveryMode flags. See comments above. |
nodeAc | The node attribute accessor that will be used to store the recovered values. A NULL value can be passed if the accessor isn't needed (mode == "gauss"). |
gaussAc | Similar to gaussAttr for data recovered at Gauss points. Required also if GAUSS_FILLED is specified in recoveryMode. |
resultId | An opaque value passed to the call to calcElementDerivedResultAtPoints() so that it can distinguish between different result types if the physics has several types |
of derived results to calculate.
|
inlinevirtual |
Virtual function called by calcDerivedResult() to evaluate results for an element directly at the provided points, which typically are node coordinates or Gauss points.
This function result is a matrix with size d x m where 'm' is the number of evaluation points and 'd' the result dimension (6 for a 3d stress calculation, for example - sxx, syy, szz, sxy, sxz, syz)
e | The element where we are calculating the result matrix |
resultId | The value of the resultId parameter passed to calcDerivedResult(). Can be used to identify the result type if the physics has more than one derived result calculation. |
evalPoints | Matrix filled with natural coordinates for the 'm' points where results will be evaluated. Size = natural_coord_dimension x m. |
evalAtIp | Flag that when set to true means that column 'i' in evalPoints is the coordinate of the 'i'th integration point. Will always be true if IP_ONLY was set in the recovery mode passed to calcDerivedResult(). |
result | Calculated results for each of the evaluation points. For each point of the 'm' points, a matrix column should be filled with the given point result. Size = d x m, where 'd' is the result dimension (equal to the accessor parameters dimension in the calcDerivedResult() call). |
|
protectedvirtual |
Check discontinuity set existance against the dsMode and dsElements attributes. Also loads discontinuity accessors for discontinuity set properties.
The received property name translation table is the SAME one used for mesh property name translations. If dsMode is DS_IGNORED, there is no loading or validation of disc set properties.
Implements GmpFemPhysics.
GmValueAccessor * GmpFemPhysicsCommon::cloneSvAcWithDifferentUnit | ( | int | id, |
QString | unitSystemName, | ||
QString | defUnit | ||
) | const |
Returns a NEW accessor to the same data referenced by id, but using a different unit. The unitSystemName should be the name used to define the unit in the unit system. If that entry is missing from the unit system table, returns the accessor in the default unit.
IMPORTANT: The accessor MUST be deleted by the caller IMPORTANT 2: The current implementation DOES NOT handle history values.
|
protected |
If this physics uses material objects, loads the set of requested materials from the table pointed to by the "materialTable" attribute. Checks that the requested materials exist and creates them.
If a material factory exists, the materialTable _attrMap property must also exist, but if the materials table doesn't exist in the physics, only the default material will be instanced.
Material properties are NOT read at this step. This is delayed until the call to checkAndLoadPropertyAccessors(), when material properties will be checked together with physics properties.
If material name translation was setup by calls to addMaterialTranslation(), material names read from table will be subjected to a translation step. If a name is not found in the translation table, an error will be raised. When translations are in effect, material indices in the _materials table will follow the model index given in addMaterialTranslation() and not the material index in this physics factory, since in this case, values returned by the _materialIndex accessor will correspond to model indices.
|
inlineprotectedvirtual |
Returns a list that associates degrees of freedom handled by this physics with their associated force attributes.
This list is not required. If the force attribute is multidimensional, it should appear in the list once with its base dof. List accessors should remain valid through the life of the physics.
Reimplemented from GmpFemPhysics.
|
protectedvirtual |
Returns the list of node dofs for the given type based on the the "stateVars" entry of the physics description map. The order of state vars in the map defines the order that they should appear in local matrices.
This base function supports only the basic case where all nodes share the same dof list, but it supports both the iso-parametric and super-parmetric cases (where only the vertex/corner nodes will have associated dofs). For different schemas, this function should be reimplemented.
Implements GmpFemPhysics.
void GmpFemPhysicsCommon::fillElementNodeValues | ( | const GmValueAccessor * | ac, |
const GmElement * | e, | ||
GmVector & | ve, | ||
int | nv = -1 |
||
) | const |
Given an element, fills the vector v with nodal values from the given accessor.
If nv is different from -1, instead of traversing all element nodes, only the first nv will be retrieved. This is very usefull in super-parametric settings where values exist only at the element vertices (corners), which in GeMA ar always the first element nodes.
The filled vector ve should have size equal to the number of retrieved values, i.e, equal to the number of element nodes / nv multiplied by the node data dimension. For multidimensional data, the returned vector will store data per node. As an example, for a QUAD4 with a 2D displacement accessor the returned vector will have 8 entries: [ux1, uy1, ux2, uy2, ux3, uy3, ux4, uy4].
Receives an accessor instead of a state var id to enable its use for aditional node attributes.
|
static |
Given a property accessor that can hold either a scalar, a vector with size 'd' or a matrix with size 'd x d', where d is the problem dimension, fills the K matrix (also d x d).
Filling rules:
bool GmpFemPhysicsCommon::fillMultiScalarFixedNodalBcLists | ( | int | bcId, |
const QList< int > & | propertyIds, | ||
int | dofId, | ||
bool | ignoreZeroValues, | ||
bool | ignoreDefValues, | ||
QList< int > & | nodes, | ||
QList< int > & | dof, | ||
QList< double > & | values, | ||
bool * | constantValues | ||
) | const |
Auxiliary function that can be used to fill boundary condition lists returned by fixedNodalForcesBc() and fixedNodalDofsBc() for a set of scalar values associated with a vector state variable whose dimension is equal to the number of scalar values.
Parameters bcId, propertyIds and dofId inform, respectively the id of the boundary condition type, the ids of the returned value properties inside the boundary condition object, ordered in the same order of the state var dimension correspondence, and the correspondinng base degree of freedom.
This function expects that propertyIds will have the same number of entries as the associated state var dimension. Nevertheless, any of those Ids can refer to a NULL accessor, meaning that that column was not given in the boundary condition and so will be ignored for creating the result lists.
Sometimes, when a column of the boundary condition values is zero, that value does not need to be added to the result lists. An example is a force value that acts only in the y direction. There is no need to add a zero valued fx component to the result lists. The ignoreZeroValues flag controls this behaviour.
When a boundary condition line has missing column values (nil), the scalar boundary condition value for that column is filled with the attribute default value. When the flag ignoreDefValue is set to true, those values will be ignored and will not be appended to the result lists. This is probably the expected behaviour in most cases. When ignoreDefValue is true and the value is a function, the evaluated function value is checked against the attribute default value (unless the default value is itself a function, when the ignoreDefValue option is ignored).
If ignoreDefValue is true, ignoreZeroValues is false and the default value is zero, ignoreDefValue will be disabled since those statements are contradictory.
Returned results (nodes, dof, values and constantValues) are the same as the ones declared in GmFemPhysics::fixedNodalDofsBc(). This function appends values to the returned lists, so multiple calls to this function can be made to handle different dof kinds. The constantValues parameter can be set to NULL if its result is not needed.
bool GmpFemPhysicsCommon::fillScalarFixedNodalBcLists | ( | int | bcId, |
int | propertyId, | ||
int | dofId, | ||
QList< int > & | nodes, | ||
QList< int > & | dof, | ||
QList< double > & | values, | ||
bool * | constantValues | ||
) | const |
Auxiliary function that can be used to fill boundary condition lists returned by fixedNodalForcesBc() and fixedNodalDofsBc() for a scalar value associated with a scalar state variable (dof).
Parameters bcId, propertyId and dofId inform, respectively the id of the boundary condition type, the id of the returned value property inside the boundary condition object and the correspondinng degree of freedom.
Returned results (nodes, dof, values and constantValues) are the same as the ones declared in GmFemPhysics::fixedNodalDofsBc(). This function appends values to the returned lists, so multiple calls to this function can be made to handle different dof kinds. The constantValues parameter can be set to NULL if its result is not needed.
bool GmpFemPhysicsCommon::fillVectorFixedNodalBcLists | ( | int | bcId, |
int | propertyId, | ||
int | dofId, | ||
bool | ignoreZeroValues, | ||
bool | ignoreDefValues, | ||
QList< int > & | nodes, | ||
QList< int > & | dof, | ||
QList< double > & | values, | ||
bool * | constantValues | ||
) | const |
Auxiliary function that can be used to fill boundary condition lists returned by fixedNodalForcesBc() and fixedNodalDofsBc() for a vector value associated with a vector state variable with the same dimension.
Parameters bcId, propertyId and dofId inform, respectively the id of the boundary condition type, the id of the returned value property inside the boundary condition object and the correspondinng base degree of freedom.
Sometimes, when a component of the vector boundary condition value is zero, that value does not need to be added to the result lists. An example is a force value that acts only in the y direction. There is no need to add a zero valued fx component to the result lists. The ignoreZeroValues flag controls this behaviour.
When a boundary condition line has missing vector component values (nil in a vector column), the vector boundary condition value component for that column is filled with the corresponding column from the attribute default value. When the flag ignoreDefValue is set to true, those values will be ignored and will not be appended to the result lists. This is the expected behaviour in many cases and allows for using vector values when fixing only part of the degrees of freedom associated with that vector. When ignoreDefValue is true and the value is a function, the evaluated function value is checked against the attribute default value (unless the default value is itself a function, when the ignoreDefValue option is ignored).
If ignoreDefValue is true, ignoreZeroValues is false and the default value is zero, ignoreDefValue will be disabled since those statements are contradictory.
Returned results (nodes, dof, values and constantValues) are the same as the ones declared in GmFemPhysics::fixedNodalDofsBc(). This function appends values to the returned lists, so multiple calls to this function can be made to handle different dof kinds. The constantValues parameter can be set to NULL if its result is not needed.
|
protected |
This function is called by checkAndLoadPrivateData() to load additional data required by composite and embedded fracture formulations.
If errors are found that prevent the use of the physics object, this function should log an error message and return false.
|
protected |
This function is called by loadAdditionalPrivateData() to load embedded element Data. If errors are found that prevent the use of the physics object, this function should return false.
Loads additional element Data.
|
protected |
This function is called by checkAndLoadPrivateData() to load neural network data required by em physics and materials.
This function is called by checkAndLoadPrivateData() to load additional data required by composite and embedded fracture formulations.
If errors are found that prevent the use of the physics object, this function should log an error message and return false.
|
protected |
This function is called by loadAdditionalPrivateData() to load additional nodes. If errors are found that prevent the use of the physics object, this function should return false.
Loads additional node Data.
GmpFemPhysicsCommonMaterial * GmpFemPhysicsCommon::material | ( | QString | modelName | ) | const |
Given a material model name, registered with a call to addMaterialTranslation, returns the associated physics material (or NULL for unregistered materials).
IMPORTANT: This function can be called only after createMaterials() execution by checkAndLoadPrivateData()
|
pure virtual |
A virtual function that MUST be implemented by every derived class to return the map defining the physics behaviour and required state vars, attributes, properties and boundary conditions.
This function will be called once at the begining of the checkAndLoadPrivateData() implementation. The returned map is not received as a constructor parameter to make it easier to create class hierarchies.
See the class description for the map syntax and usage examples.
|
inlineprotectedvirtual |
A list with names for the known boundary condition types supported by this physics.
This function is called only after the call to checkAndLoadBcAccessors().
Reimplemented from GmpFemPhysics.
|
inlineprotectedvirtual |
A list with names for the known contact boundary condition types supported by this physics.
This function is called only after the call to checkAndLoadContactBcAccessors().
Reimplemented from GmpFemPhysics.
|
inlineprotectedvirtual |
A list with names for the known external load conditions supported by this physics.
Those names will be used to recognize valid map entries in the externalLoads physics attribute. Their order in the list define the loadId used to identify the kind of external load in calls to fillElementDataForLoads().
Reimplemented from GmpFemPhysics.
|
inlineprotectedvirtual |
Returns true if the type is supported by this physics object.
Results from dofMapping() should be consistent with results from supportsCellType(), i.e. there must exist a 1:1 mapping between types where supportsCellType() returns true and non NULL pointers returned by dofMapping()
Implements GmpFemPhysics.