libMesh::FEGenericBase< OutputType > Class Template Referenceabstract

#include <exact_error_estimator.h>

Inheritance diagram for libMesh::FEGenericBase< OutputType >:

Public Types

typedef OutputType OutputShape
 
typedef TensorTools::IncrementRank< OutputShape >::type OutputGradient
 
typedef TensorTools::IncrementRank< OutputGradient >::type OutputTensor
 
typedef TensorTools::DecrementRank< OutputShape >::type OutputDivergence
 
typedef TensorTools::MakeNumber< OutputShape >::type OutputNumber
 
typedef TensorTools::IncrementRank< OutputNumber >::type OutputNumberGradient
 
typedef TensorTools::IncrementRank< OutputNumberGradient >::type OutputNumberTensor
 
typedef TensorTools::DecrementRank< OutputNumber >::type OutputNumberDivergence
 

Public Member Functions

virtual ~FEGenericBase ()
 
const std::vector< std::vector< OutputShape > > & get_phi () const
 
const std::vector< std::vector< OutputGradient > > & get_dphi () const
 
const std::vector< std::vector< OutputShape > > & get_curl_phi () const
 
const std::vector< std::vector< OutputDivergence > > & get_div_phi () const
 
const std::vector< std::vector< OutputShape > > & get_dphidx () const
 
const std::vector< std::vector< OutputShape > > & get_dphidy () const
 
const std::vector< std::vector< OutputShape > > & get_dphidz () const
 
const std::vector< std::vector< OutputShape > > & get_dphidxi () const
 
const std::vector< std::vector< OutputShape > > & get_dphideta () const
 
const std::vector< std::vector< OutputShape > > & get_dphidzeta () const
 
const std::vector< std::vector< OutputTensor > > & get_d2phi () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidx2 () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidxdy () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidxdz () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidy2 () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidydz () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidz2 () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidxi2 () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidxideta () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidxidzeta () const
 
const std::vector< std::vector< OutputShape > > & get_d2phideta2 () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidetadzeta () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidzeta2 () const
 
const std::vector< OutputGradient > & get_dphase () const
 
const std::vector< Real > & get_Sobolev_weight () const
 
const std::vector< RealGradient > & get_Sobolev_dweight () const
 
void print_phi (std::ostream &os) const
 
void print_dphi (std::ostream &os) const
 
void print_d2phi (std::ostream &os) const
 
template<>
std::unique_ptr< FEGenericBase< Real > > build (const unsigned int dim, const FEType &fet)
 
template<>
std::unique_ptr< FEGenericBase< RealGradient > > build (const unsigned int dim, const FEType &fet)
 
template<>
std::unique_ptr< FEGenericBase< Real > > build_InfFE (const unsigned int dim, const FEType &fet)
 
template<>
std::unique_ptr< FEGenericBase< RealGradient > > build_InfFE (const unsigned int, const FEType &)
 
virtual void reinit (const Elem *elem, const std::vector< Point > *const pts=libmesh_nullptr, const std::vector< Real > *const weights=libmesh_nullptr)=0
 
virtual void reinit (const Elem *elem, const unsigned int side, const Real tolerance=TOLERANCE, const std::vector< Point > *const pts=libmesh_nullptr, const std::vector< Real > *const weights=libmesh_nullptr)=0
 
virtual void edge_reinit (const Elem *elem, const unsigned int edge, const Real tolerance=TOLERANCE, const std::vector< Point > *pts=libmesh_nullptr, const std::vector< Real > *weights=libmesh_nullptr)=0
 
virtual void side_map (const Elem *elem, const Elem *side, const unsigned int s, const std::vector< Point > &reference_side_points, std::vector< Point > &reference_points)=0
 
unsigned int get_dim () const
 
const std::vector< Point > & get_xyz () const
 
const std::vector< Real > & get_JxW () const
 
const std::vector< RealGradient > & get_dxyzdxi () const
 
const std::vector< RealGradient > & get_dxyzdeta () const
 
const std::vector< RealGradient > & get_dxyzdzeta () const
 
const std::vector< RealGradient > & get_d2xyzdxi2 () const
 
const std::vector< RealGradient > & get_d2xyzdeta2 () const
 
const std::vector< RealGradient > & get_d2xyzdzeta2 () const
 
const std::vector< RealGradient > & get_d2xyzdxideta () const
 
const std::vector< RealGradient > & get_d2xyzdxidzeta () const
 
const std::vector< RealGradient > & get_d2xyzdetadzeta () const
 
const std::vector< Real > & get_dxidx () const
 
const std::vector< Real > & get_dxidy () const
 
const std::vector< Real > & get_dxidz () const
 
const std::vector< Real > & get_detadx () const
 
const std::vector< Real > & get_detady () const
 
const std::vector< Real > & get_detadz () const
 
const std::vector< Real > & get_dzetadx () const
 
const std::vector< Real > & get_dzetady () const
 
const std::vector< Real > & get_dzetadz () const
 
const std::vector< std::vector< Point > > & get_tangents () const
 
const std::vector< Point > & get_normals () const
 
const std::vector< Real > & get_curvatures () const
 
virtual void attach_quadrature_rule (QBase *q)=0
 
virtual unsigned int n_shape_functions () const =0
 
virtual unsigned int n_quadrature_points () const =0
 
ElemType get_type () const
 
unsigned int get_p_level () const
 
FEType get_fe_type () const
 
Order get_order () const
 
void set_fe_order (int new_order)
 
virtual FEContinuity get_continuity () const =0
 
virtual bool is_hierarchic () const =0
 
FEFamily get_family () const
 
const FEMapget_fe_map () const
 
void print_JxW (std::ostream &os) const
 
void print_xyz (std::ostream &os) const
 
void print_info (std::ostream &os) const
 

Static Public Member Functions

static std::unique_ptr< FEGenericBasebuild (const unsigned int dim, const FEType &type)
 
static std::unique_ptr< FEGenericBasebuild_InfFE (const unsigned int dim, const FEType &type)
 
static void compute_proj_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
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)
 
static void coarsened_dof_values (const NumericVector< Number > &global_vector, const DofMap &dof_map, const Elem *coarse_elem, DenseVector< Number > &coarse_dofs, const bool use_old_dof_indices=false)
 
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)
 
static bool on_reference_element (const Point &p, const ElemType t, const Real eps=TOLERANCE)
 
static void get_refspace_nodes (const ElemType t, std::vector< Point > &nodes)
 
static void compute_node_constraints (NodeConstraints &constraints, const Elem *elem)
 
static void compute_periodic_node_constraints (NodeConstraints &constraints, const PeriodicBoundaries &boundaries, const MeshBase &mesh, const PointLocatorBase *point_locator, const Elem *elem)
 
static void print_info (std::ostream &out=libMesh::out)
 
static std::string get_info ()
 
static unsigned int n_objects ()
 
static void enable_print_counter_info ()
 
static void disable_print_counter_info ()
 

Protected Types

typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
 

Protected Member Functions

 FEGenericBase (const unsigned int dim, const FEType &fet)
 
virtual void init_base_shape_functions (const std::vector< Point > &qp, const Elem *e)=0
 
void determine_calculations ()
 
virtual void compute_shape_functions (const Elem *elem, const std::vector< Point > &qp)
 
virtual bool shapes_need_reinit () const =0
 
void increment_constructor_count (const std::string &name)
 
void increment_destructor_count (const std::string &name)
 

Protected Attributes

std::unique_ptr< FETransformationBase< OutputType > > _fe_trans
 
std::vector< std::vector< OutputShape > > phi
 
std::vector< std::vector< OutputGradient > > dphi
 
std::vector< std::vector< OutputShape > > curl_phi
 
std::vector< std::vector< OutputDivergence > > div_phi
 
std::vector< std::vector< OutputShape > > dphidxi
 
std::vector< std::vector< OutputShape > > dphideta
 
std::vector< std::vector< OutputShape > > dphidzeta
 
std::vector< std::vector< OutputShape > > dphidx
 
std::vector< std::vector< OutputShape > > dphidy
 
std::vector< std::vector< OutputShape > > dphidz
 
std::vector< std::vector< OutputTensor > > d2phi
 
std::vector< std::vector< OutputShape > > d2phidxi2
 
std::vector< std::vector< OutputShape > > d2phidxideta
 
std::vector< std::vector< OutputShape > > d2phidxidzeta
 
std::vector< std::vector< OutputShape > > d2phideta2
 
std::vector< std::vector< OutputShape > > d2phidetadzeta
 
std::vector< std::vector< OutputShape > > d2phidzeta2
 
std::vector< std::vector< OutputShape > > d2phidx2
 
std::vector< std::vector< OutputShape > > d2phidxdy
 
std::vector< std::vector< OutputShape > > d2phidxdz
 
std::vector< std::vector< OutputShape > > d2phidy2
 
std::vector< std::vector< OutputShape > > d2phidydz
 
std::vector< std::vector< OutputShape > > d2phidz2
 
std::vector< OutputGradientdphase
 
std::vector< RealGradientdweight
 
std::vector< Realweight
 
std::unique_ptr< FEMap_fe_map
 
const unsigned int dim
 
bool calculations_started
 
bool calculate_phi
 
bool calculate_dphi
 
bool calculate_d2phi
 
bool calculate_curl_phi
 
bool calculate_div_phi
 
bool calculate_dphiref
 
FEType fe_type
 
ElemType elem_type
 
unsigned int _p_level
 
QBaseqrule
 
bool shapes_on_quadrature
 

Static Protected Attributes

static Counts _counts
 
static Threads::atomic< unsigned int > _n_objects
 
static Threads::spin_mutex _mutex
 
static bool _enable_print_counter = true
 

Friends

template<unsigned int friend_Dim, FEFamily friend_T_radial, InfMapType friend_T_map>
class InfFE
 

Detailed Description

template<typename OutputType>
class libMesh::FEGenericBase< OutputType >

This class forms the foundation from which generic finite elements may be derived. In the current implementation the templated derived class FE offers a wide variety of commonly used finite element concepts. Check there for details.

Use the FEGenericBase<OutputType>::build() method to create an object of any of the derived classes which is compatible with OutputType.

Author
Benjamin S. Kirk
Date
2002

Definition at line 37 of file exact_error_estimator.h.

Member Typedef Documentation

typedef std::map<std::string, std::pair<unsigned int, unsigned int> > libMesh::ReferenceCounter::Counts
protectedinherited

Data structure to log the information. The log is identified by the class name.

Definition at line 119 of file reference_counter.h.

template<typename OutputType>
typedef TensorTools::DecrementRank<OutputShape>::type libMesh::FEGenericBase< OutputType >::OutputDivergence

Definition at line 123 of file fe_base.h.

template<typename OutputType>
typedef TensorTools::IncrementRank<OutputShape>::type libMesh::FEGenericBase< OutputType >::OutputGradient

Definition at line 121 of file fe_base.h.

template<typename OutputType>
typedef TensorTools::MakeNumber<OutputShape>::type libMesh::FEGenericBase< OutputType >::OutputNumber

Definition at line 124 of file fe_base.h.

template<typename OutputType>
typedef TensorTools::DecrementRank<OutputNumber>::type libMesh::FEGenericBase< OutputType >::OutputNumberDivergence

Definition at line 127 of file fe_base.h.

template<typename OutputType>
typedef TensorTools::IncrementRank<OutputNumber>::type libMesh::FEGenericBase< OutputType >::OutputNumberGradient

Definition at line 125 of file fe_base.h.

template<typename OutputType>
typedef TensorTools::IncrementRank<OutputNumberGradient>::type libMesh::FEGenericBase< OutputType >::OutputNumberTensor

Definition at line 126 of file fe_base.h.

template<typename OutputType>
typedef OutputType libMesh::FEGenericBase< OutputType >::OutputShape

Convenient typedefs for gradients of output, hessians of output, and potentially-complex-valued versions of same.

Definition at line 120 of file fe_base.h.

template<typename OutputType>
typedef TensorTools::IncrementRank<OutputGradient>::type libMesh::FEGenericBase< OutputType >::OutputTensor

Definition at line 122 of file fe_base.h.

Constructor & Destructor Documentation

template<typename OutputType >
libMesh::FEGenericBase< OutputType >::FEGenericBase ( const unsigned int  dim,
const FEType fet 
)
inlineprotected

Constructor. Optionally initializes required data structures. Protected so that this base class cannot be explicitly instantiated.

Definition at line 677 of file fe_base.h.

References libMesh::FEGenericBase< OutputType >::~FEGenericBase().

678  :
679  FEAbstract(d,fet),
681  phi(),
682  dphi(),
683  curl_phi(),
684  div_phi(),
685  dphidxi(),
686  dphideta(),
687  dphidzeta(),
688  dphidx(),
689  dphidy(),
690  dphidz()
691 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
692  ,d2phi(),
693  d2phidxi2(),
694  d2phidxideta(),
695  d2phidxidzeta(),
696  d2phideta2(),
697  d2phidetadzeta(),
698  d2phidzeta2(),
699  d2phidx2(),
700  d2phidxdy(),
701  d2phidxdz(),
702  d2phidy2(),
703  d2phidydz(),
704  d2phidz2()
705 #endif
706 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
707  ,dphase(),
708  dweight(),
709  weight()
710 #endif
711 {
712 }
713 
714 
715 
716 template <typename OutputType>
717 inline
719 {
720 }
std::vector< std::vector< OutputTensor > > d2phi
Definition: fe_base.h:552
std::vector< std::vector< OutputShape > > dphidxi
Definition: fe_base.h:519
std::vector< std::vector< OutputShape > > d2phidxdz
Definition: fe_base.h:597
std::vector< std::vector< OutputShape > > dphidzeta
Definition: fe_base.h:529
std::vector< std::vector< OutputShape > > d2phidydz
Definition: fe_base.h:607
std::unique_ptr< FETransformationBase< OutputType > > _fe_trans
Definition: fe_base.h:494
std::vector< std::vector< OutputShape > > d2phidxideta
Definition: fe_base.h:562
FEAbstract(const unsigned int dim, const FEType &fet)
Definition: fe_abstract.h:608
std::vector< Real > weight
Definition: fe_base.h:644
std::vector< std::vector< OutputShape > > d2phidx2
Definition: fe_base.h:587
std::vector< std::vector< OutputShape > > curl_phi
Definition: fe_base.h:509
std::vector< std::vector< OutputShape > > dphidy
Definition: fe_base.h:539
std::vector< std::vector< OutputShape > > d2phidy2
Definition: fe_base.h:602
std::vector< std::vector< OutputShape > > d2phidetadzeta
Definition: fe_base.h:577
std::vector< std::vector< OutputShape > > d2phidxidzeta
Definition: fe_base.h:567
static std::unique_ptr< FETransformationBase< OutputShape > > build(const FEType &type)
std::vector< std::vector< OutputShape > > d2phidxdy
Definition: fe_base.h:592
std::vector< std::vector< OutputShape > > dphidx
Definition: fe_base.h:534
std::vector< std::vector< OutputShape > > phi
Definition: fe_base.h:499
std::vector< std::vector< OutputShape > > d2phideta2
Definition: fe_base.h:572
std::vector< OutputGradient > dphase
Definition: fe_base.h:630
std::vector< std::vector< OutputDivergence > > div_phi
Definition: fe_base.h:514
std::vector< std::vector< OutputGradient > > dphi
Definition: fe_base.h:504
std::vector< std::vector< OutputShape > > d2phidz2
Definition: fe_base.h:612
std::vector< std::vector< OutputShape > > d2phidxi2
Definition: fe_base.h:557
std::vector< std::vector< OutputShape > > d2phidzeta2
Definition: fe_base.h:582
std::vector< std::vector< OutputShape > > dphidz
Definition: fe_base.h:544
std::vector< std::vector< OutputShape > > dphideta
Definition: fe_base.h:524
std::vector< RealGradient > dweight
Definition: fe_base.h:637
template<typename OutputType>
virtual libMesh::FEGenericBase< OutputType >::~FEGenericBase ( )
virtual

Member Function Documentation

template<>
std::unique_ptr< FEGenericBase< Real > > libMesh::FEGenericBase< Real >::build ( const unsigned int  dim,
const FEType fet 
)

Definition at line 185 of file fe_base.C.

References libMesh::BERNSTEIN, libMesh::CLOUGH, libMesh::FEType::family, libMesh::HERMITE, libMesh::HIERARCHIC, libMesh::L2_HIERARCHIC, libMesh::L2_LAGRANGE, libMesh::LAGRANGE, libMesh::MONOMIAL, libMesh::SCALAR, libMesh::SUBDIVISION, libMesh::SZABAB, and libMesh::XYZ.

187 {
188  switch (dim)
189  {
190  // 0D
191  case 0:
192  {
193  switch (fet.family)
194  {
195  case CLOUGH:
196  return libmesh_make_unique<FE<0,CLOUGH>>(fet);
197 
198  case HERMITE:
199  return libmesh_make_unique<FE<0,HERMITE>>(fet);
200 
201  case LAGRANGE:
202  return libmesh_make_unique<FE<0,LAGRANGE>>(fet);
203 
204  case L2_LAGRANGE:
205  return libmesh_make_unique<FE<0,L2_LAGRANGE>>(fet);
206 
207  case HIERARCHIC:
208  return libmesh_make_unique<FE<0,HIERARCHIC>>(fet);
209 
210  case L2_HIERARCHIC:
211  return libmesh_make_unique<FE<0,L2_HIERARCHIC>>(fet);
212 
213  case MONOMIAL:
214  return libmesh_make_unique<FE<0,MONOMIAL>>(fet);
215 
216 #ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
217  case SZABAB:
218  return libmesh_make_unique<FE<0,SZABAB>>(fet);
219 
220  case BERNSTEIN:
221  return libmesh_make_unique<FE<0,BERNSTEIN>>(fet);
222 #endif
223 
224  case XYZ:
225  return libmesh_make_unique<FEXYZ<0>>(fet);
226 
227  case SCALAR:
228  return libmesh_make_unique<FEScalar<0>>(fet);
229 
230  default:
231  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
232  }
233  }
234  // 1D
235  case 1:
236  {
237  switch (fet.family)
238  {
239  case CLOUGH:
240  return libmesh_make_unique<FE<1,CLOUGH>>(fet);
241 
242  case HERMITE:
243  return libmesh_make_unique<FE<1,HERMITE>>(fet);
244 
245  case LAGRANGE:
246  return libmesh_make_unique<FE<1,LAGRANGE>>(fet);
247 
248  case L2_LAGRANGE:
249  return libmesh_make_unique<FE<1,L2_LAGRANGE>>(fet);
250 
251  case HIERARCHIC:
252  return libmesh_make_unique<FE<1,HIERARCHIC>>(fet);
253 
254  case L2_HIERARCHIC:
255  return libmesh_make_unique<FE<1,L2_HIERARCHIC>>(fet);
256 
257  case MONOMIAL:
258  return libmesh_make_unique<FE<1,MONOMIAL>>(fet);
259 
260 #ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
261  case SZABAB:
262  return libmesh_make_unique<FE<1,SZABAB>>(fet);
263 
264  case BERNSTEIN:
265  return libmesh_make_unique<FE<1,BERNSTEIN>>(fet);
266 #endif
267 
268  case XYZ:
269  return libmesh_make_unique<FEXYZ<1>>(fet);
270 
271  case SCALAR:
272  return libmesh_make_unique<FEScalar<1>>(fet);
273 
274  default:
275  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
276  }
277  }
278 
279 
280  // 2D
281  case 2:
282  {
283  switch (fet.family)
284  {
285  case CLOUGH:
286  return libmesh_make_unique<FE<2,CLOUGH>>(fet);
287 
288  case HERMITE:
289  return libmesh_make_unique<FE<2,HERMITE>>(fet);
290 
291  case LAGRANGE:
292  return libmesh_make_unique<FE<2,LAGRANGE>>(fet);
293 
294  case L2_LAGRANGE:
295  return libmesh_make_unique<FE<2,L2_LAGRANGE>>(fet);
296 
297  case HIERARCHIC:
298  return libmesh_make_unique<FE<2,HIERARCHIC>>(fet);
299 
300  case L2_HIERARCHIC:
301  return libmesh_make_unique<FE<2,L2_HIERARCHIC>>(fet);
302 
303  case MONOMIAL:
304  return libmesh_make_unique<FE<2,MONOMIAL>>(fet);
305 
306 #ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
307  case SZABAB:
308  return libmesh_make_unique<FE<2,SZABAB>>(fet);
309 
310  case BERNSTEIN:
311  return libmesh_make_unique<FE<2,BERNSTEIN>>(fet);
312 #endif
313 
314  case XYZ:
315  return libmesh_make_unique<FEXYZ<2>>(fet);
316 
317  case SCALAR:
318  return libmesh_make_unique<FEScalar<2>>(fet);
319 
320  case SUBDIVISION:
321  return libmesh_make_unique<FESubdivision>(fet);
322 
323  default:
324  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
325  }
326  }
327 
328 
329  // 3D
330  case 3:
331  {
332  switch (fet.family)
333  {
334  case CLOUGH:
335  libmesh_error_msg("ERROR: Clough-Tocher elements currently only support 1D and 2D");
336 
337  case HERMITE:
338  return libmesh_make_unique<FE<3,HERMITE>>(fet);
339 
340  case LAGRANGE:
341  return libmesh_make_unique<FE<3,LAGRANGE>>(fet);
342 
343  case L2_LAGRANGE:
344  return libmesh_make_unique<FE<3,L2_LAGRANGE>>(fet);
345 
346  case HIERARCHIC:
347  return libmesh_make_unique<FE<3,HIERARCHIC>>(fet);
348 
349  case L2_HIERARCHIC:
350  return libmesh_make_unique<FE<3,L2_HIERARCHIC>>(fet);
351 
352  case MONOMIAL:
353  return libmesh_make_unique<FE<3,MONOMIAL>>(fet);
354 
355 #ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
356  case SZABAB:
357  return libmesh_make_unique<FE<3,SZABAB>>(fet);
358 
359  case BERNSTEIN:
360  return libmesh_make_unique<FE<3,BERNSTEIN>>(fet);
361 #endif
362 
363  case XYZ:
364  return libmesh_make_unique<FEXYZ<3>>(fet);
365 
366  case SCALAR:
367  return libmesh_make_unique<FEScalar<3>>(fet);
368 
369  default:
370  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
371  }
372  }
373 
374  default:
375  libmesh_error_msg("Invalid dimension dim = " << dim);
376  }
377 }
FEFamily family
Definition: fe_type.h:204
const unsigned int dim
Definition: fe_abstract.h:523
template<>
std::unique_ptr< FEGenericBase< RealGradient > > libMesh::FEGenericBase< RealGradient >::build ( const unsigned int  dim,
const FEType fet 
)

Definition at line 383 of file fe_base.C.

References libMesh::FEType::family, libMesh::LAGRANGE_VEC, and libMesh::NEDELEC_ONE.

385 {
386  switch (dim)
387  {
388  // 0D
389  case 0:
390  {
391  switch (fet.family)
392  {
393  case LAGRANGE_VEC:
394  return libmesh_make_unique<FELagrangeVec<0>>(fet);
395 
396  default:
397  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
398  }
399  }
400  case 1:
401  {
402  switch (fet.family)
403  {
404  case LAGRANGE_VEC:
405  return libmesh_make_unique<FELagrangeVec<1>>(fet);
406 
407  default:
408  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
409  }
410  }
411  case 2:
412  {
413  switch (fet.family)
414  {
415  case LAGRANGE_VEC:
416  return libmesh_make_unique<FELagrangeVec<2>>(fet);
417 
418  case NEDELEC_ONE:
419  return libmesh_make_unique<FENedelecOne<2>>(fet);
420 
421  default:
422  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
423  }
424  }
425  case 3:
426  {
427  switch (fet.family)
428  {
429  case LAGRANGE_VEC:
430  return libmesh_make_unique<FELagrangeVec<3>>(fet);
431 
432  case NEDELEC_ONE:
433  return libmesh_make_unique<FENedelecOne<3>>(fet);
434 
435  default:
436  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
437  }
438  }
439 
440  default:
441  libmesh_error_msg("Invalid dimension dim = " << dim);
442  } // switch(dim)
443 }
FEFamily family
Definition: fe_type.h:204
const unsigned int dim
Definition: fe_abstract.h:523
template<typename OutputType>
static std::unique_ptr<FEGenericBase> libMesh::FEGenericBase< OutputType >::build_InfFE ( const unsigned int  dim,
const FEType type 
)
static

Builds a specific infinite element type. A std::unique_ptr<FEGenericBase> is returned to prevent a memory leak. This way the user need not remember to delete the object.

The build call will fail if the OutputShape of this class is not compatible with the output required for the requested type

Referenced by libMesh::FEMContext::cached_fe().

template<>
std::unique_ptr< FEGenericBase< Real > > libMesh::FEGenericBase< Real >::build_InfFE ( const unsigned int  dim,
const FEType fet 
)

Definition at line 456 of file fe_base.C.

References libMesh::CARTESIAN, libMesh::FEType::inf_map, libMesh::INFINITE_MAP, libMesh::JACOBI_20_00, libMesh::JACOBI_30_00, libMesh::LAGRANGE, libMesh::LEGENDRE, and libMesh::FEType::radial_family.

458 {
459  switch (dim)
460  {
461 
462  // 1D
463  case 1:
464  {
465  switch (fet.radial_family)
466  {
467  case INFINITE_MAP:
468  libmesh_error_msg("ERROR: Can't build an infinite element with FEFamily = " << fet.radial_family);
469 
470  case JACOBI_20_00:
471  {
472  switch (fet.inf_map)
473  {
474  case CARTESIAN:
475  return libmesh_make_unique<InfFE<1,JACOBI_20_00,CARTESIAN>>(fet);
476 
477  default:
478  libmesh_error_msg("ERROR: Can't build an infinite element with InfMapType = " << fet.inf_map);
479  }
480  }
481 
482  case JACOBI_30_00:
483  {
484  switch (fet.inf_map)
485  {
486  case CARTESIAN:
487  return libmesh_make_unique<InfFE<1,JACOBI_30_00,CARTESIAN>>(fet);
488 
489  default:
490  libmesh_error_msg("ERROR: Can't build an infinite element with InfMapType = " << fet.inf_map);
491  }
492  }
493 
494  case LEGENDRE:
495  {
496  switch (fet.inf_map)
497  {
498  case CARTESIAN:
499  return libmesh_make_unique<InfFE<1,LEGENDRE,CARTESIAN>>(fet);
500 
501  default:
502  libmesh_error_msg("ERROR: Can't build an infinite element with InfMapType = " << fet.inf_map);
503  }
504  }
505 
506  case LAGRANGE:
507  {
508  switch (fet.inf_map)
509  {
510  case CARTESIAN:
511  return libmesh_make_unique<InfFE<1,LAGRANGE,CARTESIAN>>(fet);
512 
513  default:
514  libmesh_error_msg("ERROR: Can't build an infinite element with InfMapType = " << fet.inf_map);
515  }
516  }
517 
518  default:
519  libmesh_error_msg("ERROR: Bad FEType.radial_family= " << fet.radial_family);
520  }
521  }
522 
523 
524 
525 
526  // 2D
527  case 2:
528  {
529  switch (fet.radial_family)
530  {
531  case INFINITE_MAP:
532  libmesh_error_msg("ERROR: Can't build an infinite element with FEFamily = " << fet.radial_family);
533 
534  case JACOBI_20_00:
535  {
536  switch (fet.inf_map)
537  {
538  case CARTESIAN:
539  return libmesh_make_unique<InfFE<2,JACOBI_20_00,CARTESIAN>>(fet);
540 
541  default:
542  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
543  }
544  }
545 
546  case JACOBI_30_00:
547  {
548  switch (fet.inf_map)
549  {
550  case CARTESIAN:
551  return libmesh_make_unique<InfFE<2,JACOBI_30_00,CARTESIAN>>(fet);
552 
553  default:
554  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
555  }
556  }
557 
558  case LEGENDRE:
559  {
560  switch (fet.inf_map)
561  {
562  case CARTESIAN:
563  return libmesh_make_unique<InfFE<2,LEGENDRE,CARTESIAN>>(fet);
564 
565  default:
566  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
567  }
568  }
569 
570  case LAGRANGE:
571  {
572  switch (fet.inf_map)
573  {
574  case CARTESIAN:
575  return libmesh_make_unique<InfFE<2,LAGRANGE,CARTESIAN>>(fet);
576 
577  default:
578  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
579  }
580  }
581 
582  default:
583  libmesh_error_msg("ERROR: Bad FEType.radial_family= " << fet.radial_family);
584  }
585  }
586 
587 
588 
589 
590  // 3D
591  case 3:
592  {
593  switch (fet.radial_family)
594  {
595  case INFINITE_MAP:
596  libmesh_error_msg("ERROR: Don't build an infinite element with FEFamily = " << fet.radial_family);
597 
598  case JACOBI_20_00:
599  {
600  switch (fet.inf_map)
601  {
602  case CARTESIAN:
603  return libmesh_make_unique<InfFE<3,JACOBI_20_00,CARTESIAN>>(fet);
604 
605  default:
606  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
607  }
608  }
609 
610  case JACOBI_30_00:
611  {
612  switch (fet.inf_map)
613  {
614  case CARTESIAN:
615  return libmesh_make_unique<InfFE<3,JACOBI_30_00,CARTESIAN>>(fet);
616 
617  default:
618  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
619  }
620  }
621 
622  case LEGENDRE:
623  {
624  switch (fet.inf_map)
625  {
626  case CARTESIAN:
627  return libmesh_make_unique<InfFE<3,LEGENDRE,CARTESIAN>>(fet);
628 
629  default:
630  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
631  }
632  }
633 
634  case LAGRANGE:
635  {
636  switch (fet.inf_map)
637  {
638  case CARTESIAN:
639  return libmesh_make_unique<InfFE<3,LAGRANGE,CARTESIAN>>(fet);
640 
641  default:
642  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
643  }
644  }
645 
646  default:
647  libmesh_error_msg("ERROR: Bad FEType.radial_family= " << fet.radial_family);
648  }
649  }
650 
651  default:
652  libmesh_error_msg("Invalid dimension dim = " << dim);
653  }
654 }
const unsigned int dim
Definition: fe_abstract.h:523
InfMapType inf_map
Definition: fe_type.h:258
FEFamily radial_family
Definition: fe_type.h:250
template<>
std::unique_ptr< FEGenericBase< RealGradient > > libMesh::FEGenericBase< RealGradient >::build_InfFE ( const unsigned  int,
const FEType  
)

Definition at line 660 of file fe_base.C.

662 {
663  // No vector types defined... YET.
664  libmesh_not_implemented();
665  return std::unique_ptr<FEVectorBase>();
666 }
template<typename OutputType >
void libMesh::FEGenericBase< OutputType >::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 
)
static

Creates a local projection on coarse_elem, based on the DoF values in global_vector for it's children. Computes a vector of coefficients corresponding to dof_indices for only the single given var

Definition at line 794 of file fe_base.C.

References std::abs(), libMesh::C_ONE, libMesh::Elem::child_ptr(), libMesh::Elem::child_ref_range(), libMesh::DenseMatrix< T >::cholesky_solve(), libMesh::FEType::default_quadrature_rule(), libMesh::Elem::dim(), libMesh::DISCONTINUOUS, libMesh::DofMap::dof_indices(), libMesh::FEInterface::dofs_on_edge(), libMesh::FEInterface::dofs_on_side(), libMesh::Elem::edge_index_range(), libMesh::TensorTools::inner_product(), libMesh::FEInterface::inverse_map(), libMesh::Elem::is_child_on_edge(), libMesh::Elem::is_child_on_side(), libMesh::Elem::is_vertex(), libmesh_nullptr, libMesh::Elem::max_descendant_p_level(), libMesh::Elem::n_children(), libMesh::FEInterface::n_dofs(), libMesh::FEInterface::n_dofs_at_node(), n_nodes, libMesh::Elem::n_nodes(), libMesh::DofMap::old_dof_indices(), libMesh::FEType::order, libMesh::Elem::p_level(), libMesh::DenseVector< T >::resize(), libMesh::DenseMatrix< T >::resize(), libMesh::Elem::side_index_range(), libMesh::TOLERANCE, libMesh::Elem::type(), libMesh::DofMap::variable_type(), libMesh::DenseMatrix< T >::zero(), libMesh::DenseVector< T >::zero(), and libMesh::zero.

Referenced by libMesh::JumpErrorEstimator::estimate_error(), and libMesh::ExactErrorEstimator::estimate_error().

800 {
801  // Side/edge local DOF indices
802  std::vector<unsigned int> new_side_dofs, old_side_dofs;
803 
804  // FIXME: what about 2D shells in 3D space?
805  unsigned int dim = elem->dim();
806 
807  // Cache n_children(); it's a virtual call but it's const.
808  const unsigned int n_children = elem->n_children();
809 
810  // We use local FE objects for now
811  // FIXME: we should use more, external objects instead for efficiency
812  const FEType & base_fe_type = dof_map.variable_type(var);
813  std::unique_ptr<FEGenericBase<OutputShape>> fe
814  (FEGenericBase<OutputShape>::build(dim, base_fe_type));
815  std::unique_ptr<FEGenericBase<OutputShape>> fe_coarse
816  (FEGenericBase<OutputShape>::build(dim, base_fe_type));
817 
818  std::unique_ptr<QBase> qrule (base_fe_type.default_quadrature_rule(dim));
819  std::unique_ptr<QBase> qedgerule (base_fe_type.default_quadrature_rule(1));
820  std::unique_ptr<QBase> qsiderule (base_fe_type.default_quadrature_rule(dim-1));
821  std::vector<Point> coarse_qpoints;
822 
823  // The values of the shape functions at the quadrature
824  // points
825  const std::vector<std::vector<OutputShape>> & phi_values =
826  fe->get_phi();
827  const std::vector<std::vector<OutputShape>> & phi_coarse =
828  fe_coarse->get_phi();
829 
830  // The gradients of the shape functions at the quadrature
831  // points on the child element.
832  const std::vector<std::vector<OutputGradient>> * dphi_values =
834  const std::vector<std::vector<OutputGradient>> * dphi_coarse =
836 
837  const FEContinuity cont = fe->get_continuity();
838 
839  if (cont == C_ONE)
840  {
841  const std::vector<std::vector<OutputGradient>> &
842  ref_dphi_values = fe->get_dphi();
843  dphi_values = &ref_dphi_values;
844  const std::vector<std::vector<OutputGradient>> &
845  ref_dphi_coarse = fe_coarse->get_dphi();
846  dphi_coarse = &ref_dphi_coarse;
847  }
848 
849  // The Jacobian * quadrature weight at the quadrature points
850  const std::vector<Real> & JxW =
851  fe->get_JxW();
852 
853  // The XYZ locations of the quadrature points on the
854  // child element
855  const std::vector<Point> & xyz_values =
856  fe->get_xyz();
857 
858 
859 
860  FEType fe_type = base_fe_type, temp_fe_type;
861  const ElemType elem_type = elem->type();
862  fe_type.order = static_cast<Order>(fe_type.order +
863  elem->max_descendant_p_level());
864 
865  // Number of nodes on parent element
866  const unsigned int n_nodes = elem->n_nodes();
867 
868  // Number of dofs on parent element
869  const unsigned int new_n_dofs =
870  FEInterface::n_dofs(dim, fe_type, elem_type);
871 
872  // Fixed vs. free DoFs on edge/face projections
873  std::vector<char> dof_is_fixed(new_n_dofs, false); // bools
874  std::vector<int> free_dof(new_n_dofs, 0);
875 
878  Ue.resize(new_n_dofs); Ue.zero();
879 
880 
881  // When coarsening, in general, we need a series of
882  // projections to ensure a unique and continuous
883  // solution. We start by interpolating nodes, then
884  // hold those fixed and project edges, then
885  // hold those fixed and project faces, then
886  // hold those fixed and project interiors
887 
888  // Copy node values first
889  {
890  std::vector<dof_id_type> node_dof_indices;
891  if (use_old_dof_indices)
892  dof_map.old_dof_indices (elem, node_dof_indices, var);
893  else
894  dof_map.dof_indices (elem, node_dof_indices, var);
895 
896  unsigned int current_dof = 0;
897  for (unsigned int n=0; n!= n_nodes; ++n)
898  {
899  // FIXME: this should go through the DofMap,
900  // not duplicate dof_indices code badly!
901  const unsigned int my_nc =
902  FEInterface::n_dofs_at_node (dim, fe_type,
903  elem_type, n);
904  if (!elem->is_vertex(n))
905  {
906  current_dof += my_nc;
907  continue;
908  }
909 
910  temp_fe_type = base_fe_type;
911  // We're assuming here that child n shares vertex n,
912  // which is wrong on non-simplices right now
913  // ... but this code isn't necessary except on elements
914  // where p refinement creates more vertex dofs; we have
915  // no such elements yet.
916  /*
917  if (elem->child_ptr(n)->p_level() < elem->p_level())
918  {
919  temp_fe_type.order =
920  static_cast<Order>(temp_fe_type.order +
921  elem->child_ptr(n)->p_level());
922  }
923  */
924  const unsigned int nc =
925  FEInterface::n_dofs_at_node (dim, temp_fe_type,
926  elem_type, n);
927  for (unsigned int i=0; i!= nc; ++i)
928  {
929  Ue(current_dof) =
930  old_vector(node_dof_indices[current_dof]);
931  dof_is_fixed[current_dof] = true;
932  current_dof++;
933  }
934  }
935  }
936 
937  // In 3D, project any edge values next
938  if (dim > 2 && cont != DISCONTINUOUS)
939  for (auto e : elem->edge_index_range())
940  {
941  FEInterface::dofs_on_edge(elem, dim, fe_type,
942  e, new_side_dofs);
943 
944  // Some edge dofs are on nodes and already
945  // fixed, others are free to calculate
946  unsigned int free_dofs = 0;
947  for (std::size_t i=0; i != new_side_dofs.size(); ++i)
948  if (!dof_is_fixed[new_side_dofs[i]])
949  free_dof[free_dofs++] = i;
950  Ke.resize (free_dofs, free_dofs); Ke.zero();
951  Fe.resize (free_dofs); Fe.zero();
952  // The new edge coefficients
953  DenseVector<Number> Uedge(free_dofs);
954 
955  // Add projection terms from each child sharing
956  // this edge
957  for (unsigned int c=0; c != n_children; ++c)
958  {
959  if (!elem->is_child_on_edge(c,e))
960  continue;
961  const Elem * child = elem->child_ptr(c);
962 
963  std::vector<dof_id_type> child_dof_indices;
964  if (use_old_dof_indices)
965  dof_map.old_dof_indices (child,
966  child_dof_indices, var);
967  else
968  dof_map.dof_indices (child,
969  child_dof_indices, var);
970  const unsigned int child_n_dofs =
971  cast_int<unsigned int>
972  (child_dof_indices.size());
973 
974  temp_fe_type = base_fe_type;
975  temp_fe_type.order =
976  static_cast<Order>(temp_fe_type.order +
977  child->p_level());
978 
979  FEInterface::dofs_on_edge(child, dim,
980  temp_fe_type, e, old_side_dofs);
981 
982  // Initialize both child and parent FE data
983  // on the child's edge
984  fe->attach_quadrature_rule (qedgerule.get());
985  fe->edge_reinit (child, e);
986  const unsigned int n_qp = qedgerule->n_points();
987 
988  FEInterface::inverse_map (dim, fe_type, elem,
989  xyz_values, coarse_qpoints);
990 
991  fe_coarse->reinit(elem, &coarse_qpoints);
992 
993  // Loop over the quadrature points
994  for (unsigned int qp=0; qp<n_qp; qp++)
995  {
996  // solution value at the quadrature point
997  OutputNumber fineval = libMesh::zero;
998  // solution grad at the quadrature point
999  OutputNumberGradient finegrad;
1000 
1001  // Sum the solution values * the DOF
1002  // values at the quadrature point to
1003  // get the solution value and gradient.
1004  for (unsigned int i=0; i<child_n_dofs;
1005  i++)
1006  {
1007  fineval +=
1008  (old_vector(child_dof_indices[i])*
1009  phi_values[i][qp]);
1010  if (cont == C_ONE)
1011  finegrad += (*dphi_values)[i][qp] *
1012  old_vector(child_dof_indices[i]);
1013  }
1014 
1015  // Form edge projection matrix
1016  for (std::size_t sidei=0, freei=0; sidei != new_side_dofs.size(); ++sidei)
1017  {
1018  unsigned int i = new_side_dofs[sidei];
1019  // fixed DoFs aren't test functions
1020  if (dof_is_fixed[i])
1021  continue;
1022  for (std::size_t sidej=0, freej=0; sidej != new_side_dofs.size(); ++sidej)
1023  {
1024  unsigned int j =
1025  new_side_dofs[sidej];
1026  if (dof_is_fixed[j])
1027  Fe(freei) -=
1028  TensorTools::inner_product(phi_coarse[i][qp],
1029  phi_coarse[j][qp]) *
1030  JxW[qp] * Ue(j);
1031  else
1032  Ke(freei,freej) +=
1033  TensorTools::inner_product(phi_coarse[i][qp],
1034  phi_coarse[j][qp]) *
1035  JxW[qp];
1036  if (cont == C_ONE)
1037  {
1038  if (dof_is_fixed[j])
1039  Fe(freei) -=
1040  TensorTools::inner_product((*dphi_coarse)[i][qp],
1041  (*dphi_coarse)[j][qp]) *
1042  JxW[qp] * Ue(j);
1043  else
1044  Ke(freei,freej) +=
1045  TensorTools::inner_product((*dphi_coarse)[i][qp],
1046  (*dphi_coarse)[j][qp]) *
1047  JxW[qp];
1048  }
1049  if (!dof_is_fixed[j])
1050  freej++;
1051  }
1052  Fe(freei) += TensorTools::inner_product(phi_coarse[i][qp],
1053  fineval) * JxW[qp];
1054  if (cont == C_ONE)
1055  Fe(freei) +=
1056  TensorTools::inner_product(finegrad, (*dphi_coarse)[i][qp]) * JxW[qp];
1057  freei++;
1058  }
1059  }
1060  }
1061  Ke.cholesky_solve(Fe, Uedge);
1062 
1063  // Transfer new edge solutions to element
1064  for (unsigned int i=0; i != free_dofs; ++i)
1065  {
1066  Number & ui = Ue(new_side_dofs[free_dof[i]]);
1067  libmesh_assert(std::abs(ui) < TOLERANCE ||
1068  std::abs(ui - Uedge(i)) < TOLERANCE);
1069  ui = Uedge(i);
1070  dof_is_fixed[new_side_dofs[free_dof[i]]] = true;
1071  }
1072  }
1073 
1074  // Project any side values (edges in 2D, faces in 3D)
1075  if (dim > 1 && cont != DISCONTINUOUS)
1076  for (auto s : elem->side_index_range())
1077  {
1078  FEInterface::dofs_on_side(elem, dim, fe_type,
1079  s, new_side_dofs);
1080 
1081  // Some side dofs are on nodes/edges and already
1082  // fixed, others are free to calculate
1083  unsigned int free_dofs = 0;
1084  for (std::size_t i=0; i != new_side_dofs.size(); ++i)
1085  if (!dof_is_fixed[new_side_dofs[i]])
1086  free_dof[free_dofs++] = i;
1087  Ke.resize (free_dofs, free_dofs); Ke.zero();
1088  Fe.resize (free_dofs); Fe.zero();
1089  // The new side coefficients
1090  DenseVector<Number> Uside(free_dofs);
1091 
1092  // Add projection terms from each child sharing
1093  // this side
1094  for (unsigned int c=0; c != n_children; ++c)
1095  {
1096  if (!elem->is_child_on_side(c,s))
1097  continue;
1098  const Elem * child = elem->child_ptr(c);
1099 
1100  std::vector<dof_id_type> child_dof_indices;
1101  if (use_old_dof_indices)
1102  dof_map.old_dof_indices (child,
1103  child_dof_indices, var);
1104  else
1105  dof_map.dof_indices (child,
1106  child_dof_indices, var);
1107  const unsigned int child_n_dofs =
1108  cast_int<unsigned int>
1109  (child_dof_indices.size());
1110 
1111  temp_fe_type = base_fe_type;
1112  temp_fe_type.order =
1113  static_cast<Order>(temp_fe_type.order +
1114  child->p_level());
1115 
1116  FEInterface::dofs_on_side(child, dim,
1117  temp_fe_type, s, old_side_dofs);
1118 
1119  // Initialize both child and parent FE data
1120  // on the child's side
1121  fe->attach_quadrature_rule (qsiderule.get());
1122  fe->reinit (child, s);
1123  const unsigned int n_qp = qsiderule->n_points();
1124 
1125  FEInterface::inverse_map (dim, fe_type, elem,
1126  xyz_values, coarse_qpoints);
1127 
1128  fe_coarse->reinit(elem, &coarse_qpoints);
1129 
1130  // Loop over the quadrature points
1131  for (unsigned int qp=0; qp<n_qp; qp++)
1132  {
1133  // solution value at the quadrature point
1134  OutputNumber fineval = libMesh::zero;
1135  // solution grad at the quadrature point
1136  OutputNumberGradient finegrad;
1137 
1138  // Sum the solution values * the DOF
1139  // values at the quadrature point to
1140  // get the solution value and gradient.
1141  for (unsigned int i=0; i<child_n_dofs;
1142  i++)
1143  {
1144  fineval +=
1145  old_vector(child_dof_indices[i]) *
1146  phi_values[i][qp];
1147  if (cont == C_ONE)
1148  finegrad += (*dphi_values)[i][qp] *
1149  old_vector(child_dof_indices[i]);
1150  }
1151 
1152  // Form side projection matrix
1153  for (std::size_t sidei=0, freei=0; sidei != new_side_dofs.size(); ++sidei)
1154  {
1155  unsigned int i = new_side_dofs[sidei];
1156  // fixed DoFs aren't test functions
1157  if (dof_is_fixed[i])
1158  continue;
1159  for (std::size_t sidej=0, freej=0; sidej != new_side_dofs.size(); ++sidej)
1160  {
1161  unsigned int j =
1162  new_side_dofs[sidej];
1163  if (dof_is_fixed[j])
1164  Fe(freei) -=
1165  TensorTools::inner_product(phi_coarse[i][qp],
1166  phi_coarse[j][qp]) *
1167  JxW[qp] * Ue(j);
1168  else
1169  Ke(freei,freej) +=
1170  TensorTools::inner_product(phi_coarse[i][qp],
1171  phi_coarse[j][qp]) *
1172  JxW[qp];
1173  if (cont == C_ONE)
1174  {
1175  if (dof_is_fixed[j])
1176  Fe(freei) -=
1177  TensorTools::inner_product((*dphi_coarse)[i][qp],
1178  (*dphi_coarse)[j][qp]) *
1179  JxW[qp] * Ue(j);
1180  else
1181  Ke(freei,freej) +=
1182  TensorTools::inner_product((*dphi_coarse)[i][qp],
1183  (*dphi_coarse)[j][qp]) *
1184  JxW[qp];
1185  }
1186  if (!dof_is_fixed[j])
1187  freej++;
1188  }
1189  Fe(freei) += TensorTools::inner_product(fineval, phi_coarse[i][qp]) * JxW[qp];
1190  if (cont == C_ONE)
1191  Fe(freei) +=
1192  TensorTools::inner_product(finegrad, (*dphi_coarse)[i][qp]) * JxW[qp];
1193  freei++;
1194  }
1195  }
1196  }
1197  Ke.cholesky_solve(Fe, Uside);
1198 
1199  // Transfer new side solutions to element
1200  for (unsigned int i=0; i != free_dofs; ++i)
1201  {
1202  Number & ui = Ue(new_side_dofs[free_dof[i]]);
1203  libmesh_assert(std::abs(ui) < TOLERANCE ||
1204  std::abs(ui - Uside(i)) < TOLERANCE);
1205  ui = Uside(i);
1206  dof_is_fixed[new_side_dofs[free_dof[i]]] = true;
1207  }
1208  }
1209 
1210  // Project the interior values, finally
1211 
1212  // Some interior dofs are on nodes/edges/sides and
1213  // already fixed, others are free to calculate
1214  unsigned int free_dofs = 0;
1215  for (unsigned int i=0; i != new_n_dofs; ++i)
1216  if (!dof_is_fixed[i])
1217  free_dof[free_dofs++] = i;
1218  Ke.resize (free_dofs, free_dofs); Ke.zero();
1219  Fe.resize (free_dofs); Fe.zero();
1220  // The new interior coefficients
1221  DenseVector<Number> Uint(free_dofs);
1222 
1223  // Add projection terms from each child
1224  for (auto & child : elem->child_ref_range())
1225  {
1226  std::vector<dof_id_type> child_dof_indices;
1227  if (use_old_dof_indices)
1228  dof_map.old_dof_indices (&child,
1229  child_dof_indices, var);
1230  else
1231  dof_map.dof_indices (&child,
1232  child_dof_indices, var);
1233  const unsigned int child_n_dofs =
1234  cast_int<unsigned int>
1235  (child_dof_indices.size());
1236 
1237  // Initialize both child and parent FE data
1238  // on the child's quadrature points
1239  fe->attach_quadrature_rule (qrule.get());
1240  fe->reinit (&child);
1241  const unsigned int n_qp = qrule->n_points();
1242 
1243  FEInterface::inverse_map (dim, fe_type, elem,
1244  xyz_values, coarse_qpoints);
1245 
1246  fe_coarse->reinit(elem, &coarse_qpoints);
1247 
1248  // Loop over the quadrature points
1249  for (unsigned int qp=0; qp<n_qp; qp++)
1250  {
1251  // solution value at the quadrature point
1252  OutputNumber fineval = libMesh::zero;
1253  // solution grad at the quadrature point
1254  OutputNumberGradient finegrad;
1255 
1256  // Sum the solution values * the DOF
1257  // values at the quadrature point to
1258  // get the solution value and gradient.
1259  for (unsigned int i=0; i<child_n_dofs; i++)
1260  {
1261  fineval +=
1262  (old_vector(child_dof_indices[i]) *
1263  phi_values[i][qp]);
1264  if (cont == C_ONE)
1265  finegrad += (*dphi_values)[i][qp] *
1266  old_vector(child_dof_indices[i]);
1267  }
1268 
1269  // Form interior projection matrix
1270  for (unsigned int i=0, freei=0;
1271  i != new_n_dofs; ++i)
1272  {
1273  // fixed DoFs aren't test functions
1274  if (dof_is_fixed[i])
1275  continue;
1276  for (unsigned int j=0, freej=0; j !=
1277  new_n_dofs; ++j)
1278  {
1279  if (dof_is_fixed[j])
1280  Fe(freei) -=
1281  TensorTools::inner_product(phi_coarse[i][qp],
1282  phi_coarse[j][qp]) *
1283  JxW[qp] * Ue(j);
1284  else
1285  Ke(freei,freej) +=
1286  TensorTools::inner_product(phi_coarse[i][qp],
1287  phi_coarse[j][qp]) *
1288  JxW[qp];
1289  if (cont == C_ONE)
1290  {
1291  if (dof_is_fixed[j])
1292  Fe(freei) -=
1293  TensorTools::inner_product((*dphi_coarse)[i][qp],
1294  (*dphi_coarse)[j][qp]) *
1295  JxW[qp] * Ue(j);
1296  else
1297  Ke(freei,freej) +=
1298  TensorTools::inner_product((*dphi_coarse)[i][qp],
1299  (*dphi_coarse)[j][qp]) *
1300  JxW[qp];
1301  }
1302  if (!dof_is_fixed[j])
1303  freej++;
1304  }
1305  Fe(freei) += TensorTools::inner_product(phi_coarse[i][qp], fineval) *
1306  JxW[qp];
1307  if (cont == C_ONE)
1308  Fe(freei) += TensorTools::inner_product(finegrad, (*dphi_coarse)[i][qp]) * JxW[qp];
1309  freei++;
1310  }
1311  }
1312  }
1313  Ke.cholesky_solve(Fe, Uint);
1314 
1315  // Transfer new interior solutions to element
1316  for (unsigned int i=0; i != free_dofs; ++i)
1317  {
1318  Number & ui = Ue(free_dof[i]);
1319  libmesh_assert(std::abs(ui) < TOLERANCE ||
1320  std::abs(ui - Uint(i)) < TOLERANCE);
1321  ui = Uint(i);
1322  // We should be fixing all dofs by now; no need to keep track of
1323  // that unless we're debugging
1324 #ifndef NDEBUG
1325  dof_is_fixed[free_dof[i]] = true;
1326 #endif
1327  }
1328 
1329 #ifndef NDEBUG
1330  // Make sure every DoF got reached!
1331  for (unsigned int i=0; i != new_n_dofs; ++i)
1332  libmesh_assert(dof_is_fixed[i]);
1333 #endif
1334 }
static void dofs_on_edge(const Elem *const elem, const unsigned int dim, const FEType &fe_t, unsigned int e, std::vector< unsigned int > &di)
Definition: fe_interface.C:493
Manages the family, order, etc. parameters for a given FE.
Definition: fe_type.h:179
double abs(double a)
static unsigned int n_dofs(const unsigned int dim, const FEType &fe_t, const ElemType t)
Definition: fe_interface.C:411
virtual void zero() libmesh_override
Definition: dense_matrix.h:792
unsigned int p_level() const
Definition: elem.h:2423
const FEType & variable_type(const unsigned int c) const
Definition: dof_map.h:1719
static void dofs_on_side(const Elem *const elem, const unsigned int dim, const FEType &fe_t, unsigned int s, std::vector< unsigned int > &di)
Definition: fe_interface.C:480
void resize(const unsigned int n)
Definition: dense_vector.h:350
virtual void zero() libmesh_override
Definition: dense_vector.h:374
The base class for all geometric element types.
Definition: elem.h:90
const class libmesh_nullptr_t libmesh_nullptr
TensorTools::IncrementRank< OutputNumber >::type OutputNumberGradient
Definition: fe_base.h:125
OrderWrapper order
Definition: fe_type.h:198
static const Real TOLERANCE
void old_dof_indices(const Elem *const elem, std::vector< dof_id_type > &di, const unsigned int vn=libMesh::invalid_uint) const
Definition: dof_map.C:2385
const Number zero
Definition: libmesh.h:178
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1700
const dof_id_type n_nodes
Definition: tecplot_io.C:67
const unsigned int dim
Definition: fe_abstract.h:523
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2446
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_interface.C:547
TensorTools::MakeNumber< OutputShape >::type OutputNumber
Definition: fe_base.h:124
static unsigned int n_dofs_at_node(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int n)
Definition: fe_interface.C:430
std::unique_ptr< QBase > default_quadrature_rule(const unsigned int dim, const int extraorder=0) const
Definition: fe_type.C:31
void resize(const unsigned int new_m, const unsigned int new_n)
Definition: dense_matrix.h:776
void cholesky_solve(const DenseVector< T2 > &b, DenseVector< T2 > &x)
A matrix object used for finite element assembly and numerics.
Definition: dense_matrix.h:54
unsigned int n_points() const
Definition: quadrature.h:114
boostcopy::enable_if_c< ScalarTraits< T >::value &&ScalarTraits< T2 >::value, typename CompareTypes< T, T2 >::supertype >::type inner_product(const T &a, const T2 &b)
Definition: tensor_tools.h:47
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Definition: dof_map.C:1924
template<typename OutputType >
void libMesh::FEGenericBase< OutputType >::coarsened_dof_values ( const NumericVector< Number > &  global_vector,
const DofMap dof_map,
const Elem coarse_elem,
DenseVector< Number > &  coarse_dofs,
const bool  use_old_dof_indices = false 
)
static

Creates a local projection on coarse_elem, based on the DoF values in global_vector for it's children. Computes a vector of coefficients corresponding to all dof_indices.

Definition at line 1340 of file fe_base.C.

References libMesh::DenseVector< T >::append(), libMesh::DofMap::n_variables(), and libMesh::DenseVector< T >::resize().

1345 {
1346  Ue.resize(0);
1347 
1348  for (unsigned int v=0; v != dof_map.n_variables(); ++v)
1349  {
1350  DenseVector<Number> Usub;
1351 
1352  coarsened_dof_values(old_vector, dof_map, elem, Usub,
1353  use_old_dof_indices);
1354 
1355  Ue.append (Usub);
1356  }
1357 }
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)
Definition: fe_base.C:794
unsigned int n_variables() const
Definition: dof_map.h:486
void libMesh::FEAbstract::compute_node_constraints ( NodeConstraints constraints,
const Elem elem 
)
staticinherited

Computes the nodal constraint contributions (for non-conforming adapted meshes), using Lagrange geometry

Definition at line 793 of file fe_abstract.C.

References std::abs(), libMesh::Elem::build_side_ptr(), libMesh::Elem::default_order(), libMesh::Elem::dim(), libMesh::FEAbstract::fe_type, libMesh::FEInterface::inverse_map(), libMesh::LAGRANGE, libMesh::Elem::level(), libmesh_nullptr, libMesh::FEInterface::n_dofs(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::parent(), libMesh::Real, libMesh::remote_elem, libMesh::FEInterface::shape(), libMesh::Elem::side_index_range(), libMesh::Threads::spin_mtx, and libMesh::Elem::subactive().

795 {
796  libmesh_assert(elem);
797 
798  const unsigned int Dim = elem->dim();
799 
800  // Only constrain elements in 2,3D.
801  if (Dim == 1)
802  return;
803 
804  // Only constrain active and ancestor elements
805  if (elem->subactive())
806  return;
807 
808  // We currently always use LAGRANGE mappings for geometry
809  const FEType fe_type(elem->default_order(), LAGRANGE);
810 
811  std::vector<const Node *> my_nodes, parent_nodes;
812 
813  // Look at the element faces. Check to see if we need to
814  // build constraints.
815  for (auto s : elem->side_index_range())
816  if (elem->neighbor_ptr(s) != libmesh_nullptr &&
817  elem->neighbor_ptr(s) != remote_elem)
818  if (elem->neighbor_ptr(s)->level() < elem->level()) // constrain dofs shared between
819  { // this element and ones coarser
820  // than this element.
821  // Get pointers to the elements of interest and its parent.
822  const Elem * parent = elem->parent();
823 
824  // This can't happen... Only level-0 elements have NULL
825  // parents, and no level-0 elements can be at a higher
826  // level than their neighbors!
827  libmesh_assert(parent);
828 
829  const std::unique_ptr<const Elem> my_side (elem->build_side_ptr(s));
830  const std::unique_ptr<const Elem> parent_side (parent->build_side_ptr(s));
831 
832  const unsigned int n_side_nodes = my_side->n_nodes();
833 
834  my_nodes.clear();
835  my_nodes.reserve (n_side_nodes);
836  parent_nodes.clear();
837  parent_nodes.reserve (n_side_nodes);
838 
839  for (unsigned int n=0; n != n_side_nodes; ++n)
840  my_nodes.push_back(my_side->node_ptr(n));
841 
842  for (unsigned int n=0; n != n_side_nodes; ++n)
843  parent_nodes.push_back(parent_side->node_ptr(n));
844 
845  for (unsigned int my_side_n=0;
846  my_side_n < n_side_nodes;
847  my_side_n++)
848  {
849  libmesh_assert_less (my_side_n, FEInterface::n_dofs(Dim-1, fe_type, my_side->type()));
850 
851  const Node * my_node = my_nodes[my_side_n];
852 
853  // The support point of the DOF
854  const Point & support_point = *my_node;
855 
856  // Figure out where my node lies on their reference element.
857  const Point mapped_point = FEInterface::inverse_map(Dim-1, fe_type,
858  parent_side.get(),
859  support_point);
860 
861  // Compute the parent's side shape function values.
862  for (unsigned int their_side_n=0;
863  their_side_n < n_side_nodes;
864  their_side_n++)
865  {
866  libmesh_assert_less (their_side_n, FEInterface::n_dofs(Dim-1, fe_type, parent_side->type()));
867 
868  const Node * their_node = parent_nodes[their_side_n];
869  libmesh_assert(their_node);
870 
871  const Real their_value = FEInterface::shape(Dim-1,
872  fe_type,
873  parent_side->type(),
874  their_side_n,
875  mapped_point);
876 
877  const Real their_mag = std::abs(their_value);
878 #ifdef DEBUG
879  // Protect for the case u_i ~= u_j,
880  // in which case i better equal j.
881  if (their_mag > 0.999)
882  {
883  libmesh_assert_equal_to (my_node, their_node);
884  libmesh_assert_less (std::abs(their_value - 1.), 0.001);
885  }
886  else
887 #endif
888  // To make nodal constraints useful for constructing
889  // sparsity patterns faster, we need to get EVERY
890  // POSSIBLE constraint coupling identified, even if
891  // there is no coupling in the isoparametric
892  // Lagrange case.
893  if (their_mag < 1.e-5)
894  {
895  // since we may be running this method concurrently
896  // on multiple threads we need to acquire a lock
897  // before modifying the shared constraint_row object.
898  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
899 
900  // A reference to the constraint row.
901  NodeConstraintRow & constraint_row = constraints[my_node].first;
902 
903  constraint_row.insert(std::make_pair (their_node,
904  0.));
905  }
906  // To get nodal coordinate constraints right, only
907  // add non-zero and non-identity values for Lagrange
908  // basis functions.
909  else // (1.e-5 <= their_mag <= .999)
910  {
911  // since we may be running this method concurrently
912  // on multiple threads we need to acquire a lock
913  // before modifying the shared constraint_row object.
914  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
915 
916  // A reference to the constraint row.
917  NodeConstraintRow & constraint_row = constraints[my_node].first;
918 
919  constraint_row.insert(std::make_pair (their_node,
920  their_value));
921  }
922  }
923  }
924  }
925 }
double abs(double a)
static unsigned int n_dofs(const unsigned int dim, const FEType &fe_t, const ElemType t)
Definition: fe_interface.C:411
const class libmesh_nullptr_t libmesh_nullptr
spin_mutex spin_mtx
Definition: threads.C:29
static Real shape(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int i, const Point &p)
Definition: fe_interface.C:614
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_interface.C:547
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::map< const Node *, Real, std::less< const Node * >, Threads::scalable_allocator< std::pair< const Node *const, Real > > > NodeConstraintRow
Definition: dof_map.h:137
const RemoteElem * remote_elem
Definition: remote_elem.C:57
template<typename OutputType >
void libMesh::FEGenericBase< OutputType >::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 
)
static

Computes the constraint matrix contributions (for meshes with periodic boundary conditions) corresponding to variable number var_number, using generic projections.

Definition at line 1647 of file fe_base.C.

References std::abs(), libMesh::TypeVector< T >::absolute_fuzzy_equals(), libMesh::Elem::active(), libMesh::PeriodicBoundaries::boundary(), libMesh::BoundaryInfo::boundary_ids(), libMesh::C_ONE, libMesh::C_ZERO, libMesh::DenseMatrix< T >::cholesky_solve(), libMesh::DofMap::constrain_p_dofs(), libMesh::FEType::default_quadrature_order(), libMesh::Elem::dim(), libMesh::DISCONTINUOUS, libMesh::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::FEInterface::dofs_on_side(), libMesh::MeshBase::get_boundary_info(), libMesh::PeriodicBoundaryBase::get_corresponding_pos(), libMesh::Elem::hmin(), libMesh::DofObject::id(), libMesh::TensorTools::inner_product(), libMesh::DofObject::invalid_id, libMesh::invalid_uint, libMesh::FEInterface::inverse_map(), libMesh::DofMap::is_constrained_dof(), libMesh::Elem::is_edge(), libMesh::Elem::is_face(), libMesh::PeriodicBoundaryBase::is_my_variable(), libMesh::Elem::is_node_on_edge(), libMesh::Elem::is_node_on_side(), libMesh::Elem::is_vertex(), libMesh::Elem::level(), libmesh_nullptr, std::min(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::DofObject::n_comp(), libMesh::Elem::n_edges(), libMesh::Elem::n_nodes(), libMesh::Elem::n_sides(), libMesh::PeriodicBoundaries::neighbor(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::node_ptr(), libMesh::Elem::node_ref(), libMesh::Elem::p_level(), libMesh::PeriodicBoundaryBase::pairedboundary, libMesh::Real, libMesh::DenseVector< T >::resize(), libMesh::DenseMatrix< T >::resize(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::Threads::spin_mtx, swap(), libMesh::DofMap::sys_number(), libMesh::TOLERANCE, and libMesh::DofMap::variable_type().

Referenced by libMesh::FEInterface::compute_periodic_constraints(), and libMesh::FEGenericBase< OutputType >::compute_proj_constraints().

1654 {
1655  // Only bother if we truly have periodic boundaries
1656  if (boundaries.empty())
1657  return;
1658 
1659  libmesh_assert(elem);
1660 
1661  // Only constrain active elements with this method
1662  if (!elem->active())
1663  return;
1664 
1665  const unsigned int Dim = elem->dim();
1666 
1667  // We need sys_number and variable_number for DofObject methods
1668  // later
1669  const unsigned int sys_number = dof_map.sys_number();
1670 
1671  const FEType & base_fe_type = dof_map.variable_type(variable_number);
1672 
1673  // Construct FE objects for this element and its pseudo-neighbors.
1674  std::unique_ptr<FEGenericBase<OutputShape>> my_fe
1675  (FEGenericBase<OutputShape>::build(Dim, base_fe_type));
1676  const FEContinuity cont = my_fe->get_continuity();
1677 
1678  // We don't need to constrain discontinuous elements
1679  if (cont == DISCONTINUOUS)
1680  return;
1681  libmesh_assert (cont == C_ZERO || cont == C_ONE);
1682 
1683  // We'll use element size to generate relative tolerances later
1684  const Real primary_hmin = elem->hmin();
1685 
1686  std::unique_ptr<FEGenericBase<OutputShape>> neigh_fe
1687  (FEGenericBase<OutputShape>::build(Dim, base_fe_type));
1688 
1689  QGauss my_qface(Dim-1, base_fe_type.default_quadrature_order());
1690  my_fe->attach_quadrature_rule (&my_qface);
1691  std::vector<Point> neigh_qface;
1692 
1693  const std::vector<Real> & JxW = my_fe->get_JxW();
1694  const std::vector<Point> & q_point = my_fe->get_xyz();
1695  const std::vector<std::vector<OutputShape>> & phi = my_fe->get_phi();
1696  const std::vector<std::vector<OutputShape>> & neigh_phi =
1697  neigh_fe->get_phi();
1698  const std::vector<Point> * face_normals = libmesh_nullptr;
1699  const std::vector<std::vector<OutputGradient>> * dphi = libmesh_nullptr;
1700  const std::vector<std::vector<OutputGradient>> * neigh_dphi = libmesh_nullptr;
1701  std::vector<dof_id_type> my_dof_indices, neigh_dof_indices;
1702  std::vector<unsigned int> my_side_dofs, neigh_side_dofs;
1703 
1704  if (cont != C_ZERO)
1705  {
1706  const std::vector<Point> & ref_face_normals =
1707  my_fe->get_normals();
1708  face_normals = &ref_face_normals;
1709  const std::vector<std::vector<OutputGradient>> & ref_dphi =
1710  my_fe->get_dphi();
1711  dphi = &ref_dphi;
1712  const std::vector<std::vector<OutputGradient>> & ref_neigh_dphi =
1713  neigh_fe->get_dphi();
1714  neigh_dphi = &ref_neigh_dphi;
1715  }
1716 
1717  DenseMatrix<Real> Ke;
1718  DenseVector<Real> Fe;
1719  std::vector<DenseVector<Real>> Ue;
1720 
1721  // Container to catch the boundary ids that BoundaryInfo hands us.
1722  std::vector<boundary_id_type> bc_ids;
1723 
1724  // Look at the element faces. Check to see if we need to
1725  // build constraints.
1726  const unsigned short int max_ns = elem->n_sides();
1727  for (unsigned short int s = 0; s != max_ns; ++s)
1728  {
1729  if (elem->neighbor_ptr(s))
1730  continue;
1731 
1732  mesh.get_boundary_info().boundary_ids (elem, s, bc_ids);
1733 
1734  for (std::vector<boundary_id_type>::const_iterator id_it=bc_ids.begin(); id_it!=bc_ids.end(); ++id_it)
1735  {
1736  const boundary_id_type boundary_id = *id_it;
1737  const PeriodicBoundaryBase * periodic = boundaries.boundary(boundary_id);
1738  if (periodic && periodic->is_my_variable(variable_number))
1739  {
1740  libmesh_assert(point_locator);
1741 
1742  // Get pointers to the element's neighbor.
1743  const Elem * neigh = boundaries.neighbor(boundary_id, *point_locator, elem, s);
1744 
1745  if (neigh == libmesh_nullptr)
1746  libmesh_error_msg("PeriodicBoundaries point locator object returned NULL!");
1747 
1748  // periodic (and possibly h refinement) constraints:
1749  // constrain dofs shared between
1750  // this element and ones as coarse
1751  // as or coarser than this element.
1752  if (neigh->level() <= elem->level())
1753  {
1754  unsigned int s_neigh =
1755  mesh.get_boundary_info().side_with_boundary_id(neigh, periodic->pairedboundary);
1756  libmesh_assert_not_equal_to (s_neigh, libMesh::invalid_uint);
1757 
1758 #ifdef LIBMESH_ENABLE_AMR
1759  // Find the minimum p level; we build the h constraint
1760  // matrix with this and then constrain away all higher p
1761  // DoFs.
1762  libmesh_assert(neigh->active());
1763  const unsigned int min_p_level =
1764  std::min(elem->p_level(), neigh->p_level());
1765 
1766  // we may need to make the FE objects reinit with the
1767  // minimum shared p_level
1768  // FIXME - I hate using const_cast<> and avoiding
1769  // accessor functions; there's got to be a
1770  // better way to do this!
1771  const unsigned int old_elem_level = elem->p_level();
1772  if (old_elem_level != min_p_level)
1773  (const_cast<Elem *>(elem))->hack_p_level(min_p_level);
1774  const unsigned int old_neigh_level = neigh->p_level();
1775  if (old_neigh_level != min_p_level)
1776  (const_cast<Elem *>(neigh))->hack_p_level(min_p_level);
1777 #endif // #ifdef LIBMESH_ENABLE_AMR
1778 
1779  // We can do a projection with a single integration,
1780  // due to the assumption of nested finite element
1781  // subspaces.
1782  // FIXME: it might be more efficient to do nodes,
1783  // then edges, then side, to reduce the size of the
1784  // Cholesky factorization(s)
1785  my_fe->reinit(elem, s);
1786 
1787  dof_map.dof_indices (elem, my_dof_indices,
1788  variable_number);
1789  dof_map.dof_indices (neigh, neigh_dof_indices,
1790  variable_number);
1791 
1792  const unsigned int n_qp = my_qface.n_points();
1793 
1794  // Translate the quadrature points over to the
1795  // neighbor's boundary
1796  std::vector<Point> neigh_point(q_point.size());
1797  for (std::size_t i=0; i != neigh_point.size(); ++i)
1798  neigh_point[i] = periodic->get_corresponding_pos(q_point[i]);
1799 
1800  FEInterface::inverse_map (Dim, base_fe_type, neigh,
1801  neigh_point, neigh_qface);
1802 
1803  neigh_fe->reinit(neigh, &neigh_qface);
1804 
1805  // We're only concerned with DOFs whose values (and/or first
1806  // derivatives for C1 elements) are supported on side nodes
1807  FEInterface::dofs_on_side(elem, Dim, base_fe_type, s, my_side_dofs);
1808  FEInterface::dofs_on_side(neigh, Dim, base_fe_type, s_neigh, neigh_side_dofs);
1809 
1810  // We're done with functions that examine Elem::p_level(),
1811  // so let's unhack those levels
1812 #ifdef LIBMESH_ENABLE_AMR
1813  if (elem->p_level() != old_elem_level)
1814  (const_cast<Elem *>(elem))->hack_p_level(old_elem_level);
1815  if (neigh->p_level() != old_neigh_level)
1816  (const_cast<Elem *>(neigh))->hack_p_level(old_neigh_level);
1817 #endif // #ifdef LIBMESH_ENABLE_AMR
1818 
1819  const unsigned int n_side_dofs =
1820  cast_int<unsigned int>
1821  (my_side_dofs.size());
1822  libmesh_assert_equal_to (n_side_dofs, neigh_side_dofs.size());
1823 
1824  Ke.resize (n_side_dofs, n_side_dofs);
1825  Ue.resize(n_side_dofs);
1826 
1827  // Form the projection matrix, (inner product of fine basis
1828  // functions against fine test functions)
1829  for (unsigned int is = 0; is != n_side_dofs; ++is)
1830  {
1831  const unsigned int i = my_side_dofs[is];
1832  for (unsigned int js = 0; js != n_side_dofs; ++js)
1833  {
1834  const unsigned int j = my_side_dofs[js];
1835  for (unsigned int qp = 0; qp != n_qp; ++qp)
1836  {
1837  Ke(is,js) += JxW[qp] *
1838  TensorTools::inner_product(phi[i][qp],
1839  phi[j][qp]);
1840  if (cont != C_ZERO)
1841  Ke(is,js) += JxW[qp] *
1842  TensorTools::inner_product((*dphi)[i][qp] *
1843  (*face_normals)[qp],
1844  (*dphi)[j][qp] *
1845  (*face_normals)[qp]);
1846  }
1847  }
1848  }
1849 
1850  // Form the right hand sides, (inner product of coarse basis
1851  // functions against fine test functions)
1852  for (unsigned int is = 0; is != n_side_dofs; ++is)
1853  {
1854  const unsigned int i = neigh_side_dofs[is];
1855  Fe.resize (n_side_dofs);
1856  for (unsigned int js = 0; js != n_side_dofs; ++js)
1857  {
1858  const unsigned int j = my_side_dofs[js];
1859  for (unsigned int qp = 0; qp != n_qp; ++qp)
1860  {
1861  Fe(js) += JxW[qp] *
1862  TensorTools::inner_product(neigh_phi[i][qp],
1863  phi[j][qp]);
1864  if (cont != C_ZERO)
1865  Fe(js) += JxW[qp] *
1866  TensorTools::inner_product((*neigh_dphi)[i][qp] *
1867  (*face_normals)[qp],
1868  (*dphi)[j][qp] *
1869  (*face_normals)[qp]);
1870  }
1871  }
1872  Ke.cholesky_solve(Fe, Ue[is]);
1873  }
1874 
1875  // Make sure we're not adding recursive constraints
1876  // due to the redundancy in the way we add periodic
1877  // boundary constraints
1878  //
1879  // In order for this to work while threaded or on
1880  // distributed meshes, we need a rigorous way to
1881  // avoid recursive constraints. Here it is:
1882  //
1883  // For vertex DoFs, if there is a "prior" element
1884  // (i.e. a coarser element or an equally refined
1885  // element with a lower id) on this boundary which
1886  // contains the vertex point, then we will avoid
1887  // generating constraints; the prior element (or
1888  // something prior to it) may do so. If we are the
1889  // most prior (or "primary") element on this
1890  // boundary sharing this point, then we look at the
1891  // boundary periodic to us, we find the primary
1892  // element there, and if that primary is coarser or
1893  // equal-but-lower-id, then our vertex dofs are
1894  // constrained in terms of that element.
1895  //
1896  // For edge DoFs, if there is a coarser element
1897  // on this boundary sharing this edge, then we will
1898  // avoid generating constraints (we will be
1899  // constrained indirectly via AMR constraints
1900  // connecting us to the coarser element's DoFs). If
1901  // we are the coarsest element sharing this edge,
1902  // then we generate constraints if and only if we
1903  // are finer than the coarsest element on the
1904  // boundary periodic to us sharing the corresponding
1905  // periodic edge, or if we are at equal level but
1906  // our edge nodes have higher ids than the periodic
1907  // edge nodes (sorted from highest to lowest, then
1908  // compared lexicographically)
1909  //
1910  // For face DoFs, we generate constraints if we are
1911  // finer than our periodic neighbor, or if we are at
1912  // equal level but our element id is higher than its
1913  // element id.
1914  //
1915  // If the primary neighbor is also the current elem
1916  // (a 1-element-thick mesh) then we choose which
1917  // vertex dofs to constrain via lexicographic
1918  // ordering on point locations
1919 
1920  // FIXME: This code doesn't yet properly handle
1921  // cases where multiple different periodic BCs
1922  // intersect.
1923  std::set<dof_id_type> my_constrained_dofs;
1924 
1925  // Container to catch boundary IDs handed back by BoundaryInfo.
1926  std::vector<boundary_id_type> new_bc_ids;
1927 
1928  for (unsigned int n = 0; n != elem->n_nodes(); ++n)
1929  {
1930  if (!elem->is_node_on_side(n,s))
1931  continue;
1932 
1933  const Node & my_node = elem->node_ref(n);
1934 
1935  if (elem->is_vertex(n))
1936  {
1937  // Find all boundary ids that include this
1938  // point and have periodic boundary
1939  // conditions for this variable
1940  std::set<boundary_id_type> point_bcids;
1941 
1942  for (unsigned int new_s = 0;
1943  new_s != max_ns; ++new_s)
1944  {
1945  if (!elem->is_node_on_side(n,new_s))
1946  continue;
1947 
1948  mesh.get_boundary_info().boundary_ids (elem, s, new_bc_ids);
1949 
1950  for (std::vector<boundary_id_type>::const_iterator
1951  new_id_it=new_bc_ids.begin(); new_id_it!=new_bc_ids.end(); ++new_id_it)
1952  {
1953  const boundary_id_type new_boundary_id = *new_id_it;
1954  const PeriodicBoundaryBase * new_periodic = boundaries.boundary(new_boundary_id);
1955  if (new_periodic && new_periodic->is_my_variable(variable_number))
1956  {
1957  point_bcids.insert(new_boundary_id);
1958  }
1959  }
1960  }
1961 
1962  // See if this vertex has point neighbors to
1963  // defer to
1964  if (primary_boundary_point_neighbor
1965  (elem, my_node, mesh.get_boundary_info(), point_bcids)
1966  != elem)
1967  continue;
1968 
1969  // Find the complementary boundary id set
1970  std::set<boundary_id_type> point_pairedids;
1971  for (std::set<boundary_id_type>::const_iterator i =
1972  point_bcids.begin(); i != point_bcids.end(); ++i)
1973  {
1974  const boundary_id_type new_boundary_id = *i;
1975  const PeriodicBoundaryBase * new_periodic = boundaries.boundary(new_boundary_id);
1976  point_pairedids.insert(new_periodic->pairedboundary);
1977  }
1978 
1979  // What do we want to constrain against?
1980  const Elem * primary_elem = libmesh_nullptr;
1981  const Elem * main_neigh = libmesh_nullptr;
1982  Point main_pt = my_node,
1983  primary_pt = my_node;
1984 
1985  for (std::set<boundary_id_type>::const_iterator i =
1986  point_bcids.begin(); i != point_bcids.end(); ++i)
1987  {
1988  // Find the corresponding periodic point and
1989  // its primary neighbor
1990  const boundary_id_type new_boundary_id = *i;
1991  const PeriodicBoundaryBase * new_periodic = boundaries.boundary(new_boundary_id);
1992 
1993  const Point neigh_pt =
1994  new_periodic->get_corresponding_pos(my_node);
1995 
1996  // If the point is getting constrained
1997  // to itself by this PBC then we don't
1998  // generate any constraints
1999  if (neigh_pt.absolute_fuzzy_equals
2000  (my_node, primary_hmin*TOLERANCE))
2001  continue;
2002 
2003  // Otherwise we'll have a constraint in
2004  // one direction or another
2005  if (!primary_elem)
2006  primary_elem = elem;
2007 
2008  const Elem * primary_neigh =
2009  primary_boundary_point_neighbor(neigh, neigh_pt,
2010  mesh.get_boundary_info(),
2011  point_pairedids);
2012 
2013  libmesh_assert(primary_neigh);
2014 
2015  if (new_boundary_id == boundary_id)
2016  {
2017  main_neigh = primary_neigh;
2018  main_pt = neigh_pt;
2019  }
2020 
2021  // Finer elements will get constrained in
2022  // terms of coarser neighbors, not the
2023  // other way around
2024  if ((primary_neigh->level() > primary_elem->level()) ||
2025 
2026  // For equal-level elements, the one with
2027  // higher id gets constrained in terms of
2028  // the one with lower id
2029  (primary_neigh->level() == primary_elem->level() &&
2030  primary_neigh->id() > primary_elem->id()) ||
2031 
2032  // On a one-element-thick mesh, we compare
2033  // points to see what side gets constrained
2034  (primary_neigh == primary_elem &&
2035  (neigh_pt > primary_pt)))
2036  continue;
2037 
2038  primary_elem = primary_neigh;
2039  primary_pt = neigh_pt;
2040  }
2041 
2042  if (!primary_elem ||
2043  primary_elem != main_neigh ||
2044  primary_pt != main_pt)
2045  continue;
2046  }
2047  else if (elem->is_edge(n))
2048  {
2049  // Find which edge we're on
2050  unsigned int e=0;
2051  for (; e != elem->n_edges(); ++e)
2052  {
2053  if (elem->is_node_on_edge(n,e))
2054  break;
2055  }
2056  libmesh_assert_less (e, elem->n_edges());
2057 
2058  // Find the edge end nodes
2059  const Node
2060  * e1 = libmesh_nullptr,
2061  * e2 = libmesh_nullptr;
2062  for (unsigned int nn = 0; nn != elem->n_nodes(); ++nn)
2063  {
2064  if (nn == n)
2065  continue;
2066 
2067  if (elem->is_node_on_edge(nn, e))
2068  {
2069  if (e1 == libmesh_nullptr)
2070  {
2071  e1 = elem->node_ptr(nn);
2072  }
2073  else
2074  {
2075  e2 = elem->node_ptr(nn);
2076  break;
2077  }
2078  }
2079  }
2080  libmesh_assert (e1 && e2);
2081 
2082  // Find all boundary ids that include this
2083  // edge and have periodic boundary
2084  // conditions for this variable
2085  std::set<boundary_id_type> edge_bcids;
2086 
2087  for (unsigned int new_s = 0;
2088  new_s != max_ns; ++new_s)
2089  {
2090  if (!elem->is_node_on_side(n,new_s))
2091  continue;
2092 
2093  // We're reusing the new_bc_ids vector created outside the loop over nodes.
2094  mesh.get_boundary_info().boundary_ids (elem, s, new_bc_ids);
2095 
2096  for (std::vector<boundary_id_type>::const_iterator
2097  new_id_it=new_bc_ids.begin(); new_id_it!=new_bc_ids.end(); ++new_id_it)
2098  {
2099  const boundary_id_type new_boundary_id = *new_id_it;
2100  const PeriodicBoundaryBase * new_periodic = boundaries.boundary(new_boundary_id);
2101  if (new_periodic && new_periodic->is_my_variable(variable_number))
2102  {
2103  edge_bcids.insert(new_boundary_id);
2104  }
2105  }
2106  }
2107 
2108 
2109  // See if this edge has neighbors to defer to
2110  if (primary_boundary_edge_neighbor
2111  (elem, *e1, *e2, mesh.get_boundary_info(), edge_bcids)
2112  != elem)
2113  continue;
2114 
2115  // Find the complementary boundary id set
2116  std::set<boundary_id_type> edge_pairedids;
2117  for (std::set<boundary_id_type>::const_iterator i =
2118  edge_bcids.begin(); i != edge_bcids.end(); ++i)
2119  {
2120  const boundary_id_type new_boundary_id = *i;
2121  const PeriodicBoundaryBase * new_periodic = boundaries.boundary(new_boundary_id);
2122  edge_pairedids.insert(new_periodic->pairedboundary);
2123  }
2124 
2125  // What do we want to constrain against?
2126  const Elem * primary_elem = libmesh_nullptr;
2127  const Elem * main_neigh = libmesh_nullptr;
2128  Point main_pt1 = *e1,
2129  main_pt2 = *e2,
2130  primary_pt1 = *e1,
2131  primary_pt2 = *e2;
2132 
2133  for (std::set<boundary_id_type>::const_iterator i =
2134  edge_bcids.begin(); i != edge_bcids.end(); ++i)
2135  {
2136  // Find the corresponding periodic edge and
2137  // its primary neighbor
2138  const boundary_id_type new_boundary_id = *i;
2139  const PeriodicBoundaryBase * new_periodic = boundaries.boundary(new_boundary_id);
2140 
2141  Point neigh_pt1 = new_periodic->get_corresponding_pos(*e1),
2142  neigh_pt2 = new_periodic->get_corresponding_pos(*e2);
2143 
2144  // If the edge is getting constrained
2145  // to itself by this PBC then we don't
2146  // generate any constraints
2147  if (neigh_pt1.absolute_fuzzy_equals
2148  (*e1, primary_hmin*TOLERANCE) &&
2149  neigh_pt2.absolute_fuzzy_equals
2150  (*e2, primary_hmin*TOLERANCE))
2151  continue;
2152 
2153  // Otherwise we'll have a constraint in
2154  // one direction or another
2155  if (!primary_elem)
2156  primary_elem = elem;
2157 
2158  const Elem * primary_neigh = primary_boundary_edge_neighbor
2159  (neigh, neigh_pt1, neigh_pt2,
2160  mesh.get_boundary_info(), edge_pairedids);
2161 
2162  libmesh_assert(primary_neigh);
2163 
2164  if (new_boundary_id == boundary_id)
2165  {
2166  main_neigh = primary_neigh;
2167  main_pt1 = neigh_pt1;
2168  main_pt2 = neigh_pt2;
2169  }
2170 
2171  // If we have a one-element thick mesh,
2172  // we'll need to sort our points to get a
2173  // consistent ordering rule
2174  //
2175  // Use >= in this test to make sure that,
2176  // for angular constraints, no node gets
2177  // constrained to itself.
2178  if (primary_neigh == primary_elem)
2179  {
2180  if (primary_pt1 > primary_pt2)
2181  std::swap(primary_pt1, primary_pt2);
2182  if (neigh_pt1 > neigh_pt2)
2183  std::swap(neigh_pt1, neigh_pt2);
2184 
2185  if (neigh_pt2 >= primary_pt2)
2186  continue;
2187  }
2188 
2189  // Otherwise:
2190  // Finer elements will get constrained in
2191  // terms of coarser ones, not the other way
2192  // around
2193  if ((primary_neigh->level() > primary_elem->level()) ||
2194 
2195  // For equal-level elements, the one with
2196  // higher id gets constrained in terms of
2197  // the one with lower id
2198  (primary_neigh->level() == primary_elem->level() &&
2199  primary_neigh->id() > primary_elem->id()))
2200  continue;
2201 
2202  primary_elem = primary_neigh;
2203  primary_pt1 = neigh_pt1;
2204  primary_pt2 = neigh_pt2;
2205  }
2206 
2207  if (!primary_elem ||
2208  primary_elem != main_neigh ||
2209  primary_pt1 != main_pt1 ||
2210  primary_pt2 != main_pt2)
2211  continue;
2212  }
2213  else if (elem->is_face(n))
2214  {
2215  // If we have a one-element thick mesh,
2216  // use the ordering of the face node and its
2217  // periodic counterpart to determine what
2218  // gets constrained
2219  if (neigh == elem)
2220  {
2221  const Point neigh_pt =
2222  periodic->get_corresponding_pos(my_node);
2223  if (neigh_pt > my_node)
2224  continue;
2225  }
2226 
2227  // Otherwise:
2228  // Finer elements will get constrained in
2229  // terms of coarser ones, not the other way
2230  // around
2231  if ((neigh->level() > elem->level()) ||
2232 
2233  // For equal-level elements, the one with
2234  // higher id gets constrained in terms of
2235  // the one with lower id
2236  (neigh->level() == elem->level() &&
2237  neigh->id() > elem->id()))
2238  continue;
2239  }
2240 
2241  // If we made it here without hitting a continue
2242  // statement, then we're at a node whose dofs
2243  // should be constrained by this element's
2244  // calculations.
2245  const unsigned int n_comp =
2246  my_node.n_comp(sys_number, variable_number);
2247 
2248  for (unsigned int i=0; i != n_comp; ++i)
2249  my_constrained_dofs.insert
2250  (my_node.dof_number
2251  (sys_number, variable_number, i));
2252  }
2253 
2254  // FIXME: old code for disambiguating periodic BCs:
2255  // this is not threadsafe nor safe to run on a
2256  // non-serialized mesh.
2257  /*
2258  std::vector<bool> recursive_constraint(n_side_dofs, false);
2259 
2260  for (unsigned int is = 0; is != n_side_dofs; ++is)
2261  {
2262  const unsigned int i = neigh_side_dofs[is];
2263  const dof_id_type their_dof_g = neigh_dof_indices[i];
2264  libmesh_assert_not_equal_to (their_dof_g, DofObject::invalid_id);
2265 
2266  {
2267  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
2268 
2269  if (!dof_map.is_constrained_dof(their_dof_g))
2270  continue;
2271  }
2272 
2273  DofConstraintRow & their_constraint_row =
2274  constraints[their_dof_g].first;
2275 
2276  for (unsigned int js = 0; js != n_side_dofs; ++js)
2277  {
2278  const unsigned int j = my_side_dofs[js];
2279  const dof_id_type my_dof_g = my_dof_indices[j];
2280  libmesh_assert_not_equal_to (my_dof_g, DofObject::invalid_id);
2281 
2282  if (their_constraint_row.count(my_dof_g))
2283  recursive_constraint[js] = true;
2284  }
2285  }
2286  */
2287 
2288  for (unsigned int js = 0; js != n_side_dofs; ++js)
2289  {
2290  // FIXME: old code path
2291  // if (recursive_constraint[js])
2292  // continue;
2293 
2294  const unsigned int j = my_side_dofs[js];
2295  const dof_id_type my_dof_g = my_dof_indices[j];
2296  libmesh_assert_not_equal_to (my_dof_g, DofObject::invalid_id);
2297 
2298  // FIXME: new code path
2299  if (!my_constrained_dofs.count(my_dof_g))
2300  continue;
2301 
2302  DofConstraintRow * constraint_row;
2303 
2304  // we may be running constraint methods concurrently
2305  // on multiple threads, so we need a lock to
2306  // ensure that this constraint is "ours"
2307  {
2308  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
2309 
2310  if (dof_map.is_constrained_dof(my_dof_g))
2311  continue;
2312 
2313  constraint_row = &(constraints[my_dof_g]);
2314  libmesh_assert(constraint_row->empty());
2315  }
2316 
2317  for (unsigned int is = 0; is != n_side_dofs; ++is)
2318  {
2319  const unsigned int i = neigh_side_dofs[is];
2320  const dof_id_type their_dof_g = neigh_dof_indices[i];
2321  libmesh_assert_not_equal_to (their_dof_g, DofObject::invalid_id);
2322 
2323  // Periodic constraints should never be
2324  // self-constraints
2325  // libmesh_assert_not_equal_to (their_dof_g, my_dof_g);
2326 
2327  const Real their_dof_value = Ue[is](js);
2328 
2329  if (their_dof_g == my_dof_g)
2330  {
2331  libmesh_assert_less (std::abs(their_dof_value-1.), 1.e-5);
2332  for (unsigned int k = 0; k != n_side_dofs; ++k)
2333  libmesh_assert(k == is || std::abs(Ue[k](js)) < 1.e-5);
2334  continue;
2335  }
2336 
2337  if (std::abs(their_dof_value) < 10*TOLERANCE)
2338  continue;
2339 
2340  constraint_row->insert(std::make_pair(their_dof_g,
2341  their_dof_value));
2342  }
2343  }
2344  }
2345  // p refinement constraints:
2346  // constrain dofs shared between
2347  // active elements and neighbors with
2348  // lower polynomial degrees
2349 #ifdef LIBMESH_ENABLE_AMR
2350  const unsigned int min_p_level =
2351  neigh->min_p_level_by_neighbor(elem, elem->p_level());
2352  if (min_p_level < elem->p_level())
2353  {
2354  // Adaptive p refinement of non-hierarchic bases will
2355  // require more coding
2356  libmesh_assert(my_fe->is_hierarchic());
2357  dof_map.constrain_p_dofs(variable_number, elem,
2358  s, min_p_level);
2359  }
2360 #endif // #ifdef LIBMESH_ENABLE_AMR
2361  }
2362  }
2363  }
2364 }
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const =0
Manages the family, order, etc. parameters for a given FE.
Definition: fe_type.h:179
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const =0
virtual bool is_edge(const unsigned int i) const =0
const BoundaryInfo & get_boundary_info() const
Definition: mesh_base.h:118
double abs(double a)
A geometric point in (x,y,z) space associated with a DOF.
Definition: node.h:52
bool active() const
Definition: elem.h:2258
const unsigned int invalid_uint
Definition: libmesh.h:184
unsigned int p_level() const
Definition: elem.h:2423
const FEType & variable_type(const unsigned int c) const
Definition: dof_map.h:1719
virtual Point get_corresponding_pos(const Point &pt) const =0
static void dofs_on_side(const Elem *const elem, const unsigned int dim, const FEType &fe_t, unsigned int s, std::vector< unsigned int > &di)
Definition: fe_interface.C:480
virtual unsigned int n_edges() const =0
void resize(const unsigned int n)
Definition: dense_vector.h:350
unsigned int min_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
Definition: elem.C:1906
The base class for all geometric element types.
Definition: elem.h:90
virtual Real hmin() const
Definition: elem.C:350
PeriodicBoundaryBase * boundary(boundary_id_type id)
const class libmesh_nullptr_t libmesh_nullptr
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:810
static const Real TOLERANCE
virtual unsigned int n_nodes() const =0
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:1968
std::vector< boundary_id_type > boundary_ids(const Node *node) const
bool is_constrained_dof(const dof_id_type dof) const
Definition: dof_map.h:1756
unsigned int side_with_boundary_id(const Elem *const elem, const boundary_id_type boundary_id) const
spin_mutex spin_mtx
Definition: threads.C:29
std::vector< std::vector< OutputShape > > phi
Definition: fe_base.h:499
int8_t boundary_id_type
Definition: id_types.h:51
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1875
Order default_quadrature_order() const
Definition: fe_type.h:333
const Node & node_ref(const unsigned int i) const
Definition: elem.h:1897
static const dof_id_type invalid_id
Definition: dof_object.h:324
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_interface.C:547
virtual unsigned int n_sides() const =0
unsigned int sys_number() const
Definition: dof_map.h:1671
std::vector< std::vector< OutputGradient > > dphi
Definition: fe_base.h:504
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool absolute_fuzzy_equals(const TypeVector< T > &rhs, Real tol=TOLERANCE) const
Definition: type_vector.h:962
virtual bool is_vertex(const unsigned int i) const =0
void swap(Iterator &lhs, Iterator &rhs)
virtual bool is_face(const unsigned int i) const =0
std::map< dof_id_type, Real, std::less< dof_id_type >, Threads::scalable_allocator< std::pair< const dof_id_type, Real > > > DofConstraintRow
Definition: dof_map.h:89
void resize(const unsigned int new_m, const unsigned int new_n)
Definition: dense_matrix.h:776
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2389
Implements 1, 2, and 3D "Gaussian" quadrature rules.
bool is_my_variable(unsigned int var_num) const
Base class for all PeriodicBoundary implementations.
void cholesky_solve(const DenseVector< T2 > &b, DenseVector< T2 > &x)
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:780
dof_id_type id() const
Definition: dof_object.h:632
A matrix object used for finite element assembly and numerics.
Definition: dense_matrix.h:54
long double min(long double a, double b)
A geometric point in (x,y,z) space.
Definition: point.h:38
const Elem * neighbor(boundary_id_type boundary_id, const PointLocatorBase &point_locator, const Elem *e, unsigned int side) const
boostcopy::enable_if_c< ScalarTraits< T >::value &&ScalarTraits< T2 >::value, typename CompareTypes< T, T2 >::supertype >::type inner_product(const T &a, const T2 &b)
Definition: tensor_tools.h:47
void constrain_p_dofs(unsigned int var, const Elem *elem, unsigned int s, unsigned int p)
uint8_t dof_id_type
Definition: id_types.h:64
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Definition: dof_map.C:1924
void libMesh::FEAbstract::compute_periodic_node_constraints ( NodeConstraints constraints,
const PeriodicBoundaries boundaries,
const MeshBase mesh,
const PointLocatorBase point_locator,
const Elem elem 
)
staticinherited

Computes the node position constraint equation contributions (for meshes with periodic boundary conditions)

Definition at line 936 of file fe_abstract.C.

References libMesh::Elem::active(), libMesh::PeriodicBoundaries::boundary(), libMesh::BoundaryInfo::boundary_ids(), libMesh::Elem::build_side_ptr(), libMesh::Elem::default_order(), libMesh::Elem::dim(), libMesh::FEAbstract::fe_type, libMesh::MeshBase::get_boundary_info(), libMesh::PeriodicBoundaryBase::get_corresponding_pos(), libMesh::invalid_uint, libMesh::FEInterface::inverse_map(), libMesh::LAGRANGE, libMesh::Elem::level(), libMesh::FEInterface::n_dofs(), libMesh::PeriodicBoundaries::neighbor(), libMesh::Elem::neighbor_ptr(), libMesh::PeriodicBoundaryBase::pairedboundary, libMesh::Real, libMesh::FEInterface::shape(), libMesh::Elem::side_index_range(), libMesh::BoundaryInfo::side_with_boundary_id(), and libMesh::Threads::spin_mtx.

941 {
942  // Only bother if we truly have periodic boundaries
943  if (boundaries.empty())
944  return;
945 
946  libmesh_assert(elem);
947 
948  // Only constrain active elements with this method
949  if (!elem->active())
950  return;
951 
952  const unsigned int Dim = elem->dim();
953 
954  // We currently always use LAGRANGE mappings for geometry
955  const FEType fe_type(elem->default_order(), LAGRANGE);
956 
957  std::vector<const Node *> my_nodes, neigh_nodes;
958 
959  // Look at the element faces. Check to see if we need to
960  // build constraints.
961  std::vector<boundary_id_type> bc_ids;
962  for (auto s : elem->side_index_range())
963  {
964  if (elem->neighbor_ptr(s))
965  continue;
966 
967  mesh.get_boundary_info().boundary_ids (elem, s, bc_ids);
968  for (std::vector<boundary_id_type>::const_iterator id_it=bc_ids.begin(); id_it!=bc_ids.end(); ++id_it)
969  {
970  const boundary_id_type boundary_id = *id_it;
971  const PeriodicBoundaryBase * periodic = boundaries.boundary(boundary_id);
972  if (periodic)
973  {
974  libmesh_assert(point_locator);
975 
976  // Get pointers to the element's neighbor.
977  const Elem * neigh = boundaries.neighbor(boundary_id, *point_locator, elem, s);
978 
979  // h refinement constraints:
980  // constrain dofs shared between
981  // this element and ones as coarse
982  // as or coarser than this element.
983  if (neigh->level() <= elem->level())
984  {
985  unsigned int s_neigh =
986  mesh.get_boundary_info().side_with_boundary_id(neigh, periodic->pairedboundary);
987  libmesh_assert_not_equal_to (s_neigh, libMesh::invalid_uint);
988 
989 #ifdef LIBMESH_ENABLE_AMR
990  libmesh_assert(neigh->active());
991 #endif // #ifdef LIBMESH_ENABLE_AMR
992 
993  const std::unique_ptr<const Elem> my_side (elem->build_side_ptr(s));
994  const std::unique_ptr<const Elem> neigh_side (neigh->build_side_ptr(s_neigh));
995 
996  const unsigned int n_side_nodes = my_side->n_nodes();
997 
998  my_nodes.clear();
999  my_nodes.reserve (n_side_nodes);
1000  neigh_nodes.clear();
1001  neigh_nodes.reserve (n_side_nodes);
1002 
1003  for (unsigned int n=0; n != n_side_nodes; ++n)
1004  my_nodes.push_back(my_side->node_ptr(n));
1005 
1006  for (unsigned int n=0; n != n_side_nodes; ++n)
1007  neigh_nodes.push_back(neigh_side->node_ptr(n));
1008 
1009  // Make sure we're not adding recursive constraints
1010  // due to the redundancy in the way we add periodic
1011  // boundary constraints, or adding constraints to
1012  // nodes that already have AMR constraints
1013  std::vector<bool> skip_constraint(n_side_nodes, false);
1014 
1015  for (unsigned int my_side_n=0;
1016  my_side_n < n_side_nodes;
1017  my_side_n++)
1018  {
1019  libmesh_assert_less (my_side_n, FEInterface::n_dofs(Dim-1, fe_type, my_side->type()));
1020 
1021  const Node * my_node = my_nodes[my_side_n];
1022 
1023  // Figure out where my node lies on their reference element.
1024  const Point neigh_point = periodic->get_corresponding_pos(*my_node);
1025 
1026  const Point mapped_point = FEInterface::inverse_map(Dim-1, fe_type,
1027  neigh_side.get(),
1028  neigh_point);
1029 
1030  // If we've already got a constraint on this
1031  // node, then the periodic constraint is
1032  // redundant
1033  {
1034  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
1035 
1036  if (constraints.count(my_node))
1037  {
1038  skip_constraint[my_side_n] = true;
1039  continue;
1040  }
1041  }
1042 
1043  // Compute the neighbors's side shape function values.
1044  for (unsigned int their_side_n=0;
1045  their_side_n < n_side_nodes;
1046  their_side_n++)
1047  {
1048  libmesh_assert_less (their_side_n, FEInterface::n_dofs(Dim-1, fe_type, neigh_side->type()));
1049 
1050  const Node * their_node = neigh_nodes[their_side_n];
1051 
1052  // If there's a constraint on an opposing node,
1053  // we need to see if it's constrained by
1054  // *our side* making any periodic constraint
1055  // on us recursive
1056  {
1057  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
1058 
1059  if (!constraints.count(their_node))
1060  continue;
1061 
1062  const NodeConstraintRow & their_constraint_row =
1063  constraints[their_node].first;
1064 
1065  for (unsigned int orig_side_n=0;
1066  orig_side_n < n_side_nodes;
1067  orig_side_n++)
1068  {
1069  libmesh_assert_less (orig_side_n, FEInterface::n_dofs(Dim-1, fe_type, my_side->type()));
1070 
1071  const Node * orig_node = my_nodes[orig_side_n];
1072 
1073  if (their_constraint_row.count(orig_node))
1074  skip_constraint[orig_side_n] = true;
1075  }
1076  }
1077  }
1078  }
1079  for (unsigned int my_side_n=0;
1080  my_side_n < n_side_nodes;
1081  my_side_n++)
1082  {
1083  libmesh_assert_less (my_side_n, FEInterface::n_dofs(Dim-1, fe_type, my_side->type()));
1084 
1085  if (skip_constraint[my_side_n])
1086  continue;
1087 
1088  const Node * my_node = my_nodes[my_side_n];
1089 
1090  // Figure out where my node lies on their reference element.
1091  const Point neigh_point = periodic->get_corresponding_pos(*my_node);
1092 
1093  // Figure out where my node lies on their reference element.
1094  const Point mapped_point = FEInterface::inverse_map(Dim-1, fe_type,
1095  neigh_side.get(),
1096  neigh_point);
1097 
1098  for (unsigned int their_side_n=0;
1099  their_side_n < n_side_nodes;
1100  their_side_n++)
1101  {
1102  libmesh_assert_less (their_side_n, FEInterface::n_dofs(Dim-1, fe_type, neigh_side->type()));
1103 
1104  const Node * their_node = neigh_nodes[their_side_n];
1105  libmesh_assert(their_node);
1106 
1107  const Real their_value = FEInterface::shape(Dim-1,
1108  fe_type,
1109  neigh_side->type(),
1110  their_side_n,
1111  mapped_point);
1112 
1113  // since we may be running this method concurrently
1114  // on multiple threads we need to acquire a lock
1115  // before modifying the shared constraint_row object.
1116  {
1117  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
1118 
1119  NodeConstraintRow & constraint_row =
1120  constraints[my_node].first;
1121 
1122  constraint_row.insert(std::make_pair(their_node,
1123  their_value));
1124  }
1125  }
1126  }
1127  }
1128  }
1129  }
1130  }
1131 }
static unsigned int n_dofs(const unsigned int dim, const FEType &fe_t, const ElemType t)
Definition: fe_interface.C:411
const unsigned int invalid_uint
Definition: libmesh.h:184
MeshBase & mesh
spin_mutex spin_mtx
Definition: threads.C:29
int8_t boundary_id_type
Definition: id_types.h:51
static Real shape(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int i, const Point &p)
Definition: fe_interface.C:614
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_interface.C:547
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::map< const Node *, Real, std::less< const Node * >, Threads::scalable_allocator< std::pair< const Node *const, Real > > > NodeConstraintRow
Definition: dof_map.h:137
template<typename OutputType >
void libMesh::FEGenericBase< OutputType >::compute_proj_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
static

Computes the constraint matrix contributions (for non-conforming adapted meshes) corresponding to variable number var_number, using generic projections.

Definition at line 1363 of file fe_base.C.

References std::abs(), libMesh::Elem::active(), libMesh::C_ONE, libMesh::C_ZERO, libMesh::DenseMatrix< T >::cholesky_solve(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::FEType::default_quadrature_order(), libMesh::Elem::dim(), libMesh::DISCONTINUOUS, libMesh::DofMap::dof_indices(), libMesh::FEInterface::dofs_on_side(), libMesh::OrderWrapper::get_order(), libMesh::TensorTools::inner_product(), libMesh::DofObject::invalid_id, libMesh::FEInterface::inverse_map(), libMesh::DofMap::is_constrained_dof(), libMesh::Elem::level(), libmesh_nullptr, std::min(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::Elem::n_neighbors(), libMesh::Elem::n_nodes(), libMesh::Elem::neighbor_ptr(), libMesh::FEType::order, libMesh::Elem::p_level(), libMesh::Real, libMesh::DenseVector< T >::resize(), libMesh::DenseMatrix< T >::resize(), libMesh::Elem::side_index_range(), libMesh::Threads::spin_mtx, libMesh::TOLERANCE, libMesh::DofMap::variable_type(), and libMesh::Elem::which_neighbor_am_i().

Referenced by libMesh::FE< Dim, T >::compute_constraints().

1367 {
1368  libmesh_assert(elem);
1369 
1370  const unsigned int Dim = elem->dim();
1371 
1372  // Only constrain elements in 2,3D.
1373  if (Dim == 1)
1374  return;
1375 
1376  // Only constrain active elements with this method
1377  if (!elem->active())
1378  return;
1379 
1380  const FEType & base_fe_type = dof_map.variable_type(variable_number);
1381 
1382  // Construct FE objects for this element and its neighbors.
1383  std::unique_ptr<FEGenericBase<OutputShape>> my_fe
1384  (FEGenericBase<OutputShape>::build(Dim, base_fe_type));
1385  const FEContinuity cont = my_fe->get_continuity();
1386 
1387  // We don't need to constrain discontinuous elements
1388  if (cont == DISCONTINUOUS)
1389  return;
1390  libmesh_assert (cont == C_ZERO || cont == C_ONE);
1391 
1392  std::unique_ptr<FEGenericBase<OutputShape>> neigh_fe
1393  (FEGenericBase<OutputShape>::build(Dim, base_fe_type));
1394 
1395  QGauss my_qface(Dim-1, base_fe_type.default_quadrature_order());
1396  my_fe->attach_quadrature_rule (&my_qface);
1397  std::vector<Point> neigh_qface;
1398 
1399  const std::vector<Real> & JxW = my_fe->get_JxW();
1400  const std::vector<Point> & q_point = my_fe->get_xyz();
1401  const std::vector<std::vector<OutputShape>> & phi = my_fe->get_phi();
1402  const std::vector<std::vector<OutputShape>> & neigh_phi =
1403  neigh_fe->get_phi();
1404  const std::vector<Point> * face_normals = libmesh_nullptr;
1405  const std::vector<std::vector<OutputGradient>> * dphi = libmesh_nullptr;
1406  const std::vector<std::vector<OutputGradient>> * neigh_dphi = libmesh_nullptr;
1407 
1408  std::vector<dof_id_type> my_dof_indices, neigh_dof_indices;
1409  std::vector<unsigned int> my_side_dofs, neigh_side_dofs;
1410 
1411  if (cont != C_ZERO)
1412  {
1413  const std::vector<Point> & ref_face_normals =
1414  my_fe->get_normals();
1415  face_normals = &ref_face_normals;
1416  const std::vector<std::vector<OutputGradient>> & ref_dphi =
1417  my_fe->get_dphi();
1418  dphi = &ref_dphi;
1419  const std::vector<std::vector<OutputGradient>> & ref_neigh_dphi =
1420  neigh_fe->get_dphi();
1421  neigh_dphi = &ref_neigh_dphi;
1422  }
1423 
1424  DenseMatrix<Real> Ke;
1425  DenseVector<Real> Fe;
1426  std::vector<DenseVector<Real>> Ue;
1427 
1428  // Look at the element faces. Check to see if we need to
1429  // build constraints.
1430  for (auto s : elem->side_index_range())
1431  if (elem->neighbor_ptr(s) != libmesh_nullptr)
1432  {
1433  // Get pointers to the element's neighbor.
1434  const Elem * neigh = elem->neighbor_ptr(s);
1435 
1436  // h refinement constraints:
1437  // constrain dofs shared between
1438  // this element and ones coarser
1439  // than this element.
1440  if (neigh->level() < elem->level())
1441  {
1442  unsigned int s_neigh = neigh->which_neighbor_am_i(elem);
1443  libmesh_assert_less (s_neigh, neigh->n_neighbors());
1444 
1445  // Find the minimum p level; we build the h constraint
1446  // matrix with this and then constrain away all higher p
1447  // DoFs.
1448  libmesh_assert(neigh->active());
1449  const unsigned int min_p_level =
1450  std::min(elem->p_level(), neigh->p_level());
1451 
1452  // we may need to make the FE objects reinit with the
1453  // minimum shared p_level
1454  const unsigned int old_elem_level = elem->p_level();
1455  if (elem->p_level() != min_p_level)
1456  my_fe->set_fe_order(my_fe->get_fe_type().order.get_order() - old_elem_level + min_p_level);
1457  const unsigned int old_neigh_level = neigh->p_level();
1458  if (old_neigh_level != min_p_level)
1459  neigh_fe->set_fe_order(neigh_fe->get_fe_type().order.get_order() - old_neigh_level + min_p_level);
1460 
1461  my_fe->reinit(elem, s);
1462 
1463  // This function gets called element-by-element, so there
1464  // will be a lot of memory allocation going on. We can
1465  // at least minimize this for the case of the dof indices
1466  // by efficiently preallocating the requisite storage.
1467  // n_nodes is not necessarily n_dofs, but it is better
1468  // than nothing!
1469  my_dof_indices.reserve (elem->n_nodes());
1470  neigh_dof_indices.reserve (neigh->n_nodes());
1471 
1472  dof_map.dof_indices (elem, my_dof_indices,
1473  variable_number,
1474  min_p_level);
1475  dof_map.dof_indices (neigh, neigh_dof_indices,
1476  variable_number,
1477  min_p_level);
1478 
1479  const unsigned int n_qp = my_qface.n_points();
1480 
1481  FEInterface::inverse_map (Dim, base_fe_type, neigh,
1482  q_point, neigh_qface);
1483 
1484  neigh_fe->reinit(neigh, &neigh_qface);
1485 
1486  // We're only concerned with DOFs whose values (and/or first
1487  // derivatives for C1 elements) are supported on side nodes
1488  FEType elem_fe_type = base_fe_type;
1489  if (old_elem_level != min_p_level)
1490  elem_fe_type.order = base_fe_type.order.get_order() - old_elem_level + min_p_level;
1491  FEType neigh_fe_type = base_fe_type;
1492  if (old_neigh_level != min_p_level)
1493  neigh_fe_type.order = base_fe_type.order.get_order() - old_neigh_level + min_p_level;
1494  FEInterface::dofs_on_side(elem, Dim, elem_fe_type, s, my_side_dofs);
1495  FEInterface::dofs_on_side(neigh, Dim, neigh_fe_type, s_neigh, neigh_side_dofs);
1496 
1497  const unsigned int n_side_dofs =
1498  cast_int<unsigned int>(my_side_dofs.size());
1499  libmesh_assert_equal_to (n_side_dofs, neigh_side_dofs.size());
1500 
1501  Ke.resize (n_side_dofs, n_side_dofs);
1502  Ue.resize(n_side_dofs);
1503 
1504  // Form the projection matrix, (inner product of fine basis
1505  // functions against fine test functions)
1506  for (unsigned int is = 0; is != n_side_dofs; ++is)
1507  {
1508  const unsigned int i = my_side_dofs[is];
1509  for (unsigned int js = 0; js != n_side_dofs; ++js)
1510  {
1511  const unsigned int j = my_side_dofs[js];
1512  for (unsigned int qp = 0; qp != n_qp; ++qp)
1513  {
1514  Ke(is,js) += JxW[qp] * TensorTools::inner_product(phi[i][qp], phi[j][qp]);
1515  if (cont != C_ZERO)
1516  Ke(is,js) += JxW[qp] *
1517  TensorTools::inner_product((*dphi)[i][qp] *
1518  (*face_normals)[qp],
1519  (*dphi)[j][qp] *
1520  (*face_normals)[qp]);
1521  }
1522  }
1523  }
1524 
1525  // Form the right hand sides, (inner product of coarse basis
1526  // functions against fine test functions)
1527  for (unsigned int is = 0; is != n_side_dofs; ++is)
1528  {
1529  const unsigned int i = neigh_side_dofs[is];
1530  Fe.resize (n_side_dofs);
1531  for (unsigned int js = 0; js != n_side_dofs; ++js)
1532  {
1533  const unsigned int j = my_side_dofs[js];
1534  for (unsigned int qp = 0; qp != n_qp; ++qp)
1535  {
1536  Fe(js) += JxW[qp] *
1537  TensorTools::inner_product(neigh_phi[i][qp],
1538  phi[j][qp]);
1539  if (cont != C_ZERO)
1540  Fe(js) += JxW[qp] *
1541  TensorTools::inner_product((*neigh_dphi)[i][qp] *
1542  (*face_normals)[qp],
1543  (*dphi)[j][qp] *
1544  (*face_normals)[qp]);
1545  }
1546  }
1547  Ke.cholesky_solve(Fe, Ue[is]);
1548  }
1549 
1550  for (unsigned int js = 0; js != n_side_dofs; ++js)
1551  {
1552  const unsigned int j = my_side_dofs[js];
1553  const dof_id_type my_dof_g = my_dof_indices[j];
1554  libmesh_assert_not_equal_to (my_dof_g, DofObject::invalid_id);
1555 
1556  // Hunt for "constraining against myself" cases before
1557  // we bother creating a constraint row
1558  bool self_constraint = false;
1559  for (unsigned int is = 0; is != n_side_dofs; ++is)
1560  {
1561  const unsigned int i = neigh_side_dofs[is];
1562  const dof_id_type their_dof_g = neigh_dof_indices[i];
1563  libmesh_assert_not_equal_to (their_dof_g, DofObject::invalid_id);
1564 
1565  if (their_dof_g == my_dof_g)
1566  {
1567 #ifndef NDEBUG
1568  const Real their_dof_value = Ue[is](js);
1569  libmesh_assert_less (std::abs(their_dof_value-1.),
1570  10*TOLERANCE);
1571 
1572  for (unsigned int k = 0; k != n_side_dofs; ++k)
1573  libmesh_assert(k == is ||
1574  std::abs(Ue[k](js)) <
1575  10*TOLERANCE);
1576 #endif
1577 
1578  self_constraint = true;
1579  break;
1580  }
1581  }
1582 
1583  if (self_constraint)
1584  continue;
1585 
1586  DofConstraintRow * constraint_row;
1587 
1588  // we may be running constraint methods concurrently
1589  // on multiple threads, so we need a lock to
1590  // ensure that this constraint is "ours"
1591  {
1592  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
1593 
1594  if (dof_map.is_constrained_dof(my_dof_g))
1595  continue;
1596 
1597  constraint_row = &(constraints[my_dof_g]);
1598  libmesh_assert(constraint_row->empty());
1599  }
1600 
1601  for (unsigned int is = 0; is != n_side_dofs; ++is)
1602  {
1603  const unsigned int i = neigh_side_dofs[is];
1604  const dof_id_type their_dof_g = neigh_dof_indices[i];
1605  libmesh_assert_not_equal_to (their_dof_g, DofObject::invalid_id);
1606  libmesh_assert_not_equal_to (their_dof_g, my_dof_g);
1607 
1608  const Real their_dof_value = Ue[is](js);
1609 
1610  if (std::abs(their_dof_value) < 10*TOLERANCE)
1611  continue;
1612 
1613  constraint_row->insert(std::make_pair(their_dof_g,
1614  their_dof_value));
1615  }
1616  }
1617 
1618  my_fe->set_fe_order(my_fe->get_fe_type().order.get_order() + old_elem_level - min_p_level);
1619  neigh_fe->set_fe_order(neigh_fe->get_fe_type().order.get_order() + old_neigh_level - min_p_level);
1620  }
1621 
1622  // p refinement constraints:
1623  // constrain dofs shared between
1624  // active elements and neighbors with
1625  // lower polynomial degrees
1626  const unsigned int min_p_level =
1627  neigh->min_p_level_by_neighbor(elem, elem->p_level());
1628  if (min_p_level < elem->p_level())
1629  {
1630  // Adaptive p refinement of non-hierarchic bases will
1631  // require more coding
1632  libmesh_assert(my_fe->is_hierarchic());
1633  dof_map.constrain_p_dofs(variable_number, elem,
1634  s, min_p_level);
1635  }
1636  }
1637 }
Manages the family, order, etc. parameters for a given FE.
Definition: fe_type.h:179
int get_order() const
Definition: fe_type.h:78
double abs(double a)
bool active() const
Definition: elem.h:2258
unsigned int p_level() const
Definition: elem.h:2423
const FEType & variable_type(const unsigned int c) const
Definition: dof_map.h:1719
static void dofs_on_side(const Elem *const elem, const unsigned int dim, const FEType &fe_t, unsigned int s, std::vector< unsigned int > &di)
Definition: fe_interface.C:480
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2084
void resize(const unsigned int n)
Definition: dense_vector.h:350
unsigned int which_neighbor_am_i(const Elem *e) const
Definition: elem.h:2182
unsigned int min_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
Definition: elem.C:1906
The base class for all geometric element types.
Definition: elem.h:90
unsigned int n_neighbors() const
Definition: elem.h:614
const class libmesh_nullptr_t libmesh_nullptr
OrderWrapper order
Definition: fe_type.h:198
static const Real TOLERANCE
virtual unsigned int n_nodes() const =0
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:1968
bool is_constrained_dof(const dof_id_type dof) const
Definition: dof_map.h:1756
spin_mutex spin_mtx
Definition: threads.C:29
std::vector< std::vector< OutputShape > > phi
Definition: fe_base.h:499
Order default_quadrature_order() const
Definition: fe_type.h:333
static const dof_id_type invalid_id
Definition: dof_object.h:324
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_interface.C:547
std::vector< std::vector< OutputGradient > > dphi
Definition: fe_base.h:504
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::map< dof_id_type, Real, std::less< dof_id_type >, Threads::scalable_allocator< std::pair< const dof_id_type, Real > > > DofConstraintRow
Definition: dof_map.h:89
void resize(const unsigned int new_m, const unsigned int new_n)
Definition: dense_matrix.h:776
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2389
Implements 1, 2, and 3D "Gaussian" quadrature rules.
void cholesky_solve(const DenseVector< T2 > &b, DenseVector< T2 > &x)
A matrix object used for finite element assembly and numerics.
Definition: dense_matrix.h:54
long double min(long double a, double b)
boostcopy::enable_if_c< ScalarTraits< T >::value &&ScalarTraits< T2 >::value, typename CompareTypes< T, T2 >::supertype >::type inner_product(const T &a, const T2 &b)
Definition: tensor_tools.h:47
void constrain_p_dofs(unsigned int var, const Elem *elem, unsigned int s, unsigned int p)
uint8_t dof_id_type
Definition: id_types.h:64
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Definition: dof_map.C:1924
template<typename OutputType >
void libMesh::FEGenericBase< OutputType >::compute_shape_functions ( const Elem elem,
const std::vector< Point > &  qp 
)
protectedvirtual

After having updated the jacobian and the transformation from local to global coordinates in FEAbstract::compute_map(), the first derivatives of the shape functions are transformed to global coordinates, giving dphi, dphidx, dphidy, and dphidz. This method should rarely be re-defined in derived classes, but still should be usable for children. Therefore, keep it protected.

Implements libMesh::FEAbstract.

Reimplemented in libMesh::FEXYZ< Dim >, and libMesh::InfFE< Dim, T_radial, T_map >.

Definition at line 672 of file fe_base.C.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_Sobolev_dweight().

674 {
675  //-------------------------------------------------------------------------
676  // Compute the shape function values (and derivatives)
677  // at the Quadrature points. Note that the actual values
678  // have already been computed via init_shape_functions
679 
680  // Start logging the shape function computation
681  LOG_SCOPE("compute_shape_functions()", "FE");
682 
683  this->determine_calculations();
684 
685  if (calculate_phi)
686  this->_fe_trans->map_phi(this->dim, elem, qp, (*this), this->phi);
687 
688  if (calculate_dphi)
689  this->_fe_trans->map_dphi(this->dim, elem, qp, (*this), this->dphi,
690  this->dphidx, this->dphidy, this->dphidz);
691 
692 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
693  if (calculate_d2phi)
694  this->_fe_trans->map_d2phi(this->dim, qp, (*this), this->d2phi,
695  this->d2phidx2, this->d2phidxdy, this->d2phidxdz,
696  this->d2phidy2, this->d2phidydz, this->d2phidz2);
697 #endif //LIBMESH_ENABLE_SECOND_DERIVATIVES
698 
699  // Only compute curl for vector-valued elements
701  this->_fe_trans->map_curl(this->dim, elem, qp, (*this), this->curl_phi);
702 
703  // Only compute div for vector-valued elements
705  this->_fe_trans->map_div(this->dim, elem, qp, (*this), this->div_phi);
706 }
std::vector< std::vector< OutputTensor > > d2phi
Definition: fe_base.h:552
std::vector< std::vector< OutputShape > > d2phidxdz
Definition: fe_base.h:597
std::vector< std::vector< OutputShape > > d2phidydz
Definition: fe_base.h:607
std::unique_ptr< FETransformationBase< OutputType > > _fe_trans
Definition: fe_base.h:494
std::vector< std::vector< OutputShape > > d2phidx2
Definition: fe_base.h:587
std::vector< std::vector< OutputShape > > curl_phi
Definition: fe_base.h:509
std::vector< std::vector< OutputShape > > dphidy
Definition: fe_base.h:539
std::vector< std::vector< OutputShape > > d2phidy2
Definition: fe_base.h:602
std::vector< std::vector< OutputShape > > d2phidxdy
Definition: fe_base.h:592
std::vector< std::vector< OutputShape > > dphidx
Definition: fe_base.h:534
std::vector< std::vector< OutputShape > > phi
Definition: fe_base.h:499
const unsigned int dim
Definition: fe_abstract.h:523
std::vector< std::vector< OutputDivergence > > div_phi
Definition: fe_base.h:514
void determine_calculations()
Definition: fe_base.C:731
std::vector< std::vector< OutputGradient > > dphi
Definition: fe_base.h:504
std::vector< std::vector< OutputShape > > d2phidz2
Definition: fe_base.h:612
std::vector< std::vector< OutputShape > > dphidz
Definition: fe_base.h:544
template<typename OutputType >
void libMesh::FEGenericBase< OutputType >::determine_calculations ( )
protected

Determine which values are to be calculated, for both the FE itself and for the FEMap.

Definition at line 731 of file fe_base.C.

References libMesh::FEInterface::field_type(), and libMesh::TYPE_VECTOR.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_Sobolev_dweight(), and libMesh::InfFE< Dim, T_radial, T_map >::reinit().

732 {
733  this->calculations_started = true;
734 
735  // If the user forgot to request anything, we'll be safe and
736  // calculate everything:
737 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
738  if (!this->calculate_phi && !this->calculate_dphi && !this->calculate_d2phi
739  && !this->calculate_curl_phi && !this->calculate_div_phi)
740  {
741  this->calculate_phi = this->calculate_dphi = this->calculate_d2phi = this->calculate_dphiref = true;
743  {
744  this->calculate_curl_phi = true;
745  this->calculate_div_phi = true;
746  }
747  }
748 #else
749  if (!this->calculate_phi && !this->calculate_dphi && !this->calculate_curl_phi && !this->calculate_div_phi)
750  {
751  this->calculate_phi = this->calculate_dphi = this->calculate_dphiref = true;
753  {
754  this->calculate_curl_phi = true;
755  this->calculate_div_phi = true;
756  }
757  }
758 #endif // LIBMESH_ENABLE_SECOND_DERIVATIVES
759 
760  // Request whichever terms are necessary from the FEMap
761  if (this->calculate_phi)
762  this->_fe_trans->init_map_phi(*this);
763 
764  if (this->calculate_dphiref)
765  this->_fe_trans->init_map_dphi(*this);
766 
767 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
768  if (this->calculate_d2phi)
769  this->_fe_trans->init_map_d2phi(*this);
770 #endif //LIBMESH_ENABLE_SECOND_DERIVATIVES
771 }
FEFamily family
Definition: fe_type.h:204
std::unique_ptr< FETransformationBase< OutputType > > _fe_trans
Definition: fe_base.h:494
static FEFieldType field_type(const FEType &fe_type)
void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited
virtual void libMesh::FEAbstract::edge_reinit ( const Elem elem,
const unsigned int  edge,
const Real  tolerance = TOLERANCE,
const std::vector< Point > *  pts = libmesh_nullptr,
const std::vector< Real > *  weights = libmesh_nullptr 
)
pure virtualinherited

Reinitializes all the physical element-dependent data based on the edge of the element elem. The tolerance parameter is passed to the involved call to inverse_map(). By default the element data are computed at the quadrature points specified by the quadrature rule qrule, but any set of points on the reference edge element may be specified in the optional argument pts.

Implemented in libMesh::InfFE< Dim, T_radial, T_map >, libMesh::FE< Dim, T >, libMesh::FE< 2, SUBDIVISION >, libMesh::FE< Dim, HIERARCHIC >, libMesh::FE< Dim, SCALAR >, libMesh::FE< Dim, L2_LAGRANGE >, libMesh::FE< Dim, NEDELEC_ONE >, libMesh::FE< Dim, HERMITE >, libMesh::FE< Dim, CLOUGH >, libMesh::FE< Dim, MONOMIAL >, libMesh::FE< Dim, XYZ >, libMesh::FE< Dim, LAGRANGE >, libMesh::FE< Dim, L2_HIERARCHIC >, and libMesh::FE< Dim, LAGRANGE_VEC >.

void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

Methods to enable/disable the reference counter output from print_info()

Definition at line 101 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

Referenced by libMesh::ReferenceCounter::n_objects().

102 {
103  _enable_print_counter = true;
104  return;
105 }
virtual FEContinuity libMesh::FEAbstract::get_continuity ( ) const
pure virtualinherited
Returns
The continuity level of the finite element.

Implemented in libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::InfFE< Dim, T_radial, T_map >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< 2, SUBDIVISION >, libMesh::FE< Dim, HIERARCHIC >, libMesh::FE< Dim, SCALAR >, libMesh::FE< Dim, L2_LAGRANGE >, libMesh::FE< Dim, NEDELEC_ONE >, libMesh::FE< Dim, HERMITE >, libMesh::FE< Dim, CLOUGH >, libMesh::FE< Dim, MONOMIAL >, libMesh::FE< Dim, XYZ >, libMesh::FE< Dim, LAGRANGE >, libMesh::FE< Dim, L2_HIERARCHIC >, libMesh::FE< Dim, LAGRANGE_VEC >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, and libMesh::FE< Dim, T >.

Referenced by libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()(), and libMesh::FEAbstract::set_fe_order().

template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_curl_phi ( ) const
inline
Returns
The curl of the shape function at the quadrature points.

Definition at line 224 of file fe_base.h.

Referenced by libMesh::ExactSolution::_compute_error().

225  { libmesh_assert(!calculations_started || calculate_curl_phi);
226  calculate_curl_phi = calculate_dphiref = true; return curl_phi; }
std::vector< std::vector< OutputShape > > curl_phi
Definition: fe_base.h:509
const std::vector<Real>& libMesh::FEAbstract::get_curvatures ( ) const
inlineinherited
Returns
The curvatures for use in face integration.

Definition at line 383 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map, libMesh::FEAbstract::attach_quadrature_rule(), libMesh::FEAbstract::n_quadrature_points(), and libMesh::FEAbstract::n_shape_functions().

384  { return this->_fe_map->get_curvatures();}
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
template<typename OutputType>
const std::vector<std::vector<OutputTensor> >& libMesh::FEGenericBase< OutputType >::get_d2phi ( ) const
inline
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phideta2 ( ) const
inline
Returns
The shape function second derivatives at the quadrature points, in reference coordinates

Definition at line 370 of file fe_base.h.

Referenced by libMesh::H1FETransformation< OutputShape >::map_d2phi().

371  { libmesh_assert(!calculations_started || calculate_d2phi);
372  calculate_d2phi = calculate_dphiref = true; return d2phideta2; }
std::vector< std::vector< OutputShape > > d2phideta2
Definition: fe_base.h:572
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidetadzeta ( ) const
inline
Returns
The shape function second derivatives at the quadrature points, in reference coordinates

Definition at line 378 of file fe_base.h.

Referenced by libMesh::H1FETransformation< OutputShape >::map_d2phi().

379  { libmesh_assert(!calculations_started || calculate_d2phi);
std::vector< std::vector< OutputShape > > d2phidetadzeta
Definition: fe_base.h:577
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidx2 ( ) const
inline
Returns
The shape function second derivatives at the quadrature points.

Definition at line 298 of file fe_base.h.

299  { libmesh_assert(!calculations_started || calculate_d2phi);
300  calculate_d2phi = calculate_dphiref = true; return d2phidx2; }
std::vector< std::vector< OutputShape > > d2phidx2
Definition: fe_base.h:587
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidxdy ( ) const
inline
Returns
The shape function second derivatives at the quadrature points.

Definition at line 306 of file fe_base.h.

307  { libmesh_assert(!calculations_started || calculate_d2phi);
308  calculate_d2phi = calculate_dphiref = true; return d2phidxdy; }
std::vector< std::vector< OutputShape > > d2phidxdy
Definition: fe_base.h:592
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidxdz ( ) const
inline
Returns
The shape function second derivatives at the quadrature points.

Definition at line 314 of file fe_base.h.

315  { libmesh_assert(!calculations_started || calculate_d2phi);
316  calculate_d2phi = calculate_dphiref = true; return d2phidxdz; }
std::vector< std::vector< OutputShape > > d2phidxdz
Definition: fe_base.h:597
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidxi2 ( ) const
inline
Returns
The shape function second derivatives at the quadrature points, in reference coordinates

Definition at line 346 of file fe_base.h.

Referenced by libMesh::H1FETransformation< OutputShape >::map_d2phi().

347  { libmesh_assert(!calculations_started || calculate_d2phi);
348  calculate_d2phi = calculate_dphiref = true; return d2phidxi2; }
std::vector< std::vector< OutputShape > > d2phidxi2
Definition: fe_base.h:557
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidxideta ( ) const
inline
Returns
The shape function second derivatives at the quadrature points, in reference coordinates

Definition at line 354 of file fe_base.h.

Referenced by libMesh::H1FETransformation< OutputShape >::map_d2phi().

355  { libmesh_assert(!calculations_started || calculate_d2phi);
std::vector< std::vector< OutputShape > > d2phidxideta
Definition: fe_base.h:562
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidxidzeta ( ) const
inline
Returns
The shape function second derivatives at the quadrature points, in reference coordinates

Definition at line 362 of file fe_base.h.

Referenced by libMesh::H1FETransformation< OutputShape >::map_d2phi().

363  { libmesh_assert(!calculations_started || calculate_d2phi);
std::vector< std::vector< OutputShape > > d2phidxidzeta
Definition: fe_base.h:567
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidy2 ( ) const
inline
Returns
The shape function second derivatives at the quadrature points.

Definition at line 322 of file fe_base.h.

323  { libmesh_assert(!calculations_started || calculate_d2phi);
324  calculate_d2phi = calculate_dphiref = true; return d2phidy2; }
std::vector< std::vector< OutputShape > > d2phidy2
Definition: fe_base.h:602
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidydz ( ) const
inline
Returns
The shape function second derivatives at the quadrature points.

Definition at line 330 of file fe_base.h.

331  { libmesh_assert(!calculations_started || calculate_d2phi);
332  calculate_d2phi = calculate_dphiref = true; return d2phidydz; }
std::vector< std::vector< OutputShape > > d2phidydz
Definition: fe_base.h:607
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidz2 ( ) const
inline
Returns
The shape function second derivatives at the quadrature points.

Definition at line 338 of file fe_base.h.

339  { libmesh_assert(!calculations_started || calculate_d2phi);
340  calculate_d2phi = calculate_dphiref = true; return d2phidz2; }
std::vector< std::vector< OutputShape > > d2phidz2
Definition: fe_base.h:612
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidzeta2 ( ) const
inline
Returns
The shape function second derivatives at the quadrature points, in reference coordinates

Definition at line 386 of file fe_base.h.

Referenced by libMesh::H1FETransformation< OutputShape >::map_d2phi().

387  { libmesh_assert(!calculations_started || calculate_d2phi);
388  calculate_d2phi = calculate_dphiref = true; return d2phidzeta2; }
std::vector< std::vector< OutputShape > > d2phidzeta2
Definition: fe_base.h:582
const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdeta2 ( ) const
inlineinherited
Returns
The second partial derivatives in eta.

Definition at line 270 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

271  { return this->_fe_map->get_d2xyzdeta2(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdetadzeta ( ) const
inlineinherited
Returns
The second partial derivatives in eta-zeta.

Definition at line 300 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

301  { return this->_fe_map->get_d2xyzdetadzeta(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdxi2 ( ) const
inlineinherited
Returns
The second partial derivatives in xi.

Definition at line 264 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

265  { return this->_fe_map->get_d2xyzdxi2(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdxideta ( ) const
inlineinherited
Returns
The second partial derivatives in xi-eta.

Definition at line 286 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

287  { return this->_fe_map->get_d2xyzdxideta(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdxidzeta ( ) const
inlineinherited
Returns
The second partial derivatives in xi-zeta.

Definition at line 294 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

295  { return this->_fe_map->get_d2xyzdxidzeta(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdzeta2 ( ) const
inlineinherited
Returns
The second partial derivatives in zeta.

Definition at line 278 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

279  { return this->_fe_map->get_d2xyzdzeta2(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<Real>& libMesh::FEAbstract::get_detadx ( ) const
inlineinherited
Returns
The deta/dx entry in the transformation matrix from physical to local coordinates.

Definition at line 330 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

331  { return this->_fe_map->get_detadx(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<Real>& libMesh::FEAbstract::get_detady ( ) const
inlineinherited
Returns
The deta/dy entry in the transformation matrix from physical to local coordinates.

Definition at line 337 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

338  { return this->_fe_map->get_detady(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<Real>& libMesh::FEAbstract::get_detadz ( ) const
inlineinherited
Returns
The deta/dz entry in the transformation matrix from physical to local coordinates.

Definition at line 344 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

345  { return this->_fe_map->get_detadz(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
unsigned int libMesh::FEAbstract::get_dim ( ) const
inlineinherited
Returns
the dimension of this FE

Definition at line 223 of file fe_abstract.h.

References libMesh::FEAbstract::dim.

224  { return dim; }
const unsigned int dim
Definition: fe_abstract.h:523
template<typename OutputType>
const std::vector<std::vector<OutputDivergence> >& libMesh::FEGenericBase< OutputType >::get_div_phi ( ) const
inline
Returns
The divergence of the shape function at the quadrature points.

Definition at line 232 of file fe_base.h.

Referenced by libMesh::ExactSolution::_compute_error().

233  { libmesh_assert(!calculations_started || calculate_div_phi);
234  calculate_div_phi = calculate_dphiref = true; return div_phi; }
std::vector< std::vector< OutputDivergence > > div_phi
Definition: fe_base.h:514
template<typename OutputType>
const std::vector<OutputGradient>& libMesh::FEGenericBase< OutputType >::get_dphase ( ) const
inline
Returns
The global first derivative of the phase term which is used in infinite elements, evaluated at the quadrature points.

In case of the general finite element class FE this field is initialized to all zero, so that the variational formulation for an infinite element produces correct element matrices for a mesh using both finite and infinite elements.

Definition at line 404 of file fe_base.h.

405  { return dphase; }
std::vector< OutputGradient > dphase
Definition: fe_base.h:630
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_dphideta ( ) const
inline
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_dphidx ( ) const
inline
Returns
The shape function x-derivative at the quadrature points.

Definition at line 240 of file fe_base.h.

241  { libmesh_assert(!calculations_started || calculate_dphi);
242  calculate_dphi = calculate_dphiref = true; return dphidx; }
std::vector< std::vector< OutputShape > > dphidx
Definition: fe_base.h:534
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_dphidxi ( ) const
inline
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_dphidy ( ) const
inline
Returns
The shape function y-derivative at the quadrature points.

Definition at line 248 of file fe_base.h.

249  { libmesh_assert(!calculations_started || calculate_dphi);
250  calculate_dphi = calculate_dphiref = true; return dphidy; }
std::vector< std::vector< OutputShape > > dphidy
Definition: fe_base.h:539
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_dphidz ( ) const
inline
Returns
The shape function z-derivative at the quadrature points.

Definition at line 256 of file fe_base.h.

257  { libmesh_assert(!calculations_started || calculate_dphi);
258  calculate_dphi = calculate_dphiref = true; return dphidz; }
std::vector< std::vector< OutputShape > > dphidz
Definition: fe_base.h:544
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_dphidzeta ( ) const
inline
const std::vector<Real>& libMesh::FEAbstract::get_dxidx ( ) const
inlineinherited
Returns
The dxi/dx entry in the transformation matrix from physical to local coordinates.

Definition at line 309 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

310  { return this->_fe_map->get_dxidx(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<Real>& libMesh::FEAbstract::get_dxidy ( ) const
inlineinherited
Returns
The dxi/dy entry in the transformation matrix from physical to local coordinates.

Definition at line 316 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

317  { return this->_fe_map->get_dxidy(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<Real>& libMesh::FEAbstract::get_dxidz ( ) const
inlineinherited
Returns
The dxi/dz entry in the transformation matrix from physical to local coordinates.

Definition at line 323 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

324  { return this->_fe_map->get_dxidz(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<RealGradient>& libMesh::FEAbstract::get_dxyzdeta ( ) const
inlineinherited
Returns
The element tangents in eta-direction at the quadrature points.

Definition at line 251 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

252  { return this->_fe_map->get_dxyzdeta(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<RealGradient>& libMesh::FEAbstract::get_dxyzdxi ( ) const
inlineinherited
Returns
The element tangents in xi-direction at the quadrature points.

Definition at line 244 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

245  { return this->_fe_map->get_dxyzdxi(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<RealGradient>& libMesh::FEAbstract::get_dxyzdzeta ( ) const
inlineinherited
Returns
The element tangents in zeta-direction at the quadrature points.

Definition at line 258 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

259  { return _fe_map->get_dxyzdzeta(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<Real>& libMesh::FEAbstract::get_dzetadx ( ) const
inlineinherited
Returns
The dzeta/dx entry in the transformation matrix from physical to local coordinates.

Definition at line 351 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

352  { return this->_fe_map->get_dzetadx(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<Real>& libMesh::FEAbstract::get_dzetady ( ) const
inlineinherited
Returns
The dzeta/dy entry in the transformation matrix from physical to local coordinates.

Definition at line 358 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

359  { return this->_fe_map->get_dzetady(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<Real>& libMesh::FEAbstract::get_dzetadz ( ) const
inlineinherited
Returns
The dzeta/dz entry in the transformation matrix from physical to local coordinates.

Definition at line 365 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

366  { return this->_fe_map->get_dzetadz(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
FEFamily libMesh::FEAbstract::get_family ( ) const
inlineinherited
Returns
The finite element family of this element.

Definition at line 447 of file fe_abstract.h.

References libMesh::FEType::family, and libMesh::FEAbstract::fe_type.

Referenced by libMesh::FE< Dim, T >::FE().

447 { return fe_type.family; }
FEFamily family
Definition: fe_type.h:204
std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

Definition at line 47 of file reference_counter.C.

References libMesh::ReferenceCounter::_counts, and libMesh::Quality::name().

Referenced by libMesh::ReferenceCounter::print_info().

48 {
49 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
50 
51  std::ostringstream oss;
52 
53  oss << '\n'
54  << " ---------------------------------------------------------------------------- \n"
55  << "| Reference count information |\n"
56  << " ---------------------------------------------------------------------------- \n";
57 
58  for (Counts::iterator it = _counts.begin();
59  it != _counts.end(); ++it)
60  {
61  const std::string name(it->first);
62  const unsigned int creations = it->second.first;
63  const unsigned int destructions = it->second.second;
64 
65  oss << "| " << name << " reference count information:\n"
66  << "| Creations: " << creations << '\n'
67  << "| Destructions: " << destructions << '\n';
68  }
69 
70  oss << " ---------------------------------------------------------------------------- \n";
71 
72  return oss.str();
73 
74 #else
75 
76  return "";
77 
78 #endif
79 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
const std::vector<Point>& libMesh::FEAbstract::get_normals ( ) const
inlineinherited
Order libMesh::FEAbstract::get_order ( ) const
inlineinherited
Returns
The approximation order of the finite element.

Definition at line 426 of file fe_abstract.h.

References libMesh::FEAbstract::_p_level, libMesh::FEAbstract::fe_type, and libMesh::FEType::order.

426 { return static_cast<Order>(fe_type.order + _p_level); }
unsigned int _p_level
Definition: fe_abstract.h:579
OrderWrapper order
Definition: fe_type.h:198
unsigned int libMesh::FEAbstract::get_p_level ( ) const
inlineinherited
Returns
The p refinement level that the current shape functions have been calculated for.

Definition at line 416 of file fe_abstract.h.

References libMesh::FEAbstract::_p_level.

416 { return _p_level; }
unsigned int _p_level
Definition: fe_abstract.h:579
void libMesh::FEAbstract::get_refspace_nodes ( const ElemType  t,
std::vector< Point > &  nodes 
)
staticinherited
Returns
The reference space coordinates of nodes based on the element type.

Definition at line 256 of file fe_abstract.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::TET10, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, and libMesh::TRISHELL3.

257 {
258  switch(itemType)
259  {
260  case EDGE2:
261  {
262  nodes.resize(2);
263  nodes[0] = Point (-1.,0.,0.);
264  nodes[1] = Point (1.,0.,0.);
265  return;
266  }
267  case EDGE3:
268  {
269  nodes.resize(3);
270  nodes[0] = Point (-1.,0.,0.);
271  nodes[1] = Point (1.,0.,0.);
272  nodes[2] = Point (0.,0.,0.);
273  return;
274  }
275  case TRI3:
276  case TRISHELL3:
277  {
278  nodes.resize(3);
279  nodes[0] = Point (0.,0.,0.);
280  nodes[1] = Point (1.,0.,0.);
281  nodes[2] = Point (0.,1.,0.);
282  return;
283  }
284  case TRI6:
285  {
286  nodes.resize(6);
287  nodes[0] = Point (0.,0.,0.);
288  nodes[1] = Point (1.,0.,0.);
289  nodes[2] = Point (0.,1.,0.);
290  nodes[3] = Point (.5,0.,0.);
291  nodes[4] = Point (.5,.5,0.);
292  nodes[5] = Point (0.,.5,0.);
293  return;
294  }
295  case QUAD4:
296  case QUADSHELL4:
297  {
298  nodes.resize(4);
299  nodes[0] = Point (-1.,-1.,0.);
300  nodes[1] = Point (1.,-1.,0.);
301  nodes[2] = Point (1.,1.,0.);
302  nodes[3] = Point (-1.,1.,0.);
303  return;
304  }
305  case QUAD8:
306  case QUADSHELL8:
307  {
308  nodes.resize(8);
309  nodes[0] = Point (-1.,-1.,0.);
310  nodes[1] = Point (1.,-1.,0.);
311  nodes[2] = Point (1.,1.,0.);
312  nodes[3] = Point (-1.,1.,0.);
313  nodes[4] = Point (0.,-1.,0.);
314  nodes[5] = Point (1.,0.,0.);
315  nodes[6] = Point (0.,1.,0.);
316  nodes[7] = Point (-1.,0.,0.);
317  return;
318  }
319  case QUAD9:
320  {
321  nodes.resize(9);
322  nodes[0] = Point (-1.,-1.,0.);
323  nodes[1] = Point (1.,-1.,0.);
324  nodes[2] = Point (1.,1.,0.);
325  nodes[3] = Point (-1.,1.,0.);
326  nodes[4] = Point (0.,-1.,0.);
327  nodes[5] = Point (1.,0.,0.);
328  nodes[6] = Point (0.,1.,0.);
329  nodes[7] = Point (-1.,0.,0.);
330  nodes[8] = Point (0.,0.,0.);
331  return;
332  }
333  case TET4:
334  {
335  nodes.resize(4);
336  nodes[0] = Point (0.,0.,0.);
337  nodes[1] = Point (1.,0.,0.);
338  nodes[2] = Point (0.,1.,0.);
339  nodes[3] = Point (0.,0.,1.);
340  return;
341  }
342  case TET10:
343  {
344  nodes.resize(10);
345  nodes[0] = Point (0.,0.,0.);
346  nodes[1] = Point (1.,0.,0.);
347  nodes[2] = Point (0.,1.,0.);
348  nodes[3] = Point (0.,0.,1.);
349  nodes[4] = Point (.5,0.,0.);
350  nodes[5] = Point (.5,.5,0.);
351  nodes[6] = Point (0.,.5,0.);
352  nodes[7] = Point (0.,0.,.5);
353  nodes[8] = Point (.5,0.,.5);
354  nodes[9] = Point (0.,.5,.5);
355  return;
356  }
357  case HEX8:
358  {
359  nodes.resize(8);
360  nodes[0] = Point (-1.,-1.,-1.);
361  nodes[1] = Point (1.,-1.,-1.);
362  nodes[2] = Point (1.,1.,-1.);
363  nodes[3] = Point (-1.,1.,-1.);
364  nodes[4] = Point (-1.,-1.,1.);
365  nodes[5] = Point (1.,-1.,1.);
366  nodes[6] = Point (1.,1.,1.);
367  nodes[7] = Point (-1.,1.,1.);
368  return;
369  }
370  case HEX20:
371  {
372  nodes.resize(20);
373  nodes[0] = Point (-1.,-1.,-1.);
374  nodes[1] = Point (1.,-1.,-1.);
375  nodes[2] = Point (1.,1.,-1.);
376  nodes[3] = Point (-1.,1.,-1.);
377  nodes[4] = Point (-1.,-1.,1.);
378  nodes[5] = Point (1.,-1.,1.);
379  nodes[6] = Point (1.,1.,1.);
380  nodes[7] = Point (-1.,1.,1.);
381  nodes[8] = Point (0.,-1.,-1.);
382  nodes[9] = Point (1.,0.,-1.);
383  nodes[10] = Point (0.,1.,-1.);
384  nodes[11] = Point (-1.,0.,-1.);
385  nodes[12] = Point (-1.,-1.,0.);
386  nodes[13] = Point (1.,-1.,0.);
387  nodes[14] = Point (1.,1.,0.);
388  nodes[15] = Point (-1.,1.,0.);
389  nodes[16] = Point (0.,-1.,1.);
390  nodes[17] = Point (1.,0.,1.);
391  nodes[18] = Point (0.,1.,1.);
392  nodes[19] = Point (-1.,0.,1.);
393  return;
394  }
395  case HEX27:
396  {
397  nodes.resize(27);
398  nodes[0] = Point (-1.,-1.,-1.);
399  nodes[1] = Point (1.,-1.,-1.);
400  nodes[2] = Point (1.,1.,-1.);
401  nodes[3] = Point (-1.,1.,-1.);
402  nodes[4] = Point (-1.,-1.,1.);
403  nodes[5] = Point (1.,-1.,1.);
404  nodes[6] = Point (1.,1.,1.);
405  nodes[7] = Point (-1.,1.,1.);
406  nodes[8] = Point (0.,-1.,-1.);
407  nodes[9] = Point (1.,0.,-1.);
408  nodes[10] = Point (0.,1.,-1.);
409  nodes[11] = Point (-1.,0.,-1.);
410  nodes[12] = Point (-1.,-1.,0.);
411  nodes[13] = Point (1.,-1.,0.);
412  nodes[14] = Point (1.,1.,0.);
413  nodes[15] = Point (-1.,1.,0.);
414  nodes[16] = Point (0.,-1.,1.);
415  nodes[17] = Point (1.,0.,1.);
416  nodes[18] = Point (0.,1.,1.);
417  nodes[19] = Point (-1.,0.,1.);
418  nodes[20] = Point (0.,0.,-1.);
419  nodes[21] = Point (0.,-1.,0.);
420  nodes[22] = Point (1.,0.,0.);
421  nodes[23] = Point (0.,1.,0.);
422  nodes[24] = Point (-1.,0.,0.);
423  nodes[25] = Point (0.,0.,1.);
424  nodes[26] = Point (0.,0.,0.);
425  return;
426  }
427  case PRISM6:
428  {
429  nodes.resize(6);
430  nodes[0] = Point (0.,0.,-1.);
431  nodes[1] = Point (1.,0.,-1.);
432  nodes[2] = Point (0.,1.,-1.);
433  nodes[3] = Point (0.,0.,1.);
434  nodes[4] = Point (1.,0.,1.);
435  nodes[5] = Point (0.,1.,1.);
436  return;
437  }
438  case PRISM15:
439  {
440  nodes.resize(15);
441  nodes[0] = Point (0.,0.,-1.);
442  nodes[1] = Point (1.,0.,-1.);
443  nodes[2] = Point (0.,1.,-1.);
444  nodes[3] = Point (0.,0.,1.);
445  nodes[4] = Point (1.,0.,1.);
446  nodes[5] = Point (0.,1.,1.);
447  nodes[6] = Point (.5,0.,-1.);
448  nodes[7] = Point (.5,.5,-1.);
449  nodes[8] = Point (0.,.5,-1.);
450  nodes[9] = Point (0.,0.,0.);
451  nodes[10] = Point (1.,0.,0.);
452  nodes[11] = Point (0.,1.,0.);
453  nodes[12] = Point (.5,0.,1.);
454  nodes[13] = Point (.5,.5,1.);
455  nodes[14] = Point (0.,.5,1.);
456  return;
457  }
458  case PRISM18:
459  {
460  nodes.resize(18);
461  nodes[0] = Point (0.,0.,-1.);
462  nodes[1] = Point (1.,0.,-1.);
463  nodes[2] = Point (0.,1.,-1.);
464  nodes[3] = Point (0.,0.,1.);
465  nodes[4] = Point (1.,0.,1.);
466  nodes[5] = Point (0.,1.,1.);
467  nodes[6] = Point (.5,0.,-1.);
468  nodes[7] = Point (.5,.5,-1.);
469  nodes[8] = Point (0.,.5,-1.);
470  nodes[9] = Point (0.,0.,0.);
471  nodes[10] = Point (1.,0.,0.);
472  nodes[11] = Point (0.,1.,0.);
473  nodes[12] = Point (.5,0.,1.);
474  nodes[13] = Point (.5,.5,1.);
475  nodes[14] = Point (0.,.5,1.);
476  nodes[15] = Point (.5,0.,0.);
477  nodes[16] = Point (.5,.5,0.);
478  nodes[17] = Point (0.,.5,0.);
479  return;
480  }
481  case PYRAMID5:
482  {
483  nodes.resize(5);
484  nodes[0] = Point (-1.,-1.,0.);
485  nodes[1] = Point (1.,-1.,0.);
486  nodes[2] = Point (1.,1.,0.);
487  nodes[3] = Point (-1.,1.,0.);
488  nodes[4] = Point (0.,0.,1.);
489  return;
490  }
491  case PYRAMID13:
492  {
493  nodes.resize(13);
494 
495  // base corners
496  nodes[0] = Point (-1.,-1.,0.);
497  nodes[1] = Point (1.,-1.,0.);
498  nodes[2] = Point (1.,1.,0.);
499  nodes[3] = Point (-1.,1.,0.);
500 
501  // apex
502  nodes[4] = Point (0.,0.,1.);
503 
504  // base midedge
505  nodes[5] = Point (0.,-1.,0.);
506  nodes[6] = Point (1.,0.,0.);
507  nodes[7] = Point (0.,1.,0.);
508  nodes[8] = Point (-1,0.,0.);
509 
510  // lateral midedge
511  nodes[9] = Point (-.5,-.5,.5);
512  nodes[10] = Point (.5,-.5,.5);
513  nodes[11] = Point (.5,.5,.5);
514  nodes[12] = Point (-.5,.5,.5);
515 
516  return;
517  }
518  case PYRAMID14:
519  {
520  nodes.resize(14);
521 
522  // base corners
523  nodes[0] = Point (-1.,-1.,0.);
524  nodes[1] = Point (1.,-1.,0.);
525  nodes[2] = Point (1.,1.,0.);
526  nodes[3] = Point (-1.,1.,0.);
527 
528  // apex
529  nodes[4] = Point (0.,0.,1.);
530 
531  // base midedge
532  nodes[5] = Point (0.,-1.,0.);
533  nodes[6] = Point (1.,0.,0.);
534  nodes[7] = Point (0.,1.,0.);
535  nodes[8] = Point (-1,0.,0.);
536 
537  // lateral midedge
538  nodes[9] = Point (-.5,-.5,.5);
539  nodes[10] = Point (.5,-.5,.5);
540  nodes[11] = Point (.5,.5,.5);
541  nodes[12] = Point (-.5,.5,.5);
542 
543  // base center
544  nodes[13] = Point (0.,0.,0.);
545 
546  return;
547  }
548 
549  default:
550  libmesh_error_msg("ERROR: Unknown element type " << itemType);
551  }
552 }
template<typename OutputType>
const std::vector<RealGradient>& libMesh::FEGenericBase< OutputType >::get_Sobolev_dweight ( ) const
inline
Returns
The first global derivative of the multiplicative weight at each quadrature point. See get_Sobolev_weight() for details. In case of FE initialized to all zero.

Definition at line 428 of file fe_base.h.

429  { return dweight; }
std::vector< RealGradient > dweight
Definition: fe_base.h:637
template<typename OutputType>
const std::vector<Real>& libMesh::FEGenericBase< OutputType >::get_Sobolev_weight ( ) const
inline
Returns
The multiplicative weight at each quadrature point. This weight is used for certain infinite element weak formulations, so that weighted Sobolev spaces are used for the trial function space. This renders the variational form easily computable.

In case of the general finite element class FE this field is initialized to all ones, so that the variational formulation for an infinite element produces correct element matrices for a mesh using both finite and infinite elements.

Definition at line 420 of file fe_base.h.

421  { return weight; }
std::vector< Real > weight
Definition: fe_base.h:644
const std::vector<std::vector<Point> >& libMesh::FEAbstract::get_tangents ( ) const
inlineinherited
Returns
The tangent vectors for face integration.

Definition at line 371 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

372  { return this->_fe_map->get_tangents(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
ElemType libMesh::FEAbstract::get_type ( ) const
inlineinherited
Returns
The element type that the current shape functions have been calculated for. Useful in determining when shape functions must be recomputed.

Definition at line 410 of file fe_abstract.h.

References libMesh::FEAbstract::elem_type.

Referenced by libMesh::InfFE< Dim, T_radial, T_map >::reinit().

410 { return elem_type; }
void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
inlineprotectedinherited

Increments the construction counter. Should be called in the constructor of any derived class that will be reference counted.

Definition at line 185 of file reference_counter.h.

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCounter::n_objects(), and libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

186 {
187  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
188  std::pair<unsigned int, unsigned int> & p = _counts[name];
189 
190  p.first++;
191 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
spin_mutex spin_mtx
Definition: threads.C:29
void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
inlineprotectedinherited

Increments the destruction counter. Should be called in the destructor of any derived class that will be reference counted.

Definition at line 198 of file reference_counter.h.

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCounter::n_objects(), and libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

199 {
200  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
201  std::pair<unsigned int, unsigned int> & p = _counts[name];
202 
203  p.second++;
204 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
spin_mutex spin_mtx
Definition: threads.C:29
virtual bool libMesh::FEAbstract::is_hierarchic ( ) const
pure virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implemented in libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::InfFE< Dim, T_radial, T_map >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< 2, SUBDIVISION >, libMesh::FE< Dim, HIERARCHIC >, libMesh::FE< Dim, SCALAR >, libMesh::FE< Dim, L2_LAGRANGE >, libMesh::FE< Dim, NEDELEC_ONE >, libMesh::FE< Dim, HERMITE >, libMesh::FE< Dim, CLOUGH >, libMesh::FE< Dim, MONOMIAL >, libMesh::FE< Dim, XYZ >, libMesh::FE< Dim, LAGRANGE >, libMesh::FE< Dim, L2_HIERARCHIC >, libMesh::FE< Dim, LAGRANGE_VEC >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, and libMesh::FE< Dim, T >.

Referenced by libMesh::FEAbstract::set_fe_order().

static unsigned int libMesh::ReferenceCounter::n_objects ( )
inlinestaticinherited
virtual unsigned int libMesh::FEAbstract::n_shape_functions ( ) const
pure virtualinherited
bool libMesh::FEAbstract::on_reference_element ( const Point p,
const ElemType  t,
const Real  eps = TOLERANCE 
)
staticinherited
Returns
true if the point p is located on the reference element for element type t, false otherwise. Since we are doing floating point comparisons here the parameter eps can be specified to indicate a tolerance. For example, $ x \le 1 $ becomes $ x \le 1 + \epsilon $.

Definition at line 554 of file fe_abstract.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::EDGE4, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::INFHEX16, libMesh::INFHEX18, libMesh::INFHEX8, libMesh::INFPRISM12, libMesh::INFPRISM6, libMesh::NODEELEM, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::Real, libMesh::TET10, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, and libMesh::TRISHELL3.

Referenced by libMesh::FEInterface::ifem_on_reference_element(), libMesh::FE< Dim, T >::inverse_map(), and libMesh::FEInterface::on_reference_element().

555 {
556  libmesh_assert_greater_equal (eps, 0.);
557 
558  const Real xi = p(0);
559 #if LIBMESH_DIM > 1
560  const Real eta = p(1);
561 #else
562  const Real eta = 0.;
563 #endif
564 #if LIBMESH_DIM > 2
565  const Real zeta = p(2);
566 #else
567  const Real zeta = 0.;
568 #endif
569 
570  switch (t)
571  {
572  case NODEELEM:
573  {
574  return (!xi && !eta && !zeta);
575  }
576  case EDGE2:
577  case EDGE3:
578  case EDGE4:
579  {
580  // The reference 1D element is [-1,1].
581  if ((xi >= -1.-eps) &&
582  (xi <= 1.+eps))
583  return true;
584 
585  return false;
586  }
587 
588 
589  case TRI3:
590  case TRISHELL3:
591  case TRI6:
592  {
593  // The reference triangle is isosceles
594  // and is bound by xi=0, eta=0, and xi+eta=1.
595  if ((xi >= 0.-eps) &&
596  (eta >= 0.-eps) &&
597  ((xi + eta) <= 1.+eps))
598  return true;
599 
600  return false;
601  }
602 
603 
604  case QUAD4:
605  case QUADSHELL4:
606  case QUAD8:
607  case QUADSHELL8:
608  case QUAD9:
609  {
610  // The reference quadrilateral element is [-1,1]^2.
611  if ((xi >= -1.-eps) &&
612  (xi <= 1.+eps) &&
613  (eta >= -1.-eps) &&
614  (eta <= 1.+eps))
615  return true;
616 
617  return false;
618  }
619 
620 
621  case TET4:
622  case TET10:
623  {
624  // The reference tetrahedral is isosceles
625  // and is bound by xi=0, eta=0, zeta=0,
626  // and xi+eta+zeta=1.
627  if ((xi >= 0.-eps) &&
628  (eta >= 0.-eps) &&
629  (zeta >= 0.-eps) &&
630  ((xi + eta + zeta) <= 1.+eps))
631  return true;
632 
633  return false;
634  }
635 
636 
637  case HEX8:
638  case HEX20:
639  case HEX27:
640  {
641  /*
642  if ((xi >= -1.) &&
643  (xi <= 1.) &&
644  (eta >= -1.) &&
645  (eta <= 1.) &&
646  (zeta >= -1.) &&
647  (zeta <= 1.))
648  return true;
649  */
650 
651  // The reference hexahedral element is [-1,1]^3.
652  if ((xi >= -1.-eps) &&
653  (xi <= 1.+eps) &&
654  (eta >= -1.-eps) &&
655  (eta <= 1.+eps) &&
656  (zeta >= -1.-eps) &&
657  (zeta <= 1.+eps))
658  {
659  // libMesh::out << "Strange Point:\n";
660  // p.print();
661  return true;
662  }
663 
664  return false;
665  }
666 
667  case PRISM6:
668  case PRISM15:
669  case PRISM18:
670  {
671  // Figure this one out...
672  // inside the reference triangle with zeta in [-1,1]
673  if ((xi >= 0.-eps) &&
674  (eta >= 0.-eps) &&
675  (zeta >= -1.-eps) &&
676  (zeta <= 1.+eps) &&
677  ((xi + eta) <= 1.+eps))
678  return true;
679 
680  return false;
681  }
682 
683 
684  case PYRAMID5:
685  case PYRAMID13:
686  case PYRAMID14:
687  {
688  // Check that the point is on the same side of all the faces
689  // by testing whether:
690  //
691  // n_i.(x - x_i) <= 0
692  //
693  // for each i, where:
694  // n_i is the outward normal of face i,
695  // x_i is a point on face i.
696  if ((-eta - 1. + zeta <= 0.+eps) &&
697  ( xi - 1. + zeta <= 0.+eps) &&
698  ( eta - 1. + zeta <= 0.+eps) &&
699  ( -xi - 1. + zeta <= 0.+eps) &&
700  ( zeta >= 0.-eps))
701  return true;
702 
703  return false;
704  }
705 
706 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
707  case INFHEX8:
708  case INFHEX16:
709  case INFHEX18:
710  {
711  // The reference infhex8 is a [-1,1]^3.
712  if ((xi >= -1.-eps) &&
713  (xi <= 1.+eps) &&
714  (eta >= -1.-eps) &&
715  (eta <= 1.+eps) &&
716  (zeta >= -1.-eps) &&
717  (zeta <= 1.+eps))
718  {
719  return true;
720  }
721  return false;
722  }
723 
724  case INFPRISM6:
725  case INFPRISM12:
726  {
727  // inside the reference triangle with zeta in [-1,1]
728  if ((xi >= 0.-eps) &&
729  (eta >= 0.-eps) &&
730  (zeta >= -1.-eps) &&
731  (zeta <= 1.+eps) &&
732  ((xi + eta) <= 1.+eps))
733  {
734  return true;
735  }
736 
737  return false;
738  }
739 #endif
740 
741  default:
742  libmesh_error_msg("ERROR: Unknown element type " << t);
743  }
744 
745  // If we get here then the point is _not_ in the
746  // reference element. Better return false.
747 
748  return false;
749 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<typename OutputType >
void libMesh::FEGenericBase< OutputType >::print_d2phi ( std::ostream &  os) const
virtual

Prints the value of each shape function's second derivatives at each quadrature point.

Implements libMesh::FEAbstract.

Definition at line 779 of file fe_base.C.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_Sobolev_dweight().

780 {
781  for (std::size_t i=0; i<dphi.size(); ++i)
782  for (std::size_t j=0; j<dphi[i].size(); ++j)
783  os << " d2phi[" << i << "][" << j << "]=" << d2phi[i][j];
784 }
std::vector< std::vector< OutputTensor > > d2phi
Definition: fe_base.h:552
std::vector< std::vector< OutputGradient > > dphi
Definition: fe_base.h:504
template<typename OutputType >
void libMesh::FEGenericBase< OutputType >::print_dphi ( std::ostream &  os) const
virtual

Prints the value of each shape function's derivative at each quadrature point.

Implements libMesh::FEAbstract.

Definition at line 721 of file fe_base.C.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_Sobolev_dweight().

722 {
723  for (std::size_t i=0; i<dphi.size(); ++i)
724  for (std::size_t j=0; j<dphi[i].size(); ++j)
725  os << " dphi[" << i << "][" << j << "]=" << dphi[i][j];
726 }
std::vector< std::vector< OutputGradient > > dphi
Definition: fe_base.h:504
void libMesh::ReferenceCounter::print_info ( std::ostream &  out = libMesh::out)
staticinherited

Prints the reference information, by default to libMesh::out.

Definition at line 88 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter, and libMesh::ReferenceCounter::get_info().

Referenced by libMesh::LibMeshInit::LibMeshInit().

89 {
91  out_stream << ReferenceCounter::get_info();
92 }
static std::string get_info()
void libMesh::FEAbstract::print_info ( std::ostream &  os) const
inherited

Prints all the relevant information about the current element.

Definition at line 766 of file fe_abstract.C.

References libMesh::FEAbstract::print_dphi(), libMesh::FEAbstract::print_JxW(), libMesh::FEAbstract::print_phi(), and libMesh::FEAbstract::print_xyz().

Referenced by libMesh::FEAbstract::get_fe_map(), and libMesh::operator<<().

767 {
768  os << "phi[i][j]: Shape function i at quadrature pt. j" << std::endl;
769  this->print_phi(os);
770 
771  os << "dphi[i][j]: Shape function i's gradient at quadrature pt. j" << std::endl;
772  this->print_dphi(os);
773 
774  os << "XYZ locations of the quadrature pts." << std::endl;
775  this->print_xyz(os);
776 
777  os << "Values of JxW at the quadrature pts." << std::endl;
778  this->print_JxW(os);
779 }
void print_JxW(std::ostream &os) const
Definition: fe_abstract.C:753
void print_xyz(std::ostream &os) const
Definition: fe_abstract.C:760
virtual void print_phi(std::ostream &os) const =0
virtual void print_dphi(std::ostream &os) const =0
void libMesh::FEAbstract::print_JxW ( std::ostream &  os) const
inherited

Prints the Jacobian times the weight for each quadrature point.

Definition at line 753 of file fe_abstract.C.

References libMesh::FEAbstract::_fe_map.

Referenced by libMesh::FEAbstract::get_fe_map(), and libMesh::FEAbstract::print_info().

754 {
755  this->_fe_map->print_JxW(os);
756 }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
template<typename OutputType >
void libMesh::FEGenericBase< OutputType >::print_phi ( std::ostream &  os) const
virtual

Prints the value of each shape function at each quadrature point.

Implements libMesh::FEAbstract.

Definition at line 710 of file fe_base.C.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_Sobolev_dweight().

711 {
712  for (std::size_t i=0; i<phi.size(); ++i)
713  for (std::size_t j=0; j<phi[i].size(); ++j)
714  os << " phi[" << i << "][" << j << "]=" << phi[i][j] << std::endl;
715 }
std::vector< std::vector< OutputShape > > phi
Definition: fe_base.h:499
void libMesh::FEAbstract::print_xyz ( std::ostream &  os) const
inherited

Prints the spatial location of each quadrature point (on the physical element).

Definition at line 760 of file fe_abstract.C.

References libMesh::FEAbstract::_fe_map.

Referenced by libMesh::FEAbstract::get_fe_map(), and libMesh::FEAbstract::print_info().

761 {
762  this->_fe_map->print_xyz(os);
763 }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:517
virtual void libMesh::FEAbstract::reinit ( const Elem elem,
const std::vector< Point > *const  pts = libmesh_nullptr,
const std::vector< Real > *const  weights = libmesh_nullptr 
)
pure virtualinherited

This is at the core of this class. Use this for each new element in the mesh. Reinitializes the requested physical element-dependent data based on the current element elem. By default the element data are computed at the quadrature points specified by the quadrature rule qrule, but any set of points on the reference element may be specified in the optional argument pts.

Note
The FE classes decide which data to initialize based on which accessor functions such as get_phi() or get_d2phi() have been called, so all such accessors should be called before the first reinit().

Implemented in libMesh::FEXYZ< Dim >, libMesh::FESubdivision, libMesh::InfFE< Dim, T_radial, T_map >, libMesh::FE< Dim, T >, libMesh::FE< 2, SUBDIVISION >, libMesh::FE< Dim, HIERARCHIC >, libMesh::FE< Dim, SCALAR >, libMesh::FE< Dim, L2_LAGRANGE >, libMesh::FE< Dim, NEDELEC_ONE >, libMesh::FE< Dim, HERMITE >, libMesh::FE< Dim, CLOUGH >, libMesh::FE< Dim, MONOMIAL >, libMesh::FE< Dim, XYZ >, libMesh::FE< Dim, LAGRANGE >, libMesh::FE< Dim, L2_HIERARCHIC >, and libMesh::FE< Dim, LAGRANGE_VEC >.

Referenced by libMesh::ExactSolution::_compute_error(), libMesh::FEMContext::build_new_fe(), libMesh::System::calculate_norm(), libMesh::ExactErrorEstimator::find_squared_element_error(), and libMesh::JumpErrorEstimator::reinit_sides().

virtual void libMesh::FEAbstract::reinit ( const Elem elem,
const unsigned int  side,
const Real  tolerance = TOLERANCE,
const std::vector< Point > *const  pts = libmesh_nullptr,
const std::vector< Real > *const  weights = libmesh_nullptr 
)
pure virtualinherited

Reinitializes all the physical element-dependent data based on the side of the element elem. The tolerance parameter is passed to the involved call to inverse_map(). By default the element data are computed at the quadrature points specified by the quadrature rule qrule, but any set of points on the reference side element may be specified in the optional argument pts.

Implemented in libMesh::FEXYZ< Dim >, libMesh::FESubdivision, libMesh::InfFE< Dim, T_radial, T_map >, libMesh::FE< Dim, T >, libMesh::FE< 2, SUBDIVISION >, libMesh::FE< Dim, HIERARCHIC >, libMesh::FE< Dim, SCALAR >, libMesh::FE< Dim, L2_LAGRANGE >, libMesh::FE< Dim, NEDELEC_ONE >, libMesh::FE< Dim, HERMITE >, libMesh::FE< Dim, CLOUGH >, libMesh::FE< Dim, MONOMIAL >, libMesh::FE< Dim, XYZ >, libMesh::FE< Dim, LAGRANGE >, libMesh::FE< Dim, L2_HIERARCHIC >, libMesh::FE< Dim, LAGRANGE_VEC >, libMesh::FEXYZ< Dim >, and libMesh::FEXYZ< Dim >.

void libMesh::FEAbstract::set_fe_order ( int  new_order)
inlineinherited

Sets the base FE order of the finite element.

Definition at line 431 of file fe_abstract.h.

References libMesh::FEAbstract::fe_type, libMesh::FEAbstract::get_continuity(), libMesh::FEAbstract::is_hierarchic(), and libMesh::FEType::order.

431 { fe_type.order = new_order; }
OrderWrapper order
Definition: fe_type.h:198
virtual bool libMesh::FEAbstract::shapes_need_reinit ( ) const
protectedpure virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implemented in libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::InfFE< Dim, T_radial, T_map >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< 2, SUBDIVISION >, libMesh::FE< Dim, HIERARCHIC >, libMesh::FE< Dim, SCALAR >, libMesh::FE< Dim, L2_LAGRANGE >, libMesh::FE< Dim, NEDELEC_ONE >, libMesh::FE< Dim, HERMITE >, libMesh::FE< Dim, CLOUGH >, libMesh::FE< Dim, MONOMIAL >, libMesh::FE< Dim, XYZ >, libMesh::FE< Dim, LAGRANGE >, libMesh::FE< Dim, L2_HIERARCHIC >, libMesh::FE< Dim, LAGRANGE_VEC >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, libMesh::FE< Dim, T >, and libMesh::FE< Dim, T >.

virtual void libMesh::FEAbstract::side_map ( const Elem elem,
const Elem side,
const unsigned int  s,
const std::vector< Point > &  reference_side_points,
std::vector< Point > &  reference_points 
)
pure virtualinherited

Friends And Related Function Documentation

template<typename OutputType>
template<unsigned int friend_Dim, FEFamily friend_T_radial, InfMapType friend_T_map>
friend class InfFE
friend

Make all InfFE<Dim,T_radial,T_map> classes friends so that they can safely used FE<Dim-1,T_base> through a FEGenericBase * as base approximation.

Definition at line 658 of file fe_base.h.

Member Data Documentation

ReferenceCounter::Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited
bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

Definition at line 143 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info(), and libMesh::ReferenceCounter::print_info().

template<typename OutputType>
std::unique_ptr<FETransformationBase<OutputType> > libMesh::FEGenericBase< OutputType >::_fe_trans
protected

Object that handles computing shape function values, gradients, etc in the physical domain.

Definition at line 494 of file fe_base.h.

Threads::spin_mutex libMesh::ReferenceCounter::_mutex
staticprotectedinherited

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 137 of file reference_counter.h.

Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

The number of objects. Print the reference count information when the number returns to 0.

Definition at line 132 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter(), and libMesh::ReferenceCounter::~ReferenceCounter().

unsigned int libMesh::FEAbstract::_p_level
protectedinherited

The p refinement level the current data structures are set up for.

Definition at line 579 of file fe_abstract.h.

Referenced by libMesh::FEAbstract::get_order(), and libMesh::FEAbstract::get_p_level().

bool libMesh::FEAbstract::calculate_curl_phi
mutableprotectedinherited

Should we calculate shape function curls?

Definition at line 549 of file fe_abstract.h.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_curl_phi().

bool libMesh::FEAbstract::calculate_div_phi
mutableprotectedinherited

Should we calculate shape function divergences?

Definition at line 554 of file fe_abstract.h.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_div_phi().

bool libMesh::FEAbstract::calculate_dphiref
mutableprotectedinherited

Should we calculate reference shape function gradients?

Definition at line 559 of file fe_abstract.h.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_curl_phi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phideta2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidetadzeta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidx2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxdy(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxdz(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxi2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxideta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxidzeta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidy2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidydz(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidz2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidzeta2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_div_phi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphideta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidx(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidxi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidy(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidz(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidzeta(), and libMesh::InfFE< Dim, T_radial, T_map >::reinit().

bool libMesh::FEAbstract::calculate_phi
mutableprotectedinherited

Should we calculate shape functions?

Definition at line 534 of file fe_abstract.h.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_phi(), and libMesh::InfFE< Dim, T_radial, T_map >::reinit().

bool libMesh::FEAbstract::calculations_started
mutableprotectedinherited

Have calculations with this object already been started? Then all get_* functions should already have been called.

Definition at line 529 of file fe_abstract.h.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_curl_phi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phideta2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidetadzeta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidx2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxdy(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxdz(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxi2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxideta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxidzeta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidy2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidydz(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidz2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidzeta2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_div_phi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphideta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidx(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidxi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidy(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidz(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidzeta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_phi(), and libMesh::FESubdivision::init_shape_functions().

template<typename OutputType>
std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< OutputType >::curl_phi
protected

Shape function curl values. Only defined for vector types.

Definition at line 509 of file fe_base.h.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_curl_phi().

template<typename OutputType>
std::vector<std::vector<OutputTensor> > libMesh::FEGenericBase< OutputType >::d2phi