Skip to content
Snippets Groups Projects
ElInfo3d.h 3.54 KiB
Newer Older
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ==                                                                        ==
// ============================================================================
//
// 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.



/** \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) 
    {
      tmpWorldVecs.resize(3);
      for (int i = 0; i < 3; i++)
	tmpWorldVecs[i].resize(3);
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) const;
    /// 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< std::vector<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 mtl::dense2D<double> mat_d1_l0_right;
    static mtl::dense2D<double> mat_d1_l12_right;



    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;