20#ifndef LIBMESH_FE_BASE_H
21#define LIBMESH_FE_BASE_H
24#include "libmesh/libmesh_common.h"
25#include "libmesh/compare_types.h"
26#include "libmesh/fe_abstract.h"
27#include "libmesh/fe_transformation_base.h"
28#include "libmesh/point.h"
29#include "libmesh/reference_counted_object.h"
30#include "libmesh/tensor_tools.h"
31#include "libmesh/type_n_tensor.h"
32#include "libmesh/vector_value.h"
33#include "libmesh/dense_matrix.h"
45template <
typename T>
class DenseMatrix;
46template <
typename T>
class DenseVector;
52template <
typename T>
class NumericVector;
54template <
typename T>
class FETransformationBase;
57#ifdef LIBMESH_ENABLE_NODE_CONSTRAINTS
61#ifdef LIBMESH_ENABLE_PERIODIC
62class PeriodicBoundaries;
63class PointLocatorBase;
66#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
67template <
unsigned int Dim, FEFamily T_radial, InfMapType T_map>
84template <
typename OutputType>
112 static std::unique_ptr<FEGenericBase>
build (
const unsigned int dim,
130#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
145#ifdef LIBMESH_ENABLE_AMR
155 const unsigned int variable_number,
167 const Elem * coarse_elem,
169 const unsigned int var,
170 const bool use_old_dof_indices =
false);
180 const Elem * coarse_elem,
182 const bool use_old_dof_indices =
false);
186#ifdef LIBMESH_ENABLE_PERIODIC
198 const unsigned int variable_number,
207 const std::vector<std::vector<OutputShape>> &
get_phi()
const
230 const std::vector<std::vector<OutputGradient>> &
get_dphi()
const
261 const std::vector<std::vector<OutputDivergence>> &
get_div_phi()
const
269 const std::vector<std::vector<OutputShape>> &
get_dphidx()
const
277 const std::vector<std::vector<OutputShape>> &
get_dphidy()
const
285 const std::vector<std::vector<OutputShape>> &
get_dphidz()
const
313#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
319 const std::vector<std::vector<OutputTensor>> &
get_d2phi()
const
425#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
519 virtual void print_phi(std::ostream & os)
const override;
526 virtual void print_dphi(std::ostream & os)
const override;
529#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
535 virtual void print_d2phi(std::ostream & os)
const override;
545#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
572#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
609 std::unique_ptr<FETransformationBase<OutputType>>
_fe_trans;
614 std::vector<std::vector<OutputShape>>
phi;
620 std::vector<std::vector<OutputGradient>>
dphi;
636 std::vector<std::vector<OutputDivergence>>
div_phi;
641 std::vector<std::vector<OutputShape>>
dphidxi;
656 std::vector<std::vector<OutputShape>>
dphidx;
661 std::vector<std::vector<OutputShape>>
dphidy;
666 std::vector<std::vector<OutputShape>>
dphidz;
669#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
674 std::vector<std::vector<OutputTensor>>
d2phi;
740#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
773#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
780 template <
unsigned int friend_Dim, FEFamily friend_T_radial, InfMapType friend_T_map>
791template <
typename OutputType>
795 "Computation of dual shape functions for vector finite element "
796 "families is not currently implemented");
799template <
typename OutputType>
803 "Computation of dual shape functions for vector finite element "
804 "families is not currently implemented");
825template <
typename OutputType>
843#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
859#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
869template <
typename OutputType>
Defines a dense matrix for use in Finite Element-type computations.
Defines a dense vector for use in Finite Element-type computations.
The constraint matrix storage format.
This class handles the numbering of degrees of freedom on a mesh.
This is the base class from which all geometric element types are derived.
This class forms the foundation from which generic finite elements may be derived.
bool calculate_map
Are we calculating mapping functions?
bool calculate_nothing
Are we potentially deliberately calculating nothing?
bool calculate_d2phi
Should we calculate shape function hessians?
const unsigned int dim
The dimensionality of the object.
bool calculate_phi
Should we calculate shape functions?
bool calculate_dphi
Should we calculate shape function gradients?
bool calculate_curl_phi
Should we calculate shape function curls?
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
bool calculate_dual
Are we calculating dual basis?
bool calculate_dphiref
Should we calculate reference shape function gradients?
bool calculate_div_phi
Should we calculate shape function divergences?
This class forms the foundation from which generic finite elements may be derived.
std::vector< std::vector< OutputTensor > > d2phi
Shape function second derivative values.
const std::vector< std::vector< OutputShape > > & get_d2phidxidzeta() const
virtual ~FEGenericBase()
Destructor.
const std::vector< std::vector< OutputShape > > & get_dphidxi() const
virtual_for_inffe void determine_calculations()
Determine which values are to be calculated, for both the FE itself and for the FEMap.
const std::vector< std::vector< OutputShape > > & get_dphidzeta() const
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
virtual void request_dphi() const override
request dphi calculations
TensorTools::IncrementRank< OutputNumberGradient >::type OutputNumberTensor
virtual void init_base_shape_functions(const std::vector< Point > &qp, const Elem *e)=0
Initialize the data fields for the base of an an infinite element.
void compute_dual_shape_coeffs(const std::vector< Real > &JxW, const std::vector< std::vector< OutputShape > > &phi)
Compute the dual basis coefficients dual_coeff we rely on the JxW (or weights) and the phi values,...
std::vector< std::vector< OutputShape > > d2phidxdz
Shape function second derivatives in the x-z direction.
const std::vector< std::vector< OutputShape > > & get_dphidy() const
virtual void print_dphi(std::ostream &os) const override
Prints the value of each shape function's derivative at each quadrature point.
std::vector< std::vector< OutputShape > > d2phidxidzeta
Shape function second derivatives in the xi-zeta direction.
std::vector< std::vector< OutputShape > > d2phidx2
Shape function second derivatives in the x direction.
static void coarsened_dof_values(const NumericVector< Number > &global_vector, const DofMap &dof_map, const Elem *coarse_elem, DenseVector< Number > &coarse_dofs, const unsigned int var, const bool use_old_dof_indices=false)
Creates a local projection on coarse_elem, based on the DoF values in global_vector for it's children...
std::vector< std::vector< OutputShape > > d2phidz2
Shape function second derivatives in the z direction.
DenseMatrix< Real > dual_coeff
Coefficient matrix for the dual basis.
std::vector< std::vector< OutputShape > > dphidx
Shape function derivatives in the x direction.
virtual void request_dual_phi() const override
virtual_for_inffe const std::vector< std::vector< OutputDivergence > > & get_div_phi() const
std::vector< std::vector< OutputShape > > d2phidy2
Shape function second derivatives in the y direction.
const std::vector< std::vector< OutputShape > > & get_phi() const
virtual const std::vector< RealGradient > & get_Sobolev_dweight() const
const DenseMatrix< Real > & get_dual_coeff() const
const std::vector< std::vector< OutputGradient > > & get_dphi() const
FEGenericBase(const unsigned int dim, const FEType &fet)
Constructor.
std::vector< std::vector< OutputShape > > dphidy
Shape function derivatives in the y direction.
std::vector< std::vector< OutputShape > > d2phidydz
Shape function second derivatives in the y-z direction.
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
Computes the constraint matrix contributions (for non-conforming adapted meshes) corresponding to var...
std::vector< std::vector< OutputDivergence > > div_phi
Shape function divergence values.
std::vector< Real > weight
Used for certain infinite element families: the additional radial weight in local coordinates,...
static std::unique_ptr< FEGenericBase > build_InfFE(const unsigned int dim, const FEType &type)
Builds a specific infinite element type.
const std::vector< std::vector< OutputShape > > & get_dphidx() const
virtual void print_dual_d2phi(std::ostream &os) const override
std::vector< std::vector< OutputGradient > > dual_dphi
const std::vector< std::vector< OutputShape > > & get_d2phidxi2() const
TensorTools::IncrementRank< OutputNumber >::type OutputNumberGradient
std::vector< std::vector< OutputGradient > > dphi
Shape function derivative values.
std::vector< std::vector< OutputShape > > d2phidxi2
Shape function second derivatives in the xi direction.
virtual void request_phi() const override
request phi calculations
virtual void print_d2phi(std::ostream &os) const override
Prints the value of each shape function's second derivatives at each quadrature point.
const std::vector< std::vector< OutputShape > > & get_dual_phi() const
const std::vector< std::vector< OutputGradient > > & get_dual_dphi() const
std::vector< std::vector< OutputShape > > d2phidxideta
Shape function second derivatives in the xi-eta direction.
virtual void print_phi(std::ostream &os) const override
Prints the value of each shape function at each quadrature point.
const std::vector< std::vector< OutputShape > > & get_d2phidx2() const
static void compute_periodic_constraints(DofConstraints &constraints, DofMap &dof_map, const PeriodicBoundaries &boundaries, const MeshBase &mesh, const PointLocatorBase *point_locator, const unsigned int variable_number, const Elem *elem)
Computes the constraint matrix contributions (for meshes with periodic boundary conditions) correspon...
std::vector< std::vector< OutputShape > > phi
Shape function values.
std::vector< std::vector< OutputShape > > dphidzeta
Shape function derivatives in the zeta direction.
const std::vector< std::vector< OutputShape > > & get_d2phideta2() const
OutputType OutputShape
Convenient typedefs for gradients of output, hessians of output, and potentially-complex-valued versi...
const std::vector< std::vector< OutputShape > > & get_d2phidy2() const
const std::vector< std::vector< OutputTensor > > & get_dual_d2phi() const
std::vector< std::vector< OutputTensor > > dual_d2phi
virtual void print_dual_phi(std::ostream &os) const override
const std::vector< OutputGradient > & get_dphase() const
std::vector< OutputGradient > dphase
Used for certain infinite element families: the first derivatives of the phase term in global coordin...
virtual const std::vector< Real > & get_Sobolev_weightxR_sq() const
std::vector< std::vector< OutputShape > > dphidz
Shape function derivatives in the z direction.
std::vector< std::vector< OutputShape > > dual_phi
std::vector< std::vector< OutputShape > > d2phidetadzeta
Shape function second derivatives in the eta-zeta direction.
const std::vector< std::vector< OutputShape > > & get_d2phidzeta2() const
TensorTools::MakeNumber< OutputShape >::type OutputNumber
const std::vector< std::vector< OutputShape > > & get_d2phidetadzeta() const
const std::vector< std::vector< OutputShape > > & get_d2phidz2() const
virtual const std::vector< Real > & get_Sobolev_weight() const
std::vector< std::vector< OutputShape > > dphidxi
Shape function derivatives in the xi direction.
TensorTools::DecrementRank< OutputShape >::type OutputDivergence
const std::vector< std::vector< OutputShape > > & get_d2phidydz() const
const std::vector< std::vector< OutputTensor > > & get_d2phi() const
std::vector< std::vector< OutputShape > > d2phideta2
Shape function second derivatives in the eta direction.
std::unique_ptr< FETransformationBase< OutputType > > _fe_trans
Object that handles computing shape function values, gradients, etc in the physical domain.
virtual const std::vector< std::vector< OutputGradient > > & get_dphi_over_decay() const
std::vector< std::vector< OutputShape > > d2phidxdy
Shape function second derivatives in the x-y direction.
const std::vector< std::vector< OutputShape > > & get_dphidz() const
virtual void compute_shape_functions(const Elem *elem, const std::vector< Point > &qp) override
After having updated the jacobian and the transformation from local to global coordinates in FEMap::c...
TensorTools::IncrementRank< OutputGradient >::type OutputTensor
virtual void print_dual_dphi(std::ostream &os) const override
std::vector< RealGradient > dweight
Used for certain infinite element families: the global derivative of the additional radial weight ,...
virtual void request_dual_dphi() const override
virtual const std::vector< std::vector< OutputGradient > > & get_dphi_over_decayxR() const
virtual const std::vector< std::vector< OutputShape > > & get_phi_over_decayxR() const
const std::vector< std::vector< OutputShape > > & get_d2phidxideta() const
virtual_for_inffe const std::vector< std::vector< OutputShape > > & get_curl_phi() const
std::vector< std::vector< OutputShape > > d2phidzeta2
Shape function second derivatives in the zeta direction.
virtual const std::vector< RealGradient > & get_Sobolev_dweightxR_sq() const
std::vector< std::vector< OutputShape > > curl_phi
Shape function curl values.
const std::vector< std::vector< OutputShape > > & get_d2phidxdz() const
std::vector< std::vector< OutputShape > > dphideta
Shape function derivatives in the eta direction.
const std::vector< std::vector< OutputShape > > & get_d2phidxdy() const
bool calculating_nothing() const
TensorTools::IncrementRank< OutputShape >::type OutputGradient
const std::vector< std::vector< OutputShape > > & get_dphideta() const
void compute_dual_shape_functions()
Compute dual_phi, dual_dphi, dual_d2phi It is only valid for this to be called after reinit has occur...
TensorTools::DecrementRank< OutputNumber >::type OutputNumberDivergence
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
A specific instantiation of the FEBase class.
This is the MeshBase class.
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
We're using a class instead of a typedef to allow forward declarations and future flexibility.
This is the base class for point locators.
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.
FEGenericBase< RealGradient > FEVectorBase
FEGenericBase< Real > FEBase