16 #define NCOEFFS 3 // number of coefficients
17 #define MUA 0 // absorption coeff id
18 #define P2 1 // `parameter 2' id
19 #define MUS 1 // alias for P2: scattering coeff
20 #define KAPPA 1 // alias for P2: diffusion coeff
21 #define REFIND 2 // refractive index id
22 #define C_ALL 3 // `all coefficients'
31 #define ELID_TRI3OLD 1
38 #define ELID_TRI6_IP 8
40 #define ELID_TRI10_IP 10
41 #define ELID_TET10_IP 11
42 #define ELID_WDG18INF 12
46 #define ELID_TRI3D3 16
47 #define ELID_TRI3D6 17
49 #define ELID_LINE2D2 19
58 #define ELCAPS_CURVED_BOUNDARY 0x1
60 #define ELCAPS_SUBSAMPLING 0x2
120 virtual void Initialise (
const NodeList& nlist);
142 void operator= (
const Element& el);
149 virtual BYTE Type ()
const = 0;
161 virtual unsigned long GetCaps ()
const = 0;
174 virtual int nNode ()
const = 0;
183 virtual int nSide ()
const = 0;
191 virtual int nSideNode (
int side)
const = 0;
204 virtual int SideNode (
int side,
int node)
const = 0;
212 virtual bool IsNode (
int node);
222 int IsSide (
int nn,
int *nd);
233 virtual bool IsSideNode (
int side,
int node);
245 RANGE_CHECK (side >= 0 && side < nSide());
246 return bndside[side];
271 {
return interfaceel; }
291 virtual Point NodeLocal (
int node)
const = 0;
303 { ERROR_UNDEF;
return Point(); }
312 virtual void MapToSide (
int side,
Point &loc)
const;
320 virtual Point SideCentre (
int side)
const;
330 Element *SideNeighbour (
int side)
const;
340 int SideNeighbourIndex (
int side)
const;
379 virtual const RVector &LNormal (
int side)
const = 0;
387 virtual double Size()
const = 0;
398 { ERROR_UNDEF;
return 0; }
408 { ERROR_UNDEF;
return 0.0; }
421 virtual bool LContains (
const Point& loc,
bool pad =
true)
const = 0;
430 virtual bool GContains (
const Point& glob,
const NodeList &nlist)
const;
446 virtual int BndSideList (
const NodeList& nlist,
int *list);
448 void InitNeighbourSupport ();
449 void InitSubdivisionSupport ();
457 int SubdivisionLevel ()
const;
459 virtual void Subdivide (
Mesh *mesh)
469 virtual RVector LocalShapeF (
const Point &loc)
const = 0;
491 const {
return LocalShapeF (Local (nlist, glob)); }
503 const Point &glob)
const
504 {
return LocalShapeD (Local (nlist, glob)); }
522 const { ERROR_UNDEF;
return 0; }
531 virtual double IntF (
int i)
const = 0;
551 virtual double IntFF (
int i,
int j)
const = 0;
564 virtual double IntFFF (
int i,
int j,
int k)
const = 0;
569 virtual void IntFFF (
double &iii,
double &iij,
double &ijk)
const = 0;
602 virtual double IntPFF (
int i,
int j,
const RVector& P)
const = 0;
626 virtual double IntDD (
int i,
int j)
const = 0;
638 { ERROR_UNDEF;
return RVector(); }
651 virtual double IntFDD (
int i,
int j,
int k)
const = 0;
679 virtual double IntPDD (
int i,
int j,
const RVector &P)
const = 0;
695 { ERROR_UNDEF;
return 0; }
708 { ERROR_UNDEF;
return 0; }
738 virtual double BndIntFF (
int i,
int j) = 0;
752 virtual double BndIntFFSide (
int i,
int j,
int sd) = 0;
782 virtual double BndIntPFF (
int i,
int j,
const RVector &P)
const = 0;
796 virtual double Intd (
int i,
int k)
const
797 { ERROR_UNDEF;
return 0.0; }
810 virtual double IntFd (
int i,
int j,
int k)
const
811 { ERROR_UNDEF;
return 0.0; }
824 { ERROR_UNDEF;
return 0.0; }
850 virtual double IntFdd (
int i,
int j,
int k,
int l,
int m)
const
851 { ERROR_UNDEF;
return 0; }
853 virtual double IntPdd (
const RVector &p,
int j,
int k,
int l,
int m)
const
854 { ERROR_UNDEF;
return 0; }
858 virtual double IntFfd (
int i,
int j,
int k,
int l)
const
859 { ERROR_UNDEF;
return 0; }
862 virtual double IntPfd (
const RVector &p,
int j,
int k,
int l)
const
863 { ERROR_UNDEF;
return 0; }
868 virtual double IntUnitSphereP (
const NodeList& nlist,
const RVector& P)
const
869 { ERROR_UNDEF;
return 0.0; }
873 virtual double IntUnitSphereFF (
const NodeList& nlist,
const int i,
const int j)
const
874 { ERROR_UNDEF;
return 0.0; }
878 virtual double IntUnitSpherePFF (
const NodeList& nlist,
const int i,
const int j,
const RVector& P)
const
879 { ERROR_UNDEF;
return 0.0; }
884 virtual RVector BndIntFX (
int side,
double (*func)(
const Point&),
892 const RVector &cntcos,
double sigma,
double sup,
899 virtual RVector BndIntFCos (
int side,
const RVector &cntcos,
double a,
901 { ERROR_UNDEF;
return RVector(); }
911 int GetSubsampleFD (
int &n,
double *&wght,
Point *&absc,
918 int GetBndSubsampleFD (
int side,
int &n,
double *&wght,
Point *&absc,
926 virtual int GetLocalSubsampleAbsc (
const Point *&absc)
const
931 virtual int GetBndSubsampleAbsc (
int side,
const Point *&absc)
const
960 virtual RDenseMatrix ElasticityStiffnessMatrix (
double E,
980 virtual RDenseMatrix IsotropicElasticityMatrix (
double E,
double nu)
const
985 virtual RVector InitialStrainVector (
double E,
double nu,
const RVector &e0)
986 { ERROR_UNDEF;
return RVector(); }
990 virtual RVector ThermalExpansionVector (
double E,
double nu,
991 double alpha,
double dT)
992 { ERROR_UNDEF;
return RVector(); }
996 virtual RVector DThermalExpansionVector (
double E,
double nu)
997 { ERROR_UNDEF;
return RVector(); }
1001 virtual int GlobalIntersection (
const NodeList &nlist,
1006 virtual int Intersection (
const Point &,
const Point &,
1024 friend std::istream& operator>> (std::istream& i,
Element &el);
1025 friend std::ostream& operator<< (std::ostream& o,
const Element &el);
1032 int Region()
const {
return region;}
1033 void SetRegion(
int nr) {region = nr;}
1035 virtual void SplitSide (
Mesh *mesh,
int side,
int newnode,
1039 virtual void Bisect (
Mesh *mesh,
int side,
int newnode,
1043 virtual void MergeAndResplit (
Mesh *mesh,
int side,
int newnode,
1128 inline double Size()
const {
return size; }
1135 inline double IntDD (
int i,
int j)
const {
return intdd.Get(i,j); }
1137 inline double BndIntFF (
int i,
int j) {
return intbff.Get(i,j); }
1140 virtual double ComputeSize (
const NodeList&)
const = 0;
1265 RDenseMatrix IsotropicElasticityMatrix (
double E,
double nu)
const;
1277 #endif // !__ELEMENT_H
Base class for all structured (regular) element types.
Definition: element.h:1097
Templated vector class.
Definition: vector.h:39
double Size() const
Returns the element size.
Definition: element.h:1128
virtual double IntFdd(int i, int j, int k, int l, int m) const
Integral of the product of a shape function and two partial shape function derivatives over the eleme...
Definition: element.h:850
virtual double IntPd(const RVector &P, int j, int k) const
Integral of the product of a nodal function and a partial shape function derivative over the element...
Definition: element.h:823
int Dimension() const
Mesh dimension.
Definition: mesh.h:181
bool HasInterfaceSide()
Checks if the element contains any internal interface sides.
Definition: element.h:270
virtual bool GContains(const Point &glob, const NodeList &nlist) const
Checks if a global point coordinate is inside the element.
virtual int Dimension(void) const
Returns the spatial dimension of the element.
Definition: element.h:1194
Base class for all 3-D unstructured element types.
Definition: element.h:1257
virtual int Dimension(void) const
Returns the spatial dimension of the element.
Definition: element.h:1217
Finite-element mesh management.
Definition: mesh.h:145
virtual BYTE VtkType() const
Returns the VTK element type identifier, or 0 if the element doesn't have a VTK representation.
Definition: element.h:155
virtual RVector GlobalShapeF(const NodeList &nlist, const Point &glob) const
Returns the values of the shape functions at a global point.
Definition: element.h:490
Base class for all 3-D structured element types.
Definition: element.h:1211
Element()
Creates a new element with no nodes.
virtual double IntFd(int i, int j, int k) const
Integral of the product of a shape function and a partial shape function derivative over the element...
Definition: element.h:810
virtual double BndIntFSide(int i, int sd)
Surface integral of a shape function over one of the sides of the element.
Definition: element.h:707
void operator=(const Element &el)
Element assignment.
virtual double Intd(int i, int k) const
Integral of partial shape function derivative over the element.
Definition: element.h:796
virtual RDenseMatrix GlobalShapeD(const NodeList &nlist, const Point &glob) const
Returns the values of the shape function derivatives at a global point.
Definition: element.h:502
bool IsBoundarySide(int side)
Checks if a side is on the mesh surface.
Definition: element.h:244
virtual RVector IntFD(int i, int j) const
Integral of a product of a shape function and a shape function derivative over the element...
Definition: element.h:637
virtual RVector BndIntF() const
Boundary integral of all shape functions over all boundary sides of the element.
Definition: element.h:694
bool HasBoundarySide()
Checks if the element contains any surface sides.
Definition: element.h:257
Base class for finite element types.
Definition: element.h:84
virtual double DetJ(const Point &loc, const NodeList *nlist=0) const
Returns determinant of Jacobian at a given point inside the element in the local frame.
Definition: element.h:407
Base class for all 2-D unstructured element types.
Definition: element.h:1234
virtual void Initialise(const NodeList &nlist)
Element initialisation.
virtual double SideSize(int side, const NodeList &nlist) const
Returns the size of an element side.
Definition: element.h:397
virtual int Dimension(void) const
Returns the spatial dimension of the element.
Definition: element.h:1263
double IntDD(int i, int j) const
Integral of a product of two shape function derivatives over the element.
Definition: element.h:1135
Base class for all unstructured element types.
Definition: element.h:1121
virtual Point SurfToLocal(int side, const Point &p) const
Maps a point from surface coordinates to local element coordinates.
Definition: element.h:302
virtual RSymMatrix Intdd() const
Integral of the product of two partial shape function derivatives over the element.
Definition: element.h:836
Dense matrix class.
Definition: crmatrix.h:38
double BndIntFF(int i, int j)
Boundary integral of a product of two shape functions over all boundary sides of the element...
Definition: element.h:1137
Base class for all 2-D structured element types.
Definition: element.h:1188
RSymMatrix BndIntFF() const
Boundary integral of all products of two shape functions over all boundary sides of the element...
Definition: element.h:1136
virtual int Dimension(void) const
Returns the spatial dimension of the element.
Definition: element.h:1240
virtual void PostInitialisation(const NodeList &nlist)
Element setup after mesh initialisation.
Definition: element.h:129
virtual int QuadRule(int order, const double **wght, const Point **absc) const
Returns the weights and abscissae of quadrature rules over the element.
Definition: element.h:521
RSymMatrix IntDD() const
Integrals of all products of two shape function derivatives over the element.
Definition: element.h:1134