20 #ifndef LIBMESH_FE_MAP_H 21 #define LIBMESH_FE_MAP_H 24 #include "libmesh/reference_counted_object.h" 25 #include "libmesh/point.h" 26 #include "libmesh/vector_value.h" 27 #include "libmesh/fe_type.h" 52 virtual ~FEMap() =
default;
54 static std::unique_ptr<FEMap>
build(
FEType fe_type);
58 template<
unsigned int Dim>
64 const std::vector<Point> & qp,
75 const std::vector<Real> & qw,
78 const std::vector<const Node *> & elem_nodes,
79 bool compute_second_derivatives);
88 const std::vector<Real> & qw,
97 const std::vector<Real> & qw);
109 const std::vector<Real> & qw,
111 bool calculate_d2phi);
117 const std::vector<Real> & qw,
124 const std::vector<Real> & qw,
131 template<
unsigned int Dim>
139 template<
unsigned int Dim>
149 const Point & reference_point);
157 const unsigned int j,
158 const Point & reference_point);
193 const bool secure =
true,
194 const bool extra_checks =
true);
206 const std::vector<Point> & physical_points,
207 std::vector<Point> & reference_points,
209 const bool secure =
true,
210 const bool extra_checks =
true);
259 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 377 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 403 const std::vector<std::vector<Real>> &
get_psi()
const 448 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 502 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 547 #endif //LIBMESH_ENABLE_SECOND_DERIVATIVES 577 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 652 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 760 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 798 #endif //LIBMESH_ENABLE_SECOND_DERIVATIVES 856 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 896 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 947 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 982 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 1018 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 1051 const std::vector<Point> & qp,
1057 this->init_reference_to_physical_map<0>(qp, elem);
1060 this->init_reference_to_physical_map<1>(qp, elem);
1063 this->init_reference_to_physical_map<2>(qp, elem);
1066 this->init_reference_to_physical_map<3>(qp, elem);
1075 #endif // LIBMESH_FE_MAP_H const std::vector< std::vector< Real > > & get_d2psidxi2() const
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
virtual void compute_affine_map(const unsigned int dim, const std::vector< Real > &qw, const Elem *elem)
Compute the jacobian and some other additional data fields.
std::vector< std::vector< Real > > & get_dphidzeta_map()
void init_edge_shape_functions(const std::vector< Point > &qp, const Elem *edge)
Same as before, but for an edge.
Real dzdeta_map(const unsigned int p) const
Used in FEMap::compute_map(), which should be be usable in derived classes, and therefore protected...
std::vector< std::vector< Real > > dpsideta_map
Map for the derivative of the side function, d(psi)/d(eta).
std::vector< std::vector< Real > > psi_map
Map for the side shape functions, psi.
std::vector< std::vector< Real > > d2psideta2_map
Map for the second derivatives (in eta) of the side shape functions.
std::vector< std::vector< Real > > & get_d2phidxideta_map()
std::vector< std::vector< Real > > & get_d2phideta2_map()
std::vector< std::vector< Real > > dphidzeta_map
Map for the derivative, d(phi)/d(zeta).
void compute_inverse_map_second_derivs(unsigned p)
A helper function used by FEMap::compute_single_point_map() to compute second derivatives of the inve...
virtual void compute_map(const unsigned int dim, const std::vector< Real > &qw, const Elem *elem, bool calculate_d2phi)
Compute the jacobian and some other additional data fields.
std::vector< std::vector< Real > > dphidxi_map
Map for the derivative, d(phi)/d(xi).
std::vector< std::vector< Real > > d2etadxyz2_map
Second derivatives of "eta" reference coordinate wrt physical coordinates.
bool calculate_dxyz
Should we calculate mapping gradients?
void compute_edge_map(int dim, const std::vector< Real > &qw, const Elem *side)
Same as before, but for an edge.
static constexpr Real TOLERANCE
std::vector< std::vector< Real > > & get_d2phidxi2_map()
static std::unique_ptr< FEMap > build(FEType fe_type)
static Point inverse_map(const unsigned int dim, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true, const bool extra_checks=true)
std::vector< RealGradient > d2xyzdzeta2_map
Vector of second partial derivatives in zeta: d^2(x)/d(zeta)^2.
std::vector< Real > dzetady_map
Map for partial derivatives: d(zeta)/d(y).
const std::vector< std::vector< Real > > & get_dphidzeta_map() const
std::vector< std::vector< Real > > d2xidxyz2_map
Second derivatives of "xi" reference coordinate wrt physical coordinates.
Real dxdeta_map(const unsigned int p) const
Used in FEMap::compute_map(), which should be be usable in derived classes, and therefore protected...
const std::vector< Real > & get_detadz() const
Real dzdxi_map(const unsigned int p) const
Used in FEMap::compute_map(), which should be be usable in derived classes, and therefore protected...
const std::vector< Real > & get_curvatures() const
This is the base class from which all geometric element types are derived.
std::vector< std::vector< Real > > d2phideta2_map
Map for the second derivative, d^2(phi)/d(eta)^2.
const std::vector< Point > & get_normals() const
std::vector< std::vector< Real > > d2phidxidzeta_map
Map for the second derivative, d^2(phi)/d(xi)d(zeta).
std::vector< Real > dxidz_map
Map for partial derivatives: d(xi)/d(z).
const std::vector< std::vector< Real > > & get_phi_map() const
std::vector< Real > & get_JxW()
const std::vector< std::vector< Real > > & get_dpsidxi() const
std::vector< std::vector< Real > > phi_map
Map for the shape function phi.
const std::vector< RealGradient > & get_dxyzdzeta() const
The libMesh namespace provides an interface to certain functionality in the library.
const std::vector< std::vector< Real > > & get_dpsideta() const
const std::vector< std::vector< Real > > & get_d2etadxyz2() const
Second derivatives of "eta" reference coordinate wrt physical coordinates.
std::vector< std::vector< Real > > d2phidetadzeta_map
Map for the second derivative, d^2(phi)/d(eta)d(zeta).
const std::vector< Real > & get_dxidz() const
std::vector< std::vector< Real > > d2psidxideta_map
Map for the second (cross) derivatives in xi, eta of the side shape functions.
std::vector< RealGradient > d2xyzdxideta_map
Vector of mixed second partial derivatives in xi-eta: d^2(x)/d(xi)d(eta) d^2(y)/d(xi)d(eta) d^2(z)/d(...
const std::vector< std::vector< Real > > & get_dphideta_map() const
const std::vector< std::vector< Point > > & get_tangents() const
std::vector< RealGradient > dxyzdzeta_map
Vector of partial derivatives: d(x)/d(zeta), d(y)/d(zeta), d(z)/d(zeta)
std::vector< std::vector< Real > > & get_dpsidxi()
std::vector< std::vector< Real > > & get_d2phidxidzeta_map()
std::vector< Real > dzetadx_map
Map for partial derivatives: d(zeta)/d(x).
std::vector< RealGradient > dxyzdxi_map
Vector of partial derivatives: d(x)/d(xi), d(y)/d(xi), d(z)/d(xi)
std::vector< std::vector< Real > > & get_d2phidetadzeta_map()
void set_jacobian_tolerance(Real tol)
Set the Jacobian tolerance used for determining when the mapping fails.
const std::vector< RealGradient > & get_d2xyzdeta2() const
std::vector< std::vector< Real > > & get_d2psideta2()
std::vector< RealGradient > d2xyzdeta2_map
Vector of second partial derivatives in eta: d^2(x)/d(eta)^2.
const std::vector< std::vector< Real > > & get_d2zetadxyz2() const
Second derivatives of "zeta" reference coordinate wrt physical coordinates.
const std::vector< RealGradient > & get_dxyzdxi() const
std::vector< std::vector< Real > > & get_d2psidxideta()
std::vector< RealGradient > d2xyzdxi2_map
Vector of second partial derivatives in xi: d^2(x)/d(xi)^2, d^2(y)/d(xi)^2, d^2(z)/d(xi)^2.
std::vector< std::vector< Real > > & get_dphidxi_map()
std::vector< Real > dzetadz_map
Map for partial derivatives: d(zeta)/d(z).
const std::vector< std::vector< Real > > & get_psi() const
Real dzdzeta_map(const unsigned int p) const
Used in FEMap::compute_map(), which should be be usable in derived classes, and therefore protected...
bool calculate_d2xyz
Should we calculate mapping hessians?
std::vector< std::vector< Real > > d2zetadxyz2_map
Second derivatives of "zeta" reference coordinate wrt physical coordinates.
const std::vector< Real > & get_dzetadx() const
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
std::vector< RealGradient > d2xyzdetadzeta_map
Vector of mixed second partial derivatives in eta-zeta: d^2(x)/d(eta)d(zeta) d^2(y)/d(eta)d(zeta) d^2...
std::vector< Real > dxidx_map
Map for partial derivatives: d(xi)/d(x).
const std::vector< std::vector< Real > > & get_d2psidxideta() const
bool calculate_xyz
Should we calculate physical point locations?
Real dxdzeta_map(const unsigned int p) const
Used in FEMap::compute_map(), which should be be usable in derived classes, and therefore protected...
std::vector< Real > dxidy_map
Map for partial derivatives: d(xi)/d(y).
const std::vector< Real > & get_jacobian() const
Real dydzeta_map(const unsigned int p) const
Used in FEMap::compute_map(), which should be be usable in derived classes, and therefore protected...
const std::vector< Real > & get_dxidx() const
std::vector< Real > curvatures
The mean curvature (= one half the sum of the principal curvatures) on the boundary at the quadrature...
const std::vector< RealGradient > & get_d2xyzdxi2() const
const std::vector< Real > & get_dzetady() const
const std::vector< Real > & get_JxW() const
std::vector< std::vector< Real > > d2psidxi2_map
Map for the second derivatives (in xi) of the side shape functions.
const std::vector< Real > & get_dxidy() const
std::vector< const Node * > _elem_nodes
Work vector for compute_affine_map()
std::vector< std::vector< Real > > & get_d2psidxi2()
void init_reference_to_physical_map(const std::vector< Point > &qp, const Elem *elem)
std::vector< Real > JxW
Jacobian*Weight values at quadrature points.
std::vector< std::vector< Real > > d2phidxideta_map
Map for the second derivative, d^2(phi)/d(xi)d(eta).
const std::vector< Point > & get_xyz() const
const std::vector< RealGradient > & get_d2xyzdetadzeta() const
std::vector< Point > normals
Normal vectors on boundary at quadrature points.
std::vector< Point > xyz
The spatial locations of the quadrature points.
const std::vector< Real > & get_dzetadz() const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real dydeta_map(const unsigned int p) const
Used in FEMap::compute_map(), which should be be usable in derived classes, and therefore protected...
std::vector< std::vector< Real > > & get_d2phidzeta2_map()
const std::vector< Real > & get_detady() const
virtual void compute_null_map(const unsigned int dim, const std::vector< Real > &qw)
Assign a fake jacobian and some other additional data fields.
static Point map(const unsigned int dim, const Elem *elem, const Point &reference_point)
std::vector< std::vector< Real > > dpsidxi_map
Map for the derivative of the side functions, d(psi)/d(xi).
std::vector< Real > detady_map
Map for partial derivatives: d(eta)/d(y).
const std::vector< RealGradient > & get_d2xyzdzeta2() const
const std::vector< std::vector< Real > > & get_dphidxi_map() const
std::vector< std::vector< Point > > tangents
Tangent vectors on boundary at quadrature points.
void print_xyz(std::ostream &os) const
Prints the spatial location of each quadrature point (on the physical element).
std::vector< std::vector< Real > > & get_dpsideta()
std::vector< RealGradient > dxyzdeta_map
Vector of partial derivatives: d(x)/d(eta), d(y)/d(eta), d(z)/d(eta)
void resize_quadrature_map_vectors(const unsigned int dim, unsigned int n_qp)
A utility function for use by compute_*_map.
static Point map_deriv(const unsigned int dim, const Elem *elem, const unsigned int j, const Point &reference_point)
std::vector< std::vector< Real > > & get_psi()
Real dxdxi_map(const unsigned int p) const
Used in FEMap::compute_map(), which should be be usable in derived classes, and therefore protected...
const std::vector< RealGradient > & get_dxyzdeta() const
void determine_calculations()
Determine which values are to be calculated.
const std::vector< RealGradient > & get_d2xyzdxidzeta() const
Real dydxi_map(const unsigned int p) const
Used in FEMap::compute_map(), which should be be usable in derived classes, and therefore protected...
virtual void compute_face_map(int dim, const std::vector< Real > &qw, const Elem *side)
Same as compute_map, but for a side.
std::vector< Real > jac
Jacobian values at quadrature points.
FEFamily
defines an enum for finite element families.
std::vector< Real > detadz_map
Map for partial derivatives: d(eta)/d(z).
std::vector< std::vector< Real > > d2phidzeta2_map
Map for the second derivative, d^2(phi)/d(zeta)^2.
std::vector< std::vector< Real > > & get_phi_map()
void print_JxW(std::ostream &os) const
Prints the Jacobian times the weight for each quadrature point.
const std::vector< std::vector< Real > > & get_d2xidxyz2() const
Second derivatives of "xi" reference coordinate wrt physical coordinates.
std::vector< std::vector< Real > > d2phidxi2_map
Map for the second derivative, d^2(phi)/d(xi)^2.
Class contained in FE that encapsulates mapping (i.e.
const std::vector< RealGradient > & get_d2xyzdxideta() const
A Point defines a location in LIBMESH_DIM dimensional Real space.
std::vector< Real > detadx_map
Map for partial derivatives: d(eta)/d(x).
void compute_single_point_map(const unsigned int dim, const std::vector< Real > &qw, const Elem *elem, unsigned int p, const std::vector< const Node *> &elem_nodes, bool compute_second_derivatives)
Compute the jacobian and some other additional data fields at the single point with index p...
std::vector< std::vector< Real > > dphideta_map
Map for the derivative, d(phi)/d(eta).
std::vector< std::vector< Real > > & get_dphideta_map()
void add_calculations()
Allows the user to prerequest additional calculations in between two calls to reinit();.
const std::vector< std::vector< Real > > & get_d2psideta2() const
void init_face_shape_functions(const std::vector< Point > &qp, const Elem *side)
Initializes the reference to physical element map for a side.
const std::vector< Real > & get_detadx() const
static FEFamily map_fe_type(const Elem &elem)
std::vector< RealGradient > d2xyzdxidzeta_map
Vector of second partial derivatives in xi-zeta: d^2(x)/d(xi)d(zeta), d^2(y)/d(xi)d(zeta), d^2(z)/d(xi)d(zeta)
Real jacobian_tolerance
The Jacobian tolerance used for determining when the mapping fails.