Toast++  1.0.2 (r.539)
Forward and inverse modelling in optical tomography
quad4.h
1 // -*-C++-*-
2 // ==========================================================================
3 // Module libfe
4 // File quad4.h
5 // Declaration of class Quad4
6 // Quadratic element aligned with the coordinate axes
7 //
8 // N2 +-------+ N3 y
9 // | | ^
10 // | | |
11 // | | |
12 // N0 +-------+ N1 +-----> x
13 //
14 // Inheritance:
15 // ------------
16 // Element
17 // ---> Element_Unstructured
18 // ---> Element_Unstructured_2D
19 // ---> Quad4
20 // ==========================================================================
21 
22 #ifndef __QUAD4_H
23 #define __QUAD4_H
24 
25 #include "toastdef.h"
26 
27 class Surface;
28 
30 public:
31 
32  Quad4 () { Node = new int[nNode()]; }
33  Quad4 (const Quad4& el);
34  ~Quad4 () { delete []Node; }
35  // constructors, destructor
36 
37  void Initialise (const NodeList &nlist);
38 
39  BYTE Type() const { return ELID_QUAD4; }
40 
41  unsigned long GetCaps () const { return 0; }
42 
43  int nNode() const { return 4; }
44  int nSide() const { return 4; }
45  int nSideNode (int) const { return 2; }
46  int SideNode (int side, int node) const;
47 
48  Point Local (const NodeList &nlist, const Point &glob) const;
49  Point NodeLocal (int node) const;
50  bool LContains (const Point& loc, bool pad = true) const;
51  bool GContains (const Point& glob, const NodeList& nlist) const;
52  RVector LocalShapeF (const Point &loc) const;
53  RDenseMatrix LocalShapeD (const Point &loc) const;
54 
55 private:
56  double len; // side length
57  Point n0; // position of node N0
58 };
59 
60 #endif // !__QUAD4_H
Definition: ndlist.h:14
#define ELID_QUAD4
4-noded quadrilateral
Definition: element.h:43
Templated vector class.
Definition: vector.h:39
Definition: node.h:39
Definition: surface.h:21
int nNode() const
Returns the number of nodes associated with the element.
Definition: quad4.h:43
bool LContains(const Point &loc, bool pad=true) const
Checks if a local point coordinate is inside the element.
Definition: quad4.h:29
int nSide() const
Returns the number of element sides.
Definition: quad4.h:44
unsigned long GetCaps() const
Returns element capability flags.
Definition: quad4.h:41
void Initialise(const NodeList &nlist)
Element initialisation.
int nSideNode(int) const
Returns the number of vertices associated with a side.
Definition: quad4.h:45
Definition: point.h:18
Point Local(const NodeList &nlist, const Point &glob) const
Maps a point from global to local element coordinates.
Point NodeLocal(int node) const
Returns the local coordinates of an element node.
BYTE Type() const
Returns an element type identifier.
Definition: quad4.h:39
Base class for all 2-D unstructured element types.
Definition: element.h:1234
bool GContains(const Point &glob, const NodeList &nlist) const
Checks if a global point coordinate is inside the element.
Dense matrix class.
Definition: crmatrix.h:38
RDenseMatrix LocalShapeD(const Point &loc) const
Returns the values of the shape function derivatives at a local point.
RVector LocalShapeF(const Point &loc) const
Returns the values of the shape functions at a local point.
int SideNode(int side, int node) const
Returns relative node index for a side vertex.