Toast++  1.0.2 (r.539)
Forward and inverse modelling in optical tomography
tri10_ip.h
1 // -*-C++-*-
2 // =========================================================================
3 // TOAST v.15 (c) Martin Schweiger 1999
4 // Library: libfe File: tri10_ip.h
5 //
6 // 10-noded isoparametric triangle for cubic shape functions and curved
7 // boundaries.
8 //
9 // ^ xi Side 0: xi = 0
10 // | Side 1: xi+eta = 1
11 // ------- Side 2: eta = 0
12 // Local N2
13 // element + Node coordinates:
14 // ------- | \ N0 = (0,0) N5 = (2/3,1/3)
15 // | \ N1 = (1,0) N6 = (1/3,2/3)
16 // N7+ +N6 N2 = (0,1) N7 = (0,2/3)
17 // | \ N3 = (1/3,0) N8 = (0,1/3)
18 // | \ N4 = (2/3,0) N9 = (1/3,1/3)
19 // N8+ + +N5
20 // | N9 \
21 // | \
22 // N0+-----+-----+-----+N1 --> xi
23 // N3 N4
24 //
25 // Inheritance:
26 // ------------
27 // Element
28 // ---> Element_Unstructured
29 // ---> Element_Unstructured_2D
30 // ---> Triangle10_ip
31 // ========================================================================= //
32 
33 #ifndef __TRI10_IP_H
34 #define __TRI10_IP_H
35 
36 #include "toastdef.h"
37 
39 public:
40 
41  Triangle10_ip () { Node = new int [nNode()]; }
42  Triangle10_ip (const Triangle10_ip &el);
43  ~Triangle10_ip () { delete []Node; }
44 
48  Element *Copy();
49 
50  void Initialise (const NodeList &nlist);
51 
52  BYTE Type () const { return ELID_TRI10_IP; }
53  unsigned long GetCaps () const { return ELCAPS_CURVED_BOUNDARY; }
54  int nNode () const { return 10; }
55  int nSide () const { return 3; }
56  int nSideNode (int /*side*/) const { return 4; }
57  int SideNode (int side, int node) const;
58 
59  Point Local (const NodeList& nlist, const Point& glob) const;
60  Point NodeLocal (int node) const;
61  RVector DirectionCosine (int side, RDenseMatrix& jacin);
62  const RVector &LNormal (int side) const;
63  bool LContains (const Point& loc, bool pad = true) const;
64  bool GContains (const Point& glob, const NodeList& nlist) const;
65 
66  RVector LocalShapeF (const Point &loc) const;
67  RDenseMatrix LocalShapeD (const Point &loc) const;
68 
69  double IntF (int i) const
70  { ERROR_UNDEF; return 0; }
71  RSymMatrix IntFF () const;
72  double IntFF (int i, int j) const;
73  double IntFFF (int i, int j, int k) const;
74  RSymMatrix IntPFF (const RVector& P) const;
75  double IntPFF (int i, int j, const RVector& P) const;
76  double IntFDD (int i, int j, int k) const;
77  RSymMatrix IntPDD (const RVector& P) const
78  { ERROR_UNDEF; return RSymMatrix(); }
79  double IntPDD (int i, int j, const RVector &P) const;
80  double BndIntFFSide (int i, int j, int sd)
81  { ERROR_UNDEF; return 0; }
82  RSymMatrix BndIntPFF (const RVector &P) const
83  { ERROR_UNDEF; return RSymMatrix(); }
84  double BndIntPFF (int i, int j, const RVector &P) const;
85  int GlobalIntersection (const NodeList &nlist, const Point &p1,
86  const Point &p2, Point **list)
87  { ERROR_UNDEF; return 0; }
88  int Intersection (const Point &p1, const Point &p2, Point** pi)
89  { ERROR_UNDEF; return 0; }
90 
91 
92 protected:
93 
94  double Jacobian (const Point &loc, RDenseMatrix &J) const;
95  // Set J to the Jacobian of the element at local point loc (J must be of
96  // dimension 2x2 on input). Return value is det J
97 
98  double IJacobian (const Point &loc, RDenseMatrix &IJ) const;
99  // Set IJ to the inverse of the Jacobian at local point loc (IJ must be
100  // of dimension 2x2 on input). Return value ist det J
101 
102  double DetJ (const Point &loc, const NodeList *nlist = 0) const;
103  // Return value of det J at local point loc
104  // nlist is required ifndef TRI10IP_STORE_COORDS
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, b0, c0, a1, b1, c1, a2, b2, c2;
111 
112 #ifdef TRI10IP_STORE_COORDS
113  double n0x, n0y, n1x, n1y, n2x, n2y, n3x, n3y, n4x, n4y;
114  double n5x, n5y, n6x, n6y, n7x, n7y, n8x, n8y, n9x, n9y;
115  // Global node coordinates
116 #endif
117 
118 private:
119 
120  RSymMatrix ComputeIntFF (const NodeList &nlist) const;
121 
122  RSymMatrix intff;
123  // stores integral over element of product of shape functions
124  // Int_el { F_i(r) F_j(r) } dr
125  // set by Initialise
126 };
127 
128 #endif // !__TRI10_IP_H
Definition: ndlist.h:14
double IntF(int i) const
Integral of a shape function over the element.
Definition: tri10_ip.h:69
Templated vector class.
Definition: vector.h:39
virtual bool GContains(const Point &glob, const NodeList &nlist) const
Checks if a global point coordinate is inside the element.
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
#define ELID_TRI10_IP
10-noded isoparametric triangle
Definition: element.h:40
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.
Definition: point.h:18
virtual RDenseMatrix LocalShapeD(const Point &loc) const =0
Returns the values of the shape function derivatives at a local point.
BYTE Type() const
Returns an element type identifier.
Definition: tri10_ip.h:52
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 IntPDD(const RVector &P) const
All integrals of products of a nodal function and two shape function derivatives over the element...
Definition: tri10_ip.h:77
RSymMatrix BndIntPFF(const RVector &P) const
Surface integrals of all products of a nodal function and two shape functions over all boundary sides...
Definition: tri10_ip.h:82
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...
int nNode() const
Returns the number of nodes associated with the element.
Definition: tri10_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
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...
Base class for all 2-D unstructured element types.
Definition: element.h:1234
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: tri10_ip.h:80
unsigned long GetCaps() const
Returns element capability flags.
Definition: tri10_ip.h:53
int nSide() const
Returns the number of element sides.
Definition: tri10_ip.h:55
virtual RVector LocalShapeF(const Point &loc) const =0
Returns the values of the shape functions at a local point.
int nSideNode(int) const
Returns the number of vertices associated with a side.
Definition: tri10_ip.h:56
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.
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: tri10_ip.h:38