libMesh
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
libMesh::FEGenericBase< OutputType > Class Template Referenceabstract

This class forms the foundation from which generic finite elements may be derived. More...

#include <exact_error_estimator.h>

Inheritance diagram for libMesh::FEGenericBase< OutputType >:
[legend]

Public Types

typedef OutputType OutputShape
 Convenient typedefs for gradients of output, hessians of output, and potentially-complex-valued versions of same. More...
 
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 ()
 Destructor. More...
 
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
 Prints the value of each shape function at each quadrature point. More...
 
void print_dphi (std::ostream &os) const
 Prints the value of each shape function's derivative at each quadrature point. More...
 
void print_d2phi (std::ostream &os) const
 Prints the value of each shape function's second derivatives at each quadrature point. More...
 
template<>
UniquePtr< FEGenericBase< Real > > build (const unsigned int dim, const FEType &fet)
 
template<>
UniquePtr< FEGenericBase< RealGradient > > build (const unsigned int dim, const FEType &fet)
 
template<>
UniquePtr< FEGenericBase< Real > > build_InfFE (const unsigned int dim, const FEType &fet)
 
template<>
UniquePtr< 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
 This is at the core of this class. More...
 
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
 Reinitializes all the physical element-dependent data based on the side of the element elem. More...
 
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
 Reinitializes all the physical element-dependent data based on the edge of the element elem. More...
 
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
 Computes the reference space quadrature points on the side of an element based on the side quadrature points. More...
 
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
 Provides the class with the quadrature rule. More...
 
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)
 Sets the base FE order of the finite element. More...
 
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
 Prints the Jacobian times the weight for each quadrature point. More...
 
void print_xyz (std::ostream &os) const
 Prints the spatial location of each quadrature point (on the physical element). More...
 
void print_info (std::ostream &os) const
 Prints all the relevant information about the current element. More...
 

Static Public Member Functions

static UniquePtr< FEGenericBasebuild (const unsigned int dim, const FEType &type)
 Builds a specific finite element type. More...
 
static UniquePtr< FEGenericBasebuild_InfFE (const unsigned int dim, const FEType &type)
 Builds a specific infinite element type. More...
 
static void compute_proj_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 Computes the constraint matrix contributions (for non-conforming adapted meshes) corresponding to variable number var_number, using generic projections. More...
 
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)
 Creates a local projection on coarse_elem, based on the DoF values in global_vector for it's children. More...
 
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)
 Creates a local projection on coarse_elem, based on the DoF values in global_vector for it's children. More...
 
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)
 Computes the constraint matrix contributions (for meshes with periodic boundary conditions) corresponding to variable number var_number, using generic projections. More...
 
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)
 Computes the nodal constraint contributions (for non-conforming adapted meshes), using Lagrange geometry. More...
 
static void compute_periodic_node_constraints (NodeConstraints &constraints, const PeriodicBoundaries &boundaries, const MeshBase &mesh, const PointLocatorBase *point_locator, const Elem *elem)
 Computes the node position constraint equation contributions (for meshes with periodic boundary conditions) More...
 
static void print_info (std::ostream &out=libMesh::out)
 Prints the reference information, by default to libMesh::out. More...
 
static std::string get_info ()
 Gets a string containing the reference information. More...
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects. More...
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info() More...
 
static void disable_print_counter_info ()
 

Protected Types

typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
 Data structure to log the information. More...
 

Protected Member Functions

 FEGenericBase (const unsigned int dim, const FEType &fet)
 Constructor. More...
 
virtual void init_base_shape_functions (const std::vector< Point > &qp, const Elem *e)=0
 Initialize the data fields for the base of an an infinite element. More...
 
void determine_calculations ()
 Determine which values are to be calculated, for both the FE itself and for the FEMap. More...
 
virtual void compute_shape_functions (const Elem *elem, const std::vector< Point > &qp)
 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. More...
 
virtual bool shapes_need_reinit () const =0
 
void increment_constructor_count (const std::string &name)
 Increments the construction counter. More...
 
void increment_destructor_count (const std::string &name)
 Increments the destruction counter. More...
 

Protected Attributes

UniquePtr< FETransformationBase< OutputType > > _fe_trans
 Object that handles computing shape function values, gradients, etc in the physical domain. More...
 
std::vector< std::vector< OutputShape > > phi
 Shape function values. More...
 
std::vector< std::vector< OutputGradient > > dphi
 Shape function derivative values. More...
 
std::vector< std::vector< OutputShape > > curl_phi
 Shape function curl values. More...
 
std::vector< std::vector< OutputDivergence > > div_phi
 Shape function divergence values. More...
 
std::vector< std::vector< OutputShape > > dphidxi
 Shape function derivatives in the xi direction. More...
 
std::vector< std::vector< OutputShape > > dphideta
 Shape function derivatives in the eta direction. More...
 
std::vector< std::vector< OutputShape > > dphidzeta
 Shape function derivatives in the zeta direction. More...
 
std::vector< std::vector< OutputShape > > dphidx
 Shape function derivatives in the x direction. More...
 
std::vector< std::vector< OutputShape > > dphidy
 Shape function derivatives in the y direction. More...
 
std::vector< std::vector< OutputShape > > dphidz
 Shape function derivatives in the z direction. More...
 
std::vector< std::vector< OutputTensor > > d2phi
 Shape function second derivative values. More...
 
std::vector< std::vector< OutputShape > > d2phidxi2
 Shape function second derivatives in the xi direction. More...
 
std::vector< std::vector< OutputShape > > d2phidxideta
 Shape function second derivatives in the xi-eta direction. More...
 
std::vector< std::vector< OutputShape > > d2phidxidzeta
 Shape function second derivatives in the xi-zeta direction. More...
 
std::vector< std::vector< OutputShape > > d2phideta2
 Shape function second derivatives in the eta direction. More...
 
std::vector< std::vector< OutputShape > > d2phidetadzeta
 Shape function second derivatives in the eta-zeta direction. More...
 
std::vector< std::vector< OutputShape > > d2phidzeta2
 Shape function second derivatives in the zeta direction. More...
 
std::vector< std::vector< OutputShape > > d2phidx2
 Shape function second derivatives in the x direction. More...
 
std::vector< std::vector< OutputShape > > d2phidxdy
 Shape function second derivatives in the x-y direction. More...
 
std::vector< std::vector< OutputShape > > d2phidxdz
 Shape function second derivatives in the x-z direction. More...
 
std::vector< std::vector< OutputShape > > d2phidy2
 Shape function second derivatives in the y direction. More...
 
std::vector< std::vector< OutputShape > > d2phidydz
 Shape function second derivatives in the y-z direction. More...
 
std::vector< std::vector< OutputShape > > d2phidz2
 Shape function second derivatives in the z direction. More...
 
std::vector< OutputGradientdphase
 Used for certain infinite element families: the first derivatives of the phase term in global coordinates, over all quadrature points. More...
 
std::vector< RealGradientdweight
 Used for certain infinite element families: the global derivative of the additional radial weight $ 1/{r^2} $, over all quadrature points. More...
 
std::vector< Realweight
 Used for certain infinite element families: the additional radial weight $ 1/{r^2} $ in local coordinates, over all quadrature points. More...
 
UniquePtr< FEMap_fe_map
 
const unsigned int dim
 The dimensionality of the object. More...
 
bool calculations_started
 Have calculations with this object already been started? Then all get_* functions should already have been called. More...
 
bool calculate_phi
 Should we calculate shape functions? More...
 
bool calculate_dphi
 Should we calculate shape function gradients? More...
 
bool calculate_d2phi
 Should we calculate shape function hessians? More...
 
bool calculate_curl_phi
 Should we calculate shape function curls? More...
 
bool calculate_div_phi
 Should we calculate shape function divergences? More...
 
bool calculate_dphiref
 Should we calculate reference shape function gradients? More...
 
FEType fe_type
 The finite element type for this object. More...
 
ElemType elem_type
 The element type the current data structures are set up for. More...
 
unsigned int _p_level
 The p refinement level the current data structures are set up for. More...
 
QBaseqrule
 A pointer to the quadrature rule employed. More...
 
bool shapes_on_quadrature
 A flag indicating if current data structures correspond to quadrature rule points. More...
 

Static Protected Attributes

static Counts _counts
 Actually holds the data. More...
 
static Threads::atomic< unsigned int_n_objects
 The number of objects. More...
 
static Threads::spin_mutex _mutex
 Mutual exclusion object to enable thread-safe reference counting. More...
 
static bool _enable_print_counter = true
 Flag to control whether reference count information is printed when print_info is called. More...
 

Friends

template<unsigned int friend_Dim, FEFamily friend_T_radial, InfMapType friend_T_map>
class InfFE
 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. More...
 

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 
)
protected

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
Shape function second derivative values.
Definition: fe_base.h:552
std::vector< std::vector< OutputShape > > dphidxi
Shape function derivatives in the xi direction.
Definition: fe_base.h:519
std::vector< std::vector< OutputShape > > d2phidxdz
Shape function second derivatives in the x-z direction.
Definition: fe_base.h:597
std::vector< std::vector< OutputShape > > dphidzeta
Shape function derivatives in the zeta direction.
Definition: fe_base.h:529
std::vector< std::vector< OutputShape > > d2phidydz
Shape function second derivatives in the y-z direction.
Definition: fe_base.h:607
static UniquePtr< FETransformationBase< OutputShape > > build(const FEType &type)
Builds an FETransformation object based on the finite element type.
std::vector< std::vector< OutputShape > > d2phidxideta
Shape function second derivatives in the xi-eta direction.
Definition: fe_base.h:562
FEAbstract(const unsigned int dim, const FEType &fet)
Constructor.
Definition: fe_abstract.h:608
std::vector< Real > weight
Used for certain infinite element families: the additional radial weight in local coordinates...
Definition: fe_base.h:644
std::vector< std::vector< OutputShape > > d2phidx2
Shape function second derivatives in the x direction.
Definition: fe_base.h:587
std::vector< std::vector< OutputShape > > curl_phi
Shape function curl values.
Definition: fe_base.h:509
std::vector< std::vector< OutputShape > > dphidy
Shape function derivatives in the y direction.
Definition: fe_base.h:539
std::vector< std::vector< OutputShape > > d2phidy2
Shape function second derivatives in the y direction.
Definition: fe_base.h:602
std::vector< std::vector< OutputShape > > d2phidetadzeta
Shape function second derivatives in the eta-zeta direction.
Definition: fe_base.h:577
std::vector< std::vector< OutputShape > > d2phidxidzeta
Shape function second derivatives in the xi-zeta direction.
Definition: fe_base.h:567
std::vector< std::vector< OutputShape > > d2phidxdy
Shape function second derivatives in the x-y direction.
Definition: fe_base.h:592
std::vector< std::vector< OutputShape > > dphidx
Shape function derivatives in the x direction.
Definition: fe_base.h:534
std::vector< std::vector< OutputShape > > phi
Shape function values.
Definition: fe_base.h:499
std::vector< std::vector< OutputShape > > d2phideta2
Shape function second derivatives in the eta direction.
Definition: fe_base.h:572
std::vector< OutputGradient > dphase
Used for certain infinite element families: the first derivatives of the phase term in global coordin...
Definition: fe_base.h:630
virtual ~FEGenericBase()
Destructor.
std::vector< std::vector< OutputDivergence > > div_phi
Shape function divergence values.
Definition: fe_base.h:514
std::vector< std::vector< OutputGradient > > dphi
Shape function derivative values.
Definition: fe_base.h:504
UniquePtr< FETransformationBase< OutputType > > _fe_trans
Object that handles computing shape function values, gradients, etc in the physical domain...
Definition: fe_base.h:494
std::vector< std::vector< OutputShape > > d2phidz2
Shape function second derivatives in the z direction.
Definition: fe_base.h:612
std::vector< std::vector< OutputShape > > d2phidxi2
Shape function second derivatives in the xi direction.
Definition: fe_base.h:557
std::vector< std::vector< OutputShape > > d2phidzeta2
Shape function second derivatives in the zeta direction.
Definition: fe_base.h:582
std::vector< std::vector< OutputShape > > dphidz
Shape function derivatives in the z direction.
Definition: fe_base.h:544
std::vector< std::vector< OutputShape > > dphideta
Shape function derivatives in the eta direction.
Definition: fe_base.h:524
std::vector< RealGradient > dweight
Used for certain infinite element families: the global derivative of the additional radial weight ...
Definition: fe_base.h:637
template<typename OutputType>
virtual libMesh::FEGenericBase< OutputType >::~FEGenericBase ( )
virtual

Member Function Documentation

virtual void libMesh::FEAbstract::attach_quadrature_rule ( QBase q)
pure virtualinherited
template<typename OutputType>
static UniquePtr<FEGenericBase> libMesh::FEGenericBase< OutputType >::build ( const unsigned int  dim,
const FEType type 
)
static

Builds a specific finite element type.

A UniquePtr<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 OutputType of this class is not compatible with the output required for the requested type

Referenced by libMesh::ExactSolution::_compute_error(), libMesh::UniformRefinementEstimator::_estimate_error(), assemble(), LinearElasticity::assemble(), assemble_1D(), assemble_biharmonic(), assemble_cd(), assemble_elasticity(), assemble_ellipticdg(), assemble_helmholtz(), assemble_laplace(), assemble_mass(), assemble_matrices(), assemble_poisson(), assemble_shell(), assemble_stokes(), assemble_wave(), libMesh::FEMContext::cached_fe(), libMesh::System::calculate_norm(), compute_stresses(), LinearElasticity::compute_stresses(), LargeDeformationElasticity::compute_stresses(), libMesh::MeshFunction::discontinuous_gradient(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::MeshFunction::gradient(), libMesh::MeshFunction::hessian(), libMesh::InfFE< Dim, T_radial, T_map >::InfFE(), libMesh::InfFE< Dim, T_radial, T_map >::init_face_shape_functions(), libMesh::RBEIMAssembly::initialize_fe(), integrate_function(), LaplaceYoung::jacobian(), LargeDeformationElasticity::jacobian(), main(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::BoundaryProjectSolution::operator()(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::InfFE< Dim, T_radial, T_map >::reinit(), LaplaceYoung::residual(), LargeDeformationElasticity::residual(), libMesh::HPCoarsenTest::select_refinement(), FETest< order, family, elem_type >::setUp(), and libMesh::Elem::volume().

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

Definition at line 184 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.

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

Definition at line 385 of file fe_base.C.

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

387 {
388  switch (dim)
389  {
390  // 0D
391  case 0:
392  {
393  switch (fet.family)
394  {
395  case LAGRANGE_VEC:
396  return UniquePtr<FEVectorBase>(new FELagrangeVec<0>(fet));
397 
398  default:
399  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
400  }
401  }
402  case 1:
403  {
404  switch (fet.family)
405  {
406  case LAGRANGE_VEC:
407  return UniquePtr<FEVectorBase>(new FELagrangeVec<1>(fet));
408 
409  default:
410  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
411  }
412  }
413  case 2:
414  {
415  switch (fet.family)
416  {
417  case LAGRANGE_VEC:
418  return UniquePtr<FEVectorBase>(new FELagrangeVec<2>(fet));
419 
420  case NEDELEC_ONE:
421  return UniquePtr<FEVectorBase>(new FENedelecOne<2>(fet));
422 
423  default:
424  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
425  }
426  }
427  case 3:
428  {
429  switch (fet.family)
430  {
431  case LAGRANGE_VEC:
432  return UniquePtr<FEVectorBase>(new FELagrangeVec<3>(fet));
433 
434  case NEDELEC_ONE:
435  return UniquePtr<FEVectorBase>(new FENedelecOne<3>(fet));
436 
437  default:
438  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
439  }
440  }
441 
442  default:
443  libmesh_error_msg("Invalid dimension dim = " << dim);
444  } // switch(dim)
445 
446  libmesh_error_msg("We'll never get here!");
447  return UniquePtr<FEVectorBase>();
448 }
FELagrangeVec objects are used for working with vector-valued finite elements.
Definition: fe.h:899
FEFamily family
The type of finite element.
Definition: fe_type.h:203
FENedelecOne objects are used for working with vector-valued Nedelec finite elements of the first kin...
Definition: fe.h:923
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
const unsigned int dim
The dimensionality of the object.
Definition: fe_abstract.h:523
template<typename OutputType>
static UniquePtr<FEGenericBase> libMesh::FEGenericBase< OutputType >::build_InfFE ( const unsigned int  dim,
const FEType type 
)
static

Builds a specific infinite element type.

A UniquePtr<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 assemble_wave(), and libMesh::FEMContext::cached_fe().

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

Definition at line 461 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.

463 {
464  switch (dim)
465  {
466 
467  // 1D
468  case 1:
469  {
470  switch (fet.radial_family)
471  {
472  case INFINITE_MAP:
473  libmesh_error_msg("ERROR: Can't build an infinite element with FEFamily = " << fet.radial_family);
474 
475  case JACOBI_20_00:
476  {
477  switch (fet.inf_map)
478  {
479  case CARTESIAN:
481 
482  default:
483  libmesh_error_msg("ERROR: Can't build an infinite element with InfMapType = " << fet.inf_map);
484  }
485  }
486 
487  case JACOBI_30_00:
488  {
489  switch (fet.inf_map)
490  {
491  case CARTESIAN:
493 
494  default:
495  libmesh_error_msg("ERROR: Can't build an infinite element with InfMapType = " << fet.inf_map);
496  }
497  }
498 
499  case LEGENDRE:
500  {
501  switch (fet.inf_map)
502  {
503  case CARTESIAN:
505 
506  default:
507  libmesh_error_msg("ERROR: Can't build an infinite element with InfMapType = " << fet.inf_map);
508  }
509  }
510 
511  case LAGRANGE:
512  {
513  switch (fet.inf_map)
514  {
515  case CARTESIAN:
517 
518  default:
519  libmesh_error_msg("ERROR: Can't build an infinite element with InfMapType = " << fet.inf_map);
520  }
521  }
522 
523  default:
524  libmesh_error_msg("ERROR: Bad FEType.radial_family= " << fet.radial_family);
525  }
526  }
527 
528 
529 
530 
531  // 2D
532  case 2:
533  {
534  switch (fet.radial_family)
535  {
536  case INFINITE_MAP:
537  libmesh_error_msg("ERROR: Can't build an infinite element with FEFamily = " << fet.radial_family);
538 
539  case JACOBI_20_00:
540  {
541  switch (fet.inf_map)
542  {
543  case CARTESIAN:
545 
546  default:
547  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
548  }
549  }
550 
551  case JACOBI_30_00:
552  {
553  switch (fet.inf_map)
554  {
555  case CARTESIAN:
557 
558  default:
559  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
560  }
561  }
562 
563  case LEGENDRE:
564  {
565  switch (fet.inf_map)
566  {
567  case CARTESIAN:
569 
570  default:
571  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
572  }
573  }
574 
575  case LAGRANGE:
576  {
577  switch (fet.inf_map)
578  {
579  case CARTESIAN:
581 
582  default:
583  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
584  }
585  }
586 
587  default:
588  libmesh_error_msg("ERROR: Bad FEType.radial_family= " << fet.radial_family);
589  }
590  }
591 
592 
593 
594 
595  // 3D
596  case 3:
597  {
598  switch (fet.radial_family)
599  {
600  case INFINITE_MAP:
601  libmesh_error_msg("ERROR: Don't build an infinite element with FEFamily = " << fet.radial_family);
602 
603  case JACOBI_20_00:
604  {
605  switch (fet.inf_map)
606  {
607  case CARTESIAN:
609 
610  default:
611  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
612  }
613  }
614 
615  case JACOBI_30_00:
616  {
617  switch (fet.inf_map)
618  {
619  case CARTESIAN:
621 
622  default:
623  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
624  }
625  }
626 
627  case LEGENDRE:
628  {
629  switch (fet.inf_map)
630  {
631  case CARTESIAN:
633 
634  default:
635  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
636  }
637  }
638 
639  case LAGRANGE:
640  {
641  switch (fet.inf_map)
642  {
643  case CARTESIAN:
645 
646  default:
647  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
648  }
649  }
650 
651  default:
652  libmesh_error_msg("ERROR: Bad FEType.radial_family= " << fet.radial_family);
653  }
654  }
655 
656  default:
657  libmesh_error_msg("Invalid dimension dim = " << dim);
658  }
659 
660  libmesh_error_msg("We'll never get here!");
661  return UniquePtr<FEBase>();
662 }
A specific instantiation of the FEBase class.
Definition: fe.h:40
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
const unsigned int dim
The dimensionality of the object.
Definition: fe_abstract.h:523
InfMapType inf_map
The coordinate mapping type of the infinite element.
Definition: fe_type.h:257
FEFamily radial_family
For InfFE, family contains the radial shape family, while base_family contains the approximation type...
Definition: fe_type.h:249
template<>
UniquePtr< FEGenericBase< RealGradient > > libMesh::FEGenericBase< RealGradient >::build_InfFE ( const unsigned  int,
const FEType  
)

Definition at line 668 of file fe_base.C.

670 {
671  // No vector types defined... YET.
672  libmesh_not_implemented();
673  return UniquePtr<FEVectorBase>();
674 }
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
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 802 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(), dim, 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::libmesh_assert(), 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().

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

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

1353 {
1354  Ue.resize(0);
1355 
1356  for (unsigned int v=0; v != dof_map.n_variables(); ++v)
1357  {
1358  DenseVector<Number> Usub;
1359 
1360  coarsened_dof_values(old_vector, dof_map, elem, Usub,
1361  use_old_dof_indices);
1362 
1363  Ue.append (Usub);
1364  }
1365 }
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)
Creates a local projection on coarse_elem, based on the DoF values in global_vector for it&#39;s children...
Definition: fe_base.C:802
unsigned int n_variables() const
Definition: dof_map.h:477
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 796 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::libmesh_assert(), 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().

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

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

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

1375 {
1376  libmesh_assert(elem);
1377 
1378  const unsigned int Dim = elem->dim();
1379 
1380  // Only constrain elements in 2,3D.
1381  if (Dim == 1)
1382  return;
1383 
1384  // Only constrain active elements with this method
1385  if (!elem->active())
1386  return;
1387 
1388  const FEType & base_fe_type = dof_map.variable_type(variable_number);
1389 
1390  // Construct FE objects for this element and its neighbors.
1392  (FEGenericBase<OutputShape>::build(Dim, base_fe_type));
1393  const FEContinuity cont = my_fe->get_continuity();
1394 
1395  // We don't need to constrain discontinuous elements
1396  if (cont == DISCONTINUOUS)
1397  return;
1398  libmesh_assert (cont == C_ZERO || cont == C_ONE);
1399 
1401  (FEGenericBase<OutputShape>::build(Dim, base_fe_type));
1402 
1403  QGauss my_qface(Dim-1, base_fe_type.default_quadrature_order());
1404  my_fe->attach_quadrature_rule (&my_qface);
1405  std::vector<Point> neigh_qface;
1406 
1407  const std::vector<Real> & JxW = my_fe->get_JxW();
1408  const std::vector<Point> & q_point = my_fe->get_xyz();
1409  const std::vector<std::vector<OutputShape>> & phi = my_fe->get_phi();
1410  const std::vector<std::vector<OutputShape>> & neigh_phi =
1411  neigh_fe->get_phi();
1412  const std::vector<Point> * face_normals = libmesh_nullptr;
1413  const std::vector<std::vector<OutputGradient>> * dphi = libmesh_nullptr;
1414  const std::vector<std::vector<OutputGradient>> * neigh_dphi = libmesh_nullptr;
1415 
1416  std::vector<dof_id_type> my_dof_indices, neigh_dof_indices;
1417  std::vector<unsigned int> my_side_dofs, neigh_side_dofs;
1418 
1419  if (cont != C_ZERO)
1420  {
1421  const std::vector<Point> & ref_face_normals =
1422  my_fe->get_normals();
1423  face_normals = &ref_face_normals;
1424  const std::vector<std::vector<OutputGradient>> & ref_dphi =
1425  my_fe->get_dphi();
1426  dphi = &ref_dphi;
1427  const std::vector<std::vector<OutputGradient>> & ref_neigh_dphi =
1428  neigh_fe->get_dphi();
1429  neigh_dphi = &ref_neigh_dphi;
1430  }
1431 
1432  DenseMatrix<Real> Ke;
1433  DenseVector<Real> Fe;
1434  std::vector<DenseVector<Real>> Ue;
1435 
1436  // Look at the element faces. Check to see if we need to
1437  // build constraints.
1438  for (auto s : elem->side_index_range())
1439  if (elem->neighbor_ptr(s) != libmesh_nullptr)
1440  {
1441  // Get pointers to the element's neighbor.
1442  const Elem * neigh = elem->neighbor_ptr(s);
1443 
1444  // h refinement constraints:
1445  // constrain dofs shared between
1446  // this element and ones coarser
1447  // than this element.
1448  if (neigh->level() < elem->level())
1449  {
1450  unsigned int s_neigh = neigh->which_neighbor_am_i(elem);
1451  libmesh_assert_less (s_neigh, neigh->n_neighbors());
1452 
1453  // Find the minimum p level; we build the h constraint
1454  // matrix with this and then constrain away all higher p
1455  // DoFs.
1456  libmesh_assert(neigh->active());
1457  const unsigned int min_p_level =
1458  std::min(elem->p_level(), neigh->p_level());
1459 
1460  // we may need to make the FE objects reinit with the
1461  // minimum shared p_level
1462  const unsigned int old_elem_level = elem->p_level();
1463  if (elem->p_level() != min_p_level)
1464  my_fe->set_fe_order(my_fe->get_fe_type().order.get_order() - old_elem_level + min_p_level);
1465  const unsigned int old_neigh_level = neigh->p_level();
1466  if (old_neigh_level != min_p_level)
1467  neigh_fe->set_fe_order(neigh_fe->get_fe_type().order.get_order() - old_neigh_level + min_p_level);
1468 
1469  my_fe->reinit(elem, s);
1470 
1471  // This function gets called element-by-element, so there
1472  // will be a lot of memory allocation going on. We can
1473  // at least minimize this for the case of the dof indices
1474  // by efficiently preallocating the requisite storage.
1475  // n_nodes is not necessarily n_dofs, but it is better
1476  // than nothing!
1477  my_dof_indices.reserve (elem->n_nodes());
1478  neigh_dof_indices.reserve (neigh->n_nodes());
1479 
1480  dof_map.dof_indices (elem, my_dof_indices,
1481  variable_number,
1482  min_p_level);
1483  dof_map.dof_indices (neigh, neigh_dof_indices,
1484  variable_number,
1485  min_p_level);
1486 
1487  const unsigned int n_qp = my_qface.n_points();
1488 
1489  FEInterface::inverse_map (Dim, base_fe_type, neigh,
1490  q_point, neigh_qface);
1491 
1492  neigh_fe->reinit(neigh, &neigh_qface);
1493 
1494  // We're only concerned with DOFs whose values (and/or first
1495  // derivatives for C1 elements) are supported on side nodes
1496  FEType elem_fe_type = base_fe_type;
1497  if (old_elem_level != min_p_level)
1498  elem_fe_type.order = base_fe_type.order.get_order() - old_elem_level + min_p_level;
1499  FEType neigh_fe_type = base_fe_type;
1500  if (old_neigh_level != min_p_level)
1501  neigh_fe_type.order = base_fe_type.order.get_order() - old_neigh_level + min_p_level;
1502  FEInterface::dofs_on_side(elem, Dim, elem_fe_type, s, my_side_dofs);
1503  FEInterface::dofs_on_side(neigh, Dim, neigh_fe_type, s_neigh, neigh_side_dofs);
1504 
1505  const unsigned int n_side_dofs =
1506  cast_int<unsigned int>(my_side_dofs.size());
1507  libmesh_assert_equal_to (n_side_dofs, neigh_side_dofs.size());
1508 
1509  Ke.resize (n_side_dofs, n_side_dofs);
1510  Ue.resize(n_side_dofs);
1511 
1512  // Form the projection matrix, (inner product of fine basis
1513  // functions against fine test functions)
1514  for (unsigned int is = 0; is != n_side_dofs; ++is)
1515  {
1516  const unsigned int i = my_side_dofs[is];
1517  for (unsigned int js = 0; js != n_side_dofs; ++js)
1518  {
1519  const unsigned int j = my_side_dofs[js];
1520  for (unsigned int qp = 0; qp != n_qp; ++qp)
1521  {
1522  Ke(is,js) += JxW[qp] * TensorTools::inner_product(phi[i][qp], phi[j][qp]);
1523  if (cont != C_ZERO)
1524  Ke(is,js) += JxW[qp] *
1525  TensorTools::inner_product((*dphi)[i][qp] *
1526  (*face_normals)[qp],
1527  (*dphi)[j][qp] *
1528  (*face_normals)[qp]);
1529  }
1530  }
1531  }
1532 
1533  // Form the right hand sides, (inner product of coarse basis
1534  // functions against fine test functions)
1535  for (unsigned int is = 0; is != n_side_dofs; ++is)
1536  {
1537  const unsigned int i = neigh_side_dofs[is];
1538  Fe.resize (n_side_dofs);
1539  for (unsigned int js = 0; js != n_side_dofs; ++js)
1540  {
1541  const unsigned int j = my_side_dofs[js];
1542  for (unsigned int qp = 0; qp != n_qp; ++qp)
1543  {
1544  Fe(js) += JxW[qp] *
1545  TensorTools::inner_product(neigh_phi[i][qp],
1546  phi[j][qp]);
1547  if (cont != C_ZERO)
1548  Fe(js) += JxW[qp] *
1549  TensorTools::inner_product((*neigh_dphi)[i][qp] *
1550  (*face_normals)[qp],
1551  (*dphi)[j][qp] *
1552  (*face_normals)[qp]);
1553  }
1554  }
1555  Ke.cholesky_solve(Fe, Ue[is]);
1556  }
1557 
1558  for (unsigned int js = 0; js != n_side_dofs; ++js)
1559  {
1560  const unsigned int j = my_side_dofs[js];
1561  const dof_id_type my_dof_g = my_dof_indices[j];
1562  libmesh_assert_not_equal_to (my_dof_g, DofObject::invalid_id);
1563 
1564  // Hunt for "constraining against myself" cases before
1565  // we bother creating a constraint row
1566  bool self_constraint = false;
1567  for (unsigned int is = 0; is != n_side_dofs; ++is)
1568  {
1569  const unsigned int i = neigh_side_dofs[is];
1570  const dof_id_type their_dof_g = neigh_dof_indices[i];
1571  libmesh_assert_not_equal_to (their_dof_g, DofObject::invalid_id);
1572 
1573  if (their_dof_g == my_dof_g)
1574  {
1575 #ifndef NDEBUG
1576  const Real their_dof_value = Ue[is](js);
1577  libmesh_assert_less (std::abs(their_dof_value-1.),
1578  10*TOLERANCE);
1579 
1580  for (unsigned int k = 0; k != n_side_dofs; ++k)
1581  libmesh_assert(k == is ||
1582  std::abs(Ue[k](js)) <
1583  10*TOLERANCE);
1584 #endif
1585 
1586  self_constraint = true;
1587  break;
1588  }
1589  }
1590 
1591  if (self_constraint)
1592  continue;
1593 
1594  DofConstraintRow * constraint_row;
1595 
1596  // we may be running constraint methods concurrently
1597  // on multiple threads, so we need a lock to
1598  // ensure that this constraint is "ours"
1599  {
1600  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
1601 
1602  if (dof_map.is_constrained_dof(my_dof_g))
1603  continue;
1604 
1605  constraint_row = &(constraints[my_dof_g]);
1606  libmesh_assert(constraint_row->empty());
1607  }
1608 
1609  for (unsigned int is = 0; is != n_side_dofs; ++is)
1610  {
1611  const unsigned int i = neigh_side_dofs[is];
1612  const dof_id_type their_dof_g = neigh_dof_indices[i];
1613  libmesh_assert_not_equal_to (their_dof_g, DofObject::invalid_id);
1614  libmesh_assert_not_equal_to (their_dof_g, my_dof_g);
1615 
1616  const Real their_dof_value = Ue[is](js);
1617 
1618  if (std::abs(their_dof_value) < 10*TOLERANCE)
1619  continue;
1620 
1621  constraint_row->insert(std::make_pair(their_dof_g,
1622  their_dof_value));
1623  }
1624  }
1625 
1626  my_fe->set_fe_order(my_fe->get_fe_type().order.get_order() + old_elem_level - min_p_level);
1627  neigh_fe->set_fe_order(neigh_fe->get_fe_type().order.get_order() + old_neigh_level - min_p_level);
1628  }
1629 
1630  // p refinement constraints:
1631  // constrain dofs shared between
1632  // active elements and neighbors with
1633  // lower polynomial degrees
1634  const unsigned int min_p_level =
1635  neigh->min_p_level_by_neighbor(elem, elem->p_level());
1636  if (min_p_level < elem->p_level())
1637  {
1638  // Adaptive p refinement of non-hierarchic bases will
1639  // require more coding
1640  libmesh_assert(my_fe->is_hierarchic());
1641  dof_map.constrain_p_dofs(variable_number, elem,
1642  s, min_p_level);
1643  }
1644  }
1645 }
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
Definition: fe_type.h:178
int get_order() const
Explicitly request the order as an int.
Definition: fe_type.h:77
double abs(double a)
bool active() const
Definition: elem.h:2257
unsigned int p_level() const
Definition: elem.h:2422
const FEType & variable_type(const unsigned int c) const
Definition: dof_map.h:1697
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)
Fills the vector di with the local degree of freedom indices associated with side s of element elem A...
Definition: fe_interface.C:495
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2083
void resize(const unsigned int n)
Resize the vector.
Definition: dense_vector.h:350
unsigned int which_neighbor_am_i(const Elem *e) const
This function tells you which neighbor e is.
Definition: elem.h:2181
unsigned int min_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
Definition: elem.C:2017
This is the base class from which all geometric element types are derived.
Definition: elem.h:89
unsigned int n_neighbors() const
Definition: elem.h:613
const class libmesh_nullptr_t libmesh_nullptr
OrderWrapper order
The approximation order of the element.
Definition: fe_type.h:197
static const Real TOLERANCE
libmesh_assert(j)
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
virtual unsigned int n_nodes() const =0
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:1967
bool is_constrained_dof(const dof_id_type dof) const
Definition: dof_map.h:1734
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
std::vector< std::vector< OutputShape > > phi
Shape function values.
Definition: fe_base.h:499
Order default_quadrature_order() const
Definition: fe_type.h:332
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
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:569
std::vector< std::vector< OutputGradient > > dphi
Shape function derivative values.
Definition: fe_base.h:504
FEContinuity
defines an enum for finite element types to libmesh_assert a certain level (or type? Hcurl?) of continuity.
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
A row of the Dof constraint matrix.
Definition: dof_map.h:88
void resize(const unsigned int new_m, const unsigned int new_n)
Resize the matrix.
Definition: dense_matrix.h:776
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2388
This class implements specific orders of Gauss quadrature.
Defines a dense vector for use in Finite Element-type computations.
long double min(long double a, double b)
void cholesky_solve(const DenseVector< T2 > &b, DenseVector< T2 > &x)
For symmetric positive definite (SPD) matrices.
Definition: dense_matrix.C:911
This class forms the foundation from which generic finite elements may be derived.
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)
Constrains degrees of freedom on side s of element elem which correspond to variable number var and t...
uint8_t dof_id_type
Definition: id_types.h:64
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Fills the vector di with the global degree of freedom indices for the element.
Definition: dof_map.C:1917
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 680 of file fe_base.C.

References dim.

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

682 {
683  //-------------------------------------------------------------------------
684  // Compute the shape function values (and derivatives)
685  // at the Quadrature points. Note that the actual values
686  // have already been computed via init_shape_functions
687 
688  // Start logging the shape function computation
689  LOG_SCOPE("compute_shape_functions()", "FE");
690 
691  this->determine_calculations();
692 
693  if (calculate_phi)
694  this->_fe_trans->map_phi(this->dim, elem, qp, (*this), this->phi);
695 
696  if (calculate_dphi)
697  this->_fe_trans->map_dphi(this->dim, elem, qp, (*this), this->dphi,
698  this->dphidx, this->dphidy, this->dphidz);
699 
700 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
701  if (calculate_d2phi)
702  this->_fe_trans->map_d2phi(this->dim, qp, (*this), this->d2phi,
703  this->d2phidx2, this->d2phidxdy, this->d2phidxdz,
704  this->d2phidy2, this->d2phidydz, this->d2phidz2);
705 #endif //LIBMESH_ENABLE_SECOND_DERIVATIVES
706 
707  // Only compute curl for vector-valued elements
709  this->_fe_trans->map_curl(this->dim, elem, qp, (*this), this->curl_phi);
710 
711  // Only compute div for vector-valued elements
713  this->_fe_trans->map_div(this->dim, elem, qp, (*this), this->div_phi);
714 }
bool calculate_d2phi
Should we calculate shape function hessians?
Definition: fe_abstract.h:544
bool calculate_curl_phi
Should we calculate shape function curls?
Definition: fe_abstract.h:549
std::vector< std::vector< OutputTensor > > d2phi
Shape function second derivative values.
Definition: fe_base.h:552
std::vector< std::vector< OutputShape > > d2phidxdz
Shape function second derivatives in the x-z direction.
Definition: fe_base.h:597
std::vector< std::vector< OutputShape > > d2phidydz
Shape function second derivatives in the y-z direction.
Definition: fe_base.h:607
bool calculate_phi
Should we calculate shape functions?
Definition: fe_abstract.h:534
std::vector< std::vector< OutputShape > > d2phidx2
Shape function second derivatives in the x direction.
Definition: fe_base.h:587
std::vector< std::vector< OutputShape > > curl_phi
Shape function curl values.
Definition: fe_base.h:509
std::vector< std::vector< OutputShape > > dphidy
Shape function derivatives in the y direction.
Definition: fe_base.h:539
std::vector< std::vector< OutputShape > > d2phidy2
Shape function second derivatives in the y direction.
Definition: fe_base.h:602
bool calculate_div_phi
Should we calculate shape function divergences?
Definition: fe_abstract.h:554
std::vector< std::vector< OutputShape > > d2phidxdy
Shape function second derivatives in the x-y direction.
Definition: fe_base.h:592
std::vector< std::vector< OutputShape > > dphidx
Shape function derivatives in the x direction.
Definition: fe_base.h:534
std::vector< std::vector< OutputShape > > phi
Shape function values.
Definition: fe_base.h:499
const unsigned int dim
The dimensionality of the object.
Definition: fe_abstract.h:523
std::vector< std::vector< OutputDivergence > > div_phi
Shape function divergence values.
Definition: fe_base.h:514
void determine_calculations()
Determine which values are to be calculated, for both the FE itself and for the FEMap.
Definition: fe_base.C:739
std::vector< std::vector< OutputGradient > > dphi
Shape function derivative values.
Definition: fe_base.h:504
bool calculate_dphi
Should we calculate shape function gradients?
Definition: fe_abstract.h:539
UniquePtr< FETransformationBase< OutputType > > _fe_trans
Object that handles computing shape function values, gradients, etc in the physical domain...
Definition: fe_base.h:494
std::vector< std::vector< OutputShape > > d2phidz2
Shape function second derivatives in the z direction.
Definition: fe_base.h:612
std::vector< std::vector< OutputShape > > dphidz
Shape function derivatives in the z direction.
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 739 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().

740 {
741  this->calculations_started = true;
742 
743  // If the user forgot to request anything, we'll be safe and
744  // calculate everything:
745 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
746  if (!this->calculate_phi && !this->calculate_dphi && !this->calculate_d2phi
747  && !this->calculate_curl_phi && !this->calculate_div_phi)
748  {
749  this->calculate_phi = this->calculate_dphi = this->calculate_d2phi = this->calculate_dphiref = true;
751  {
752  this->calculate_curl_phi = true;
753  this->calculate_div_phi = true;
754  }
755  }
756 #else
757  if (!this->calculate_phi && !this->calculate_dphi && !this->calculate_curl_phi && !this->calculate_div_phi)
758  {
759  this->calculate_phi = this->calculate_dphi = this->calculate_dphiref = true;
761  {
762  this->calculate_curl_phi = true;
763  this->calculate_div_phi = true;
764  }
765  }
766 #endif // LIBMESH_ENABLE_SECOND_DERIVATIVES
767 
768  // Request whichever terms are necessary from the FEMap
769  if (this->calculate_phi)
770  this->_fe_trans->init_map_phi(*this);
771 
772  if (this->calculate_dphiref)
773  this->_fe_trans->init_map_dphi(*this);
774 
775 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
776  if (this->calculate_d2phi)
777  this->_fe_trans->init_map_d2phi(*this);
778 #endif //LIBMESH_ENABLE_SECOND_DERIVATIVES
779 }
bool calculate_d2phi
Should we calculate shape function hessians?
Definition: fe_abstract.h:544
bool calculate_curl_phi
Should we calculate shape function curls?
Definition: fe_abstract.h:549
FEFamily family
The type of finite element.
Definition: fe_type.h:203
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
bool calculate_phi
Should we calculate shape functions?
Definition: fe_abstract.h:534
static FEFieldType field_type(const FEType &fe_type)
bool calculate_div_phi
Should we calculate shape function divergences?
Definition: fe_abstract.h:554
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
bool calculate_dphi
Should we calculate shape function gradients?
Definition: fe_abstract.h:539
UniquePtr< FETransformationBase< OutputType > > _fe_trans
Object that handles computing shape function values, gradients, etc in the physical domain...
Definition: fe_base.h:494
FEType fe_type
The finite element type for this object.
Definition: fe_abstract.h:567
void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 107 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

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

108 {
109  _enable_print_counter = false;
110  return;
111 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
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 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
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
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().

226  calculate_curl_phi = calculate_dphiref = true; return curl_phi; }
bool calculate_curl_phi
Should we calculate shape function curls?
Definition: fe_abstract.h:549
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
std::vector< std::vector< OutputShape > > curl_phi
Shape function curl values.
Definition: fe_base.h:509
libmesh_assert(j)
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
const std::vector<Real>& libMesh::FEAbstract::get_curvatures ( ) const
inherited
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();}
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
template<typename OutputType>
const std::vector<std::vector<OutputTensor> >& libMesh::FEGenericBase< OutputType >::get_d2phi ( ) const
Returns
The shape function second derivatives at the quadrature points.

Definition at line 290 of file fe_base.h.

Referenced by libMesh::ExactSolution::_compute_error(), libMesh::System::calculate_norm(), libMesh::ExactErrorEstimator::find_squared_element_error(), libMesh::LaplacianErrorEstimator::init_context(), libMesh::ParsedFEMFunction< Output >::init_context(), libMesh::LaplacianErrorEstimator::internal_side_integration(), and libMesh::FEMContext::some_hessian().

292  calculate_d2phi = calculate_dphiref = true; return d2phi; }
bool calculate_d2phi
Should we calculate shape function hessians?
Definition: fe_abstract.h:544
std::vector< std::vector< OutputTensor > > d2phi
Shape function second derivative values.
Definition: fe_base.h:552
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
libmesh_assert(j)
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phideta2 ( ) const
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().

372  calculate_d2phi = calculate_dphiref = true; return d2phideta2; }
bool calculate_d2phi
Should we calculate shape function hessians?
Definition: fe_abstract.h:544
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
libmesh_assert(j)
std::vector< std::vector< OutputShape > > d2phideta2
Shape function second derivatives in the eta direction.
Definition: fe_base.h:572
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidetadzeta ( ) const
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().

bool calculate_d2phi
Should we calculate shape function hessians?
Definition: fe_abstract.h:544
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
libmesh_assert(j)
std::vector< std::vector< OutputShape > > d2phidetadzeta
Shape function second derivatives in the eta-zeta direction.
Definition: fe_base.h:577
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidx2 ( ) const
Returns
The shape function second derivatives at the quadrature points.

Definition at line 298 of file fe_base.h.

300  calculate_d2phi = calculate_dphiref = true; return d2phidx2; }
bool calculate_d2phi
Should we calculate shape function hessians?
Definition: fe_abstract.h:544
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
std::vector< std::vector< OutputShape > > d2phidx2
Shape function second derivatives in the x direction.
Definition: fe_base.h:587
libmesh_assert(j)
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidxdy ( ) const
Returns
The shape function second derivatives at the quadrature points.

Definition at line 306 of file fe_base.h.

308  calculate_d2phi = calculate_dphiref = true; return d2phidxdy; }
bool calculate_d2phi
Should we calculate shape function hessians?
Definition: fe_abstract.h:544
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
libmesh_assert(j)
std::vector< std::vector< OutputShape > > d2phidxdy
Shape function second derivatives in the x-y direction.
Definition: fe_base.h:592
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidxdz ( ) const
Returns
The shape function second derivatives at the quadrature points.

Definition at line 314 of file fe_base.h.

316  calculate_d2phi = calculate_dphiref = true; return d2phidxdz; }
bool calculate_d2phi
Should we calculate shape function hessians?
Definition: fe_abstract.h:544
std::vector< std::vector< OutputShape > > d2phidxdz
Shape function second derivatives in the x-z direction.
Definition: fe_base.h:597
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
libmesh_assert(j)
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidxi2 ( ) const
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().

348  calculate_d2phi = calculate_dphiref = true; return d2phidxi2; }
bool calculate_d2phi
Should we calculate shape function hessians?
Definition: fe_abstract.h:544
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
libmesh_assert(j)
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
std::vector< std::vector< OutputShape > > d2phidxi2
Shape function second derivatives in the xi direction.
Definition: fe_base.h:557
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidxideta ( ) const
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().

bool calculate_d2phi
Should we calculate shape function hessians?
Definition: fe_abstract.h:544
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
std::vector< std::vector< OutputShape > > d2phidxideta
Shape function second derivatives in the xi-eta direction.
Definition: fe_base.h:562
libmesh_assert(j)
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidxidzeta ( ) const
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().

bool calculate_d2phi
Should we calculate shape function hessians?
Definition: fe_abstract.h:544
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
libmesh_assert(j)
std::vector< std::vector< OutputShape > > d2phidxidzeta
Shape function second derivatives in the xi-zeta direction.
Definition: fe_base.h:567
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidy2 ( ) const
Returns
The shape function second derivatives at the quadrature points.

Definition at line 322 of file fe_base.h.

324  calculate_d2phi = calculate_dphiref = true; return d2phidy2; }
bool calculate_d2phi
Should we calculate shape function hessians?
Definition: fe_abstract.h:544
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
std::vector< std::vector< OutputShape > > d2phidy2
Shape function second derivatives in the y direction.
Definition: fe_base.h:602
libmesh_assert(j)
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidydz ( ) const
Returns
The shape function second derivatives at the quadrature points.

Definition at line 330 of file fe_base.h.

332  calculate_d2phi = calculate_dphiref = true; return d2phidydz; }
bool calculate_d2phi
Should we calculate shape function hessians?
Definition: fe_abstract.h:544
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
std::vector< std::vector< OutputShape > > d2phidydz
Shape function second derivatives in the y-z direction.
Definition: fe_base.h:607
libmesh_assert(j)
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidz2 ( ) const
Returns
The shape function second derivatives at the quadrature points.

Definition at line 338 of file fe_base.h.

340  calculate_d2phi = calculate_dphiref = true; return d2phidz2; }
bool calculate_d2phi
Should we calculate shape function hessians?
Definition: fe_abstract.h:544
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
libmesh_assert(j)
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
std::vector< std::vector< OutputShape > > d2phidz2
Shape function second derivatives in the z direction.
Definition: fe_base.h:612
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_d2phidzeta2 ( ) const
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().

388  calculate_d2phi = calculate_dphiref = true; return d2phidzeta2; }
bool calculate_d2phi
Should we calculate shape function hessians?
Definition: fe_abstract.h:544
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
libmesh_assert(j)
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
std::vector< std::vector< OutputShape > > d2phidzeta2
Shape function second derivatives in the zeta direction.
Definition: fe_base.h:582
const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdeta2 ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdetadzeta ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdxi2 ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdxideta ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdxidzeta ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdzeta2 ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<Real>& libMesh::FEAbstract::get_detadx ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<Real>& libMesh::FEAbstract::get_detady ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<Real>& libMesh::FEAbstract::get_detadz ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
unsigned int libMesh::FEAbstract::get_dim ( ) const
inherited
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
The dimensionality of the object.
Definition: fe_abstract.h:523
template<typename OutputType>
const std::vector<std::vector<OutputDivergence> >& libMesh::FEGenericBase< OutputType >::get_div_phi ( ) const
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().

234  calculate_div_phi = calculate_dphiref = true; return div_phi; }
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
bool calculate_div_phi
Should we calculate shape function divergences?
Definition: fe_abstract.h:554
libmesh_assert(j)
std::vector< std::vector< OutputDivergence > > div_phi
Shape function divergence values.
Definition: fe_base.h:514
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
template<typename OutputType>
const std::vector<OutputGradient>& libMesh::FEGenericBase< OutputType >::get_dphase ( ) const
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.

Referenced by assemble_wave().

405  { return dphase; }
std::vector< OutputGradient > dphase
Used for certain infinite element families: the first derivatives of the phase term in global coordin...
Definition: fe_base.h:630
template<typename OutputType>
const std::vector<std::vector<OutputGradient> >& libMesh::FEGenericBase< OutputType >::get_dphi ( ) const
Returns
The shape function derivatives at the quadrature points.

Definition at line 216 of file fe_base.h.

Referenced by libMesh::ExactSolution::_compute_error(), assemble_wave(), libMesh::KellyErrorEstimator::boundary_side_integration(), libMesh::System::calculate_norm(), ElasticitySystem::element_time_derivative(), libMesh::ExactErrorEstimator::find_squared_element_error(), libMesh::OldSolutionValue< Output, point_output >::get_shape_outputs(), PoissonSystem::init_context(), LaplaceSystem::init_context(), libMesh::ParsedFEMFunction< Output >::init_context(), libMesh::KellyErrorEstimator::init_context(), ElasticityRBConstruction::init_context(), libMesh::KellyErrorEstimator::internal_side_integration(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()(), FETest< order, family, elem_type >::setUp(), libMesh::FEMContext::some_gradient(), and FETest< order, family, elem_type >::testGradU().

218  calculate_dphi = calculate_dphiref = true; return dphi; }
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
libmesh_assert(j)
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
std::vector< std::vector< OutputGradient > > dphi
Shape function derivative values.
Definition: fe_base.h:504
bool calculate_dphi
Should we calculate shape function gradients?
Definition: fe_abstract.h:539
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_dphideta ( ) const
Returns
The shape function eta-derivative at the quadrature points.

Definition at line 272 of file fe_base.h.

Referenced by libMesh::HCurlFETransformation< OutputShape >::map_curl(), libMesh::H1FETransformation< OutputShape >::map_curl(), libMesh::H1FETransformation< OutputShape >::map_d2phi(), libMesh::H1FETransformation< OutputShape >::map_div(), and libMesh::H1FETransformation< OutputShape >::map_dphi().

274  calculate_dphiref = true; return dphideta; }
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
libmesh_assert(j)
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
std::vector< std::vector< OutputShape > > dphideta
Shape function derivatives in the eta direction.
Definition: fe_base.h:524
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_dphidx ( ) const
Returns
The shape function x-derivative at the quadrature points.

Definition at line 240 of file fe_base.h.

Referenced by FETest< order, family, elem_type >::setUp(), and FETest< order, family, elem_type >::testGradUComp().

242  calculate_dphi = calculate_dphiref = true; return dphidx; }
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
libmesh_assert(j)
std::vector< std::vector< OutputShape > > dphidx
Shape function derivatives in the x direction.
Definition: fe_base.h:534
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
bool calculate_dphi
Should we calculate shape function gradients?
Definition: fe_abstract.h:539
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_dphidxi ( ) const
Returns
The shape function xi-derivative at the quadrature points.

Definition at line 264 of file fe_base.h.

Referenced by libMesh::HCurlFETransformation< OutputShape >::map_curl(), libMesh::H1FETransformation< OutputShape >::map_curl(), libMesh::H1FETransformation< OutputShape >::map_d2phi(), libMesh::H1FETransformation< OutputShape >::map_div(), and libMesh::H1FETransformation< OutputShape >::map_dphi().

266  calculate_dphiref = true; return dphidxi; }
std::vector< std::vector< OutputShape > > dphidxi
Shape function derivatives in the xi direction.
Definition: fe_base.h:519
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
libmesh_assert(j)
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_dphidy ( ) const
Returns
The shape function y-derivative at the quadrature points.

Definition at line 248 of file fe_base.h.

Referenced by FETest< order, family, elem_type >::setUp(), and FETest< order, family, elem_type >::testGradUComp().

250  calculate_dphi = calculate_dphiref = true; return dphidy; }
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
std::vector< std::vector< OutputShape > > dphidy
Shape function derivatives in the y direction.
Definition: fe_base.h:539
libmesh_assert(j)
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
bool calculate_dphi
Should we calculate shape function gradients?
Definition: fe_abstract.h:539
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_dphidz ( ) const
Returns
The shape function z-derivative at the quadrature points.

Definition at line 256 of file fe_base.h.

Referenced by FETest< order, family, elem_type >::setUp(), and FETest< order, family, elem_type >::testGradUComp().

258  calculate_dphi = calculate_dphiref = true; return dphidz; }
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
libmesh_assert(j)
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
bool calculate_dphi
Should we calculate shape function gradients?
Definition: fe_abstract.h:539
std::vector< std::vector< OutputShape > > dphidz
Shape function derivatives in the z direction.
Definition: fe_base.h:544
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_dphidzeta ( ) const
Returns
The shape function zeta-derivative at the quadrature points.

Definition at line 280 of file fe_base.h.

Referenced by libMesh::HCurlFETransformation< OutputShape >::map_curl(), libMesh::H1FETransformation< OutputShape >::map_curl(), libMesh::H1FETransformation< OutputShape >::map_d2phi(), libMesh::H1FETransformation< OutputShape >::map_div(), and libMesh::H1FETransformation< OutputShape >::map_dphi().

282  calculate_dphiref = true; return dphidzeta; }
std::vector< std::vector< OutputShape > > dphidzeta
Shape function derivatives in the zeta direction.
Definition: fe_base.h:529
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
libmesh_assert(j)
bool calculate_dphiref
Should we calculate reference shape function gradients?
Definition: fe_abstract.h:559
const std::vector<Real>& libMesh::FEAbstract::get_dxidx ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<Real>& libMesh::FEAbstract::get_dxidy ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<Real>& libMesh::FEAbstract::get_dxidz ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<RealGradient>& libMesh::FEAbstract::get_dxyzdeta ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<RealGradient>& libMesh::FEAbstract::get_dxyzdxi ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<RealGradient>& libMesh::FEAbstract::get_dxyzdzeta ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<Real>& libMesh::FEAbstract::get_dzetadx ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<Real>& libMesh::FEAbstract::get_dzetady ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
const std::vector<Real>& libMesh::FEAbstract::get_dzetadz ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
FEFamily libMesh::FEAbstract::get_family ( ) const
inherited
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
The type of finite element.
Definition: fe_type.h:203
FEType fe_type
The finite element type for this object.
Definition: fe_abstract.h:567
const FEMap& libMesh::FEAbstract::get_fe_map ( ) const
inherited
FEType libMesh::FEAbstract::get_fe_type ( ) const
inherited
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)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
static Counts _counts
Actually holds the data.
const std::vector<Real>& libMesh::FEAbstract::get_JxW ( ) const
inherited
const std::vector<Point>& libMesh::FEAbstract::get_normals ( ) const
inherited
Order libMesh::FEAbstract::get_order ( ) const
inherited
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
The p refinement level the current data structures are set up for.
Definition: fe_abstract.h:579
OrderWrapper order
The approximation order of the element.
Definition: fe_type.h:197
Order
defines an enum for polynomial orders.
Definition: enum_order.h:32
FEType fe_type
The finite element type for this object.
Definition: fe_abstract.h:567
unsigned int libMesh::FEAbstract::get_p_level ( ) const
inherited
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
The p refinement level the current data structures are set up for.
Definition: fe_abstract.h:579
template<typename OutputType>
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< OutputType >::get_phi ( ) const
Returns
The shape function values at the quadrature points on the element.

Definition at line 208 of file fe_base.h.

Referenced by libMesh::ExactSolution::_compute_error(), assemble_wave(), libMesh::DiscontinuityMeasure::boundary_side_integration(), libMesh::System::calculate_norm(), NavierSystem::element_constraint(), CoupledSystem::element_constraint(), NavierSystem::element_time_derivative(), ElasticitySystem::element_time_derivative(), CoupledSystem::element_time_derivative(), libMesh::RBEIMAssembly::evaluate_basis_function(), libMesh::ExactErrorEstimator::find_squared_element_error(), libMesh::OldSolutionValue< Output, point_output >::get_shape_outputs(), NavierSystem::init_context(), SolidSystem::init_context(), PoissonSystem::init_context(), LaplaceSystem::init_context(), CurlCurlSystem::init_context(), ElasticitySystem::init_context(), CoupledSystem::init_context(), libMesh::ParsedFEMFunction< Output >::init_context(), libMesh::DiscontinuityMeasure::init_context(), ElasticityRBConstruction::init_context(), libMesh::FEMSystem::init_context(), libMesh::RBEIMConstruction::init_context_with_sys(), LaplaceSystem::init_dirichlet_bcs(), libMesh::DiscontinuityMeasure::internal_side_integration(), ElasticitySystem::mass_residual(), libMesh::FEMPhysics::mass_residual(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()(), FETest< order, family, elem_type >::setUp(), SolidSystem::side_time_derivative(), ElasticitySystem::side_time_derivative(), libMesh::FEMContext::some_value(), SlitMeshRefinedSystemTest::testRestart(), SlitMeshRefinedSystemTest::testSystem(), FETest< order, family, elem_type >::testU(), and libMesh::RBEIMConstruction::truth_solve().

210  calculate_phi = true; return phi; }
bool calculations_started
Have calculations with this object already been started? Then all get_* functions should already have...
Definition: fe_abstract.h:529
bool calculate_phi
Should we calculate shape functions?
Definition: fe_abstract.h:534
libmesh_assert(j)
std::vector< std::vector< OutputShape > > phi
Shape function values.
Definition: fe_base.h:499
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 259 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.

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

Referenced by assemble_wave().

429  { return dweight; }
std::vector< RealGradient > dweight
Used for certain infinite element families: the global derivative of the additional radial weight ...
Definition: fe_base.h:637
template<typename OutputType>
const std::vector<Real>& libMesh::FEGenericBase< OutputType >::get_Sobolev_weight ( ) const
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.

Referenced by assemble_wave().

421  { return weight; }
std::vector< Real > weight
Used for certain infinite element families: the additional radial weight in local coordinates...
Definition: fe_base.h:644
const std::vector<std::vector<Point> >& libMesh::FEAbstract::get_tangents ( ) const
inherited
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(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:517
ElemType libMesh::FEAbstract::get_type ( ) const
inherited
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; }
ElemType elem_type
The element type the current data structures are set up for.
Definition: fe_abstract.h:573
const std::vector<Point>& libMesh::FEAbstract::get_xyz ( ) const
inherited
void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
protectedinherited

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)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
static Counts _counts
Actually holds the data.
void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
protectedinherited

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)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
static Counts _counts
Actually holds the data.
template<typename OutputType>
virtual void libMesh::FEGenericBase< OutputType >::init_base_shape_functions ( const std::vector< Point > &  qp,
const Elem e 
)
protectedpure virtual
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 ( )
staticinherited
virtual unsigned int libMesh::FEAbstract::n_quadrature_points ( ) const
pure virtualinherited
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 557 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().

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