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);
223 template <
unsigned int Dim, FEFamily T_radial, InfMapType T_map>
224 class InfFE :
public FEBase 251 InfFE(
const FEType & fet);
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,
375 FEComputeData & data);
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);
402 #endif // LIBMESH_ENABLE_DEPRECATED 409 const Elem * inf_elem,
410 const unsigned int n);
412 #ifdef LIBMESH_ENABLE_DEPRECATED 422 #endif // 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);
1027 #endif // LIBMESH_ENABLE_DEPRECATED 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);
1322 #endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 1325 #endif // LIBMESH_INF_FE_H std::vector< Real > weightxr_sq
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< Real > detadz_map
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
std::vector< Real > dxidx_map
bool calculate_map_scaled
Are we calculating scaled mapping functions?
virtual void determine_calculations() override
Determine which values are to be calculated, for both the FE itself and for the FEMap.
static Real shape_deriv(const FEType &fet, const Elem *inf_elem, const unsigned int i, const unsigned int j, const Point &p)
virtual const std::vector< RealGradient > & get_dxyzdxi() const override
ElemType
Defines an enum for geometric element types.
static ElemType get_elem_type(const ElemType type)
unsigned int _n_total_qp
The total number of quadrature points for the current configuration.
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>.
virtual const std::vector< std::vector< Point > > & get_tangents() const override
static Point map(const Elem *inf_elem, const Point &reference_point)
static unsigned int n_dofs_per_elem(const FEType &fet, const ElemType inf_elem_type)
static unsigned int n_base_mapping_sf(const Elem &base_elem, const Order base_mapping_order)
std::vector< Real > dsomdv
the first local derivative of the radial decay in local coordinates.
static bool _warned_for_shape
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Order
defines an enum for polynomial orders.
bool calculate_phi
Should we calculate shape functions?
A specific instantiation of the FEBase class.
static unsigned int n_dofs(const Order o_radial)
std::vector< Real > detadx_map_scaled
static unsigned int n_dofs_per_elem(const Order o_radial)
bool calculate_phi_scaled
Are we calculating scaled shape functions?
static unsigned int n_dofs_at_node(const FEType &fet, const ElemType inf_elem_type, const unsigned int n)
static Point map(const unsigned int dim, const Elem *inf_elem, const Point &reference_point)
std::vector< Real > dzetadz_map
static Real eval_deriv(Real v, Order o_radial, unsigned int i)
std::vector< Real > dweightdv
the additional radial weight in local coordinates, over all quadrature points.
static Real decay_deriv(const unsigned int dim, const Real)
std::vector< Real > dxidx_map_scaled
static constexpr Real TOLERANCE
std::vector< Real > dzetady_map
std::vector< std::vector< Real > > phixr
virtual const std::vector< RealGradient > & get_dxyzdeta() const override
std::vector< Real > dxidz_map
static Real Dxr_sq(const Real)
std::unique_ptr< QBase > radial_qrule
The quadrature rule for the base element associated with the current infinite element.
virtual const std::vector< Real > & get_detadz() const override
std::vector< unsigned int > _base_node_index
The internal structure of the InfFE – tensor product of base element times radial nodes – has to be...
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, etc.
virtual const std::vector< RealGradient > & get_d2xyzdxi2() const override
This is the base class from which all geometric element types are derived.
std::vector< Real > dxidy_map_scaled
std::vector< Real > dxidy_map
InfFEBase()
Never use an object of this type.
virtual const std::vector< RealGradient > & get_d2xyzdzeta2() 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< Real > detadx_map
std::vector< Real > weight
Used for certain infinite element families: the additional radial weight in local coordinates...
virtual const std::vector< Real > & get_dxidx() const override
Class that encapsulates mapping (i.e.
The Node constraint storage format.
static Real shape(const FEType &fet, const ElemType t, const unsigned int i, const Point &p)
std::vector< Real > detady_map_scaled
The libMesh namespace provides an interface to certain functionality in the library.
static Point inverse_map(const unsigned int dim, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
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.
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...
static std::unique_ptr< const Elem > build_elem(const Elem *inf_elem)
Build the base element of an infinite element.
virtual FEContinuity get_continuity() const override
static unsigned int n_dofs_at_node(const Order o_radial, const unsigned int n_onion)
std::vector< std::vector< Real > > mode
the radial approximation shapes in local coordinates Needed when setting up the overall shape functio...
This nested class contains most of the static methods related to the base part of an infinite element...
void compute_face_functions()
virtual const std::vector< Real > & get_dzetady() const override
std::vector< Real > dzetady_map_scaled
std::vector< RealGradient > dweightxr_sq
std::vector< std::vector< RealGradient > > dphixr
static Real D(const Real v)
static bool _warned_for_dshape
This class handles the numbering of degrees of freedom on a mesh.
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_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...
std::vector< Real > JxWxdecay
bool calculate_jxw
Are we calculating the unscaled jacobian? We avoid it if not requested explicitly; this has the worst...
friend class InfFE
Make all InfFE<Dim,T_radial,T_map> classes friends of each other, so that the protected eval() may be...
virtual const std::vector< Real > & get_JxWxdecay_sq() 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)
virtual const std::vector< Real > & get_Sobolev_weight() const override
virtual unsigned int n_quadrature_points() const override
static Order mapping_order()
std::unique_ptr< FEBase > base_fe
Have a FE<Dim-1,T_base> handy for base approximation.
virtual const std::vector< Real > & get_dxidz() const override
static Real decay(const unsigned int dim, const Real v)
static Real eval(Real v, Order o_radial, unsigned int i)
FEType current_fe_type
This FEType stores the characteristics for which the data structures phi, phi_map etc are currently i...
virtual const std::vector< Real > & get_detadx() const override
virtual const std::vector< RealGradient > & get_d2xyzdxideta() const override
bool calculate_dphi_scaled
Are we calculating scaled shape function gradients?
FEGenericBase< Real > FEBase
virtual const std::vector< Real > & get_dzetadx() const override
virtual bool shapes_need_reinit() const override
unsigned int _n_total_approx_sf
The number of total approximation shape functions for the current configuration.
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< unsigned int > _radial_node_index
The internal structure of the InfFE – tensor product of base element times radial nodes – has to be...
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< Real > & get_dxidy() const override
std::vector< Real > som
the radial decay in local coordinates.
static Point inverse_map(const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
virtual const std::vector< std::vector< OutputGradient > > & get_dphi_over_decay() const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool calculate_dphi
Should we calculate shape function gradients?
virtual const std::vector< Real > & get_Sobolev_weightxR_sq() const override
bool calculate_map
Are we calculating mapping functions?
virtual const std::vector< RealGradient > & get_d2xyzdeta2() const override
std::vector< Real > dzetadx_map
FEContinuity
defines an enum for finite element types to libmesh_assert a certain level (or type? Hcurl?) of continuity.
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.
std::unique_ptr< QBase > base_qrule
The quadrature rule for the base element associated with the current infinite element.
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)
std::vector< Real > dxidz_map_scaled
std::vector< unsigned int > _radial_shape_index
The internal structure of the InfFE – tensor product of base element shapes times radial shapes – h...
static Real D_deriv(const Real v)
std::vector< Point > xyz
Physical quadrature points.
virtual const std::vector< RealGradient > & get_Sobolev_dweight() const override
std::vector< Point > normals
InfFERadial()
Never use an object of this type.
std::vector< std::vector< RealGradient > > dphixr_sq
static void inf_compute_node_constraints(NodeConstraints &constraints, const Elem *elem)
static bool _warned_for_nodal_soln
static members that are used to issue warning messages only once.
static void compute_data(const FEType &fe_t, const Elem *inf_elem, FEComputeData &data)
Generalized version of shape(), takes an Elem *.
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< std::vector< OutputShape > > & get_phi_over_decayxR() const override
virtual const std::vector< RealGradient > & get_d2xyzdetadzeta() const override
virtual const std::vector< Real > & get_detady() const override
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.
virtual const std::vector< Real > & get_JxW() const override
std::vector< unsigned int > _base_shape_index
The internal structure of the InfFE – tensor product of base element shapes times radial shapes – h...
std::vector< Real > dzetadz_map_scaled
virtual const std::vector< std::vector< OutputGradient > > & get_dphi_over_decayxR() const override
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< RealGradient > & get_d2xyzdxidzeta() const override
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...
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...
virtual const std::vector< Point > & get_normals() const override
std::vector< std::vector< Real > > dmodedv
the first local derivative of the radial approximation shapes.
A Point defines a location in LIBMESH_DIM dimensional Real space.
virtual unsigned int n_shape_functions() const override
virtual bool is_hierarchic() const override
The constraint matrix storage format.
std::vector< std::vector< Point > > tangents
The QBase class provides the basic functionality from which various quadrature rules can be derived...
std::vector< Real > detady_map
virtual const std::vector< Point > & get_xyz() const override
Infinite elements are in some sense directional, compared to conventional finite elements.
std::vector< Real > dzetadx_map_scaled
std::vector< Real > _total_qrule_weights
this vector contains the combined integration weights, so that FEAbstract::compute_map() can still be...
virtual const std::vector< RealGradient > & get_Sobolev_dweightxR_sq() const override
virtual const std::vector< Real > & get_curvatures() const override
static unsigned int n_shape_functions(const FEType &fet, const Elem *inf_elem)
void update_base_elem(const Elem *inf_elem)
Updates the protected member base_elem to the appropriate base element for the given inf_elem...
std::vector< RealGradient > dweight
Used for certain infinite element families: the global derivative of the additional radial weight ...
static unsigned int n_dofs(const FEType &fet, const Elem *inf_elem)
std::unique_ptr< const Elem > base_elem
The "base" (aka non-infinite) element associated with the current infinite element.
virtual const std::vector< RealGradient > & get_dxyzdzeta() const override