ElInfo3d.h 3.53 KB
Newer Older
1 2 3 4
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
5
// ==  http://www.amdis-fem.org                                              ==
6 7
// ==                                                                        ==
// ============================================================================
8 9 10 11 12 13 14 15 16 17 18 19
//
// Software License for AMDiS
//
// Copyright (c) 2010 Dresden University of Technology 
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.


20 21 22 23 24 25

/** \file ElInfo3d.h */

#ifndef AMDIS_ELINFO3D_H
#define AMDIS_ELINFO3D_H

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

namespace AMDiS {

  /** \ingroup Traverse
   * \brief
   * ElInfo class for 3-dimensional elements (\ref Tetrahedron).
   */
  class ElInfo3d : public ElInfo
  {
  public:
38
    /// Constructor. Calls ElInfo's protected Constructor.
Thomas Witkowski's avatar
Thomas Witkowski committed
39 40 41
    ElInfo3d(Mesh* aMesh) 
      : ElInfo(aMesh) 
    {
42 43 44
      tmpWorldVecs.resize(3);
      for (int i = 0; i < 3; i++)
	tmpWorldVecs[i].resize(3);
45
    }
46

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

56
    /// 3-dimensional realisation of ElInfo's fillElInfo method.
57 58
    void fillElInfo(int ichild, const ElInfo *elinfo_old);

59
    /// 3-dimensional realisation of ElInfo's fillMacroInfo method.
60 61
    void fillMacroInfo(const MacroElement *);

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

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

68
    /// 3-dimensional realisation of ElInfo's getNormal method.
69
    double getNormal(int side, WorldVector<double> &normal) const;
70

71
    /// update ElInfo after refinement (of some neighbours). Only in 3d!
72 73
    void update();

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

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

86
    mtl::dense2D<double>& getSubElemCoordsMat(int degree) const;
87

88
    mtl::dense2D<double>& getSubElemGradCoordsMat(int degree) const;
89

90 91 92 93 94 95
  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
96

97
    /// Tmp vectors used for calculations in calcGrdLambda and getNormal().
98
    std::vector< std::vector<double> > tmpWorldVecs;
99 100 101 102 103 104

    static double mat_d1_left_val[4][4];
    static mtl::dense2D<double> mat_d1_left;

    static double mat_d1_l0_right_val[4][4];
    static mtl::dense2D<double> mat_d1_l0_right;
105 106

    static double mat_d1_l12_right_val[4][4];
107
    static mtl::dense2D<double> mat_d1_l12_right;
108 109 110 111 112 113 114 115 116 117 118



    static double mat_d4_left_val[35][35];
    static mtl::dense2D<double> mat_d4_left;

    static double mat_d4_l0_right_val[35][35];
    static mtl::dense2D<double> mat_d4_l0_right;

    static double mat_d4_l12_right_val[35][35];
    static mtl::dense2D<double> mat_d4_l12_right;
119 120 121 122 123
  };

}

#endif // AMDIS_ELINFO3D_H