20#ifndef LIBMESH_INF_FE_H
21#define LIBMESH_INF_FE_H
23#include "libmesh/libmesh_config.h"
25#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
28#include "libmesh/fe_base.h"
29#include "libmesh/inf_fe_map.h"
82 static Real D (
const Real v) {
return (1.-v)*(1.-v)/4.; }
114 {
return static_cast<unsigned int>(o_radial)+1; }
126 const unsigned int n_onion);
137 {
return static_cast<unsigned int>(o_radial)+1; }
168 static std::unique_ptr<const Elem>
build_elem (
const Elem * inf_elem);
183 const Order base_mapping_order);
223template <
unsigned int Dim, FEFamily T_radial, InfMapType T_map>
270 const unsigned int i,
287 const unsigned int i,
304 const unsigned int i,
306 const bool add_p_level);
321 const Elem * inf_elem,
322 const unsigned int i,
323 const unsigned int j,
339 const Elem * inf_elem,
340 const unsigned int i,
341 const unsigned int j,
343 const bool add_p_level);
359 const unsigned int i,
360 const unsigned int j,
374 const Elem * inf_elem,
382 const Elem * inf_elem)
383 {
return n_dofs(fet, inf_elem); }
392 const Elem * inf_elem);
394#ifdef LIBMESH_ENABLE_DEPRECATED
401 const unsigned int n);
409 const Elem * inf_elem,
410 const unsigned int n);
412#ifdef LIBMESH_ENABLE_DEPRECATED
429 const Elem * inf_elem);
453 const std::vector<Number> & elem_soln,
458 const Point & reference_point)
468 const bool secure =
true)
476 const std::vector<Point> & physical_points,
477 std::vector<Point> & reference_points,
479 const bool secure =
true)
483 reference_points, tolerance, secure);
497 const std::vector<Point> *
const pts =
nullptr,
498 const std::vector<Real> *
const weights =
nullptr)
override;
506 const unsigned int s,
508 const std::vector<Point> *
const pts =
nullptr,
509 const std::vector<Real> *
const weights =
nullptr)
override;
517 const unsigned int edge,
519 const std::vector<Point> *
const pts =
nullptr,
520 const std::vector<Real> *
const weights =
nullptr)
override;
529 const std::vector<Point> & ,
530 std::vector<Point> & )
override
532 libmesh_not_implemented();
567 virtual const std::vector<Point> &
get_xyz ()
const override
577 virtual const std::vector<Real> &
get_JxW ()
const override
638 virtual const std::vector<RealGradient> &
get_dxyzdxi()
const override
646 virtual const std::vector<RealGradient> &
get_dxyzdeta()
const override
657#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
694 virtual const std::vector<Real> &
get_dxidx()
const override
703 virtual const std::vector<Real> &
get_dxidy()
const override
712 virtual const std::vector<Real> &
get_dxidz()
const override
721 virtual const std::vector<Real> &
get_detadx()
const override
730 virtual const std::vector<Real> &
get_detady()
const override
739 virtual const std::vector<Real> &
get_detadz()
const override
797 virtual const std::vector<std::vector<Point>> &
get_tangents()
const override
808#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
837#ifdef LIBMESH_ENABLE_AMR
846 const unsigned int variable_number,
847 const Elem * child_elem);
850#ifdef LIBMESH_ENABLE_NODE_CONSTRAINTS
903 const Elem *)
override
904 { libmesh_not_implemented(); }
918 const std::vector<Point> * radial_pts =
nullptr);
927 const std::vector<Point> & base_qp,
928 const Elem * inf_elem);
935 const Elem * inf_side);
948 const std::vector<Point> & base_qp,
949 const std::vector<Point> & radial_qp);
961 libmesh_not_implemented();
1001 const unsigned int outer_node_index,
1002 unsigned int & base_node,
1003 unsigned int & radial_node);
1014 const unsigned int outer_node_index,
1015 unsigned int & base_node,
1016 unsigned int & radial_node);
1018#ifdef LIBMESH_ENABLE_DEPRECATED
1024 const unsigned int i,
1025 unsigned int & base_shape,
1026 unsigned int & radial_shape);
1036 const Elem * inf_elem,
1037 const unsigned int i,
1038 unsigned int & base_shape,
1039 unsigned int & radial_shape);
1077 std::vector<std::vector<Real>>
mode;
1116 std::vector<std::vector<RealGradient>>
dphixr;
1252 template <
unsigned int friend_Dim, FEFamily friend_T_radial, InfMapType friend_T_map>
1281 return sqrt((1.-v)/2.);
1287 libmesh_error_msg(
"Invalid dim = " <<
dim);
1309 return -0.25/sqrt(1.-v);
1315 libmesh_error_msg(
"Invalid dim = " <<
dim);
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.
bool calculate_map
Are we calculating mapping functions?
bool calculate_phi
Should we calculate shape functions?
bool calculate_dphi
Should we calculate shape function gradients?
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
unsigned int _n_total_qp
The total number of quadrature points for the current configuration.
class FEComputeData hides arbitrary data to be passed to and from children of FEBase through the FEIn...
This class forms the foundation from which generic finite elements may be derived.
std::vector< Real > weight
Used for certain infinite element families: the additional radial weight in local coordinates,...
std::vector< RealGradient > dweight
Used for certain infinite element families: the global derivative of the additional radial weight ,...
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
This nested class contains most of the static methods related to the base part of an infinite element...
static unsigned int n_base_mapping_sf(const Elem &base_elem, const Order base_mapping_order)
InfFEBase()
Never use an object of this type.
static ElemType get_elem_type(const ElemType type)
static std::unique_ptr< const Elem > build_elem(const Elem *inf_elem)
Build the base element of an infinite element.
Class that encapsulates mapping (i.e.
static Point inverse_map(const unsigned int dim, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
static Point map(const unsigned int dim, const Elem *inf_elem, const Point &reference_point)
Infinite elements are in some sense directional, compared to conventional finite elements.
static Real D(const Real v)
static Real D_deriv(const Real v)
static Real decay_deriv(const unsigned int dim, const Real)
static unsigned int n_dofs_per_elem(const Order o_radial)
static Real Dxr_sq(const Real)
static unsigned int n_dofs_at_node(const Order o_radial, const unsigned int n_onion)
static Order mapping_order()
InfFERadial()
Never use an object of this type.
static unsigned int n_dofs(const Order o_radial)
static Real decay(const unsigned int dim, const Real v)
A specific instantiation of the FEBase class.
std::vector< Real > dzetady_map
void init_radial_shape_functions(const Elem *inf_elem, const std::vector< Point > *radial_pts=nullptr)
Some of the member data only depend on the radial part of the infinite element.
std::vector< Real > dzetadx_map
void init_face_shape_functions(const std::vector< Point > &, const Elem *inf_side)
Initialize all the data fields like weight, phi, etc for the side s.
virtual const std::vector< Real > & get_dxidx() const override
virtual const std::vector< Real > & get_dzetadx() const override
static unsigned int n_dofs(const FEType &fet, const Elem *inf_elem)
static Point map(const Elem *inf_elem, const Point &reference_point)
virtual const std::vector< std::vector< OutputShape > > & get_phi_over_decayxR() const override
static unsigned int n_dofs_at_node(const FEType &fet, const ElemType inf_elem_type, const unsigned int n)
std::vector< Real > dsomdv
the first local derivative of the radial decay in local coordinates.
static Real eval(Real v, Order o_radial, unsigned int i)
std::vector< Real > dzetady_map_scaled
virtual const std::vector< RealGradient > & get_dxyzdeta() const override
std::vector< Real > dxidx_map
virtual const std::vector< Real > & get_curvatures() const override
std::unique_ptr< QBase > base_qrule
The quadrature rule for the base element associated with the current infinite element.
static bool _warned_for_nodal_soln
static members that are used to issue warning messages only once.
virtual unsigned int n_shape_functions() const override
std::vector< std::vector< RealGradient > > dphixr
std::vector< Real > detady_map_scaled
static void inf_compute_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *child_elem)
Computes the constraint matrix contributions (for non-conforming adapted meshes) corresponding to var...
virtual bool shapes_need_reinit() const override
std::vector< Real > dweightdv
the additional radial weight in local coordinates, over all quadrature points.
std::vector< std::vector< Real > > phixr
virtual const std::vector< RealGradient > & get_d2xyzdeta2() const override
virtual const std::vector< Real > & get_JxW() const override
virtual const std::vector< Real > & get_dxidy() const override
virtual const std::vector< RealGradient > & get_Sobolev_dweight() const override
virtual const std::vector< Real > & get_detady() const override
FEType current_fe_type
This FEType stores the characteristics for which the data structures phi, phi_map etc are currently i...
bool calculate_dphi_scaled
Are we calculating scaled shape function gradients?
static void compute_node_indices_fast(const ElemType inf_elem_type, const unsigned int outer_node_index, unsigned int &base_node, unsigned int &radial_node)
Does the same as compute_node_indices(), but stores the maps for the current element type.
std::vector< std::vector< RealGradient > > dphixr_sq
virtual const std::vector< std::vector< Point > > & get_tangents() const override
virtual const std::vector< Real > & get_detadz() const override
virtual void determine_calculations() override
Determine which values are to be calculated, for both the FE itself and for the FEMap.
static Real eval_deriv(Real v, Order o_radial, unsigned int i)
static void inf_compute_node_constraints(NodeConstraints &constraints, const Elem *elem)
std::vector< Real > detadx_map_scaled
std::vector< Real > dxidx_map_scaled
virtual const std::vector< RealGradient > & get_d2xyzdxi2() const override
static bool _warned_for_shape
std::vector< std::vector< Real > > dmodedv
the first local derivative of the radial approximation shapes.
void compute_shape_functions(const Elem *inf_elem, const std::vector< Point > &base_qp, const std::vector< Point > &radial_qp)
After having updated the jacobian and the transformation from local to global coordinates in FEAbstra...
virtual const std::vector< RealGradient > & get_dxyzdzeta() const override
std::vector< RealGradient > dweightxr_sq
std::vector< Real > dzetadz_map
static unsigned int n_shape_functions(const FEType &fet, const Elem *inf_elem)
bool calculate_jxw
Are we calculating the unscaled jacobian? We avoid it if not requested explicitly; this has the worst...
virtual const std::vector< Real > & get_dzetadz() const override
bool calculate_xyz
Are we calculating the positions of quadrature points?
std::vector< Real > detadz_map
std::vector< unsigned int > _base_node_index
The internal structure of the InfFE – tensor product of base element times radial nodes – has to be d...
virtual const std::vector< Point > & get_xyz() const override
static Real shape_deriv(const FEType &fet, const Elem *inf_elem, const unsigned int i, const unsigned int j, const Point &p)
std::vector< Real > dzetadz_map_scaled
virtual FEContinuity get_continuity() const override
std::vector< unsigned int > _radial_node_index
The internal structure of the InfFE – tensor product of base element times radial nodes – has to be d...
virtual const std::vector< RealGradient > & get_d2xyzdxidzeta() const override
static Point inverse_map(const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
std::vector< Real > dzetadx_map_scaled
virtual void attach_quadrature_rule(QBase *q) override
The use of quadrature rules with the InfFE class is somewhat different from the approach of the FE cl...
virtual const std::vector< Real > & get_JxWxdecay_sq() const override
std::vector< Point > normals
virtual const std::vector< std::vector< OutputGradient > > & get_dphi_over_decayxR() const override
unsigned int _n_total_approx_sf
The number of total approximation shape functions for the current configuration.
std::unique_ptr< QBase > radial_qrule
The quadrature rule for the base element associated with the current infinite element.
std::vector< Real > dxidz_map
static void compute_shape_indices(const FEType &fet, const ElemType inf_elem_type, const unsigned int i, unsigned int &base_shape, unsigned int &radial_shape)
virtual void reinit(const Elem *elem, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr) override
This is at the core of this class.
virtual const std::vector< Point > & get_normals() const override
virtual const std::vector< RealGradient > & get_Sobolev_dweightxR_sq() const override
std::vector< Real > detady_map
std::vector< Real > dxidy_map_scaled
virtual const std::vector< Real > & get_dzetady() const override
virtual const std::vector< RealGradient > & get_dxyzdxi() const override
static Real shape(const FEType &fet, const ElemType t, const unsigned int i, const Point &p)
virtual void init_base_shape_functions(const std::vector< Point > &, const Elem *) override
Do not use this derived member in InfFE<Dim,T_radial,T_map>.
std::vector< Real > dxidy_map
std::vector< unsigned int > _base_shape_index
The internal structure of the InfFE – tensor product of base element shapes times radial shapes – has...
virtual const std::vector< std::vector< OutputGradient > > & get_dphi_over_decay() const override
std::vector< Real > weightxr_sq
void update_base_elem(const Elem *inf_elem)
Updates the protected member base_elem to the appropriate base element for the given inf_elem.
static bool _warned_for_dshape
std::vector< Point > xyz
Physical quadrature points.
virtual void side_map(const Elem *, const Elem *, const unsigned int, const std::vector< Point > &, std::vector< Point > &) override
Computes the reference space quadrature points on the side of an element based on the side quadrature...
std::vector< Real > _total_qrule_weights
this vector contains the combined integration weights, so that FEAbstract::compute_map() can still be...
std::vector< Real > detadz_map_scaled
virtual const std::vector< RealGradient > & get_d2xyzdetadzeta() const override
static void compute_data(const FEType &fe_t, const Elem *inf_elem, FEComputeData &data)
Generalized version of shape(), takes an Elem *.
std::unique_ptr< FEBase > base_fe
Have a FE<Dim-1,T_base> handy for base approximation.
std::vector< Real > JxWxdecay
void compute_face_functions()
virtual const std::vector< Real > & get_Sobolev_weight() const override
static void compute_node_indices(const ElemType inf_elem_type, const unsigned int outer_node_index, unsigned int &base_node, unsigned int &radial_node)
Computes the indices in the base base_node and in radial direction radial_node (either 0 or 1) associ...
std::vector< std::vector< Point > > tangents
std::vector< Real > detadx_map
virtual const std::vector< Real > & get_Sobolev_weightxR_sq() const override
virtual void compute_shape_functions(const Elem *, const std::vector< Point > &) override
Use compute_shape_functions(const Elem*, const std::vector<Point> &, const std::vector<Point> &) inst...
std::vector< unsigned int > _radial_shape_index
The internal structure of the InfFE – tensor product of base element shapes times radial shapes – has...
std::unique_ptr< const Elem > base_elem
The "base" (aka non-infinite) element associated with the current infinite element.
bool calculate_map_scaled
Are we calculating scaled mapping functions?
std::vector< Real > dxidz_map_scaled
virtual const std::vector< RealGradient > & get_d2xyzdxideta() const override
friend class InfFE
Make all InfFE<Dim,T_radial,T_map> classes friends of each other, so that the protected eval() may be...
std::vector< std::vector< Real > > mode
the radial approximation shapes in local coordinates Needed when setting up the overall shape functio...
static unsigned int n_dofs_per_elem(const FEType &fet, const ElemType inf_elem_type)
virtual bool is_hierarchic() const override
static void inverse_map(const Elem *elem, const std::vector< Point > &physical_points, std::vector< Point > &reference_points, const Real tolerance=TOLERANCE, const bool secure=true)
void init_shape_functions(const std::vector< Point > &radial_qp, const std::vector< Point > &base_qp, const Elem *inf_elem)
Initialize all the data fields like weight, mode, phi, dphidxi, dphideta, dphidzeta,...
virtual const std::vector< Real > & get_dxidz() const override
virtual const std::vector< RealGradient > & get_d2xyzdzeta2() const override
std::vector< Real > som
the radial decay in local coordinates.
static ElemType _compute_node_indices_fast_current_elem_type
When compute_node_indices_fast() is used, this static variable remembers the element type for which t...
bool calculate_phi_scaled
Are we calculating scaled shape functions?
virtual unsigned int n_quadrature_points() const override
virtual const std::vector< Real > & get_detadx() const override
virtual void edge_reinit(const Elem *elem, const unsigned int edge, const Real tolerance=TOLERANCE, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr) override
Not implemented yet.
static void nodal_soln(const FEType &fet, const Elem *elem, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
Usually, this method would build the nodal soln from the element soln.
The Node constraint storage format.
A Point defines a location in LIBMESH_DIM dimensional Real space.
The QBase class provides the basic functionality from which various quadrature rules can be derived.
The libMesh namespace provides an interface to certain functionality in the library.
ElemType
Defines an enum for geometric element types.
static constexpr Real TOLERANCE
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real