Xfem
The Xfem Plugin
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
XfemMesh Class Reference

Basic class for a XFEM mesh. This is the basic mesh interface for xfem problems adding enrichment capabilities to the standard Gema elememnt mesh. The "real" implementation inherits from either the standard Gema mesh or from a surface mesh. More...

#include <xfemMesh.h>

Inheritance diagram for XfemMesh:
Inheritance graph
[legend]
Collaboration diagram for XfemMesh:
Collaboration graph
[legend]

Public Member Functions

 XfemMesh (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 Constructor. Will be called by the plugin loading code.
 
virtual ~XfemMesh ()
 Destructor.
 
virtual void printValues (const GmLogCategory &logger, int options)
 Overrides printValues to add subelement information.
 
virtual const XfemElementelement (int index) const
 Returns a mesh cell already converted to an XfemElement.
 
virtual XfemElementelement (int index)
 Returns a mesh cell already converted to an XfemElement. Non const version.
 
virtual bool enrichElement (XfemElement *e)
 Marks the given element as enriched. More...
 
virtual XfemEnrichedElementDataenrichedElementData (const XfemElement *e) const
 Returns the enriched element private data or NULL if the element has not been enriched.
 
const QMap< int, XfemEnrichedElementData * > & enrichedElementMap () const
 Returns the map storing data for every enriched element in the mesh. Use carefully.
 
virtual int numRegularSubElements (const XfemElement *e) const
 Returns the number of regular (non fracture) sub-elements of the given enriched element (0 for non enriched ones)
 
virtual int numFractureSubElements (const XfemElement *e) const
 Returns the number of fracture sub-elements of the given enriched element (0 for non enriched ones)
 
virtual const XfemSubElementsubElement (const XfemElement *e, int index) const
 Returns a subelement of an enriched element. More...
 
virtual const XfemSubElementfractureSubElement (const XfemElement *e, int index) const
 Returns a fracture sub-element with an indexing starting from zero for the first fracture sub-element. Equivalent to calling subElement(e, index + numRegularSubElements(e))
 
virtual void clearSubElements ()
 Clears all subelements from the mesh. This will automatically clear element integration rules and data stored by gauss attributes.
 
virtual void clearSubElements (XfemElement *e)
 Clears the list of subelements from the given enriched element. This will automatically clear the element integration rule and the data stored by gauss attributes.
 
virtual int addSubElement (XfemElement *e, XfemSubElement *se, int ruleSet=0)
 Adds a new sub-element to the xfem element. This addition will automatically trigger an update in the element integration rule (for regular sub-elements) and in the data stored by gauss attributes. More...
 
virtual void removeSubElement (XfemElement *e, int index)
 Removes an existing sub-element from the enriched element. This removal will automatically trigger an update in the element integration rule and in the data stored by gauss attributes. More...
 
virtual void updateSubElementCoordinates (XfemElement *e, int index, const GmMatrix &seNaturalCoords, int ruleSet=0)
 Updates the set of natural coordinates from a sub-element, provided that the sub-element type remains the same. This update will automatically trigger an update in the element integration rule. IMPORTANT: Values stored in Gauss points are NOT changed to reflect the change in point locations. That should be done externally. More...
 
const GmIntegrationRuleenrichedElementRegularIntegrationRule (const XfemElement *e, int ruleSet) const
 Returns the elements regular integration rule with support for enriched elements. More...
 
const GmIntegrationRuleenrichedElementFractureIntegrationRule (const XfemSubElement *se, int ruleSet) const
 Returns the integration rule for the given fracture sub-element.
 
virtual XfemGaussAccessorenrichedGaussAttributeAccessor (QString id, Unit desiredUnit, const GmLogCategory &logger) const
 Equivalent to call enrichedGaussAttributeAccessor(id, 0, true, desiredUnit, logger)
 
virtual XfemGaussAccessorenrichedGaussAttributeAccessor (QString id, int snum, bool locked, Unit desiredUnit, const GmLogCategory &logger) const
 Similar to GmElementMesh::gaussAttributeAccessor(), this function returns an accessor to data stored in Gauss points for the attribute id. Its different from gaussAttributeAccessor() for enriched elements since the returned accessor grants access to data stored for enriched integration points, while the other function does not, returning data on relgular integration points even for enriched elements.
 
virtual const QList< XfemFracture * > & naturalFractures () const
 Returns the list of mesh natural fractures.
 
virtual void addNaturalFracture (XfemFracture *f)
 Adds a new natural fracture to the mesh. The mesh takes ownership of the fracture object.
 
virtual void clearNaturalFractures ()
 Remove all natural fractures from the mesh. More...
 
virtual GmVector getElemCutInfo (int id) const
 Returns the list with element information {iElem, # of fractures per element}.
 
virtual void addElemCutInfo (QList< GmVector > eCI)
 Adds a vector with element cut information.
 
virtual void deleteElemCutInfo ()
 delete element cut information
 
virtual int sizeElemCutInfo ()
 Returns the size of elemCutInfo list.
 
virtual int getTotalNumDOF (int id) const
 Returns the list with the total number of DOF at a specific position.
 
virtual void addTotalNumDOF (QList< int > eCI)
 Adds a the list with the total number of DOF.
 
virtual void deleteTotalNumDOF ()
 delete element cut information
 
virtual int sizeTotalNumDOF ()
 Returns the size of elemCutInfo list.
 
virtual QString getNodeStateVarIds (int id) const
 Returns the list with the state variable ids in the model.
 
virtual void addNodeStateVarIds (QStringList eCI)
 Adds list with the state variable ids in the model.
 
virtual void deleteNodeStateVarIds ()
 delete list with the state variable ids in the model
 
virtual int sizeNodeStateVarIds () const
 Returns the size of list with the state variable ids in the model.
 
void setCubicLaw (bool cubicLaw)
 Set the cubic Law Boolean to define whether cubic law or constant fracture permeability is used.
 
virtual bool getCubicLaw () const
 Returns the Boolean to define whether cubic law or constant fracture permeability is used.
 
void setMultiPhasic (bool multiPhasic)
 Set the multiPhasic Boolean to define whether multiPhasic analysis is carried out.
 
virtual bool getMultiPhasic () const
 Returns the Boolean to define whether multiPhasic analysis is carried out.
 
void setNonIsoThermal (bool nonIsoThermal)
 Set the nonIsoThermal Boolean to define whether nonIsoThermal analysis is carried out.
 
virtual bool getNonIsoThermal () const
 Returns the Boolean to define whether nonIsoThermal analysis is carried out.
 
void setSaturationRelativePermeabilityModel (char nonIsoThermal)
 Set the Char defining the Saturation and Relative Permeability Model.
 
virtual bool getSaturationRelativePermeabilityModel () const
 Returns the Char defining the Saturation and Relative Permeability Model.
 
virtual QList< int > getNodeTopologicalMap (int i) const
 Returns the list of element id who contain the node i.
 
virtual void addNodeTopologicalMap (QList< int > eCI)
 Adds the list of element id who contain the node i.
 
virtual QList< int > getElemTopologicalMap (int i) const
 Returns the list of element neighborns of element id who contain the node i.
 
virtual void addElemTopologicalMap (QList< int > eCI)
 Adds the list of element neighborns of element id who contain the node i.
 
virtual QList< QPair< int, QList< int > > > getfaceTopologicalMap (int i) const
 Returns the list of neighborn element for each face of the element i.
 
virtual void addFaceTopologicalMap (QList< QPair< int, QList< int >>> eCI)
 Adds the list of neighborn element for each face of the element i.
 

Protected Member Functions

virtual GmGaussValueSetcreateGaussValueSet (GmValueInfo *info)
 Overrides the standard GmElementMesh::createGaussValueSet() implementation to create XfemMGaussValueSet instances.
 
virtual void clearXfemData ()
 Clears Xfem related data from the mesh.
 

Private Attributes

QMap< int, XfemEnrichedElementData * > _elementMap
 Map storing individual data for enriched elements.
 
QList< XfemFracture * > _naturalFractures
 The set of mesh natural fractures.
 
QList< GmVector_elemCutInfo
 vector with element information {iElem, # of fractures per element}
 
QList< int > _totalDofSet
 list with the total number of DOF in the model
 
QStringList _nodeStateVarIds
 
bool _cubicLaw
 
bool _multiPhasic
 
bool _nonIsoThermal
 
char _SaRelPer
 
QList< QList< int > > _nodeTopologicalMap
 
QList< QList< int > > _elemTopologicalMap
 
QList< QList< QPair< int, QList< int > > > > _faceTopologicalMap
 

Detailed Description

Basic class for a XFEM mesh. This is the basic mesh interface for xfem problems adding enrichment capabilities to the standard Gema elememnt mesh. The "real" implementation inherits from either the standard Gema mesh or from a surface mesh.

Member Function Documentation

◆ addSubElement()

int XfemMesh::addSubElement ( XfemElement e,
XfemSubElement se,
int  ruleSet = 0 
)
virtual

Adds a new sub-element to the xfem element. This addition will automatically trigger an update in the element integration rule (for regular sub-elements) and in the data stored by gauss attributes.

If the element 'e' had not been enriched before, it will be enriched by this call.

Parameters
eThe element that will have an added sub element
seThe sub element added to e. The element will take ownership of the subelement that will be deleted when the element is deleted.
ruleSetThe integration rule set (see coments in GmElementMesh::elementIntegrationRule()) that will be used to define the integration rule that will be applied to the subelement. A value of 0 (the default) means that the default rule for the subelement type will be used.
Returns
Returns the new subelement index inside the element.

◆ clearNaturalFractures()

void XfemMesh::clearNaturalFractures ( )
virtual

Remove all natural fractures from the mesh.

Clears all natural fractures from the mesh.

◆ enrichedElementRegularIntegrationRule()

const GmIntegrationRule * XfemMesh::enrichedElementRegularIntegrationRule ( const XfemElement e,
int  ruleSet 
) const

Returns the elements regular integration rule with support for enriched elements.

If the element has been enriched, returns the elements particular integration rule. If not, returns the rule tied to the element type in the given rule set.

◆ enrichElement()

bool XfemMesh::enrichElement ( XfemElement e)
virtual

Marks the given element as enriched.

After calling enrichElement(), it should be filled with subelements for adjusting its integration points.

This function returns false (and does nothing) if the element had already been enriched in the past.

◆ removeSubElement()

void XfemMesh::removeSubElement ( XfemElement e,
int  index 
)
virtual

Removes an existing sub-element from the enriched element. This removal will automatically trigger an update in the element integration rule and in the data stored by gauss attributes.

The e parameter must reference an enriched element and index must point to a valid sub-element index, as returned by numRegularSubElements() + numFractureSubElements().

◆ subElement()

const XfemSubElement * XfemMesh::subElement ( const XfemElement e,
int  index 
) const
virtual

Returns a subelement of an enriched element.

The index parameter should be a valid index between 0 and numRegularSubElements() + numFractureSubElements() - 1, remembering that fracture sub-elements are positioned as the last sub-elements.

This function also expects 'e' to be an enriched element. The returned pointer is const since changes to a sub-element should be done by using the mesh interface.

This guarantees the consistency between sub-elements, integration points and stored data.

◆ updateSubElementCoordinates()

void XfemMesh::updateSubElementCoordinates ( XfemElement e,
int  index,
const GmMatrix seNaturalCoords,
int  ruleSet = 0 
)
virtual

Updates the set of natural coordinates from a sub-element, provided that the sub-element type remains the same. This update will automatically trigger an update in the element integration rule. IMPORTANT: Values stored in Gauss points are NOT changed to reflect the change in point locations. That should be done externally.

Parameters
eThe element that contains the sub-element. Must refer to an enriched element
indexThe sub-element index inside element e. Must point to a valid sub-element index
seNaturalCoordsThe new sub-element node coordinates, given in the father element natural coordinate system. The matrix is organized as a 'd x n' matrix where d is the number of natural coordinates for element 'e' and n the number of nodes for the sub element type. See XfemSubElement() documentation for an example.
ruleSetThe integration rule set (see coments in GmElementMesh::elementIntegrationRule()) that will be used to define the integration rule that will be applied to the subelement. A value of 0 (the default) means that the default rule for the subelement type will be used. IMPORTANT: The given ruleSet MUST be the same used when the subelement was added in a call to addSubElement()

The documentation for this class was generated from the following files: