libMesh
inf_fe.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2026 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 
19 
20 #ifndef LIBMESH_INF_FE_H
21 #define LIBMESH_INF_FE_H
22 
23 #include "libmesh/libmesh_config.h"
24 
25 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
26 
27 // Local includes
28 #include "libmesh/fe_base.h"
29 #include "libmesh/inf_fe_map.h"
30 
31 // C++ includes
32 #include <cstddef>
33 
34 namespace libMesh
35 {
36 
37 
38 // forward declarations
39 class Elem;
40 class FEComputeData;
41 
42 
54 {
55 private:
56 
61 
62 public:
63 
68  static Real decay (const unsigned int dim, const Real v);
69 
74  static Real decay_deriv (const unsigned int dim, const Real);
75 
82  static Real D (const Real v) { return (1.-v)*(1.-v)/4.; }
83 
84  static Real Dxr_sq (const Real /*v*/) { return 1.; }
85 
90  static Real D_deriv (const Real v) { return (v-1.)/2.; }
91 
92 
97  static Order mapping_order() { return FIRST; }
98 
113  static unsigned int n_dofs (const Order o_radial)
114  { return static_cast<unsigned int>(o_radial)+1; }
115 
125  static unsigned int n_dofs_at_node (const Order o_radial,
126  const unsigned int n_onion);
127 
136  static unsigned int n_dofs_per_elem (const Order o_radial)
137  { return static_cast<unsigned int>(o_radial)+1; }
138 
139 };
140 
141 
142 
152 {
153 private:
154 
159 
160 public:
161 
168  static std::unique_ptr<const Elem> build_elem (const Elem * inf_elem);
169 
175  static ElemType get_elem_type (const ElemType type);
176 
182  static unsigned int n_base_mapping_sf (const Elem & base_elem,
183  const Order base_mapping_order);
184 
185 };
186 
187 
188 
223 template <unsigned int Dim, FEFamily T_radial, InfMapType T_map>
224 class InfFE : public FEBase
225 {
226 
227  /*
228  * Protect the nested class
229  */
230 protected:
231 
232 
233 public:
234 
235  // InfFE continued
236 
250  explicit
251  InfFE(const FEType & fet);
252  ~InfFE() = default;
253 
254  // The static public members for access from FEInterface etc
255 
268  static Real shape(const FEType & fet,
269  const ElemType t,
270  const unsigned int i,
271  const Point & p);
272 
285  static Real shape(const FEType & fet,
286  const Elem * elem,
287  const unsigned int i,
288  const Point & p);
289 
302  static Real shape(const FEType fet,
303  const Elem * elem,
304  const unsigned int i,
305  const Point & p,
306  const bool add_p_level);
307 
320  static Real shape_deriv (const FEType & fet,
321  const Elem * inf_elem,
322  const unsigned int i,
323  const unsigned int j,
324  const Point & p);
325 
338  static Real shape_deriv (const FEType fet,
339  const Elem * inf_elem,
340  const unsigned int i,
341  const unsigned int j,
342  const Point & p,
343  const bool add_p_level);
344 
357  static Real shape_deriv (const FEType & fet,
358  const ElemType inf_elem_type,
359  const unsigned int i,
360  const unsigned int j,
361  const Point & p);
362 
373  static void compute_data(const FEType & fe_t,
374  const Elem * inf_elem,
375  FEComputeData & data);
376 
381  static unsigned int n_shape_functions (const FEType & fet,
382  const Elem * inf_elem)
383  { return n_dofs(fet, inf_elem); }
384 
391  static unsigned int n_dofs(const FEType & fet,
392  const Elem * inf_elem);
393 
394 #ifdef LIBMESH_ENABLE_DEPRECATED
395 
399  static unsigned int n_dofs_at_node(const FEType & fet,
400  const ElemType inf_elem_type,
401  const unsigned int n);
402 #endif // LIBMESH_ENABLE_DEPRECATED
403 
408  static unsigned int n_dofs_at_node(const FEType & fet,
409  const Elem * inf_elem,
410  const unsigned int n);
411 
412 #ifdef LIBMESH_ENABLE_DEPRECATED
413 
420  static unsigned int n_dofs_per_elem(const FEType & fet,
421  const ElemType inf_elem_type);
422 #endif // LIBMESH_ENABLE_DEPRECATED
423 
428  static unsigned int n_dofs_per_elem(const FEType & fet,
429  const Elem * inf_elem);
430 
434  virtual FEContinuity get_continuity() const override
435  { return C_ZERO; } // FIXME - is this true??
436 
441  virtual bool is_hierarchic() const override
442  { return false; } // FIXME - Inf FEs don't handle p elevation yet
443 
451  static void nodal_soln(const FEType & fet,
452  const Elem * elem,
453  const std::vector<Number> & elem_soln,
454  std::vector<Number> & nodal_soln);
455 
456 
457  static Point map (const Elem * inf_elem,
458  const Point & reference_point)
459  {
460  // libmesh_deprecated(); // soon
461  return InfFEMap::map(Dim, inf_elem, reference_point);
462  }
463 
464 
465  static Point inverse_map (const Elem * elem,
466  const Point & p,
467  const Real tolerance = TOLERANCE,
468  const bool secure = true)
469  {
470  // libmesh_deprecated(); // soon
471  return InfFEMap::inverse_map(Dim, elem, p, tolerance, secure);
472  }
473 
474 
475  static void inverse_map (const Elem * elem,
476  const std::vector<Point> & physical_points,
477  std::vector<Point> & reference_points,
478  const Real tolerance = TOLERANCE,
479  const bool secure = true)
480  {
481  // libmesh_deprecated(); // soon
482  return InfFEMap::inverse_map(Dim, elem, physical_points,
483  reference_points, tolerance, secure);
484  }
485 
486 
487  // The workhorses of InfFE. These are often used during matrix assembly.
488 
496  virtual void reinit (const Elem * elem,
497  const std::vector<Point> * const pts = nullptr,
498  const std::vector<Real> * const weights = nullptr) override;
499 
505  virtual void reinit (const Elem * inf_elem,
506  const unsigned int s,
507  const Real tolerance = TOLERANCE,
508  const std::vector<Point> * const pts = nullptr,
509  const std::vector<Real> * const weights = nullptr) override;
510 
516  virtual void edge_reinit (const Elem * elem,
517  const unsigned int edge,
518  const Real tolerance = TOLERANCE,
519  const std::vector<Point> * const pts = nullptr,
520  const std::vector<Real> * const weights = nullptr) override;
521 
526  virtual void side_map (const Elem * /* elem */,
527  const Elem * /* side */,
528  const unsigned int /* s */,
529  const std::vector<Point> & /* reference_side_points */,
530  std::vector<Point> & /* reference_points */) override
531  {
532  libmesh_not_implemented();
533  }
534 
546  virtual void attach_quadrature_rule (QBase * q) override;
547 
552  virtual unsigned int n_shape_functions () const override
553  { return _n_total_approx_sf; }
554 
560  virtual unsigned int n_quadrature_points () const override
561  { libmesh_assert(radial_qrule); return this->_n_total_qp; }
562 
567  virtual const std::vector<Point> & get_xyz () const override
569  calculate_xyz = true; return xyz; }
570 
577  virtual const std::vector<Real> & get_JxW () const override
578  {
580  calculate_jxw = true;
581  return this->JxW;
582  }
583 
592  virtual const std::vector<Real> & get_JxWxdecay_sq () const override
594  calculate_map_scaled = true; return this->JxWxdecay;}
595 
596 
607  virtual const std::vector<std::vector<OutputShape>> & get_phi_over_decayxR () const override
609  calculate_phi_scaled = true; return phixr; }
610 
611 
617  virtual const std::vector<std::vector<OutputGradient>> & get_dphi_over_decayxR () const override
619  calculate_dphi_scaled = true; return dphixr; }
620 
621 
629  virtual const std::vector<std::vector<OutputGradient>> & get_dphi_over_decay () const override
631  calculate_dphi_scaled = true; return dphixr_sq; }
632 
633 
638  virtual const std::vector<RealGradient> & get_dxyzdxi() const override
639  { calculate_map = true; libmesh_not_implemented();}
640 
641 
646  virtual const std::vector<RealGradient> & get_dxyzdeta() const override
647  { calculate_map = true; libmesh_not_implemented();}
648 
649 
654  virtual const std::vector<RealGradient> & get_dxyzdzeta() const override
655  { calculate_map = true; libmesh_not_implemented();}
656 
657 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
658 
661  virtual const std::vector<RealGradient> & get_d2xyzdxi2() const override
662  { calculate_map = true; libmesh_not_implemented();}
666  virtual const std::vector<RealGradient> & get_d2xyzdeta2() const override
667  { calculate_map = true; libmesh_not_implemented();}
671  virtual const std::vector<RealGradient> & get_d2xyzdzeta2() const override
672  { calculate_map = true; libmesh_not_implemented();}
676  virtual const std::vector<RealGradient> & get_d2xyzdxideta() const override
677  { calculate_map = true; libmesh_not_implemented();}
681  virtual const std::vector<RealGradient> & get_d2xyzdxidzeta() const override
682  { calculate_map = true; libmesh_not_implemented();}
686  virtual const std::vector<RealGradient> & get_d2xyzdetadzeta() const override
687  { calculate_map = true; libmesh_not_implemented();}
688 #endif
689 
694  virtual const std::vector<Real> & get_dxidx() const override
696  calculate_map = true; return dxidx_map;}
697 
698 
703  virtual const std::vector<Real> & get_dxidy() const override
705  calculate_map = true; return dxidy_map;}
706 
707 
712  virtual const std::vector<Real> & get_dxidz() const override
714  calculate_map = true; return dxidz_map;}
715 
716 
721  virtual const std::vector<Real> & get_detadx() const override
723  calculate_map = true; return detadx_map;}
724 
725 
730  virtual const std::vector<Real> & get_detady() const override
732  calculate_map = true; return detady_map;}
733 
734 
739  virtual const std::vector<Real> & get_detadz() const override
741  calculate_map = true; return detadz_map;}
742 
743 
748  virtual const std::vector<Real> & get_dzetadx() const override
750  calculate_map = true; return dzetadx_map;}
751 
752 
757  virtual const std::vector<Real> & get_dzetady() const override
759  calculate_map = true; return dzetady_map;}
760 
761 
766  virtual const std::vector<Real> & get_dzetadz() const override
768  calculate_map = true; return dzetadz_map;}
769 
770 
778  virtual const std::vector<Real> & get_Sobolev_weight() const override
780  calculate_phi = true; return weight; }
781 
782 
788  virtual const std::vector<RealGradient> & get_Sobolev_dweight() const override
790  calculate_dphi = true; return dweight; }
791 
792 
793 
797  virtual const std::vector<std::vector<Point>> & get_tangents() const override
799  calculate_map = true; return tangents; }
800 
804  virtual const std::vector<Point> & get_normals() const override
806  calculate_map = true; return normals; }
807 
808 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
809 
812  virtual const std::vector<Real> & get_curvatures() const override
813  { calculate_map = true; libmesh_not_implemented();}
814 #endif
815 
821  virtual const std::vector<Real> & get_Sobolev_weightxR_sq() const override
823  calculate_phi_scaled = true; return weightxr_sq; }
824 
825 
832  virtual const std::vector<RealGradient> & get_Sobolev_dweightxR_sq() const override
834  calculate_dphi_scaled = true; return dweightxr_sq; }
835 
836 
837 #ifdef LIBMESH_ENABLE_AMR
838 
844  static void inf_compute_constraints (DofConstraints & constraints,
845  DofMap & dof_map,
846  const unsigned int variable_number,
847  const Elem * child_elem);
848 #endif
849 
850 #ifdef LIBMESH_ENABLE_NODE_CONSTRAINTS
851  static void inf_compute_node_constraints (NodeConstraints & constraints,
852  const Elem * elem);
853 #endif
854 
855 
856 protected:
857 
858  // static members used by the workhorses
859 
876  static Real eval(Real v,
877  Order o_radial,
878  unsigned int i);
879 
885  static Real eval_deriv(Real v,
886  Order o_radial,
887  unsigned int i);
888 
889 
890 
891  // Non-static members used by the workhorses
892 
897  void update_base_elem (const Elem * inf_elem);
898 
902  virtual void init_base_shape_functions(const std::vector<Point> &,
903  const Elem *) override
904  { libmesh_not_implemented(); }
905 
910  virtual void determine_calculations() override;
911 
917  void init_radial_shape_functions(const Elem * inf_elem,
918  const std::vector<Point> * radial_pts = nullptr);
919 
926  void init_shape_functions(const std::vector<Point> & radial_qp,
927  const std::vector<Point> & base_qp,
928  const Elem * inf_elem);
929 
934  void init_face_shape_functions (const std::vector<Point> &,
935  const Elem * inf_side);
936 
947  void compute_shape_functions(const Elem * inf_elem,
948  const std::vector<Point> & base_qp,
949  const std::vector<Point> & radial_qp);
950 
951  void compute_face_functions();
952 
957  virtual void compute_shape_functions(const Elem *, const std::vector<Point> & ) override
958  {
959  //FIXME: it seems this function cannot be left out because
960  // it is pure virtual in \p FEBase
961  libmesh_not_implemented();
962  }
963 
967  mutable bool calculate_map_scaled;
968 
972  mutable bool calculate_phi_scaled;
973 
977  mutable bool calculate_dphi_scaled;
978 
979 
983  mutable bool calculate_xyz;
984 
985 
990  mutable bool calculate_jxw;
991 
992  // Miscellaneous static members
993 
1000  static void compute_node_indices (const ElemType inf_elem_type,
1001  const unsigned int outer_node_index,
1002  unsigned int & base_node,
1003  unsigned int & radial_node);
1004 
1013  static void compute_node_indices_fast (const ElemType inf_elem_type,
1014  const unsigned int outer_node_index,
1015  unsigned int & base_node,
1016  unsigned int & radial_node);
1017 
1018 #ifdef LIBMESH_ENABLE_DEPRECATED
1019  /*
1020  * \deprecated Call the version of this function that takes an Elem * instead.
1021  */
1022  static void compute_shape_indices (const FEType & fet,
1023  const ElemType inf_elem_type,
1024  const unsigned int i,
1025  unsigned int & base_shape,
1026  unsigned int & radial_shape);
1027 #endif // LIBMESH_ENABLE_DEPRECATED
1028 
1035  static void compute_shape_indices (const FEType & fet,
1036  const Elem * inf_elem,
1037  const unsigned int i,
1038  unsigned int & base_shape,
1039  unsigned int & radial_shape);
1040 
1046  std::vector<Point> xyz;
1047 
1048  std::vector<Real> weightxr_sq;
1055  std::vector<Real> dweightdv;
1056 
1057  std::vector<RealGradient> dweightxr_sq;
1058 
1066  std::vector<Real> som;
1071  std::vector<Real> dsomdv;
1072 
1077  std::vector<std::vector<Real>> mode;
1078 
1083  std::vector<std::vector<Real>> dmodedv;
1084 
1085  // mapping of reference element to physical element
1086  // These vectors usually belong to \p this->fe_map
1087  // but for infinite elements, \p FEMap cannot
1088  // compute them.
1089  std::vector<Real> dxidx_map;
1090  std::vector<Real> dxidy_map;
1091  std::vector<Real> dxidz_map;
1092  std::vector<Real> detadx_map;
1093  std::vector<Real> detady_map;
1094  std::vector<Real> detadz_map;
1095  std::vector<Real> dzetadx_map;
1096  std::vector<Real> dzetady_map;
1097  std::vector<Real> dzetadz_map;
1098 
1099  // scaled mapping: Similar to the above
1100  // vectors, but scaled by radial (infinite) coordinate.
1101  std::vector<Real> dxidx_map_scaled;
1102  std::vector<Real> dxidy_map_scaled;
1103  std::vector<Real> dxidz_map_scaled;
1104  std::vector<Real> detadx_map_scaled;
1105  std::vector<Real> detady_map_scaled;
1106  std::vector<Real> detadz_map_scaled;
1107  std::vector<Real> dzetadx_map_scaled;
1108  std::vector<Real> dzetady_map_scaled;
1109  std::vector<Real> dzetadz_map_scaled;
1110 
1111 
1112  // respectively weighted shape functions.
1113  //FIXME: these names are correct only in 3D
1114  // but avoid long and clumbsy names...
1115  std::vector<std::vector<Real>> phixr;
1116  std::vector<std::vector<RealGradient>> dphixr;
1117  std::vector<std::vector<RealGradient>> dphixr_sq;
1118 
1119  std::vector<Real> JxWxdecay;
1120  std::vector<Real> JxW;
1121 
1122  std::vector<Point> normals;
1123  std::vector<std::vector<Point>> tangents;
1124 
1125  // numbering scheme maps
1126 
1135  std::vector<unsigned int> _radial_node_index;
1136 
1145  std::vector<unsigned int> _base_node_index;
1146 
1155  std::vector<unsigned int> _radial_shape_index;
1156 
1165  std::vector<unsigned int> _base_shape_index;
1166 
1167  // some more protected members
1168 
1173  unsigned int _n_total_approx_sf;
1174 
1179  std::vector<Real> _total_qrule_weights;
1180 
1185  std::unique_ptr<QBase> base_qrule;
1186 
1191  std::unique_ptr<QBase> radial_qrule;
1192 
1198  std::unique_ptr<const Elem> base_elem;
1199 
1206  std::unique_ptr<FEBase> base_fe;
1207 
1217 
1218 
1219 private:
1220 
1224  virtual bool shapes_need_reinit() const override;
1225 
1234 
1235 
1236 #ifdef DEBUG
1237 
1242  static bool _warned_for_shape;
1243  static bool _warned_for_dshape;
1244 
1245 #endif
1246 
1252  template <unsigned int friend_Dim, FEFamily friend_T_radial, InfMapType friend_T_map>
1253  friend class InfFE;
1254 
1255  friend class InfFEMap;
1256 };
1257 
1258 
1259 
1260 // InfFERadial class inline members
1261 // FIXME: decay in 3D is a/r
1262 // thus, this function fixes the mapping v<->r explicitly.
1263 // This is consistent with the current InfFEMap, which, however, is
1264 // written such that more general mappings can be implemented.
1265 inline
1266 Real InfFERadial::decay(const unsigned int dim, const Real v)
1267 {
1268  switch (dim)
1269  {
1270  case 3:
1271  return (1.-v)/2.;
1272 
1273  case 2:
1274  // according to P. Bettess "Infinite Elements",
1275  // the 2D case is rather tricky:
1276  // - the sqrt() requires special integration rules
1277  // if not both trial- and test function are involved
1278  // - the analytic solutions contain not only the sqrt, but
1279  // also a polynomial with rather many terms, so convergence
1280  // might be bad.
1281  return sqrt((1.-v)/2.);
1282 
1283  case 1:
1284  return 1.;
1285 
1286  default:
1287  libmesh_error_msg("Invalid dim = " << dim);
1288  }
1289 }
1290 
1291 inline
1292 Real InfFERadial::decay_deriv (const unsigned int dim, const Real v)
1293 {
1294  switch (dim)
1295  {
1296  case 3:
1297  return -0.5;
1298 
1299  case 2:
1300  // according to P. Bettess "Infinite Elements",
1301  // the 2D case is rather tricky:
1302  // - the sqrt() requires special integration rules
1303  // if not both trial- and test function are involved
1304  // - the analytic solutions contain not only the sqrt, but
1305  // also a polynomial with rather many terms, so convergence
1306  // might be bad.
1307 
1308  libmesh_assert (-1.-1.e-5 <= v && v < 1.);
1309  return -0.25/sqrt(1.-v);
1310 
1311  case 1:
1312  return 0.;
1313 
1314  default:
1315  libmesh_error_msg("Invalid dim = " << dim);
1316  }
1317 }
1318 
1319 } // namespace libMesh
1320 
1321 
1322 #endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1323 
1324 
1325 #endif // LIBMESH_INF_FE_H
std::vector< Real > weightxr_sq
Definition: inf_fe.h:1048
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
Definition: inf_fe.h:1094
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
Definition: fe_type.h:196
std::vector< Real > dxidx_map
Definition: inf_fe.h:1089
bool calculate_map_scaled
Are we calculating scaled mapping functions?
Definition: inf_fe.h:967
virtual void determine_calculations() override
Determine which values are to be calculated, for both the FE itself and for the FEMap.
Definition: inf_fe.C:329
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
Definition: inf_fe.h:638
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.
Definition: fe_abstract.h:774
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>.
Definition: inf_fe.h:902
virtual const std::vector< std::vector< Point > > & get_tangents() const override
Definition: inf_fe.h:797
static Point map(const Elem *inf_elem, const Point &reference_point)
Definition: inf_fe.h:457
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.
Definition: inf_fe.h:1071
static bool _warned_for_shape
Definition: inf_fe.h:1242
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:666
Order
defines an enum for polynomial orders.
Definition: enum_order.h:40
bool calculate_phi
Should we calculate shape functions?
Definition: fe_abstract.h:691
A specific instantiation of the FEBase class.
Definition: fe.h:42
static unsigned int n_dofs(const Order o_radial)
Definition: inf_fe.h:113
std::vector< Real > detadx_map_scaled
Definition: inf_fe.h:1104
static unsigned int n_dofs_per_elem(const Order o_radial)
Definition: inf_fe.h:136
bool calculate_phi_scaled
Are we calculating scaled shape functions?
Definition: inf_fe.h:972
static unsigned int n_dofs_at_node(const FEType &fet, const ElemType inf_elem_type, const unsigned int n)
Definition: inf_fe_static.C:84
static Point map(const unsigned int dim, const Elem *inf_elem, const Point &reference_point)
Definition: inf_fe_map.C:40
std::vector< Real > dzetadz_map
Definition: inf_fe.h:1097
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.
Definition: inf_fe.h:1055
static Real decay_deriv(const unsigned int dim, const Real)
Definition: inf_fe.h:1292
std::vector< Real > dxidx_map_scaled
Definition: inf_fe.h:1101
static constexpr Real TOLERANCE
std::vector< Real > dzetady_map
Definition: inf_fe.h:1096
unsigned int dim
std::vector< std::vector< Real > > phixr
Definition: inf_fe.h:1115
virtual const std::vector< RealGradient > & get_dxyzdeta() const override
Definition: inf_fe.h:646
std::vector< Real > dxidz_map
Definition: inf_fe.h:1091
static Real Dxr_sq(const Real)
Definition: inf_fe.h:84
std::unique_ptr< QBase > radial_qrule
The quadrature rule for the base element associated with the current infinite element.
Definition: inf_fe.h:1191
virtual const std::vector< Real > & get_detadz() const override
Definition: inf_fe.h:739
std::vector< unsigned int > _base_node_index
The internal structure of the InfFE – tensor product of base element times radial nodes – has to be...
Definition: inf_fe.h:1145
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.
Definition: inf_fe.C:451
virtual const std::vector< RealGradient > & get_d2xyzdxi2() const override
Definition: inf_fe.h:661
This is the base class from which all geometric element types are derived.
Definition: elem.h:94
std::vector< Real > dxidy_map_scaled
Definition: inf_fe.h:1102
std::vector< Real > dxidy_map
Definition: inf_fe.h:1090
InfFEBase()
Never use an object of this type.
Definition: inf_fe.h:158
virtual const std::vector< RealGradient > & get_d2xyzdzeta2() const override
Definition: inf_fe.h:671
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...
Definition: inf_fe.h:957
std::vector< Real > detadx_map
Definition: inf_fe.h:1092
std::vector< Real > weight
Used for certain infinite element families: the additional radial weight in local coordinates...
Definition: fe_base.h:767
virtual const std::vector< Real > & get_dxidx() const override
Definition: inf_fe.h:694
Class that encapsulates mapping (i.e.
Definition: inf_fe_map.h:47
The Node constraint storage format.
Definition: dof_map.h:156
static Real shape(const FEType &fet, const ElemType t, const unsigned int i, const Point &p)
std::vector< Real > detady_map_scaled
Definition: inf_fe.h:1105
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)
Definition: inf_fe_map.C:96
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
Definition: inf_fe.h:434
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...
Definition: inf_fe.h:1077
This nested class contains most of the static methods related to the base part of an infinite element...
Definition: inf_fe.h:151
void compute_face_functions()
virtual const std::vector< Real > & get_dzetady() const override
Definition: inf_fe.h:757
std::vector< Real > dzetady_map_scaled
Definition: inf_fe.h:1108
std::vector< RealGradient > dweightxr_sq
Definition: inf_fe.h:1057
std::vector< std::vector< RealGradient > > dphixr
Definition: inf_fe.h:1116
static Real D(const Real v)
Definition: inf_fe.h:82
static bool _warned_for_dshape
Definition: inf_fe.h:1243
~InfFE()=default
This class handles the numbering of degrees of freedom on a mesh.
Definition: dof_map.h:179
virtual const std::vector< Real > & get_dzetadz() const override
Definition: inf_fe.h:766
bool calculate_xyz
Are we calculating the positions of quadrature points?
Definition: inf_fe.h:983
std::vector< Real > detadz_map_scaled
Definition: inf_fe.h:1106
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
Definition: inf_fe.h:1119
bool calculate_jxw
Are we calculating the unscaled jacobian? We avoid it if not requested explicitly; this has the worst...
Definition: inf_fe.h:990
friend class InfFE
Make all InfFE<Dim,T_radial,T_map> classes friends of each other, so that the protected eval() may be...
Definition: inf_fe.h:1253
virtual const std::vector< Real > & get_JxWxdecay_sq() const override
Definition: inf_fe.h:592
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)
Definition: inf_fe.h:475
virtual const std::vector< Real > & get_Sobolev_weight() const override
Definition: inf_fe.h:778
virtual unsigned int n_quadrature_points() const override
Definition: inf_fe.h:560
static Order mapping_order()
Definition: inf_fe.h:97
std::unique_ptr< FEBase > base_fe
Have a FE<Dim-1,T_base> handy for base approximation.
Definition: inf_fe.h:1206
std::vector< Real > JxW
Definition: inf_fe.h:1120
virtual const std::vector< Real > & get_dxidz() const override
Definition: inf_fe.h:712
libmesh_assert(ctx)
static Real decay(const unsigned int dim, const Real v)
Definition: inf_fe.h:1266
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...
Definition: inf_fe.h:1216
virtual const std::vector< Real > & get_detadx() const override
Definition: inf_fe.h:721
virtual const std::vector< RealGradient > & get_d2xyzdxideta() const override
Definition: inf_fe.h:676
bool calculate_dphi_scaled
Are we calculating scaled shape function gradients?
Definition: inf_fe.h:977
FEGenericBase< Real > FEBase
virtual const std::vector< Real > & get_dzetadx() const override
Definition: inf_fe.h:748
virtual bool shapes_need_reinit() const override
Definition: inf_fe.C:1121
unsigned int _n_total_approx_sf
The number of total approximation shape functions for the current configuration.
Definition: inf_fe.h:1173
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.
Definition: inf_fe.C:387
std::vector< unsigned int > _radial_node_index
The internal structure of the InfFE – tensor product of base element times radial nodes – has to be...
Definition: inf_fe.h:1135
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...
Definition: inf_fe.C:753
virtual const std::vector< Real > & get_dxidy() const override
Definition: inf_fe.h:703
std::vector< Real > som
the radial decay in local coordinates.
Definition: inf_fe.h:1066
static Point inverse_map(const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: inf_fe.h:465
virtual const std::vector< std::vector< OutputGradient > > & get_dphi_over_decay() const override
Definition: inf_fe.h:629
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool calculate_dphi
Should we calculate shape function gradients?
Definition: fe_abstract.h:696
virtual const std::vector< Real > & get_Sobolev_weightxR_sq() const override
Definition: inf_fe.h:821
bool calculate_map
Are we calculating mapping functions?
Definition: fe_abstract.h:686
virtual const std::vector< RealGradient > & get_d2xyzdeta2() const override
Definition: inf_fe.h:666
std::vector< Real > dzetadx_map
Definition: inf_fe.h:1095
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.
Definition: inf_fe.h:1185
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
Definition: inf_fe.h:1103
std::vector< unsigned int > _radial_shape_index
The internal structure of the InfFE – tensor product of base element shapes times radial shapes – h...
Definition: inf_fe.h:1155
static Real D_deriv(const Real v)
Definition: inf_fe.h:90
std::vector< Point > xyz
Physical quadrature points.
Definition: inf_fe.h:1046
virtual const std::vector< RealGradient > & get_Sobolev_dweight() const override
Definition: inf_fe.h:788
std::vector< Point > normals
Definition: inf_fe.h:1122
InfFERadial()
Never use an object of this type.
Definition: inf_fe.h:60
std::vector< std::vector< RealGradient > > dphixr_sq
Definition: inf_fe.h:1117
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.
Definition: inf_fe.h:1241
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.
Definition: inf_fe.C:120
virtual const std::vector< std::vector< OutputShape > > & get_phi_over_decayxR() const override
Definition: inf_fe.h:607
virtual const std::vector< RealGradient > & get_d2xyzdetadzeta() const override
Definition: inf_fe.h:686
virtual const std::vector< Real > & get_detady() const override
Definition: inf_fe.h:730
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
Definition: inf_fe.h:577
std::vector< unsigned int > _base_shape_index
The internal structure of the InfFE – tensor product of base element shapes times radial shapes – h...
Definition: inf_fe.h:1165
std::vector< Real > dzetadz_map_scaled
Definition: inf_fe.h:1109
virtual const std::vector< std::vector< OutputGradient > > & get_dphi_over_decayxR() const override
Definition: inf_fe.h:617
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...
Definition: inf_fe.C:79
virtual const std::vector< RealGradient > & get_d2xyzdxidzeta() const override
Definition: inf_fe.h:681
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...
Definition: inf_fe.h:526
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...
Definition: inf_fe.h:1233
virtual const std::vector< Point > & get_normals() const override
Definition: inf_fe.h:804
std::vector< std::vector< Real > > dmodedv
the first local derivative of the radial approximation shapes.
Definition: inf_fe.h:1083
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:39
virtual unsigned int n_shape_functions() const override
Definition: inf_fe.h:552
virtual bool is_hierarchic() const override
Definition: inf_fe.h:441
The constraint matrix storage format.
Definition: dof_map.h:108
std::vector< std::vector< Point > > tangents
Definition: inf_fe.h:1123
The QBase class provides the basic functionality from which various quadrature rules can be derived...
Definition: quadrature.h:61
std::vector< Real > detady_map
Definition: inf_fe.h:1093
virtual const std::vector< Point > & get_xyz() const override
Definition: inf_fe.h:567
Infinite elements are in some sense directional, compared to conventional finite elements.
Definition: inf_fe.h:53
std::vector< Real > dzetadx_map_scaled
Definition: inf_fe.h:1107
std::vector< Real > _total_qrule_weights
this vector contains the combined integration weights, so that FEAbstract::compute_map() can still be...
Definition: inf_fe.h:1179
virtual const std::vector< RealGradient > & get_Sobolev_dweightxR_sq() const override
Definition: inf_fe.h:832
virtual const std::vector< Real > & get_curvatures() const override
Definition: inf_fe.h:812
static unsigned int n_shape_functions(const FEType &fet, const Elem *inf_elem)
Definition: inf_fe.h:381
void update_base_elem(const Elem *inf_elem)
Updates the protected member base_elem to the appropriate base element for the given inf_elem...
Definition: inf_fe.C:109
std::vector< RealGradient > dweight
Used for certain infinite element families: the global derivative of the additional radial weight ...
Definition: fe_base.h:760
static unsigned int n_dofs(const FEType &fet, const Elem *inf_elem)
Definition: inf_fe_static.C:66
std::unique_ptr< const Elem > base_elem
The "base" (aka non-infinite) element associated with the current infinite element.
Definition: inf_fe.h:1198
virtual const std::vector< RealGradient > & get_dxyzdzeta() const override
Definition: inf_fe.h:654