Xfem
The Xfem Plugin
Loading...
Searching...
No Matches
xfemSubElement.h
Go to the documentation of this file.
1/************************************************************************
2**
3** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4** All rights reserved.
5**
6** This file is part of the "GeMA" software. It's use should respect
7** the terms in the license agreement that can be found together
8** with this source code.
9** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11** A PARTICULAR PURPOSE.
12**
13************************************************************************/
14
24#ifndef _GEMA_XFEM_SUBELEMENT_H_
25#define _GEMA_XFEM_SUBELEMENT_H_
26
27#include <gmCell.h>
28#include <gmMatrix.h>
29
30class XfemElement;
31
33#define XFEM_SUBELEMENT_FRACTURE_MASK (~(~0u >> 1))
34
39{
40public:
41
42 XfemSubElement(GmCellType type, bool fracture, const GmMatrix& nodeNaturalCoordinates);
43
45 GmCellType type() const { return (GmCellType)(_typeFracture & ~XFEM_SUBELEMENT_FRACTURE_MASK); }
46
49
56 const GmMatrix& nodeCoordinates() const { return _naturalCoords; }
57
61 int firstGaussPoint() const { return _firstGp; }
62
64 int numGaussPoints() const { return _numGp; }
65
66 int nodeIndex(const XfemElement* e, int index, GmValueAccessor* coordAc, bool* ok) const;
67
68private:
69 friend class XfemEnrichedElementData;
70
74 int _numGp;
75};
76
77#endif
78
Basic interface for an XFEM element.
Definition xfemElement.h:44
A class used to store per element data needed only in enriched elements.
Definition xfemEnrichedElementData.h:38
A class used to represent an enriched element subelement, defining an integration region inside the e...
Definition xfemSubElement.h:39
int _typeFracture
The sub element type combined with a flag in its MSB to tell if this is a fracture sub-element or not...
Definition xfemSubElement.h:71
GmCellType type() const
Returns the subelement type.
Definition xfemSubElement.h:45
GmMatrix _naturalCoords
The set of nodes defining the subelement geometry. Coordinates are given in father natural coordinate...
Definition xfemSubElement.h:72
int _firstGp
The index of this subelement first Gauss point inside the element.
Definition xfemSubElement.h:73
int firstGaussPoint() const
Returns the index of this subelements first Gauss point. For regular subelements, this is also the in...
Definition xfemSubElement.h:61
int numGaussPoints() const
Returns the number of Gauss/integration points tied to this subelement.
Definition xfemSubElement.h:64
int nodeIndex(const XfemElement *e, int index, GmValueAccessor *coordAc, bool *ok) const
Given the sub-element's father element, and a sub-element vertex index (a value between 0 and the num...
Definition xfemSubElement.cpp:92
const GmMatrix & nodeCoordinates() const
Returns the subelement node coordinates, given in the father element natural coordinate system....
Definition xfemSubElement.h:56
bool fracture() const
Returns true if this is a sub-element used to represent the fracture (discontinuity) itself.
Definition xfemSubElement.h:48
int _numGp
The number of Gauss points for this subelement.
Definition xfemSubElement.h:74
XfemSubElement(GmCellType type, bool fracture, const GmMatrix &nodeNaturalCoordinates)
Subelement constructor.
Definition xfemSubElement.cpp:69
GmCellType
arma::mat GmMatrix
#define XFEM_SUBELEMENT_FRACTURE_MASK
Mask with 1 on the MSB to tell if the subelement is a fracture (MSB = 1) or not (MSB = 0)
Definition xfemSubElement.h:33