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

A special integration rule for handling refined xfem elements. More...

#include <xfemIntegrationRule.h>

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

Public Member Functions

 XfemIntegrationRule (int ncoord, int npoints=0)
 Builds an integration rule that returns integration points with the specified number of natural coordinates. More...
 
virtual ~XfemIntegrationRule ()
 Destructor.
 
virtual bool isValid () const
 Returns true if this is a valid integration rule object, false if not. More...
 
virtual int numPoints () const
 
virtual void integrationPoint (int index, GmVector &naturalCoord, double *weight) const
 
virtual int subElement (int index) const
 Returns the sub-element number that contains the given integration point.
 
virtual int numNaturalCoord () const
 
virtual int degree () const
 Returns the integration degree for this rule. Always returns 0.
 
virtual GmIntegrationRuleType ruleType () const
 
virtual QString ruleName () const
 Returns the current ruleName adopted by this integration rule. Always returns "xfem".
 
virtual int cacheKey () const
 
virtual int rulePar (int num) const
 
virtual int ruleParNumPoints (int num) const
 
void clearPoints ()
 Removes all registered integration points from the rule, making it into an invalid rule.
 
void setNumPoints (int npoints)
 Adjust the number of integration points to the requested number, adding new entries if necessary. Remaining integration points will keep their values and new ones will be initialized with zeros.
 
void setIntegrationPoint (int index, const GmVector &naturalCoord, double weight, int subElement)
 Updates the value, weight and sub-element of an existing integration point. More...
 
void addIntegrationPoint (const GmVector &naturalCoord, double weight, int subElement)
 Adds a new integration point to the rule.
 
void removeIntegrationPoints (int firstIndex, int num, int seOffset)
 Removes the given range of integration points from the list. More...
 
void addIntegrationPoints (GmCellType type, GmCellType seType, const GmMatrix &seNaturalCoords, const GmIntegrationRule *seIr, int subElement)
 Adds a set of integration points corresponding to the default integration points of a sub element of the given type and coordinates. More...
 
void setIntegrationPoints (int firstIndex, GmCellType type, GmCellType seType, const GmMatrix &seNaturalCoords, const GmIntegrationRule *seIr, int subElement)
 Updates the set of integration points corresponding to the default integration points of a sub element of the given type and coordinates. More...
 
- Public Member Functions inherited from GmIntegrationRule
virtual const QVector< int > & closestIntegrationIndex (GmCellType type, int P, int Q, int nodeIndex) const
 

Private Member Functions

int nextCacheKey () const
 Returns the next available cache key.
 
void fillSubelementIntegrationPoint (GmCellType type, GmCellType seType, const GmShape *seShape, const GmMatrix &seNaturalCoords, const GmIntegrationRule *seIr, int ipIndex, QPair< GmVector, double > &ipData)
 Auxiliary function used by addIntegrationPoints() and setIntegrationPoints() to compute the position and weight of the integration point specified by ipIndex in the reference set of the father element, filling ipData (coordinate + weight).
 

Private Attributes

int _internalId
 An unique internal id used as cache key for Xfem integration rules.
 
int _ncoord
 The number of coordinates in each integration point.
 
QVector< QPair< GmVector, double > > _ipList
 The list of integration points and their weights.
 
QVector< int > _subElemList
 A list storing the subelement that each ip belongs to.
 

Additional Inherited Members

- Static Public Member Functions inherited from GmIntegrationRule
static GmIntegrationRuleinstance (GmCellType type, int P, int Q, GmIntegrationRuleType irType, int rule1=-1, int rule2=-1, int rule3=-1)
 
- Protected Member Functions inherited from GmIntegrationRule
int makeCacheKey (GmIntegrationRuleCacheKeyBase base, bool closed, int rule1, int rule2=-1, int rule3=-1) const
 
QString makeRuleName (GmIntegrationRuleType irType, int rule1, int rule2=-1, int rule3=-1) const
 

Detailed Description

A special integration rule for handling refined xfem elements.

This class allows the user to manually add integration points to the rule, obeying the standard integration rule query interface.

Constructor & Destructor Documentation

◆ XfemIntegrationRule()

XfemIntegrationRule::XfemIntegrationRule ( int  ncoord,
int  npoints = 0 
)

Builds an integration rule that returns integration points with the specified number of natural coordinates.

If npoints is greater than zero, the rule will be initialized with npoints integration points. Their weights and coordinates wil be set to zero, and so they should be later initialized by calls to setIntegrationPoint(). This is only usefull when partitioning the father element into a regular grid for integration. For the subelement strategy, just pass 0 to npoints. The point set will be constructed by calls to addIntegrationPoints().

Member Function Documentation

◆ addIntegrationPoints()

void XfemIntegrationRule::addIntegrationPoints ( GmCellType  type,
GmCellType  seType,
const GmMatrix seNaturalCoords,
const GmIntegrationRule seIr,
int  subElement 
)

Adds a set of integration points corresponding to the default integration points of a sub element of the given type and coordinates.

Parameters
typeThe type of the element that this integration rule is tied to. Used for validation purposes.
seTypeThe sub element type. It must be compatible with type (both should be surface types or both volume types) and they should have the same interpolation order (the current calculation done to convert the sub element integration points to the father element reference frame requires that).
seNaturalCoordsThe sub element coordinates, given in the natural coordinate space of the father element (element that this rule is tied to). This is a matrix organized as a 'd x n' matrix where d is the number of natural coordinates for the father element and n the number of nodes for the sub element type. For a tri3 sub element maped over a quad4 father, for example, it will contain the xi and eta coordinates of the thre points forming the triangle:
seNaturalCoords = [xi_node1, xi_node2, xi_node3]
[eta_node1, eta_node2, eta_node3]
For a quad4 sub element maped over a tri3 father that would give:
seNaturalCoords = [zeta1_node1, zeta1_node2, zeta1_node3, zeta1_node4]
[zeta2_node1, zeta2_node2, zeta2_node3, zeta2_node4]
[zeta3_node1, zeta3_node2, zeta3_node3, zeta3_node4]
seIrThe default integration rule for the sub element type.
subElementThe subelement number

◆ isValid()

virtual bool XfemIntegrationRule::isValid ( ) const
inlinevirtual

Returns true if this is a valid integration rule object, false if not.

   An invalid object is an object without integration points

Implements GmIntegrationRule.

◆ removeIntegrationPoints()

void XfemIntegrationRule::removeIntegrationPoints ( int  firstIndex,
int  num,
int  seOffset 
)

Removes the given range of integration points from the list.

Parameters
firstIndexThe index of the first integration point to remove
numThe number of integration points to remove
seOffsetIf different from zero, this value represents an offset that will be subtracted from the subelement index of each subelement with index greater than firstIndex+num-1

◆ setIntegrationPoint()

void XfemIntegrationRule::setIntegrationPoint ( int  index,
const GmVector naturalCoord,
double  weight,
int  subElement 
)

Updates the value, weight and sub-element of an existing integration point.

A value of -1 passed to subElement means that the sub-element number should not be updated.

◆ setIntegrationPoints()

void XfemIntegrationRule::setIntegrationPoints ( int  firstIndex,
GmCellType  type,
GmCellType  seType,
const GmMatrix seNaturalCoords,
const GmIntegrationRule seIr,
int  subElement 
)

Updates the set of integration points corresponding to the default integration points of a sub element of the given type and coordinates.

Parameters
firstIndexThe index in the integration points list of the first integration point that will be replaced by this call.
typeThe type of the element that this integration rule is tied to. Used for validation purposes.
seTypeThe sub element type. It must be compatible with type (both should be surface types or both volume types) and they should have the same interpolation order (the current calculation done to convert the sub element integration points to the father element reference frame requires that).
seNaturalCoordsThe sub element coordinates, given in the natural coordinate space of the father element (element that this rule is tied to). This is a matrix organized as a 'd x n' matrix where d is the number of natural coordinates for the father element and n the number of nodes for the sub element type. For a tri3 sub element maped over a quad4 father, for example, it will contain the xi and eta coordinates of the thre points forming the triangle:
seNaturalCoords = [xi_node1, xi_node2, xi_node3]
[eta_node1, eta_node2, eta_node3]
For a quad4 sub element maped over a tri3 father that would give:
seNaturalCoords = [zeta1_node1, zeta1_node2, zeta1_node3, zeta1_node4]
[zeta2_node1, zeta2_node2, zeta2_node3, zeta2_node4]
[zeta3_node1, zeta3_node2, zeta3_node3, zeta3_node4]
seIrThe default integration rule for the sub element type. IMPORTANT: The given rule MUST be the same used when the subelement was added in a call to addIntegrationPoints().
subElementThe subelement number or -1 if the subelement information should not be changed.

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