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