ElInfo3d.h 3.39 KB
Newer Older
1
2
3
4
5
6
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
7
// ==  TU Dresden                                                            ==
8
// ==                                                                        ==
9
10
11
// ==  Institut fr Wissenschaftliches Rechnen                               ==
// ==  Zellescher Weg 12-14                                                  ==
// ==  01069 Dresden                                                         ==
12
13
14
15
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
16
// ==  https://gforge.zih.tu-dresden.de/projects/amdis/                      ==
17
18
19
20
21
22
23
24
// ==                                                                        ==
// ============================================================================

/** \file ElInfo3d.h */

#ifndef AMDIS_ELINFO3D_H
#define AMDIS_ELINFO3D_H

25
#include <boost/numeric/mtl/mtl.hpp>
26
27
28
29
30
31
32
33
34
35
36
#include "ElInfo.h"

namespace AMDiS {

  /** \ingroup Traverse
   * \brief
   * ElInfo class for 3-dimensional elements (\ref Tetrahedron).
   */
  class ElInfo3d : public ElInfo
  {
  public:
37
    /// Constructor. Calls ElInfo's protected Constructor.
Thomas Witkowski's avatar
Thomas Witkowski committed
38
39
40
    ElInfo3d(Mesh* aMesh) 
      : ElInfo(aMesh) 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
41
      tmpWorldVecs.resize(4);
42
    }
43

44
    /// Assignment operator
Thomas Witkowski's avatar
Thomas Witkowski committed
45
46
    ElInfo3d& operator=(const ElInfo3d& rhs) 
    {
47
      ElInfo::operator=(rhs);
48
      elType = rhs.elType;
49
50
51
52
      orientation = rhs.orientation;
      return *this;
    } 

53
    /// 3-dimensional realisation of ElInfo's fillElInfo method.
54
55
    void fillElInfo(int ichild, const ElInfo *elinfo_old);

56
    /// 3-dimensional realisation of ElInfo's fillMacroInfo method.
57
58
    void fillMacroInfo(const MacroElement *);

59
    /// 3-dimensional realisation of ElInfo's worldToCoord method.
60
61
    const int worldToCoord(const WorldVector<double>& w, DimVec<double>* l) const;

62
    /// 3-dimensional realisation of ElInfo's calcGrdLambda method.
Thomas Witkowski's avatar
Thomas Witkowski committed
63
    double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam);
64

65
    /// 3-dimensional realisation of ElInfo's getNormal method.
Thomas Witkowski's avatar
Thomas Witkowski committed
66
    double getNormal(int side, WorldVector<double> &normal);
67

68
    /// update ElInfo after refinement (of some neighbours). Only in 3d!
69
70
    void update();

71
    /// get ElInfo's \ref orientation
Thomas Witkowski's avatar
Thomas Witkowski committed
72
73
    inline signed char getOrientation() const 
    { 
74
      return orientation; 
75
    }
76

77
    /// set ElInfo's \ref orientation to o
Thomas Witkowski's avatar
Thomas Witkowski committed
78
79
    inline void setOrientation(signed char o) 
    { 
80
      orientation = o; 
81
    }
82
83
84
85
86
87
88

  protected:
    /** \brief
     * +/- 1: sign of the determinant of the transformation to the reference
     * element with vertices (0,0,0), (1,1,1), (1,1,0), (1,0,0).
     */
    signed char orientation;
Thomas Witkowski's avatar
Thomas Witkowski committed
89

90
    /// Tmp vectors used for calculations in calcGrdLambda and getNormal().
91
    std::vector< WorldVector<double> > tmpWorldVecs;
92
93
94
95
96
  };

}

#endif // AMDIS_ELINFO3D_H