Toast++  1.0.2 (r.539)
Forward and inverse modelling in optical tomography
tet10.h
1 // -*-C++-*-
2 // ==========================================================================
3 // Module libfe
4 // File tet10.h
5 // Declaration of class Tetrahedron10
6 //
7 // 10-noded tetrahedron for implementation of quadratic shape functions
8 //
9 // Node arrangement:
10 // Side contains nodes
11 // ^ z 0 (z=0) 0,1,2,4,7,5
12 // | 1 (y=0) 0,3,1,6,8,4
13 // ^ y 2 (x=0) 0,2,3,5,9,6
14 // N3+-_ N9 / 3 (1-x-y-z=0) 1,3,2,8,9,7
15 // |\ -+-_
16 // | \ -+N2 Node coords of local element:
17 // | \ . \ N0 = (0,0,0)
18 // | \ \ N1 = (1,0,0)
19 // N6+ . +N8 \ N2 = (0,1,0)
20 // | N5+ \ +N7 N3 = (0,0,1)
21 // | . \ \ N4 = (1/2,0,0)
22 // | . \ \ N5 = (0,1/2,0)
23 // |. \ \ N6 = (0,0,1/2)
24 // +-------+-------+ --> x N7 = (1/2,1/2,0)
25 // N0 N4 N1 N8 = (1/2,0,1/2)
26 // N9 = (0,1/2,1/2)
27 // Inheritance:
28 // ------------
29 // Element
30 // ---> Element_Unstructured
31 // ---> Element_Unstructured_3D
32 // ---> Tetrahedron10
33 // ==========================================================================
34 
35 #ifndef __TET10_H
36 #define __TET10_H
37 
39 public:
40 
41  Tetrahedron10() { Node = new int[nNode()]; }
42  Tetrahedron10( const Tetrahedron10 &el);
43  ~Tetrahedron10() { delete []Node; }
44 
48  Element *Copy();
49 
50  void Initialise (const NodeList &nlist);
51 
52  BYTE Type() const { return ELID_TET10; }
53  BYTE VtkType() const { return 24; }
54  unsigned long GetCaps () const { return ELCAPS_SUBSAMPLING; }
55  int nNode() const { return 10; }
56  int nSide() const { return 4; }
57  int nSideNode (int /*side*/) const { return 6; }
58  int SideNode (int side, int node) const;
59  double SideSize (int sd, const NodeList &nlist) const;
60 
61  Point Local (const NodeList& nlist, const Point& glob) const;
62  Point NodeLocal (int node) const;
63  Point SurfToLocal (int side, const Point &p) const;
64  RVector DirectionCosine (int side, RDenseMatrix& jacin);
65  const RVector &LNormal (int side) const;
66  bool LContains (const Point& loc, bool pad = true) const;
67 
68  RVector LocalShapeF (const Point &loc) const;
69  RDenseMatrix LocalShapeD (const Point &loc) const;
70  RVector GlobalShapeF (const NodeList& nlist, const Point& glob) const;
71  RDenseMatrix GlobalShapeD (const NodeList& nlist, const Point& glob) const;
72 
73  double IntF (int i) const;
74  RSymMatrix IntFF() const;
75  double IntFF (int i, int j) const;
76  double IntFFF (int i, int j, int k) const;
77  RSymMatrix IntPFF (const RVector& P) const;
78  double IntPFF (int i, int j, const RVector& P) const;
79  double IntFDD (int i, int j, int k) const;
80  RSymMatrix IntPDD (const RVector& P) const
81  { ERROR_UNDEF; return RSymMatrix(); }
82  double IntPDD (int i, int j, const RVector &P) const;
83  double BndIntFFSide (int i, int j, int sd)
84  { ERROR_UNDEF; return 0; }
85  RSymMatrix BndIntPFF (const RVector &P) const
86  { ERROR_UNDEF; return RSymMatrix(); }
87  double BndIntPFF (int i, int j, const RVector &P) const;
88  RVector BndIntFX (int side, double (*func)(const Point&),
89  const NodeList &nlist) const;
90  RVector BndIntFCos (int side, const RVector &cntcos, double a,
91  const NodeList &nlist) const;
92  RDenseMatrix ElasticityStiffnessMatrix (double modulus, double pratio)
93  const;
94  RVector InitialStrainVector (double E, double nu, const RVector &e);
95  RVector ThermalExpansionVector (double E, double nu, double alpha, double dT);
96  int GetLocalSubsampleAbsc (const Point *&absc) const;
97  int GetBndSubsampleAbsc (int side, const Point *&absc) const;
98  int GlobalIntersection (const NodeList &nlist, const Point &p1,
99  const Point &p2, Point **list)
100  { ERROR_UNDEF; return 0; }
101  int Intersection (const Point &p1, const Point &p2, Point** pi)
102  { ERROR_UNDEF; return 0; }
103 
104 protected:
105 
106  double ComputeSize (const NodeList &nlist) const;
107  RSymMatrix ComputeIntDD (const NodeList &nlist) const;
108  RSymMatrix ComputeBndIntFF (const NodeList& nlist) const;
109 
110  double a0, a1, a2, a3, b0, b1, b2, b3, c0, c1, c2, c3, d0, d1, d2, d3;
111  double side_size[4]; // surface triangle areas
112 
113 private:
114 
115 #ifdef TET10_STORE_INTFF
116  RSymMatrix intff;
117  // stores integral over element of product of 2 shape functions
118  // Int_el { F_i(r) F_j(r) } dr
119  // valid after call to Initialise
120 #endif
121 
122 };
123 
124 #endif // !__TET10_H
Definition: ndlist.h:14
Templated vector class.
Definition: vector.h:39
#define ELID_TET10
10-noded tetrahedron
Definition: element.h:37
virtual RSymMatrix IntFF() const =0
Integrals of all products of two shape functions over the element.
Definition: node.h:39
Base class for all 3-D unstructured element types.
Definition: element.h:1257
int nSide() const
Returns the number of element sides.
Definition: tet10.h:56
unsigned long GetCaps() const
Returns element capability flags.
Definition: tet10.h:54
virtual RVector DirectionCosine(int side, RDenseMatrix &jacin)=0
Returns the direction cosines of a side normal.
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
RSymMatrix BndIntPFF(const RVector &P) const
Surface integrals of all products of a nodal function and two shape functions over all boundary sides...
Definition: tet10.h:85
virtual double IntFFF(int i, int j, int k) const =0
Integral of a product of three shape functions over the element.
Definition: point.h:18
virtual RDenseMatrix LocalShapeD(const Point &loc) const =0
Returns the values of the shape function derivatives at a local point.
virtual const RVector & LNormal(int side) const =0
Returns a side normal in local coordinates.
int nSideNode(int) const
Returns the number of vertices associated with a side.
Definition: tet10.h:57
virtual RSymMatrix IntPFF(const RVector &P) const =0
Integrals of all products of two shape functions and a nodal function over the element.
virtual void Initialise(const NodeList &nlist)
Element initialisation.
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
BYTE Type() const
Returns an element type identifier.
Definition: tet10.h:52
virtual RSymMatrix BndIntPFF(const RVector &P) const =0
Surface integrals of all products of a nodal function and two shape functions over all boundary sides...
Definition: tet10.h:38
double BndIntFFSide(int i, int j, int sd)
Surface integral of a product of two shape functions over one of the sides of the element...
Definition: tet10.h:83
virtual int nNode() const =0
Returns the number of nodes associated with the element.
Base class for finite element types.
Definition: element.h:84
int nNode() const
Returns the number of nodes associated with the element.
Definition: tet10.h:55
virtual RSymMatrix IntPDD(const RVector &P) const =0
All integrals of products of a nodal function and two shape function derivatives over the element...
virtual double IntF(int i) const =0
Integral of a shape function over the element.
virtual double SideSize(int side, const NodeList &nlist) const
Returns the size of an element side.
Definition: element.h:397
BYTE VtkType() const
Returns the VTK element type identifier, or 0 if the element doesn't have a VTK representation.
Definition: tet10.h:53
virtual RVector LocalShapeF(const Point &loc) const =0
Returns the values of the shape functions at a local point.
virtual Point SurfToLocal(int side, const Point &p) const
Maps a point from surface coordinates to local element coordinates.
Definition: element.h:302
virtual Element * Copy()=0
Create a copy of the element and return a pointer to it.
Dense matrix class.
Definition: crmatrix.h:38
virtual Point Local(const NodeList &nlist, const Point &glob) const =0
Maps a point from global to local element coordinates.
virtual double IntFDD(int i, int j, int k) const =0
Integral of a product of a shape function and two shape function derivatives over the element...
virtual Point NodeLocal(int node) const =0
Returns the local coordinates of an element node.
#define ELCAPS_SUBSAMPLING
element implements IntFFF and IntFDD by subsampling
Definition: element.h:61
virtual int SideNode(int side, int node) const =0
Returns relative node index for a side vertex.
virtual bool LContains(const Point &loc, bool pad=true) const =0
Checks if a local point coordinate is inside the element.
RSymMatrix IntPDD(const RVector &P) const
All integrals of products of a nodal function and two shape function derivatives over the element...
Definition: tet10.h:80