Skip to content
Snippets Groups Projects
ElInfo3d.h 3.8 KiB
Newer Older
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  TU Dresden                                                            ==
// ==  Institut fr Wissenschaftliches Rechnen                               ==
// ==  Zellescher Weg 12-14                                                  ==
// ==  01069 Dresden                                                         ==
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  https://gforge.zih.tu-dresden.de/projects/amdis/                      ==
// ==                                                                        ==
// ============================================================================

/** \file ElInfo3d.h */

#ifndef AMDIS_ELINFO3D_H
#define AMDIS_ELINFO3D_H

#include "ElInfo.h"

namespace AMDiS {

  /** \ingroup Traverse
   * \brief
   * ElInfo class for 3-dimensional elements (\ref Tetrahedron).
   */
  class ElInfo3d : public ElInfo
  {
  public:
    /// Constructor. Calls ElInfo's protected Constructor.
    ElInfo3d(Mesh* aMesh) 
      : ElInfo(aMesh) 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
      tmpWorldVecs.resize(4);
Thomas Witkowski's avatar
Thomas Witkowski committed
    ElInfo3d& operator=(const ElInfo3d& rhs) 
    {
      ElInfo::operator=(rhs);
      elType = rhs.elType;
      orientation = rhs.orientation;
      return *this;
    } 

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

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

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

    /// 3-dimensional realisation of ElInfo's calcGrdLambda method.
    double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam);
    /// 3-dimensional realisation of ElInfo's getNormal method.
    double getNormal(int side, WorldVector<double> &normal);
    /// update ElInfo after refinement (of some neighbours). Only in 3d!
    /// get ElInfo's \ref orientation
Thomas Witkowski's avatar
Thomas Witkowski committed
    inline signed char getOrientation() const 
    { 
    /// set ElInfo's \ref orientation to o
Thomas Witkowski's avatar
Thomas Witkowski committed
    inline void setOrientation(signed char o) 
    { 
    mtl::dense2D<double>& getSubElemCoordsMat(int degree) const;
    mtl::dense2D<double>& getSubElemGradCoordsMat(int degree) const;
  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;
    /// Tmp vectors used for calculations in calcGrdLambda and getNormal().
    std::vector< WorldVector<double> > tmpWorldVecs;

    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 double mat_d1_l12_right_val[4][4];
    static mtl::dense2D<double> mat_d1_l0_right;
    static mtl::dense2D<double> mat_d1_l12_right;