24#ifndef _GEMA_PLUGIN_FEM_PHYSICS_COMMON_H_
25#define _GEMA_PLUGIN_FEM_PHYSICS_COMMON_H_
63 RequiredIf(
bool required) : _mode(required), _l(NULL), _r(NULL) {}
73 : _mode(2), _type(type), _attr(attr), _op(op), _val(val), _l(NULL), _r(NULL)
75 assert(type ==
"dimension" || type ==
"attributes" || type ==
"stateVars" || type ==
"properties");
76 assert(type ==
"dimension" || !attr.
isEmpty());
77 assert(((op == EXISTS || op == NOT_EXISTS) && val.isNull()) ||
78 ((op != EXISTS && op != NOT_EXISTS) && !val.isNull()));
85 assert(op == OR || op == AND);
128 Size(
int lin = Any,
int col = Any) : _nlin(lin), _ncol(col) { assert(lin > AttrLin && col > AttrLin); }
135 : _nlin(lin), _ncol(col), _linAttrType(linType), _linAttr(linAttr), _colAttrType(colType), _colAttr(colAttr) {}
179 Attribute() : _id(-1), _type(User), _size(-1, -1), _required(false) {}
183 : _id(id), _name(name), _type(type), _size(nlin, ncol), _unit(unit), _defVal(defValue), _required(required) { assert(
id >= 0 && type != Enum); }
187 : _id(id), _name(name), _type(type), _size(-1, -1), _unit(unit), _defVal(defValue), _required(required) { assert(
id >= 0 && type != Enum); }
191 : _id(id), _name(name), _type(type), _size(-1, -1), _defVal(defValue), _required(false) { assert(
id >= 0 && type != Enum); }
195 : _id(id), _name(name), _type(type), _size(nlin, ncol), _defVal(defValue), _required(false) { assert(
id >= 0 && type != Enum); }
199 : _id(id), _name(name), _type(Enum), _enumMap(enumMap), _size(-1, -1), _unit(unit), _defVal(defValue), _required(required) { assert(
id >= 0); }
203 : _id(id), _name(name), _type(Enum), _enumMap(enumMap), _size(-1, -1), _defVal(defValue), _required(false) { assert(
id >= 0); }
225 ValueType(
GmDimType type,
int nlin = -1,
int ncol = -1,
bool canBeFunction =
true,
int history = -1,
const char* format =
"")
226 : _type(type), _size(nlin, ncol), _function(canBeFunction), _history(history), _format(format) {}
230 bool canBeFunction =
true,
int history = -1,
const char* format =
"")
231 : _type(type), _size(nlin, linType, linAttr, ncol, colType, colAttr),
232 _function(canBeFunction), _history(history), _format(format) {}
248 Value() : _id(-1), _required(false), _historyRefId(-1), _historyState(0), _historyLocked(true) {}
252 : _id(id), _name(name), _description(description), _unit(unit), _types(
QList<
ValueType>() << type), _required(required),
253 _historyRefId(-1), _historyState(0), _historyLocked(true) { assert(
id >= 0); }
257 : _id(id), _name(name), _description(description), _unit(unit), _types(types), _required(required),
258 _historyRefId(-1), _historyState(0), _historyLocked(true)
283 bool canBeFunction =
true,
int history = -1,
const char* format =
"")
284 :
Value(id, name, description, unit,
ValueType(
GM_SCALAR_VALUE, -1, -1, canBeFunction, history, format), required) {}
295 bool canBeFunction =
true,
int history = -1,
const char* format =
"")
296 :
Value(id, name, description, unit,
ValueType(
GM_VECTOR_VALUE, nlin, -1, canBeFunction, history, format), required) {}
300 const RequiredIf& required =
RequiredIf(
true),
bool canBeFunction =
true,
int history = -1,
const char* format =
"")
301 :
Value(id, name, description, unit,
ValueType(
GM_VECTOR_VALUE, nlin, linType, linAttr, -1,
"",
"",
302 canBeFunction, history, format), required) {}
313 bool canBeFunction =
true,
int history = -1,
const char* format =
"")
314 :
Value(id, name, description, unit,
ValueType(
GM_MATRIX_VALUE, nlin, ncol, canBeFunction, history, format), required) {}
321 bool canBeFunction =
true,
int history = -1,
const char* format =
"")
322 :
Value(id, name, description, unit,
ValueType(
GM_MATRIX_VALUE, nlin, linType, linAttr, ncol, colType, colAttr,
323 canBeFunction, history, format), required) {}
332 HistoryValue(
int id,
int refId,
int state,
bool locked =
true)
336 _historyRefId = refId;
337 _historyState = state;
338 _historyLocked = locked;
350 TList& operator<< (
const T& t) { this->append(t);
return *
this; }
377 Bc() : _id(-1), _required(false) {}
381 : _id(id), _name(name), _bcType(bcType), _bcUseType(bcUseType),
382 _bcValues(
ValueList() << bcValue), _required(required) { assert(
id >= 0); }
386 : _id(id), _name(name), _bcType(bcType), _bcUseType(bcUseType),
387 _bcValues(bcValues), _required(required) { assert(
id >= 0); }
431 return T() << v.
value<
typename T::listType>();
453 int svCount()
const {
return _svAccessors.size(); }
459 int baseDof(
int id)
const {
return _svDof.at(
id); }
493 bool constantBc(
int id)
const {
return _constantBcValues.at(
id); }
526 RECOVER_AT_GAUSS = 0x01,
527 RECOVER_AT_NODES = 0x02,
528 DIRECT_NODE_EVAL = 0x04,
542 bool fillVectorFixedNodalBcLists(
int bcId,
int propertyId,
int dofId,
bool ignoreZeroValues,
bool ignoreDefValues,
545 bool fillMultiScalarFixedNodalBcLists(
int bcId,
const QVector<int>& propertyIds,
int dofId,
bool ignoreZeroValues,
bool ignoreDefValues,
570 Q_UNUSED(e); Q_UNUSED(resultId); Q_UNUSED(evalPoints); Q_UNUSED(evalAtIp); Q_UNUSED(result);
580 void addMaterialTranslation(
const char* modelName,
const char* physicsName,
int modelIndex,
bool defaultMaterial);
631 template<
class T,
class Ac>
642 bool createMaterials(
LuaTable& table);
644 bool loadAttributes (
LuaTable& table);
645 void loadUnitSystemData(
LuaTable& table);
725 : _physicsName(
""), _modelIndex(-1) {}
728 : _physicsName(physicsName), _modelIndex(modelIndex) {}
A simple class to store additional Data required by Fem physics.
Definition gmpFemNeuralNetwork.h:36
A wrapper over a QList<T> that knows how to convert itself into a QVariant, provided that the resulti...
Definition gmpFemPhysicsCommon.h:346
A class that implements several common functions required by GmpFemPhysics.
Definition gmpFemPhysicsCommon.h:41
const QVector< const GmBoundaryCondition * > & calcBoundaryConditions() const
Returns a list of boundary conditions that affect the matrix/vector calculations.
Definition gmpFemPhysicsCommon.h:501
QVector< GmCellAccessor * > _cellAttrAccessors
List with cell attribute accessors.
Definition gmpFemPhysicsCommon.h:696
QVector< GmValueAccessor * > _nodeAttrAccessors
List with node attribute accessors.
Definition gmpFemPhysicsCommon.h:695
QVector< QVariant > _attributes
List with physics private attributes.
Definition gmpFemPhysicsCommon.h:682
GmContactBoundaryConditionAccessor * contactAc(int id) const
Returns the accessor for the given contact boundary condition value.
Definition gmpFemPhysicsCommon.h:488
GmValueAccessor * loadAc(int loadId) const
Returns the accessor for retrieving external load nodal values for the given load type....
Definition gmpFemPhysicsCommon.h:504
QList< QPair< int, GmValueAccessor * > > _dofForceAttributes
List mapping state vars to their force attribute accessors.
Definition gmpFemPhysicsCommon.h:689
QVector< GmBoundaryConditionAccessor * > _bcAccessors
List with acessors for boundary condition values.
Definition gmpFemPhysicsCommon.h:703
virtual const QStringList & supportedBcTypes() const
A list with names for the known boundary condition types supported by this physics.
Definition gmpFemPhysicsCommon.h:605
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 gmpFemPhysicsCommon.h:467
bool _discSetElementMode
When _disSetMode is Required or Optional, does it require that elements be added for intersections?
Definition gmpFemPhysicsCommon.h:711
GmValueAccessor * nodeAc() const
Returns the accessor for retrieving node coordinates.
Definition gmpFemPhysicsCommon.h:444
QVector< int > _svDof
List with the base dof number for each accessor in _svAccessors.
Definition gmpFemPhysicsCommon.h:691
QVector< const GmBoundaryCondition * > _calcBoundaryConditions
List with boundary conditions that affect element matrix/vector calculations.
Definition gmpFemPhysicsCommon.h:702
QStringList _boundaryConditionTypes
List with the names of the supported boundary condition types.
Definition gmpFemPhysicsCommon.h:700
GmValueAccessor * _nodeAccessor
An accessor for retrieving node coordinate values.
Definition gmpFemPhysicsCommon.h:692
GmCellAccessor * _materialIndex
The accessor used for retrieving an element material index.
Definition gmpFemPhysicsCommon.h:718
QVector< bool > _constantContactBcValues
List with flags defining if the properties in _contactAccessors can have functions or not.
Definition gmpFemPhysicsCommon.h:706
QVector< GmValueAccessor * > _loadAccessors
List with node acessors suplying external load data.
Definition gmpFemPhysicsCommon.h:707
QVector< bool > _constantBcValues
List with flags defining if the properties in _bcAccessors can have functions or not.
Definition gmpFemPhysicsCommon.h:705
const GmSimulationData * _simData
An accessor for retrieving all simulation Data.
Definition gmpFemPhysicsCommon.h:681
GmSegmentCell2DIntersectionCoordAccessor * _discSet2DInterCoordAc
The coordinate accessor for intersection data for 2d polyline discontinuity sets.
Definition gmpFemPhysicsCommon.h:713
QStringList _contactConditionTypes
List with the names of the supported contact boundary condition types.
Definition gmpFemPhysicsCommon.h:701
const GmContactBoundaryCondition * contactCondition(int id) const
Returns the contact boundary condition object for the given bc type id.
Definition gmpFemPhysicsCommon.h:482
const GmBoundaryCondition * boundaryCondition(int id) const
Returns the boundary condition object for the given bc type id.
Definition gmpFemPhysicsCommon.h:479
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 pro...
Definition gmpFemPhysicsCommon.h:568
QVector< const GmBoundaryCondition * > _boundaryConditions
List with boundary conditions.
Definition gmpFemPhysicsCommon.h:698
virtual const QStringList & supportedContactBcTypes() const
A list with names for the known contact boundary condition types supported by this physics.
Definition gmpFemPhysicsCommon.h:608
virtual Unit timeUnit() const
Returns the unit in which the physics handles time. Returns Unit() if not relevant to the physics.
Definition gmpFemPhysicsCommon.h:596
DiscSetRequiredMode
A QList<Bc> that can be implicitely converted to a QVariant.
Definition gmpFemPhysicsCommon.h:404
@ DS_IGNORED
A discontinuity set is ignored by this physics.
Definition gmpFemPhysicsCommon.h:405
@ DS_OPTIONAL
A discontinuity set is optional for this physics. Will be used if available but is not required.
Definition gmpFemPhysicsCommon.h:407
@ DS_REQUIRED
A discontinuity set is required for this physics.
Definition gmpFemPhysicsCommon.h:406
QVector< GmContactBoundaryConditionAccessor * > _contactAccessors
List with acessors for contact boundary condition values.
Definition gmpFemPhysicsCommon.h:704
GmCellAccessor * cellAttrAc(int id) const
Returns the accessor for the given cell attribute.
Definition gmpFemPhysicsCommon.h:473
TList< Attribute > AttributeList
A QList<int> that can be implicitely converted to a QVariant.
Definition gmpFemPhysicsCommon.h:354
bool _iso
Iso parametric (true) or super parametric (false) element?
Definition gmpFemPhysicsCommon.h:684
virtual bool supportsParallel(FemSupportedParallelMethods methodType) const
Returns true if this physics object supports multiple calls in parallel (by multiple threads) to the ...
Definition gmpFemPhysicsCommon.h:590
GmValueAccessor * nodeAttrAc(int id) const
Returns the accessor for the given node attribute.
Definition gmpFemPhysicsCommon.h:470
bool constantBc(int id) const
Returns true if the given boundary condition property is not a function (so its value does not change...
Definition gmpFemPhysicsCommon.h:493
QMap< QString, QString > _unitSystem
The user given unit system or empty for using the default one.
Definition gmpFemPhysicsCommon.h:715
bool isoParametric() const
Is this an iso-parametric or a super-parametric element setting?
Definition gmpFemPhysicsCommon.h:450
int nodeDim() const
Returns the node dimension (number of node coordinates)
Definition gmpFemPhysicsCommon.h:447
static T listFromVariant(const QVariant &v)
Auxiliary function returning a T list from a QVariant that contains either T or a T::listType.
Definition gmpFemPhysicsCommon.h:428
virtual const QStringList & supportedExternalLoads() const
A list with names for the known external load conditions supported by this physics.
Definition gmpFemPhysicsCommon.h:613
TList< Value > ValueList
A QList<Attribute> that can be implicitely converted to a QVariant.
Definition gmpFemPhysicsCommon.h:355
DiscSetRequiredMode _discSetMode
Defines whether a discontinuity set association is required, optional or ignored.
Definition gmpFemPhysicsCommon.h:710
const QVector< GmpFemPhysicsCommonMaterial * > & materialList() const
Returns the internal material list. It can contain NULL values if the material is not used by this ph...
Definition gmpFemPhysicsCommon.h:521
QVector< GmDiscontinuityAccessor * > _discSetPropertyAccessors
List with property accessors for the discontinuity set.
Definition gmpFemPhysicsCommon.h:712
GmCellAccessor * propertyAc(int id) const
Returns the accessor for the given cell property.
Definition gmpFemPhysicsCommon.h:462
QMap< QString, MaterialTranslationInfo > _materialTranslationMap
Map used to translate material names and indices
Definition gmpFemPhysicsCommon.h:734
GmBoundaryConditionAccessor * bcAc(int id) const
Returns the accessor for the given boundary condition value.
Definition gmpFemPhysicsCommon.h:485
QStringList _externalLoadsList
List storing the names of the supported external load types.
Definition gmpFemPhysicsCommon.h:708
virtual const QVariantMap * physicsMetaDataMap()=0
A virtual function that MUST be implemented by every derived class to return the map defining the phy...
QVector< GmGaussAccessor * > _gaussAttrAccessors
List with Gauss attribute accessors.
Definition gmpFemPhysicsCommon.h:697
const QVariantMap * _attrMap
Map describing the physics behaviour and required characteristics.
Definition gmpFemPhysicsCommon.h:679
virtual bool checkLoadedData()
Additional checking function, called after all attributes and accessors from physicsMetaDataMap() hav...
Definition gmpFemPhysicsCommon.h:578
int baseDof(int id) const
Returns the base dof for the given state var.
Definition gmpFemPhysicsCommon.h:459
DerivedResultsRecoveryMode
Enumeration used to specify the behavior of a call to calcDerivedResults()
Definition gmpFemPhysicsCommon.h:525
QVector< bool > _constantProperties
List with flags defining if the properties in _propertyAccessors can have functions or not.
Definition gmpFemPhysicsCommon.h:694
QString _defaultModelMaterialName
The name of the default material when the translation map is used.
Definition gmpFemPhysicsCommon.h:736
int _largestModelMaterialIndex
Largest value in MaterialTranslationInfo::_modelIndex or -1 if the map is unused.
Definition gmpFemPhysicsCommon.h:735
unsigned int _parallelMethods
An or of FemSupportedParallelMethods entries specifying which physics methods can be called in parall...
Definition gmpFemPhysicsCommon.h:687
virtual const QList< QPair< int, GmValueAccessor * > > & dofForceAttributes() const
Returns a list that associates degrees of freedom handled by this physics with their associated force...
Definition gmpFemPhysicsCommon.h:602
virtual bool supportsCellType(GmCellType type) const
Returns true if the type is supported by this physics object.
Definition gmpFemPhysicsCommon.h:587
int svCount() const
Returns the number of state vars supported by this physics.
Definition gmpFemPhysicsCommon.h:453
const GmpFemPhysicsCommonMaterialFactory * _matFactory
Material factory. NULL if material abstraction is not needed.
Definition gmpFemPhysicsCommon.h:680
GmGaussAccessor * gaussAttrAc(int id) const
Returns the accessor for the given Gauss attribute.
Definition gmpFemPhysicsCommon.h:476
bool constantContactBc(int id) const
Returns true if the given contact boundary condition property is not a function (so its value does no...
Definition gmpFemPhysicsCommon.h:498
int _nodeDim
Node dimension.
Definition gmpFemPhysicsCommon.h:683
QVector< GmpFemPhysicsCommonMaterial * > _materials
The set of materials in use by this physics.
Definition gmpFemPhysicsCommon.h:717
QVector< GmValueAccessor * > _svAccessors
List with state var acessors.
Definition gmpFemPhysicsCommon.h:690
GmSegmentCell2DIntersectionCoordAccessor * discontinuity2dIntersectionCoordAc() const
Returns the appropriate accessor for retrieving intersection coordinates for a 2d cell-discontinuity ...
Definition gmpFemPhysicsCommon.h:510
QVector< const GmContactBoundaryCondition * > _contactConditions
List with contact boundary conditions.
Definition gmpFemPhysicsCommon.h:699
Unit _timeUnit
The physics time unit.
Definition gmpFemPhysicsCommon.h:716
GmValueAccessor * svAc(int id) const
Returns the accessor for the given state var.
Definition gmpFemPhysicsCommon.h:456
GmDiscontinuityAccessor * discontinuityAc(int discId) const
Returns the accessor for retrieving discontinuity set property / cell attributes for the given id.
Definition gmpFemPhysicsCommon.h:507
QVector< GmCellAccessor * > _propertyAccessors
List with property accessors.
Definition gmpFemPhysicsCommon.h:693
int _defaultMaterialIndex
The index in _materials for retrieving an element material when _materialIndex is NULL.
Definition gmpFemPhysicsCommon.h:719
const QVariant & attribute(int id) const
Returns the value of the given attribute.
Definition gmpFemPhysicsCommon.h:441
A simple factory used to register material type names, their numeric indices and their instance funct...
Definition gmpFemPhysicsCommonMaterial.h:157
A class that implements a common behaviour for physics materials.
Definition gmpFemPhysicsCommonMaterial.h:45
A class deriving from GmpFemPhysicsCommon that contains references for other physics objects that are...
Definition gmpFemPhysicsCoupled.h:37
A simple class to store additional Data required by Fem physics.
Definition gmpFemPhysicsData.h:34
Base interface class for FEM Physics type plugins.
Definition gmpFemPhysics.h:45
virtual bool checkAndLoadAttributeAccessors(LuaTable &nodeTable, LuaTable &cellTable, LuaTable &gaussTable)=0
This function is called by loadPrivateData() and should be implemented in derived classes to check if...
virtual bool checkMeshDimension(int ndim)=0
This function is called by loadPrivateData() to let the phyiscs check if it is compatible with the nu...
virtual bool checkAndLoadExternalLoadAccessors(LuaTable &loadsTable)=0
This function is called by loadPrivateData() and should be implemented in derived classes to check if...
virtual bool checkAndLoadBcAccessors()=0
This function is called by loadPrivateData() and should be implemented in derived classes to check if...
virtual void printParameters(const GmLogCategory &logger)
Asks the object to print its parameters using the provided logger.
Definition gmpFemPhysics.cpp:584
virtual bool checkAndLoadPrivateData(LuaTable &table)=0
This function is called by loadPrivateData() to let derived classes check consistency and load values...
virtual bool checkAndLoadPropertyAccessors(LuaTable &table)=0
This function is called by loadPrivateData() and should be implemented in derived classes to check if...
virtual bool checkAndLoadDofMapping(LuaTable &table)=0
This function is called by loadPrivateData() and should be implemented in derived classes to prepare ...
virtual const GmElementDof * dofMapping(GmCellType type) const =0
Returns the mapping of node degrees of freedom for a cell type or NULL if this physics object does no...
FemSupportedParallelMethods
Enum used to specify which physics plugin methods can be called in parallel. Values can be ored toget...
Definition gmpFemPhysics.h:58
virtual bool checkAndLoadContactBcAccessors()=0
This function is called by loadPrivateData() and should be implemented in derived classes to check if...
virtual Unit dofUnit(int dof) const =0
Returns the unit in which calculated values for the supplied dof are given. Should return Unit() for ...
virtual bool checkAndLoadDiscontinuitySetAccessors(LuaTable &table)=0
This function is called by loadPrivateData() and should be implemented in derived classes to check if...
virtual bool bcAffectsCalc(const GmBoundaryCondition *bc) const
Method called by the FEM process asking the physics whether the supplied boundary condition affects t...
Definition gmpFemPhysics.h:313
Declaration of the GmpFemPhysics interface class.
Q_DECLARE_METATYPE(LuaFunction)
bool isEmpty() const const
bool canConvert(int targetTypeId) const const
void setValue(const T &value)
A structure used to define attributes interpreted by the physics.
Definition gmpFemPhysicsCommon.h:161
Attribute(int id, QString name, AttributeType type, const RequiredIf &required, QString unit="", QVariant defValue=QVariant())
Generic attribute constructor for non vector/matrix/enum types, given the attribute name,...
Definition gmpFemPhysicsCommon.h:186
Attribute(int id, QString name, AttributeType type, int nlin, int ncol, const RequiredIf &required, QString unit="", QVariant defValue=QVariant())
Generic attribute constructor for non enum types, given the attribute name, expected type,...
Definition gmpFemPhysicsCommon.h:182
AttributeType
Attribute data type.
Definition gmpFemPhysicsCommon.h:164
@ Int
An integer number. Read variant with toInt().
Definition gmpFemPhysicsCommon.h:167
@ Enum
An integer number whose value is equal to an enum option. Read variant with toInt().
Definition gmpFemPhysicsCommon.h:175
@ StringList
A list of strings (QStringList). Read variant with toStringList().
Definition gmpFemPhysicsCommon.h:171
@ DoubleList
A list of doubles (QList<double>). Read variant with value< QList<double> >().
Definition gmpFemPhysicsCommon.h:170
@ User
Any value. Checks will be done later.
Definition gmpFemPhysicsCommon.h:165
@ Matrix
A GmMatrix object. Read variant with value<GmMatrix>().
Definition gmpFemPhysicsCommon.h:173
@ Double
A double value. Read variant with toDouble().
Definition gmpFemPhysicsCommon.h:168
@ Bool
A boolean value. Read variant with toBool().
Definition gmpFemPhysicsCommon.h:166
@ ScalarOrVector
A GmVector object that also accepts a scalar value. Read variant with value<GmVector>().
Definition gmpFemPhysicsCommon.h:174
@ String
A string (QString). Read variant with toString().
Definition gmpFemPhysicsCommon.h:169
@ Vector
A GmVector object. Read variant with value<GmVector>().
Definition gmpFemPhysicsCommon.h:172
QVariant _defVal
A default value applied to the attribute if not given and optional.
Definition gmpFemPhysicsCommon.h:216
Attribute(int id, QString name, const QMap< QString, int > &enumMap, QVariant defValue)
Attribute constructor for an optional enumerated attribute with default and no unit.
Definition gmpFemPhysicsCommon.h:202
AttributeType _type
The expected attribute type for validation purposes.
Definition gmpFemPhysicsCommon.h:213
RequiredIf _required
Is the attribute required?
Definition gmpFemPhysicsCommon.h:218
Attribute(int id, QString name, AttributeType type, QVariant defValue)
Attribute constructor for optional attributes with default and no unit.
Definition gmpFemPhysicsCommon.h:190
Attribute()
Default constructor needed to enable storing an Attribute in a QVariant. Builds an invalid Attribute.
Definition gmpFemPhysicsCommon.h:179
QString _unit
The attribute unit for double types.
Definition gmpFemPhysicsCommon.h:215
Size _size
The requested number of lines/columns for a vector / matrix.
Definition gmpFemPhysicsCommon.h:214
QMap< QString, int > _enumMap
Map for trnslating enum types.
Definition gmpFemPhysicsCommon.h:217
int _id
Attribute id storing its intended position in the attributes list.
Definition gmpFemPhysicsCommon.h:211
Attribute(int id, QString name, const QMap< QString, int > &enumMap, const RequiredIf &required, QString unit="", QVariant defValue=QVariant())
Attribute constructor for a generic enumerated attribute.
Definition gmpFemPhysicsCommon.h:198
QString _name
The attribute name.
Definition gmpFemPhysicsCommon.h:212
Attribute(int id, QString name, AttributeType type, int nlin, int ncol, QVariant defValue)
Attribute constructor for optional vector/amatrix attributes with default and no unit.
Definition gmpFemPhysicsCommon.h:194
A QList<Value> that can be implicitely converted to a QVariant.
Definition gmpFemPhysicsCommon.h:359
Bc()
Default constructor needed to enable storing a Bc in a QVariant. Builds an invalid Bc.
Definition gmpFemPhysicsCommon.h:377
int _id
Value id storing its intended position in the values list.
Definition gmpFemPhysicsCommon.h:392
RequiredIf _required
Is the value required?
Definition gmpFemPhysicsCommon.h:397
ValueList _bcValues
List with boundary condition values.
Definition gmpFemPhysicsCommon.h:396
BcType
Definition gmpFemPhysicsCommon.h:361
@ EdgeFace
The boundary condition will be applied over an edge for 2D elements and over a face for 3D elements.
Definition gmpFemPhysicsCommon.h:366
BcUseType
Definition gmpFemPhysicsCommon.h:370
@ FixedDof
The boundary condition represents fixed dof (u) values in K.u = f and will be treated by GmpFemPhysic...
Definition gmpFemPhysicsCommon.h:373
@ FixedForce
The boundary condition represents fixed force (f) values in K.u = f and will be treated by GmpFemPhys...
Definition gmpFemPhysicsCommon.h:372
@ Calc
The boundary condition affects element matrix/vector calculations and will be treated by GmpFemPhysic...
Definition gmpFemPhysicsCommon.h:371
BcType _bcType
Boundary condition application type.
Definition gmpFemPhysicsCommon.h:394
Bc(int id, QString name, BcType bcType, BcUseType bcUseType, const Value &bcValue, const RequiredIf &required=RequiredIf(false))
Bc constructor given a single value accessor.
Definition gmpFemPhysicsCommon.h:380
QString _name
Value name.
Definition gmpFemPhysicsCommon.h:393
Bc(int id, QString name, BcType bcType, BcUseType bcUseType, const ValueList &bcValues, const RequiredIf &required=RequiredIf(false))
Bc constructor given multiple value accessor.
Definition gmpFemPhysicsCommon.h:385
BcUseType _bcUseType
A value defining how this BC will be used by the physics.
Definition gmpFemPhysicsCommon.h:395
A specialization of the Value structure for obtaining accessor for old attribute states.
Definition gmpFemPhysicsCommon.h:328
HistoryValue()
Default constructor needed to enable storing a HisoryValue in a QVariant. Builds an invalid Value.
Definition gmpFemPhysicsCommon.h:330
Auxiliary structure used to keep information about material translation names.
Definition gmpFemPhysicsCommon.h:723
int _modelIndex
The material index used in the model, corresponding to the model name.
Definition gmpFemPhysicsCommon.h:731
QString _physicsName
The material name as seen by this physics.
Definition gmpFemPhysicsCommon.h:730
A specialization of the Value structure for MATRIX values.
Definition gmpFemPhysicsCommon.h:307
MatrixValue()
Default constructor needed to enable storing a MatrixValue in a QVariant. Builds an invalid Value.
Definition gmpFemPhysicsCommon.h:309
MatrixValue(int id, QString name, QString description, QString unit, int nlin, int ncol, const RequiredIf &required=RequiredIf(true), bool canBeFunction=true, int history=-1, const char *format="")
Constructor. Creates a Value object with MATRIX type and the specified number of lines and columns.
Definition gmpFemPhysicsCommon.h:312
MatrixValue(int id, QString name, QString description, QString unit, int nlin, QString linType, QString linAttr, int ncol, QString colType, QString colAttr, const RequiredIf &required=RequiredIf(true), bool canBeFunction=true, int history=-1, const char *format="")
Constructor. Creates a Value object with MATRIX type and the specified number of lines and columns po...
Definition gmpFemPhysicsCommon.h:319
A structure used to define if a value is required or not, being able to specify conditional situation...
Definition gmpFemPhysicsCommon.h:46
const RequiredIf * _r
Right hand side for logical operation.
Definition gmpFemPhysicsCommon.h:111
RequiredIf(bool required)
Constructor used to define if a value is required (true) or optional (false);.
Definition gmpFemPhysicsCommon.h:63
const RequiredIf * _l
Lefft hand side for logical operation.
Definition gmpFemPhysicsCommon.h:110
int _mode
0 = optional, 1 = required, 2 = conditional required, 3 = logic op
Definition gmpFemPhysicsCommon.h:105
~RequiredIf()
Destructor.
Definition gmpFemPhysicsCommon.h:101
RequiredIf(QString type, QString attr, RequiredIfOp op, QVariant val=QVariant())
Constructor for a optional requirement clause.
Definition gmpFemPhysicsCommon.h:72
RequiredIfOp _op
The operation applied over the value. Valid operations depend on _type.
Definition gmpFemPhysicsCommon.h:108
QString _type
Type of the conditional required clause. Can be "dimension", "attributes", "stateVars" or "properties...
Definition gmpFemPhysicsCommon.h:106
QString _attr
The attribute inside _type that will be compared if type different from "dimension".
Definition gmpFemPhysicsCommon.h:107
RequiredIf(const RequiredIf &l, RequiredIfOp op, const RequiredIf &r)
Constructor for logical clause (OR or AND)
Definition gmpFemPhysicsCommon.h:82
QVariant _val
The value to be compared, depending on _op.
Definition gmpFemPhysicsCommon.h:109
RequiredIfOp
Available operations for conditional requirements.
Definition gmpFemPhysicsCommon.h:49
@ AND
Logical and between two other conditions.
Definition gmpFemPhysicsCommon.h:59
@ NEQ
An attribute value or dimension is not equal to the given value.
Definition gmpFemPhysicsCommon.h:51
@ NOT_EXISTS
An attribute, state var or property does not exists.
Definition gmpFemPhysicsCommon.h:57
@ LTE
An attribute value or dimension is less than or equal to the given numeric value.
Definition gmpFemPhysicsCommon.h:53
@ EQ
An attribute value or dimension is equal to the given value.
Definition gmpFemPhysicsCommon.h:50
@ OR
Logical or between two other conditions.
Definition gmpFemPhysicsCommon.h:58
@ EXISTS
An attribute, state var or property exists.
Definition gmpFemPhysicsCommon.h:56
@ LT
An attribute value or dimension is less than to the given numeric value.
Definition gmpFemPhysicsCommon.h:52
@ GT
An attribute value or dimension is greater than to the given numeric value.
Definition gmpFemPhysicsCommon.h:54
@ GTE
An attribute value or dimension is greater than or equal to the given numeric value.
Definition gmpFemPhysicsCommon.h:55
A specialization of the Value structure for SCALAR values.
Definition gmpFemPhysicsCommon.h:277
ScalarValue(int id, QString name, QString description, QString unit, const RequiredIf &required=RequiredIf(true), bool canBeFunction=true, int history=-1, const char *format="")
Constructor. Creates a Value object with SCALAR type.
Definition gmpFemPhysicsCommon.h:282
ScalarValue()
Default constructor needed to enable storing a ScalarValue in a QVariant. Builds an invalid Value.
Definition gmpFemPhysicsCommon.h:279
A structure to define a size (number of lines / columns)
Definition gmpFemPhysicsCommon.h:116
int _ncol
THe number of columns or a negative enum value.
Definition gmpFemPhysicsCommon.h:152
QString _linAttr
The attribute to query for the dimension if _nlin == AttrDim.
Definition gmpFemPhysicsCommon.h:155
Size(int lin=Any, int col=Any)
Size constructor for lin, col different from AttrDim.
Definition gmpFemPhysicsCommon.h:128
QString _colAttrType
Type of the query attribute if _ncol == AttrDim. Can be "attributes", "stateVars" or "properties".
Definition gmpFemPhysicsCommon.h:154
int ncol(const GmpFemPhysicsCommon *p, GmpFemPhysicsCommonMaterial *m=NULL) const
Returns the number of columns of the size. Sizes of type Dimension, Dimension2 and AttrLin/Col are co...
Definition gmpFemPhysicsCommon.h:147
int _nlin
The number of lines or a negative enum value.
Definition gmpFemPhysicsCommon.h:151
int nlin(const GmpFemPhysicsCommon *p, GmpFemPhysicsCommonMaterial *m=NULL) const
Returns the number of lines of the size. Sizes of type Dimension, Dimension2 and AttrLin/Col are conv...
Definition gmpFemPhysicsCommon.h:141
Size(int lin, QString linType, QString linAttr, int col, QString colType, QString colAttr)
Size constructor for at least one value an AttrLin/Col. For either line or column,...
Definition gmpFemPhysicsCommon.h:134
QString _colAttr
The attribute to query for the dimension if _ncol == AttrDim.
Definition gmpFemPhysicsCommon.h:156
QString _linAttrType
Type of the query attribute if _nlin == AttrDim. Can be "attributes", "stateVars" or "properties".
Definition gmpFemPhysicsCommon.h:153
A structure used to specify value accessors needed by the physics.
Definition gmpFemPhysicsCommon.h:246
Value()
Default constructor needed to enable storing a Value in a QVariant. Builds an invalid Value.
Definition gmpFemPhysicsCommon.h:248
QList< ValueType > _types
Value types (if more than one, types will be tried on the given order). Empty for history values.
Definition gmpFemPhysicsCommon.h:268
int _historyState
The desired history state. 0 means current state, 1 = previous state and so on.
Definition gmpFemPhysicsCommon.h:271
int _historyRefId
The reference Value describing the base attribute that this accessor points to.
Definition gmpFemPhysicsCommon.h:270
bool _historyLocked
Should the accessor be locked to the state (true) or to the data (false).
Definition gmpFemPhysicsCommon.h:272
QString _unit
Value unit.
Definition gmpFemPhysicsCommon.h:267
Value(int id, QString name, QString description, QString unit, const QList< ValueType > &types, const RequiredIf &required=RequiredIf(true))
Value constructor given multiple possible types.
Definition gmpFemPhysicsCommon.h:256
Value(int id, QString name, QString description, QString unit, const ValueType &type, const RequiredIf &required=RequiredIf(true))
Value constructor given a single possible type.
Definition gmpFemPhysicsCommon.h:251
QString _description
Value description (for error messages)
Definition gmpFemPhysicsCommon.h:266
RequiredIf _required
Is the value required?
Definition gmpFemPhysicsCommon.h:269
QString _name
Value name.
Definition gmpFemPhysicsCommon.h:265
int _id
Value id storing its intended position in the values list.
Definition gmpFemPhysicsCommon.h:264
A structure used to specify if a value should be a scalar, a vector or a matrix and their dimensions.
Definition gmpFemPhysicsCommon.h:223
ValueType(GmDimType type, int nlin=-1, int ncol=-1, bool canBeFunction=true, int history=-1, const char *format="")
Constructor.
Definition gmpFemPhysicsCommon.h:225
bool _function
Set to true if the value can be a function, false if not.
Definition gmpFemPhysicsCommon.h:239
int _history
The desired history value if _history != -1. Used by node and Gauss attributes only.
Definition gmpFemPhysicsCommon.h:240
GmDimType _type
Scalar, vector or matrix.
Definition gmpFemPhysicsCommon.h:237
Size _size
The number of lines/columns for a vector / matrix.
Definition gmpFemPhysicsCommon.h:238
ValueType(GmDimType type, int nlin, QString linType, QString linAttr, int ncol, QString colType, QString colAttr, bool canBeFunction=true, int history=-1, const char *format="")
Constructor allowing for an AttrDim size.
Definition gmpFemPhysicsCommon.h:229
QString _format
The desired format when creating an attribute. Used by node and Gauss attributes only.
Definition gmpFemPhysicsCommon.h:241
A specialization of the Value structure for VECTOR values.
Definition gmpFemPhysicsCommon.h:289
VectorValue(int id, QString name, QString description, QString unit, int nlin, QString linType, QString linAttr, const RequiredIf &required=RequiredIf(true), bool canBeFunction=true, int history=-1, const char *format="")
Constructor. Creates a Value object with VECTOR type and the specified number of lines given by an at...
Definition gmpFemPhysicsCommon.h:299
VectorValue(int id, QString name, QString description, QString unit, int nlin, const RequiredIf &required=RequiredIf(true), bool canBeFunction=true, int history=-1, const char *format="")
Constructor. Creates a Value object with VECTOR type and the specified number of lines.
Definition gmpFemPhysicsCommon.h:294
VectorValue()
Default constructor needed to enable storing a VectorValue in a QVariant. Builds an invalid Value.
Definition gmpFemPhysicsCommon.h:291