Toast++  1.0.2 (r.539)
Forward and inverse modelling in optical tomography
tri10.h
1 // -*-C++-*-
2 // =========================================================================
3 // TOAST v.15 (c) Martin Schweiger 1999
4 // Library: libfe File: tri10.h
5 //
6 // 10-noded triangle for cubic shape functions and straight boundaries,
7 // using analytic integration methods.
8 //
9 // ^ eta Side 0: eta = 0
10 // | Side 1: xi+eta = 1
11 // ------- Side 2: xi = 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
31 // =========================================================================
32 
33 #ifndef __TRI10_H
34 #define __TRI10_H
35 
36 #include "toastdef.h"
37 
58 class FELIB Triangle10: public Element_Unstructured_2D {
59 public:
60 
61  Triangle10 () { Node = new int [nNode()]; }
62  Triangle10 (const Triangle10 &el);
63  ~Triangle10 () { delete []Node; }
64 
68  Element *Copy();
69 
70  void Initialise (const NodeList &nlist);
71 
72  BYTE Type () const { return ELID_TRI10; }
73  unsigned long GetCaps () const { return 0; }
74  int nNode () const { return 10; }
75  int nSide () const { return 3; }
76 
77  int nSideNode (int /*side*/) const { return 4; }
78  int SideNode (int side, int node) const;
79 
80  Point Local (const NodeList& nlist, const Point& glob) const;
81  Point NodeLocal (int node) const;
82  RVector DirectionCosine (int side, RDenseMatrix& jacin);
83  const RVector &LNormal (int side) const;
84  bool LContains (const Point& loc, bool pad = true) const;
85  bool GContains (const Point& glob, const NodeList& nlist) const;
86 
87  RVector LocalShapeF (const Point &loc) const;
88  RDenseMatrix LocalShapeD (const Point &loc) const;
89  RVector GlobalShapeF (const NodeList& nlist, const Point& glob) const;
90 
91  double IntF (int i) const;
92  RSymMatrix IntFF() const;
93  double IntFF (int i, int j) const;
94  double IntFFF (int i, int j, int k) const;
95  RSymMatrix IntPFF (const RVector& P) const;
96  double IntPFF (int i, int j, const RVector& P) const;
97  double IntFDD (int i, int j, int k) const;
98  RSymMatrix IntPDD (const RVector& P) const
99  { ERROR_UNDEF; return RSymMatrix(); }
100  double IntPDD (int i, int j, const RVector &P) const;
101 
102  double BndIntFSide (int i, int sd);
103  double BndIntFFSide (int i, int j, int sd);
104 
105  RSymMatrix BndIntPFF (const RVector &P) const
106  { ERROR_UNDEF; return RSymMatrix(); }
107  double BndIntPFF (int i, int j, const RVector &P) const;
108  int GlobalIntersection (const NodeList &nlist, const Point &p1,
109  const Point &p2, Point **list)
110  { ERROR_UNDEF; return 0; }
111  int Intersection (const Point &p1, const Point &p2, Point** pi)
112  { ERROR_UNDEF; return 0; }
113 
114 
115 protected:
116 
117  //double Jacobian (const Point &loc, Matrix &J) const;
118  // Set J to the Jacobian of the element at local point loc (J must be of
119  // dimension 2x2 on input). Return value is det J
120 
121  //double IJacobian (const Point &loc, Matrix &IJ) const;
122  // Set IJ to the inverse of the Jacobian at local point loc (IJ must be
123  // of dimension 2x2 on input). Return value ist det J
124 
125  //double DetJ (const Point &loc, const NodeList *nlist = 0) const;
126  // Return value of det J at local point loc
127  // nlist is required ifndef TRI10IP_STORE_COORDS
128 
129  double ComputeSize (const NodeList &nlist) const;
130  RSymMatrix ComputeIntDD (const NodeList &nlist) const;
131  void ComputeIntFD (const NodeList &nlist);
132  RSymMatrix ComputeBndIntFF (const NodeList& nlist) const;
133 
134  int GetLocalSubsampleAbsc (const Point *&absc) const;
135 
136  double a0, b0, c0, a1, b1, c1, a2, b2, c2;
137  RDenseMatrix intfd_0, intfd_1; // IntFD storage
138 
139 #ifdef TRI10_STORE_COORDS
140  double n0x, n0y, n1x, n1y, n2x, n2y, n3x, n3y, n4x, n4y;
141  double n5x, n5y, n6x, n6y, n7x, n7y, n8x, n8y, n9x, n9y;
142  // Global node coordinates
143 #endif
144 
145 private:
146 
147 #ifdef TRI10_STORE_INTFF
148  SymMatrix intff;
149  // stores integral over element of product of shape functions
150  // Int_el { F_i(r) F_j(r) } dr
151  // set by Initialise
152 #endif
153 
154 };
155 
156 #endif // !__TRI10_H
Definition: ndlist.h:14
BYTE Type() const
Returns an element type identifier.
Definition: tri10.h:72
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.h:105
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.
A 10-noded 2-dimensional triangle element with straight edges and 3rd order shape functions...
Definition: tri10.h:58
virtual RSymMatrix IntFF() const =0
Integrals of all products of two shape functions over the element.
Definition: node.h:39
unsigned long GetCaps() const
Returns element capability flags.
Definition: tri10.h:73
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
virtual double IntFFF(int i, int j, int k) const =0
Integral of a product of three shape functions over 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: tri10.h:98
Definition: point.h:18
virtual double BndIntFFSide(int i, int j, int sd)=0
Surface integral of a product of two shape functions over one of the sides of the element...
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.
virtual RSymMatrix IntPFF(const RVector &P) const =0
Integrals of all products of two shape functions and a nodal function over the element.
int nNode() const
Returns the number of nodes associated with the element.
Definition: tri10.h:74
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
virtual void Initialise(const NodeList &nlist)
Element initialisation.
#define ELID_TRI10
10-noded triangle
Definition: element.h:39
int nSideNode(int) const
Returns the number of vertices associated with a side.
Definition: tri10.h:77
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...
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 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
virtual double IntF(int i) const =0
Integral of a shape function 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: tri10.h:75
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.