ElInfo3d.h 3.69 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  crystal growth group                                                  ==
// ==                                                                        ==
// ==  Stiftung caesar                                                       ==
// ==  Ludwig-Erhard-Allee 2                                                 ==
// ==  53175 Bonn                                                            ==
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  http://www.caesar.de/cg/AMDiS                                         ==
// ==                                                                        ==
// ============================================================================

/** \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
45
46
47
48
49
50
51
    ElInfo3d& operator=(const ElInfo3d& rhs) {
      ElInfo::operator=(rhs);
      el_type = rhs.el_type;
      orientation = rhs.orientation;
      return *this;
    } 

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

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

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

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

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

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

70
    /// get ElInfo's \ref el_type
71
72
    inline unsigned char getType() const { 
      return el_type; 
73
    }
74

75
    /// get ElInfo's \ref orientation
76
77
    inline signed char getOrientation() const { 
      return orientation; 
78
    }
79

80
    /// set ElInfo's \ref el_type to t
81
82
    inline void setType(unsigned char t) { 
      el_type = t; 
83
    }
84

85
    /// set ElInfo's \ref orientation to o
86
87
    inline void setOrientation(signed char o) { 
      orientation = o; 
88
    }
89
90

  protected:
91
    /// \ref el 's type. Is Filled automatically by the traversal routines.
92
93
94
95
96
97
98
    unsigned char el_type;

    /** \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
99

100
    /// Tmp vectors used for calculations in calcGrdLambda and getNormal().
101
    std::vector< WorldVector<double> > tmpWorldVecs;
102
103
104
105
106
  };

}

#endif // AMDIS_ELINFO3D_H