element2D.hh

Go to the documentation of this file.
1 
6 #ifndef element2DLin_hh
7 #define element2DLin_hh
8 
9 #include "element.hh"
10 #include "geometry/cell2D.hh"
11 
12 namespace concepts {
13  // forward declaration
14  template<typename F>
15  class ElementGraphics;
16 }
17 
18 namespace linearFEM {
19  // forward declaration
20  class TriangleGraphics;
21  class QuadGraphics;
22 
23  // ************************************************************** Triangle **
24 
29  class Triangle : public Element {
30  public:
36  Triangle(const concepts::Triangle2d& cell, uint idx[]) :
37  Element(3, idx), cell_(cell) {}
45  concepts::TColumn<Real>* T1 = 0) :
46  Element(T0, T1), cell_(cell) {}
47  virtual const concepts::Triangle& support() const {
48  return cell_.connector(); }
49  virtual const concepts::Triangle2d& cell() const { return cell_; }
57  Real shapefct(const uint i, const Real xi1, const Real xi2) const;
63  concepts::Real2d shapefctD(const uint i) const;
64  virtual const concepts::ElementGraphics<Real>* graphics() const;
65  protected:
66  virtual std::ostream& info(std::ostream& os) const;
67  private:
70  static std::unique_ptr<TriangleGraphics> graphics_;
71  };
72 
73  // ****************************************************************** Quad **
74 
79  class Quad : public Element {
80  public:
86  Quad(const concepts::Quad2d& cell, uint idx[]) :
87  Element(4, idx), cell_(cell) {}
95  concepts::TColumn<Real>* T1 = 0) : Element(T0, T1), cell_(cell) {}
96  virtual const concepts::Quad& support() const { return cell_.connector(); }
97  virtual const concepts::Quad2d& cell() const { return cell_; }
108  void evaluate(Real* res, const Real* x, const uint n) const;
119  void evaluateD(concepts::Real2d* res, const Real* x, const uint n) const;
121  protected:
122  virtual std::ostream& info(std::ostream& os) const;
123  private:
126  static std::unique_ptr<QuadGraphics> graphics_;
127  };
128 
129 } // namespace linearFEM
130 
131 #endif // element2DLin_hh
A column of a T matrix.
Definition: analytical.hh:18
A 2D cell: quadrilateral.
Definition: cell2D.hh:378
virtual const concepts::Quad & support() const
Returns the support of this element.
Definition: element2D.hh:96
Triangle & connector() const
Returns the triangle connector (topology)
Definition: cell2D.hh:91
virtual const concepts::Triangle2d & cell() const
Returns the cell of this element.
Definition: element2D.hh:49
virtual std::ostream & info(std::ostream &os) const
virtual const concepts::ElementGraphics< Real > * graphics() const
A quadrilateral in the topology.
Definition: topology.hh:272
Triangle(const concepts::Triangle2d &cell, concepts::TColumn< Real > *T0, concepts::TColumn< Real > *T1=0)
Constructor.
Definition: element2D.hh:44
Quad & connector() const
Returns the quadrilateral connector (topology)
Definition: cell2D.hh:234
A 2D cell: triangle.
Definition: cell2D.hh:31
virtual std::ostream & info(std::ostream &os) const
Triangle(const concepts::Triangle2d &cell, uint idx[])
Constructor.
Definition: element2D.hh:36
const concepts::Quad2d & cell_
Cell of the element.
Definition: element2D.hh:125
Linear FEM in 1D, 2D and 3D.
Definition: spaceTraits.hh:19
Real shapefct(const uint i, const Real xi1, const Real xi2) const
Computes the value of the ith shape function in the point (xi1, xi2).
concepts::Real2d shapefctD(const uint i) const
Returns the gradient of the ith shape function.
Quadrilateral element with bilinear shape functions in 2D.
Definition: element2D.hh:79
static std::unique_ptr< TriangleGraphics > graphics_
Definition: element2D.hh:70
virtual const concepts::Quad2d & cell() const
Returns the cell of this element.
Definition: element2D.hh:97
void evaluate(Real *res, const Real *x, const uint n) const
Evaluates the shape functions in the given one dimensional points.
Quad(const concepts::Quad2d &cell, concepts::TColumn< Real > *T0, concepts::TColumn< Real > *T1=0)
Constructor.
Definition: element2D.hh:94
const concepts::Triangle2d & cell_
Cell of the element.
Definition: element2D.hh:69
Base class for the element for linear FEM.
Definition: element.hh:30
virtual const concepts::Triangle & support() const
Returns the support of this element.
Definition: element2D.hh:47
void evaluateD(concepts::Real2d *res, const Real *x, const uint n) const
Evaluates the derivatives of the shape functions in the given one dimensional points.
Triangular element with linear shape functions in 2D.
Definition: element2D.hh:29
static std::unique_ptr< QuadGraphics > graphics_
Definition: element2D.hh:126
A triangle in the topology.
Definition: topology.hh:193
virtual const concepts::ElementGraphics< Real > * graphics() const
Quad(const concepts::Quad2d &cell, uint idx[])
Constructor.
Definition: element2D.hh:86
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich