libMesh
fe_transformation_base.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 #ifndef LIBMESH_FE_TRANSFORMATION_BASE_H
19 #define LIBMESH_FE_TRANSFORMATION_BASE_H
20 
21 #include "libmesh/fe_base.h"
22 
23 namespace libMesh
24 {
25 
26 //Forward Declarations
27 template<typename T> class FEGenericBase;
28 template<typename T> class H1FETransformation;
29 template<typename T> class HCurlFETransformation;
30 class FEType;
31 
41 template<typename OutputShape>
43 {
44 public:
45 
48 
53 
57  virtual void init_map_phi(const FEGenericBase<OutputShape> & fe) const = 0;
58 
62  virtual void init_map_dphi(const FEGenericBase<OutputShape> & fe) const = 0;
63 
67  virtual void init_map_d2phi(const FEGenericBase<OutputShape> & fe) const = 0;
68 
73  virtual void map_phi(const unsigned int dim,
74  const Elem * const elem,
75  const std::vector<Point> & qp,
76  const FEGenericBase<OutputShape> & fe,
77  std::vector<std::vector<OutputShape>> & phi) const = 0;
78 
83  virtual void map_dphi(const unsigned int dim,
84  const Elem * const elem,
85  const std::vector<Point> & qp,
86  const FEGenericBase<OutputShape> & fe,
87  std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient>> & dphi,
88  std::vector<std::vector<OutputShape>> & dphidx,
89  std::vector<std::vector<OutputShape>> & dphidy,
90  std::vector<std::vector<OutputShape>> & dphidz) const = 0;
91 
92 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
93 
97  virtual void map_d2phi(const unsigned int dim,
98  const std::vector<Point> & qp,
99  const FEGenericBase<OutputShape> & fe,
100  std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor>> & d2phi,
101  std::vector<std::vector<OutputShape>> & d2phidx2,
102  std::vector<std::vector<OutputShape>> & d2phidxdy,
103  std::vector<std::vector<OutputShape>> & d2phidxdz,
104  std::vector<std::vector<OutputShape>> & d2phidy2,
105  std::vector<std::vector<OutputShape>> & d2phidydz,
106  std::vector<std::vector<OutputShape>> & d2phidz2) const = 0;
107 #endif //LIBMESH_ENABLE_SECOND_DERIVATIVES
108 
109 
114  virtual void map_curl(const unsigned int dim,
115  const Elem * const elem,
116  const std::vector<Point> & qp,
117  const FEGenericBase<OutputShape> & fe,
118  std::vector<std::vector<OutputShape>> & curl_phi) const = 0;
119 
124  virtual void map_div(const unsigned int dim,
125  const Elem * const elem,
126  const std::vector<Point> & qp,
127  const FEGenericBase<OutputShape> & fe,
128  std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputDivergence>> & div_phi) const = 0;
129 
130 }; // class FETransformationBase
131 
132 }
133 
134 #endif // LIBMESH_FE_TRANSFORMATION_BASE_H
virtual void map_d2phi(const unsigned int dim, const std::vector< Point > &qp, const FEGenericBase< OutputShape > &fe, std::vector< std::vector< typename FEGenericBase< OutputShape >::OutputTensor >> &d2phi, std::vector< std::vector< OutputShape >> &d2phidx2, std::vector< std::vector< OutputShape >> &d2phidxdy, std::vector< std::vector< OutputShape >> &d2phidxdz, std::vector< std::vector< OutputShape >> &d2phidy2, std::vector< std::vector< OutputShape >> &d2phidydz, std::vector< std::vector< OutputShape >> &d2phidz2) const =0
Evaluates shape function Hessians in physical coordinates based on proper finite element transformati...
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
Definition: fe_type.h:178
virtual void map_curl(const unsigned int dim, const Elem *const elem, const std::vector< Point > &qp, const FEGenericBase< OutputShape > &fe, std::vector< std::vector< OutputShape >> &curl_phi) const =0
Evaluates the shape function curl in physical coordinates based on proper finite element transformati...
virtual void map_dphi(const unsigned int dim, const Elem *const elem, const std::vector< Point > &qp, const FEGenericBase< OutputShape > &fe, std::vector< std::vector< typename FEGenericBase< OutputShape >::OutputGradient >> &dphi, std::vector< std::vector< OutputShape >> &dphidx, std::vector< std::vector< OutputShape >> &dphidy, std::vector< std::vector< OutputShape >> &dphidz) const =0
Evaluates shape function gradients in physical coordinates based on proper finite element transformat...
static UniquePtr< FETransformationBase< OutputShape > > build(const FEType &type)
Builds an FETransformation object based on the finite element type.
This class handles the computation of the shape functions in the physical domain for HCurl conforming...
unsigned int dim
virtual void init_map_d2phi(const FEGenericBase< OutputShape > &fe) const =0
Pre-requests any necessary data from FEMap.
This is the base class from which all geometric element types are derived.
Definition: elem.h:89
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.
The libMesh namespace provides an interface to certain functionality in the library.
TensorTools::DecrementRank< OutputShape >::type OutputDivergence
Definition: fe_base.h:123
This class handles the computation of the shape functions in the physical domain for H1 conforming el...
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
virtual void init_map_phi(const FEGenericBase< OutputShape > &fe) const =0
Pre-requests any necessary data from FEMap.
virtual void init_map_dphi(const FEGenericBase< OutputShape > &fe) const =0
Pre-requests any necessary data from FEMap.
This class handles the computation of the shape functions in the physical domain. ...
Definition: fe_base.h:55
This class forms the foundation from which generic finite elements may be derived.
virtual void map_div(const unsigned int dim, const Elem *const elem, const std::vector< Point > &qp, const FEGenericBase< OutputShape > &fe, std::vector< std::vector< typename FEGenericBase< OutputShape >::OutputDivergence >> &div_phi) const =0
Evaluates the shape function divergence in physical coordinates based on proper finite element transf...
virtual void map_phi(const unsigned int dim, const Elem *const elem, const std::vector< Point > &qp, const FEGenericBase< OutputShape > &fe, std::vector< std::vector< OutputShape >> &phi) const =0
Evaluates shape functions in physical coordinates based on proper finite element transformation.