MFEM  v3.2
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
eltrans.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11 
12 #ifndef MFEM_ELEMENTTRANSFORM
13 #define MFEM_ELEMENTTRANSFORM
14 
15 #include "../config/config.hpp"
16 #include "../linalg/linalg.hpp"
17 #include "intrules.hpp"
18 #include "fe.hpp"
19 
20 namespace mfem
21 {
22 
24 {
25 protected:
29 
30 public:
32 
34 
35  void SetIntPoint(const IntegrationPoint *ip)
37  const IntegrationPoint &GetIntPoint() { return *IntPoint; }
38 
39  virtual void Transform(const IntegrationPoint &, Vector &) = 0;
40  virtual void Transform(const IntegrationRule &, DenseMatrix &) = 0;
41 
43  virtual void Transform(const DenseMatrix &matrix, DenseMatrix &result) = 0;
44 
48  virtual const DenseMatrix & Jacobian() = 0;
49  virtual double Weight() = 0;
50 
51  virtual int Order() = 0;
52  virtual int OrderJ() = 0;
53  virtual int OrderW() = 0;
55  virtual int OrderGrad(const FiniteElement *fe) = 0;
56 
59  virtual int GetSpaceDim() = 0;
60 
65  virtual int TransformBack(const Vector &, IntegrationPoint &) = 0;
66 
67  virtual ~ElementTransformation() { }
68 };
69 
71 {
72 private:
73  DenseMatrix dshape, dFdx;
74  double Wght;
75  Vector shape;
76 
77  const FiniteElement *FElem;
78  DenseMatrix PointMat;
79 
80 public:
81  void SetFE(const FiniteElement *FE) { FElem = FE; }
82  const FiniteElement* GetFE() const { return FElem; }
83 
84  DenseMatrix &GetPointMat () { return PointMat; }
85 
86  void SetIdentityTransformation(int GeomType);
87 
88  virtual void Transform(const IntegrationPoint &, Vector &);
89  virtual void Transform(const IntegrationRule &, DenseMatrix &);
90  virtual void Transform(const DenseMatrix &matrix, DenseMatrix &result);
91 
92  virtual const DenseMatrix & Jacobian();
93  virtual double Weight();
94 
95  virtual int Order() { return FElem->GetOrder(); }
96  virtual int OrderJ();
97  virtual int OrderW();
98  virtual int OrderGrad(const FiniteElement *fe);
99 
100  virtual int GetSpaceDim()
101  {
102  // this function should only be called after PointMat is initialized
103  return PointMat.Height();
104  }
105 
106  virtual int TransformBack(const Vector &, IntegrationPoint &);
107 
109 };
110 
112 {
113 public:
115  void Transform (const IntegrationPoint &, IntegrationPoint &);
116  void Transform (const IntegrationRule &, IntegrationRule &);
117 };
118 
120 {
121 public:
125 };
126 
127 /* Elem1(Loc1(x)) = Face(x) = Elem2(Loc2(x))
128 
129 
130  Physical Space
131 
132  *--------* ^ *--------*
133  Elem1No / / \ / \ / \ \ Elem2No
134  / / \ / \ / \ \
135  / / n \ / \ / \ \
136  *--------* ==> * ( ) * *--------*
137  \ \ / \ / \ / /
138  \ \ / \ / \ / /
139  \ \ / \ / \ / /
140  *--------* v *--------*
141 
142  ^ ^
143  | ^ |
144  Elem1 | | | Elem2
145  | | Face |
146  |
147  *--------* *--------*
148  / /| / /|
149  1 *--------* | 1 *--------* 1 *--------* |
150  | | | Loc1 | | Loc2 | | |
151  | | * <----- | x | -----> | | *
152  | |/ | | | |/
153  *--------* *--------* *--------*
154  0 1 0 1 0 1
155 
156  Reference Space
157 */
158 
159 }
160 
161 #endif
Abstract class for Finite Elements.
Definition: fe.hpp:44
virtual ~ElementTransformation()
Definition: eltrans.hpp:67
ElementTransformation * Face
Definition: eltrans.hpp:123
Class for integration rule.
Definition: intrules.hpp:83
const IntegrationPoint * IntPoint
Definition: eltrans.hpp:28
void SetIntPoint(const IntegrationPoint *ip)
Definition: eltrans.hpp:35
void SetIdentityTransformation(int GeomType)
Definition: eltrans.cpp:29
int GetOrder() const
Returns the order of the finite element.
Definition: fe.hpp:91
Data type dense matrix using column-major storage.
Definition: densemat.hpp:22
virtual int TransformBack(const Vector &, IntegrationPoint &)
Definition: eltrans.cpp:190
IntegrationPointTransformation Loc2
Definition: eltrans.hpp:124
const FiniteElement * GetFE() const
Definition: eltrans.hpp:82
virtual void Transform(const IntegrationPoint &, Vector &)
Definition: eltrans.cpp:129
const IntegrationPoint & GetIntPoint()
Definition: eltrans.hpp:37
ElementTransformation * Elem2
Definition: eltrans.hpp:123
virtual int TransformBack(const Vector &, IntegrationPoint &)=0
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows.
Definition: operator.hpp:35
IntegrationPointTransformation Loc1
Definition: eltrans.hpp:124
virtual int OrderGrad(const FiniteElement *fe)
order of adj(J)^t.grad(fi)
Definition: eltrans.cpp:110
virtual double Weight()=0
virtual const DenseMatrix & Jacobian()
Definition: eltrans.cpp:52
void Transform(const IntegrationPoint &, IntegrationPoint &)
Definition: eltrans.cpp:243
Class for integration point with weight.
Definition: intrules.hpp:25
virtual int OrderGrad(const FiniteElement *fe)=0
order of adj(J)^t.grad(fi)
void SetFE(const FiniteElement *FE)
Definition: eltrans.hpp:81
IsoparametricTransformation Transf
Definition: eltrans.hpp:114
ElementTransformation * Elem1
Definition: eltrans.hpp:123
Vector data type.
Definition: vector.hpp:33
virtual void Transform(const IntegrationPoint &, Vector &)=0
virtual int GetSpaceDim()=0
virtual const DenseMatrix & Jacobian()=0