Toast++  1.0.2 (r.539)
Forward and inverse modelling in optical tomography
tet10_ip.h
1 // -*-C++-*-
2 // =========================================================================
3 // TOAST v.15 (c) Martin Schweiger 1999
4 // Library: libfe File: tet10_ip.h
5 //
6 // Declaration of class Tetrahedron10
7 // 10-noded 2nd order isoparametric tetrahedron
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_ip
33 // =========================================================================
34 
35 #ifndef __TET10_IP_H
36 #define __TET10_IP_H
37 
38 #include "toastdef.h"
39 
41 public:
42 
43  Tetrahedron10_ip () { Node = new int[nNode()]; }
45  ~Tetrahedron10_ip () { delete []Node; }
46 
50  Element *Copy();
51 
52  void Initialise (const NodeList &nlist);
53 
54  BYTE Type() const { return ELID_TET10_IP; }
55  BYTE VtkType() const { return 24; }
56  unsigned long GetCaps () const { return ELCAPS_CURVED_BOUNDARY; }
57  int nNode() const { return 10; }
58  int nSide() const { return 4; }
59  int nSideNode (int /*side*/) const { return 6; }
60  int SideNode (int side, int node) const;
61 
62  Point Local (const NodeList& nlist, const Point& glob) const;
63  Point NodeLocal (int node) 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 
71  double IntF (int i) const
72  { ERROR_UNDEF; return 0; }
73  RSymMatrix IntFF() const;
74  double IntFF (int i, int j) const;
75  double IntFFF (int i, int j, int k) const;
76  RSymMatrix IntPFF (const RVector& P) const;
77  double IntPFF (int i, int j, const RVector& P) const;
78  double IntFDD (int i, int j, int k) const;
79  RSymMatrix IntPDD (const RVector& P) const
80  { ERROR_UNDEF; return RSymMatrix(); }
81  double IntPDD (int i, int j, const RVector &P) const;
82  double BndIntFFSide (int i, int j, int sd)
83  { ERROR_UNDEF; return 0; }
84  RSymMatrix BndIntPFF (const RVector &P) const
85  { ERROR_UNDEF; return RSymMatrix(); }
86  double BndIntPFF (int i, int j, const RVector &P) const;
87  int GlobalIntersection (const NodeList &nlist, const Point &p1,
88  const Point &p2, Point **list)
89  { ERROR_UNDEF; return 0; }
90  int Intersection (const Point &p1, const Point &p2, Point** pi)
91  { ERROR_UNDEF; return 0; }
92 
93 protected:
94 
95  double Jacobian (const Point &loc, RDenseMatrix &J) const;
96  // Set J to the Jacobian of the element at local point loc (J must be of
97  // dimension 3x3 on input). Return value is det J
98 
99  double IJacobian (const Point &loc, RDenseMatrix &IJ) const;
100  // Set IJ to the inverse of the Jacobian at local point loc (IJ must be
101  // of dimension 3x3 on input). Return value ist det J
102 
103  double DetJ (const Point &loc, const NodeList *nlist = 0) const;
104  // Return value of det J at local point loc
105  // nlist is required ifndef TRI10IP_STORE_COORDS
106 
107  double ComputeSize (const NodeList &nlist) const;
108  RSymMatrix ComputeIntDD (const NodeList &nlist) const;
109  RSymMatrix ComputeBndIntFF (const NodeList& nlist) const;
110 
111  double a0, a1, a2, a3, b0, b1, b2, b3, c0, c1, c2, c3, d0, d1, d2, d3;
112  double side_size[4]; // surface triangle areas
113 
114 #ifdef TET10IP_STORE_COORDS
115  double n0x, n0y, n0z, n1x, n1y, n1z, n2x, n2y, n2z, n3x, n3y, n3z;
116  double n4x, n4y, n4z, n5x, n5y, n5z, n6x, n6y, n6z, n7x, n7y, n7z;
117  double n8x, n8y, n8z, n9x, n9y, n9z;
118  // Global node coordinates
119 #endif
120 
121 private:
122 
123  RSymMatrix ComputeIntFF (const NodeList &nlist) const;
124 
125  RSymMatrix intff;
126  // stores integral over element of product of shape functions
127  // Int_el { F_i(r) F_j(r) } dr
128  // set by Initialise
129 
130 };
131 
132 #endif // !__TET10_H
Definition: ndlist.h:14
unsigned long GetCaps() const
Returns element capability flags.
Definition: tet10_ip.h:56
Templated vector class.
Definition: vector.h:39
virtual RSymMatrix IntFF() const =0
Integrals of all products of two shape functions over the element.
#define ELCAPS_CURVED_BOUNDARY
element can have curved boundaries
Definition: element.h:59
Definition: node.h:39
RSymMatrix IntPDD(const RVector &P) const
All integrals of products of a nodal function and two shape function derivatives over the element...
Definition: tet10_ip.h:79
Base class for all 3-D unstructured element types.
Definition: element.h:1257
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_ip.h:82
virtual RVector DirectionCosine(int side, RDenseMatrix &jacin)=0
Returns the direction cosines of a side normal.
virtual double IntFFF(int i, int j, int k) const =0
Integral of a product of three shape functions over the element.
#define ELID_TET10_IP
10-noded isoparametric tetrahedron
Definition: element.h:41
Definition: point.h:18
virtual RDenseMatrix LocalShapeD(const Point &loc) const =0
Returns the values of the shape function derivatives at a local point.
int nSideNode(int) const
Returns the number of vertices associated with a side.
Definition: tet10_ip.h:59
virtual const RVector & LNormal(int side) const =0
Returns a side normal in local coordinates.
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.
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_ip.h:84
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...
BYTE Type() const
Returns an element type identifier.
Definition: tet10_ip.h:54
virtual int nNode() const =0
Returns the number of nodes associated with the element.
Base class for finite element types.
Definition: element.h:84
BYTE VtkType() const
Returns the VTK element type identifier, or 0 if the element doesn't have a VTK representation.
Definition: tet10_ip.h:55
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
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 RVector LocalShapeF(const Point &loc) const =0
Returns the values of the shape functions at a local point.
int nSide() const
Returns the number of element sides.
Definition: tet10_ip.h:58
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...
double IntF(int i) const
Integral of a shape function over the element.
Definition: tet10_ip.h:71
virtual Point NodeLocal(int node) const =0
Returns the local coordinates of an element node.
int nNode() const
Returns the number of nodes associated with the element.
Definition: tet10_ip.h:57
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.
Definition: tet10_ip.h:40