libMesh::DGFEMContext Class Reference

Extends FEMContext to work for DG problems. More...

#include <dg_fem_context.h>

Inheritance diagram for libMesh::DGFEMContext:

Public Types

enum  AlgebraicType {
  NONE = 0, DOFS_ONLY, CURRENT, OLD,
  OLD_DOFS_ONLY
}
 
typedef const DenseSubVector< Number > &(DiffContext::* diff_subsolution_getter) (unsigned int) const
 
typedef std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< std::unique_ptr< DenseSubVector< Number > > > > >::iterator localized_vectors_iterator
 

Public Member Functions

 DGFEMContext (const System &sys)
 
virtual ~DGFEMContext ()
 
virtual void side_fe_reinit () override
 
void neighbor_side_fe_reinit ()
 
const std::vector< dof_id_type > & get_neighbor_dof_indices () const
 
const std::vector< dof_id_type > & get_neighbor_dof_indices (unsigned int var) const
 
const DenseVector< Number > & get_neighbor_residual () const
 
DenseVector< Number > & get_neighbor_residual ()
 
const DenseSubVector< Number > & get_neighbor_residual (unsigned int var) const
 
DenseSubVector< Number > & get_neighbor_residual (unsigned int var)
 
const DenseMatrix< Number > & get_elem_elem_jacobian () const
 
DenseMatrix< Number > & get_elem_elem_jacobian ()
 
const DenseSubMatrix< Number > & get_elem_elem_jacobian (unsigned int var1, unsigned int var2) const
 
DenseSubMatrix< Number > & get_elem_elem_jacobian (unsigned int var1, unsigned int var2)
 
const DenseMatrix< Number > & get_elem_neighbor_jacobian () const
 
DenseMatrix< Number > & get_elem_neighbor_jacobian ()
 
const DenseSubMatrix< Number > & get_elem_neighbor_jacobian (unsigned int var1, unsigned int var2) const
 
DenseSubMatrix< Number > & get_elem_neighbor_jacobian (unsigned int var1, unsigned int var2)
 
const DenseMatrix< Number > & get_neighbor_elem_jacobian () const
 
DenseMatrix< Number > & get_neighbor_elem_jacobian ()
 
const DenseSubMatrix< Number > & get_neighbor_elem_jacobian (unsigned int var1, unsigned int var2) const
 
DenseSubMatrix< Number > & get_neighbor_elem_jacobian (unsigned int var1, unsigned int var2)
 
const DenseMatrix< Number > & get_neighbor_neighbor_jacobian () const
 
DenseMatrix< Number > & get_neighbor_neighbor_jacobian ()
 
const DenseSubMatrix< Number > & get_neighbor_neighbor_jacobian (unsigned int var1, unsigned int var2) const
 
DenseSubMatrix< Number > & get_neighbor_neighbor_jacobian (unsigned int var1, unsigned int var2)
 
void set_neighbor (const Elem &neighbor)
 
const Elemget_neighbor () const
 
bool dg_terms_are_active () const
 
template<typename OutputShape >
void get_neighbor_side_fe (unsigned int var, FEGenericBase< OutputShape > *&fe) const
 
bool has_side_boundary_id (boundary_id_type id) const
 
std::vector< boundary_id_typeside_boundary_ids () const
 
void side_boundary_ids (std::vector< boundary_id_type > &vec_to_fill) const
 
Number interior_value (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void interior_value (unsigned int var, unsigned int qp, OutputType &u) const
 
Number side_value (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void side_value (unsigned int var, unsigned int qp, OutputType &u) const
 
Number point_value (unsigned int var, const Point &p) const
 
template<typename OutputType >
void point_value (unsigned int var, const Point &p, OutputType &u, const Real tolerance=TOLERANCE) const
 
Gradient interior_gradient (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void interior_gradient (unsigned int var, unsigned int qp, OutputType &du) const
 
Gradient side_gradient (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void side_gradient (unsigned int var, unsigned int qp, OutputType &du) const
 
Gradient point_gradient (unsigned int var, const Point &p) const
 
template<typename OutputType >
void point_gradient (unsigned int var, const Point &p, OutputType &grad_u, const Real tolerance=TOLERANCE) const
 
Tensor interior_hessian (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void interior_hessian (unsigned int var, unsigned int qp, OutputType &d2u) const
 
Tensor side_hessian (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void side_hessian (unsigned int var, unsigned int qp, OutputType &d2u) const
 
Tensor point_hessian (unsigned int var, const Point &p) const
 
template<typename OutputType >
void point_hessian (unsigned int var, const Point &p, OutputType &hess_u, const Real tolerance=TOLERANCE) const
 
Number fixed_interior_value (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void fixed_interior_value (unsigned int var, unsigned int qp, OutputType &u) const
 
Number fixed_side_value (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void fixed_side_value (unsigned int var, unsigned int qp, OutputType &u) const
 
Number fixed_point_value (unsigned int var, const Point &p) const
 
template<typename OutputType >
void fixed_point_value (unsigned int var, const Point &p, OutputType &u, const Real tolerance=TOLERANCE) const
 
Gradient fixed_interior_gradient (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void fixed_interior_gradient (unsigned int var, unsigned int qp, OutputType &grad_u) const
 
Gradient fixed_side_gradient (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void fixed_side_gradient (unsigned int var, unsigned int qp, OutputType &grad_u) const
 
Gradient fixed_point_gradient (unsigned int var, const Point &p) const
 
template<typename OutputType >
void fixed_point_gradient (unsigned int var, const Point &p, OutputType &grad_u, const Real tolerance=TOLERANCE) const
 
Tensor fixed_interior_hessian (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void fixed_interior_hessian (unsigned int var, unsigned int qp, OutputType &hess_u) const
 
Tensor fixed_side_hessian (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void fixed_side_hessian (unsigned int var, unsigned int qp, OutputType &hess_u) const
 
Tensor fixed_point_hessian (unsigned int var, const Point &p) const
 
template<typename OutputType >
void fixed_point_hessian (unsigned int var, const Point &p, OutputType &hess_u, const Real tolerance=TOLERANCE) const
 
template<typename OutputShape >
void get_element_fe (unsigned int var, FEGenericBase< OutputShape > *&fe) const
 
FEBaseget_element_fe (unsigned int var) const
 
template<typename OutputShape >
void get_element_fe (unsigned int var, FEGenericBase< OutputShape > *&fe, unsigned short dim) const
 
FEBaseget_element_fe (unsigned int var, unsigned short dim) const
 
template<typename OutputShape >
void get_side_fe (unsigned int var, FEGenericBase< OutputShape > *&fe) const
 
FEBaseget_side_fe (unsigned int var) const
 
template<typename OutputShape >
void get_side_fe (unsigned int var, FEGenericBase< OutputShape > *&fe, unsigned short dim) const
 
FEBaseget_side_fe (unsigned int var, unsigned short dim) const
 
template<typename OutputShape >
void get_edge_fe (unsigned int var, FEGenericBase< OutputShape > *&fe) const
 
FEBaseget_edge_fe (unsigned int var) const
 
template<typename OutputType >
void interior_values (unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &interior_values_vector) const
 
template<typename OutputType >
void side_values (unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &side_values_vector) const
 
template<typename OutputType >
void interior_gradients (unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &interior_gradients_vector) const
 
template<typename OutputType >
void side_gradients (unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &side_gradients_vector) const
 
template<typename OutputType >
void interior_hessians (unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &d2u_vals) const
 
template<typename OutputType >
void side_hessians (unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &d2u_vals) const
 
template<typename OutputType >
void interior_rate (unsigned int var, unsigned int qp, OutputType &u) const
 
template<typename OutputType >
void side_rate (unsigned int var, unsigned int qp, OutputType &u) const
 
template<typename OutputType >
void point_rate (unsigned int var, const Point &p, OutputType &u) const
 
template<typename OutputType >
void interior_accel (unsigned int var, unsigned int qp, OutputType &u) const
 
template<typename OutputType >
void side_accel (unsigned int var, unsigned int qp, OutputType &u) const
 
template<typename OutputType >
void point_accel (unsigned int var, const Point &p, OutputType &u) const
 
template<typename OutputType >
void interior_curl (unsigned int var, unsigned int qp, OutputType &curl_u) const
 
template<typename OutputType >
void point_curl (unsigned int var, const Point &p, OutputType &curl_u, const Real tolerance=TOLERANCE) const
 
template<typename OutputType >
void interior_div (unsigned int var, unsigned int qp, OutputType &div_u) const
 
virtual void elem_reinit (Real theta) override
 
virtual void elem_side_reinit (Real theta) override
 
virtual void elem_edge_reinit (Real theta) override
 
virtual void nonlocal_reinit (Real theta) override
 
virtual void pre_fe_reinit (const System &, const Elem *e)
 
virtual void elem_fe_reinit (const std::vector< Point > *const pts=nullptr)
 
virtual void edge_fe_reinit ()
 
const QBaseget_element_qrule () const
 
const QBaseget_element_qrule (unsigned short dim) const
 
const QBaseget_side_qrule () const
 
const QBaseget_side_qrule (unsigned short dim) const
 
const QBaseget_edge_qrule () const
 
virtual void set_mesh_system (System *sys)
 
const Systemget_mesh_system () const
 
Systemget_mesh_system ()
 
unsigned int get_mesh_x_var () const
 
void set_mesh_x_var (unsigned int x_var)
 
unsigned int get_mesh_y_var () const
 
void set_mesh_y_var (unsigned int y_var)
 
unsigned int get_mesh_z_var () const
 
void set_mesh_z_var (unsigned int z_var)
 
bool has_elem () const
 
const Elemget_elem () const
 
Elemget_elem ()
 
unsigned char get_side () const
 
unsigned char get_edge () const
 
unsigned char get_dim () const
 
unsigned char get_elem_dim () const
 
const std::set< unsigned char > & elem_dimensions () const
 
void elem_position_set (Real theta)
 
void elem_position_get ()
 
void set_algebraic_type (const AlgebraicType atype)
 
AlgebraicType algebraic_type () const
 
void set_custom_solution (const NumericVector< Number > *custom_sol)
 
template<typename OutputShape >
FEGenericBase< OutputShape > * build_new_fe (const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
 
template<>
FEGenericBase< Real > * cached_fe (const unsigned int elem_dim, const FEType fe_type) const
 
template<>
FEGenericBase< RealGradient > * cached_fe (const unsigned int elem_dim, const FEType fe_type) const
 
unsigned int n_vars () const
 
const Systemget_system () const
 
const DenseVector< Number > & get_elem_solution () const
 
DenseVector< Number > & get_elem_solution ()
 
const DenseSubVector< Number > & get_elem_solution (unsigned int var) const
 
DenseSubVector< Number > & get_elem_solution (unsigned int var)
 
const DenseVector< Number > & get_elem_solution_rate () const
 
DenseVector< Number > & get_elem_solution_rate ()
 
const DenseSubVector< Number > & get_elem_solution_rate (unsigned int var) const
 
DenseSubVector< Number > & get_elem_solution_rate (unsigned int var)
 
const DenseVector< Number > & get_elem_solution_accel () const
 
DenseVector< Number > & get_elem_solution_accel ()
 
const DenseSubVector< Number > & get_elem_solution_accel (unsigned int var) const
 
DenseSubVector< Number > & get_elem_solution_accel (unsigned int var)
 
const DenseVector< Number > & get_elem_fixed_solution () const
 
DenseVector< Number > & get_elem_fixed_solution ()
 
const DenseSubVector< Number > & get_elem_fixed_solution (unsigned int var) const
 
DenseSubVector< Number > & get_elem_fixed_solution (unsigned int var)
 
const DenseVector< Number > & get_elem_residual () const
 
DenseVector< Number > & get_elem_residual ()
 
const DenseSubVector< Number > & get_elem_residual (unsigned int var) const
 
DenseSubVector< Number > & get_elem_residual (unsigned int var)
 
const DenseMatrix< Number > & get_elem_jacobian () const
 
DenseMatrix< Number > & get_elem_jacobian ()
 
const DenseSubMatrix< Number > & get_elem_jacobian (unsigned int var1, unsigned int var2) const
 
DenseSubMatrix< Number > & get_elem_jacobian (unsigned int var1, unsigned int var2)
 
const std::vector< Number > & get_qois () const
 
std::vector< Number > & get_qois ()
 
const std::vector< DenseVector< Number > > & get_qoi_derivatives () const
 
std::vector< DenseVector< Number > > & get_qoi_derivatives ()
 
const DenseSubVector< Number > & get_qoi_derivatives (std::size_t qoi, unsigned int var) const
 
DenseSubVector< Number > & get_qoi_derivatives (std::size_t qoi, unsigned int var)
 
const std::vector< dof_id_type > & get_dof_indices () const
 
std::vector< dof_id_type > & get_dof_indices ()
 
const std::vector< dof_id_type > & get_dof_indices (unsigned int var) const
 
std::vector< dof_id_type > & get_dof_indices (unsigned int var)
 
unsigned int n_dof_indices () const
 
unsigned int n_dof_indices (unsigned int var) const
 
Real get_system_time () const
 
Real get_time () const
 
void set_time (Real time_in)
 
Real get_elem_solution_derivative () const
 
Real get_elem_solution_rate_derivative () const
 
Real get_elem_solution_accel_derivative () const
 
Real get_fixed_solution_derivative () const
 
bool is_adjoint () const
 
bool & is_adjoint ()
 
void set_deltat_pointer (Real *dt)
 
Real get_deltat_value ()
 
void add_localized_vector (NumericVector< Number > &localized_vector, const System &sys)
 
DenseVector< Number > & get_localized_vector (const NumericVector< Number > &localized_vector)
 
const DenseVector< Number > & get_localized_vector (const NumericVector< Number > &localized_vector) const
 
DenseSubVector< Number > & get_localized_subvector (const NumericVector< Number > &localized_vector, unsigned int var)
 
const DenseSubVector< Number > & get_localized_subvector (const NumericVector< Number > &localized_vector, unsigned int var) const
 

Public Attributes

System_mesh_sys
 
unsigned int _mesh_x_var
 
unsigned int _mesh_y_var
 
unsigned int _mesh_z_var
 
unsigned char side
 
unsigned char edge
 
Real time
 
const Real system_time
 
Real elem_solution_derivative
 
Real elem_solution_rate_derivative
 
Real elem_solution_accel_derivative
 
Real fixed_solution_derivative
 

Protected Member Functions

template<typename OutputShape >
FEGenericBase< OutputShape > * cached_fe (const unsigned int elem_dim, const FEType fe_type) const
 
void set_elem (const Elem *e)
 
template<typename OutputType , typename FENeeded< OutputType >::value_getter fe_getter, diff_subsolution_getter subsolution_getter>
void some_value (unsigned int var, unsigned int qp, OutputType &u) const
 
template<typename OutputType , typename FENeeded< OutputType >::grad_getter fe_getter, diff_subsolution_getter subsolution_getter>
void some_gradient (unsigned int var, unsigned int qp, OutputType &u) const
 
template<typename OutputType , typename FENeeded< OutputType >::hess_getter fe_getter, diff_subsolution_getter subsolution_getter>
void some_hessian (unsigned int var, unsigned int qp, OutputType &u) const
 

Protected Attributes

AlgebraicType _atype
 
const NumericVector< Number > * _custom_solution
 
std::unique_ptr< FEGenericBase< Real > > _real_fe
 
std::unique_ptr< FEGenericBase< RealGradient > > _real_grad_fe
 
bool _real_fe_is_inf
 
bool _real_grad_fe_is_inf
 
std::vector< std::map< FEType, std::unique_ptr< FEAbstract > > > _element_fe
 
std::vector< std::map< FEType, std::unique_ptr< FEAbstract > > > _side_fe
 
std::map< FEType, std::unique_ptr< FEAbstract > > _edge_fe
 
std::vector< std::vector< FEAbstract * > > _element_fe_var
 
std::vector< std::vector< FEAbstract * > > _side_fe_var
 
std::vector< FEAbstract * > _edge_fe_var
 
const BoundaryInfo_boundary_info
 
const Elem_elem
 
unsigned char _dim
 
unsigned char _elem_dim
 
std::set< unsigned char > _elem_dims
 
std::vector< std::unique_ptr< QBase > > _element_qrule
 
std::vector< std::unique_ptr< QBase > > _side_qrule
 
std::unique_ptr< QBase_edge_qrule
 
int _extra_quadrature_order
 
std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< std::unique_ptr< DenseSubVector< Number > > > > > _localized_vectors
 
DenseVector< Number_elem_solution
 
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subsolutions
 
DenseVector< Number_elem_solution_rate
 
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subsolution_rates
 
DenseVector< Number_elem_solution_accel
 
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subsolution_accels
 
DenseVector< Number_elem_fixed_solution
 
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_fixed_subsolutions
 
DenseVector< Number_elem_residual
 
DenseMatrix< Number_elem_jacobian
 
std::vector< Number_elem_qoi
 
std::vector< DenseVector< Number > > _elem_qoi_derivative
 
std::vector< std::vector< std::unique_ptr< DenseSubVector< Number > > > > _elem_qoi_subderivatives
 
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subresiduals
 
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_subjacobians
 
std::vector< dof_id_type_dof_indices
 
std::vector< std::vector< dof_id_type > > _dof_indices_var
 

Private Attributes

const Elem_neighbor
 
DenseVector< Number_neighbor_residual
 
DenseMatrix< Number_elem_elem_jacobian
 
DenseMatrix< Number_elem_neighbor_jacobian
 
DenseMatrix< Number_neighbor_elem_jacobian
 
DenseMatrix< Number_neighbor_neighbor_jacobian
 
std::vector< std::unique_ptr< DenseSubVector< Number > > > _neighbor_subresiduals
 
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_elem_subjacobians
 
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_neighbor_subjacobians
 
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _neighbor_elem_subjacobians
 
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _neighbor_neighbor_subjacobians
 
std::vector< dof_id_type_neighbor_dof_indices
 
std::vector< std::vector< dof_id_type > > _neighbor_dof_indices_var
 
std::map< FEType, std::unique_ptr< FEAbstract > > _neighbor_side_fe
 
std::vector< FEAbstract * > _neighbor_side_fe_var
 
bool _dg_terms_active
 

Detailed Description

Extends FEMContext to work for DG problems.

This class extends FEMContext in order to provide extra data required to perform local element residual and Jacobian assembly in the case of a discontinuous Galerkin (DG) discretization.

Author
David Knezevic
Date
2015

Definition at line 39 of file dg_fem_context.h.

Member Typedef Documentation

◆ diff_subsolution_getter

typedef const DenseSubVector<Number>&(DiffContext::* libMesh::FEMContext::diff_subsolution_getter) (unsigned int) const
inherited

Helper typedef to simplify refactoring

Definition at line 1030 of file fem_context.h.

◆ localized_vectors_iterator

typedef std::map<const NumericVector<Number> *, std::pair<DenseVector<Number>, std::vector<std::unique_ptr<DenseSubVector<Number> > > > >::iterator libMesh::DiffContext::localized_vectors_iterator
inherited

Typedef for the localized_vectors iterator

Definition at line 544 of file diff_context.h.

Member Enumeration Documentation

◆ AlgebraicType

Enum describing what data to use when initializing algebraic structures on each element.

Enumerator
NONE 
DOFS_ONLY 
CURRENT 
OLD 
OLD_DOFS_ONLY 

Definition at line 933 of file fem_context.h.

933  { NONE = 0, // Do not reinitialize dof_indices
934  DOFS_ONLY, // Reinitialize dof_indices, not
935  // algebraic structures
936  CURRENT, // Use dof_indices, current solution
937  OLD, // Use old_dof_indices, custom solution
938  OLD_DOFS_ONLY}; // Reinitialize old_dof_indices, not

Constructor & Destructor Documentation

◆ DGFEMContext()

libMesh::DGFEMContext::DGFEMContext ( const System sys)
explicit

Constructor. Allocates some but fills no data structures.

Definition at line 29 of file dg_fem_context.C.

References libMesh::FEMContext::_dim, _elem_elem_jacobian, _elem_elem_subjacobians, _elem_neighbor_jacobian, _elem_neighbor_subjacobians, _neighbor_elem_jacobian, _neighbor_elem_subjacobians, _neighbor_neighbor_jacobian, _neighbor_neighbor_subjacobians, _neighbor_residual, _neighbor_side_fe, _neighbor_side_fe_var, _neighbor_subresiduals, libMesh::FEAbstract::build(), libMesh::System::n_vars(), and libMesh::System::variable_type().

30  : FEMContext(sys),
31  _neighbor(nullptr),
32  _neighbor_dof_indices_var(sys.n_vars()),
33  _dg_terms_active(false)
34 {
35  unsigned int nv = sys.n_vars();
36  libmesh_assert (nv);
37 
38  _neighbor_subresiduals.reserve(nv);
39  _elem_elem_subjacobians.resize(nv);
40  _elem_neighbor_subjacobians.resize(nv);
41  _neighbor_elem_subjacobians.resize(nv);
43 
44  for (unsigned int i=0; i != nv; ++i)
45  {
46  _neighbor_subresiduals.emplace_back(libmesh_make_unique<DenseSubVector<Number>>(_neighbor_residual));
47  _elem_elem_subjacobians[i].reserve(nv);
48  _elem_neighbor_subjacobians[i].reserve(nv);
49  _neighbor_elem_subjacobians[i].reserve(nv);
50  _neighbor_neighbor_subjacobians[i].reserve(nv);
51 
52  for (unsigned int j=0; j != nv; ++j)
53  {
54  _elem_elem_subjacobians[i].emplace_back(libmesh_make_unique<DenseSubMatrix<Number>>(_elem_elem_jacobian));
55  _elem_neighbor_subjacobians[i].emplace_back(libmesh_make_unique<DenseSubMatrix<Number>>(_elem_neighbor_jacobian));
56  _neighbor_elem_subjacobians[i].emplace_back(libmesh_make_unique<DenseSubMatrix<Number>>(_neighbor_elem_jacobian));
57  _neighbor_neighbor_subjacobians[i].emplace_back(libmesh_make_unique<DenseSubMatrix<Number>>(_neighbor_neighbor_jacobian));
58  }
59  }
60 
61  _neighbor_side_fe_var.resize(nv);
62  for (unsigned int i=0; i != nv; ++i)
63  {
64  FEType fe_type = sys.variable_type(i);
65 
66  if (_neighbor_side_fe[fe_type] == nullptr)
67  _neighbor_side_fe[fe_type] = FEAbstract::build(this->_dim, fe_type);
68 
69  _neighbor_side_fe_var[i] = _neighbor_side_fe[fe_type].get();
70  }
71 }
DenseVector< Number > _neighbor_residual
DenseMatrix< Number > _elem_elem_jacobian
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_elem_subjacobians
std::vector< std::vector< dof_id_type > > _neighbor_dof_indices_var
std::vector< FEAbstract * > _neighbor_side_fe_var
DenseMatrix< Number > _neighbor_elem_jacobian
DenseMatrix< Number > _elem_neighbor_jacobian
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_neighbor_subjacobians
unsigned char _dim
Definition: fem_context.h:1124
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _neighbor_elem_subjacobians
static std::unique_ptr< FEAbstract > build(const unsigned int dim, const FEType &type)
Definition: fe_abstract.C:71
DenseMatrix< Number > _neighbor_neighbor_jacobian
FEMContext(const System &sys)
Definition: fem_context.C:37
std::vector< std::unique_ptr< DenseSubVector< Number > > > _neighbor_subresiduals
std::map< FEType, std::unique_ptr< FEAbstract > > _neighbor_side_fe
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _neighbor_neighbor_subjacobians

◆ ~DGFEMContext()

libMesh::DGFEMContext::~DGFEMContext ( )
virtual

Destructor.

Definition at line 73 of file dg_fem_context.C.

74 {
75 }

Member Function Documentation

◆ add_localized_vector()

void libMesh::DiffContext::add_localized_vector ( NumericVector< Number > &  localized_vector,
const System sys 
)
inherited

Adds a vector to the map of localized vectors. We can later evaluate interior_values, interior_gradients and side_values for these fields these vectors represent.

Definition at line 119 of file diff_context.C.

References libMesh::DiffContext::_localized_vectors, and libMesh::System::n_vars().

120 {
121  // Make an empty pair keyed with a reference to this _localized_vector
122  _localized_vectors[&localized_vector] = std::make_pair(DenseVector<Number>(), std::vector<std::unique_ptr<DenseSubVector<Number>>>());
123 
124  unsigned int nv = sys.n_vars();
125 
126  _localized_vectors[&localized_vector].second.reserve(nv);
127 
128  // Fill the DenseSubVector with nv copies of DenseVector
129  for (unsigned int i=0; i != nv; ++i)
130  _localized_vectors[&localized_vector].second.emplace_back(libmesh_make_unique<DenseSubVector<Number>>(_localized_vectors[&localized_vector].first));
131 }
std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< std::unique_ptr< DenseSubVector< Number > > > > > _localized_vectors
Definition: diff_context.h:575

◆ algebraic_type()

AlgebraicType libMesh::FEMContext::algebraic_type ( ) const
inlineinherited

Definition at line 954 of file fem_context.h.

References libMesh::FEMContext::_atype.

Referenced by libMesh::FEMContext::build_new_fe(), and libMesh::FEMContext::pre_fe_reinit().

954 { return _atype; }
AlgebraicType _atype
Definition: fem_context.h:999

◆ build_new_fe()

template<typename OutputShape >
template FEGenericBase< RealGradient > * libMesh::FEMContext::build_new_fe ( const FEGenericBase< OutputShape > *  fe,
const Point p,
const Real  tolerance = TOLERANCE 
) const
inherited

Helper function to reduce some code duplication in the *_point_* methods.

Definition at line 1862 of file fem_context.C.

References libMesh::FEMContext::algebraic_type(), libMesh::Elem::dim(), libMesh::FEType::family, libMesh::FEMContext::get_elem(), libMesh::FEAbstract::get_fe_type(), libMesh::FEMContext::has_elem(), libMesh::FEInterface::inverse_map(), libMesh::Elem::JUST_COARSENED, libMesh::Elem::JUST_REFINED, libMesh::FEMContext::OLD, libMesh::FEType::order, libMesh::Elem::p_refinement_flag(), libMesh::FEAbstract::reinit(), and libMesh::SCALAR.

Referenced by libMesh::FEMContext::fixed_point_gradient(), libMesh::FEMContext::fixed_point_hessian(), libMesh::FEMContext::fixed_point_value(), libMesh::FEMContext::point_curl(), libMesh::FEMContext::point_gradient(), libMesh::FEMContext::point_hessian(), and libMesh::FEMContext::point_value().

1865 {
1866  FEType fe_type = fe->get_fe_type();
1867 
1868  // If we don't have an Elem to evaluate on, then the only functions
1869  // we can sensibly evaluate are the scalar dofs which are the same
1870  // everywhere.
1871  libmesh_assert(this->has_elem() || fe_type.family == SCALAR);
1872 
1873 #ifdef LIBMESH_ENABLE_AMR
1874  if ((algebraic_type() == OLD) &&
1875  this->has_elem())
1876  {
1877  if (this->get_elem().p_refinement_flag() == Elem::JUST_REFINED)
1878  fe_type.order = static_cast<Order>(fe_type.order - 1);
1879  else if (this->get_elem().p_refinement_flag() == Elem::JUST_COARSENED)
1880  fe_type.order = static_cast<Order>(fe_type.order + 1);
1881  }
1882 #endif // LIBMESH_ENABLE_AMR
1883 
1884  const unsigned int elem_dim = this->has_elem() ? this->get_elem().dim() : 0;
1885 
1886  FEGenericBase<OutputShape>* fe_new = cached_fe<OutputShape>(elem_dim, fe_type);
1887 
1888  // Map the physical co-ordinates to the master co-ordinates using the inverse_map from fe_interface.h
1889  // Build a vector of point co-ordinates to send to reinit
1890  Point master_point = this->has_elem() ?
1891  FEInterface::inverse_map (elem_dim,
1892  fe_type,
1893  &this->get_elem(),
1894  p,
1895  tolerance) : Point(0);
1896 
1897  std::vector<Point> coor(1, master_point);
1898 
1899  // Reinitialize the element and compute the shape function values at coor
1900  if (this->has_elem())
1901  fe_new->reinit (&this->get_elem(), &coor);
1902  else
1903  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1904  fe_new->reinit (nullptr, &coor);
1905 
1906  return fe_new;
1907 }
const Elem & get_elem() const
Definition: fem_context.h:871
RefinementState p_refinement_flag() const
Definition: elem.h:2654
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:590
virtual unsigned short dim() const =0
AlgebraicType algebraic_type() const
Definition: fem_context.h:954
bool has_elem() const
Definition: fem_context.h:865

◆ cached_fe() [1/3]

template<typename OutputShape >
FEGenericBase<OutputShape>* libMesh::FEMContext::cached_fe ( const unsigned int  elem_dim,
const FEType  fe_type 
) const
protectedinherited

◆ cached_fe() [2/3]

template<>
FEGenericBase<Real>* libMesh::FEMContext::cached_fe ( const unsigned int  elem_dim,
const FEType  fe_type 
) const
inherited

Definition at line 1789 of file fem_context.C.

References libMesh::FEMContext::_real_fe, libMesh::FEMContext::_real_fe_is_inf, libMesh::FEGenericBase< OutputType >::build(), libMesh::FEGenericBase< OutputType >::build_InfFE(), libMesh::FEMContext::get_elem(), libMesh::FEMContext::has_elem(), and libMesh::Elem::infinite().

1791 {
1792 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1793  const bool fe_needs_inf =
1794  this->has_elem() && this->get_elem().infinite();
1795 #endif
1796 
1797  if (!_real_fe ||
1798  elem_dim != _real_fe->get_dim() ||
1799  fe_type != _real_fe->get_fe_type())
1800  _real_fe =
1801 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1802  fe_needs_inf ?
1803  FEGenericBase<Real>::build_InfFE(elem_dim, fe_type) :
1804 #endif
1805  FEGenericBase<Real>::build(elem_dim, fe_type);
1806 
1807 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1808  else if (fe_needs_inf && !_real_fe_is_inf)
1809  _real_fe =
1810  FEGenericBase<Real>::build_InfFE(elem_dim, fe_type);
1811  else if (!fe_needs_inf && _real_fe_is_inf)
1812  _real_fe =
1813  FEGenericBase<Real>::build(elem_dim, fe_type);
1814 
1815  _real_fe_is_inf =
1816  (this->has_elem() && this->get_elem().infinite());
1817 #endif
1818 
1819  return _real_fe.get();
1820 }
const Elem & get_elem() const
Definition: fem_context.h:871
std::unique_ptr< FEGenericBase< Real > > _real_fe
Definition: fem_context.h:1006
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
static std::unique_ptr< FEGenericBase > build_InfFE(const unsigned int dim, const FEType &type)
virtual bool infinite() const =0
bool has_elem() const
Definition: fem_context.h:865

◆ cached_fe() [3/3]

template<>
FEGenericBase<RealGradient>* libMesh::FEMContext::cached_fe ( const unsigned int  elem_dim,
const FEType  fe_type 
) const
inherited

Definition at line 1825 of file fem_context.C.

References libMesh::FEMContext::_real_grad_fe, libMesh::FEMContext::_real_grad_fe_is_inf, libMesh::FEGenericBase< OutputType >::build(), libMesh::FEGenericBase< OutputType >::build_InfFE(), libMesh::FEMContext::get_elem(), libMesh::FEMContext::has_elem(), and libMesh::Elem::infinite().

1827 {
1828 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1829  const bool fe_needs_inf =
1830  this->has_elem() && this->get_elem().infinite();
1831 #endif
1832 
1833  if (!_real_grad_fe ||
1834  elem_dim != _real_grad_fe->get_dim() ||
1835  fe_type != _real_grad_fe->get_fe_type())
1836  _real_grad_fe =
1837 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1838  fe_needs_inf ?
1839  FEGenericBase<RealGradient>::build_InfFE(elem_dim, fe_type) :
1840 #endif
1841  FEGenericBase<RealGradient>::build(elem_dim, fe_type);
1842 
1843 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1844  else if (fe_needs_inf && !_real_grad_fe_is_inf)
1845  _real_grad_fe =
1846  FEGenericBase<RealGradient>::build_InfFE(elem_dim, fe_type);
1847  else if (!fe_needs_inf && _real_grad_fe_is_inf)
1848  _real_grad_fe =
1849  FEGenericBase<RealGradient>::build(elem_dim, fe_type);
1850 
1852  (this->has_elem() && this->get_elem().infinite());
1853 #endif
1854 
1855  return _real_grad_fe.get();
1856 }
std::unique_ptr< FEGenericBase< RealGradient > > _real_grad_fe
Definition: fem_context.h:1007
const Elem & get_elem() const
Definition: fem_context.h:871
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
static std::unique_ptr< FEGenericBase > build_InfFE(const unsigned int dim, const FEType &type)
virtual bool infinite() const =0
bool has_elem() const
Definition: fem_context.h:865

◆ dg_terms_are_active()

bool libMesh::DGFEMContext::dg_terms_are_active ( ) const
inline

Are the DG terms active, i.e. have they been assembled?

Definition at line 232 of file dg_fem_context.h.

References _dg_terms_active.

233  { return _dg_terms_active; }

◆ edge_fe_reinit()

void libMesh::FEMContext::edge_fe_reinit ( )
virtualinherited

Reinitializes edge FE objects on the current geometric element

Definition at line 1399 of file fem_context.C.

References libMesh::FEMContext::_edge_fe, libMesh::FEMContext::get_edge(), libMesh::FEMContext::get_elem(), and libMesh::FEMContext::get_elem_dim().

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

1400 {
1401  libmesh_assert_equal_to (this->get_elem_dim(), 3);
1402 
1403  // Initialize all the interior FE objects on elem/edge.
1404  // Logging of FE::reinit is done in the FE functions
1405  for (auto & pr : _edge_fe)
1406  pr.second->edge_reinit(&(this->get_elem()), this->get_edge());
1407 }
unsigned char get_edge() const
Definition: fem_context.h:891
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const Elem & get_elem() const
Definition: fem_context.h:871
std::map< FEType, std::unique_ptr< FEAbstract > > _edge_fe
Definition: fem_context.h:1097

◆ elem_dimensions()

const std::set<unsigned char>& libMesh::FEMContext::elem_dimensions ( ) const
inlineinherited
Returns
Set of dimensions of elements present in the mesh at context initialization.

Definition at line 913 of file fem_context.h.

References libMesh::FEMContext::_elem_dims.

Referenced by libMesh::LaplacianErrorEstimator::init_context(), libMesh::DiscontinuityMeasure::init_context(), libMesh::KellyErrorEstimator::init_context(), and libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()().

914  { return _elem_dims; }
std::set< unsigned char > _elem_dims
Definition: fem_context.h:1135

◆ elem_edge_reinit()

void libMesh::FEMContext::elem_edge_reinit ( Real  theta)
overridevirtualinherited

Resets the current time in the context. Additionally, reinitialize Elem and FE objects if there's a moving mesh present in the system such that the mesh is deformed to its position at $ t_{\theta} $.

Reimplemented from libMesh::DiffContext.

Definition at line 1337 of file fem_context.C.

References libMesh::FEMContext::_mesh_sys, libMesh::FEMContext::_update_time_from_system(), libMesh::FEMContext::edge_fe_reinit(), and libMesh::FEMContext::elem_position_set().

1338 {
1339  // Update the "time" variable of this context object
1340  this->_update_time_from_system(theta);
1341 
1342  // Handle a moving element if necessary
1343  if (_mesh_sys)
1344  {
1345  // FIXME - not threadsafe yet!
1346  elem_position_set(theta);
1347  edge_fe_reinit();
1348  }
1349 }
void elem_position_set(Real theta)
Definition: fem_context.h:1197
void _update_time_from_system(Real theta)
Definition: fem_context.C:1774
virtual void edge_fe_reinit()
Definition: fem_context.C:1399

◆ elem_fe_reinit()

void libMesh::FEMContext::elem_fe_reinit ( const std::vector< Point > *const  pts = nullptr)
virtualinherited

Reinitializes interior FE objects on the current geometric element

Definition at line 1362 of file fem_context.C.

References libMesh::FEMContext::_element_fe, libMesh::FEMContext::get_elem(), libMesh::FEMContext::get_elem_dim(), and libMesh::FEMContext::has_elem().

Referenced by libMesh::FEMContext::elem_reinit(), libMesh::FEMSystem::mesh_position_set(), libMesh::FEMContext::nonlocal_reinit(), and libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()().

1363 {
1364  // Initialize all the interior FE objects on elem.
1365  // Logging of FE::reinit is done in the FE functions
1366  // We only reinit the FE objects for the current element
1367  // dimension
1368  const unsigned char dim = this->get_elem_dim();
1369 
1370  libmesh_assert( !_element_fe[dim].empty() );
1371 
1372  for (const auto & pr : _element_fe[dim])
1373  {
1374  if (this->has_elem())
1375  pr.second->reinit(&(this->get_elem()), pts);
1376  else
1377  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1378  pr.second->reinit(nullptr);
1379  }
1380 }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const Elem & get_elem() const
Definition: fem_context.h:871
std::vector< std::map< FEType, std::unique_ptr< FEAbstract > > > _element_fe
Definition: fem_context.h:1095
bool has_elem() const
Definition: fem_context.h:865

◆ elem_position_get()

void libMesh::FEMContext::elem_position_get ( )
inherited

Uses the geometry of elem to set the coordinate data specified by mesh_*_position configuration.

Definition at line 1411 of file fem_context.C.

References libMesh::FEMContext::_mesh_sys, libMesh::Elem::default_order(), libMesh::FEMContext::get_elem(), libMesh::FEMContext::get_elem_dim(), libMesh::DiffContext::get_elem_solution(), libMesh::FEMContext::get_element_fe(), libMesh::FEMContext::get_mesh_x_var(), libMesh::FEMContext::get_mesh_y_var(), libMesh::FEMContext::get_mesh_z_var(), libMesh::invalid_uint, libMesh::LAGRANGE, n_nodes, libMesh::Elem::n_nodes(), libMesh::n_threads(), and libMesh::Elem::point().

Referenced by libMesh::FEMSystem::mesh_position_get().

1412 {
1413  // This is too expensive to call unless we've been asked to move the mesh
1414  libmesh_assert (_mesh_sys);
1415 
1416  // This will probably break with threading when two contexts are
1417  // operating on elements which share a node
1418  libmesh_assert_equal_to (libMesh::n_threads(), 1);
1419 
1420  // If the coordinate data is in our own system, it's already
1421  // been set up for us
1422  // if (_mesh_sys == this->number())
1423  // {
1424  unsigned int n_nodes = this->get_elem().n_nodes();
1425 
1426 #ifndef NDEBUG
1427  const unsigned char dim = this->get_elem_dim();
1428 
1429  // For simplicity we demand that mesh coordinates be stored
1430  // in a format that allows a direct copy
1431  libmesh_assert(this->get_mesh_x_var() == libMesh::invalid_uint ||
1432  (this->get_element_fe(this->get_mesh_x_var(), dim)->get_fe_type().family
1433  == LAGRANGE &&
1434  this->get_element_fe(this->get_mesh_x_var(), dim)->get_fe_type().order.get_order()
1435  == this->get_elem().default_order()));
1436  libmesh_assert(this->get_mesh_y_var() == libMesh::invalid_uint ||
1437  (this->get_element_fe(this->get_mesh_y_var(), dim)->get_fe_type().family
1438  == LAGRANGE &&
1439  this->get_element_fe(this->get_mesh_y_var(), dim)->get_fe_type().order.get_order()
1440  == this->get_elem().default_order()));
1441  libmesh_assert(this->get_mesh_z_var() == libMesh::invalid_uint ||
1442  (this->get_element_fe(this->get_mesh_z_var(), dim)->get_fe_type().family
1443  == LAGRANGE &&
1444  this->get_element_fe(this->get_mesh_z_var(), dim)->get_fe_type().order.get_order()
1445  == this->get_elem().default_order()));
1446 #endif
1447 
1448  // Get degree of freedom coefficients from point coordinates
1449  if (this->get_mesh_x_var() != libMesh::invalid_uint)
1450  for (unsigned int i=0; i != n_nodes; ++i)
1451  (this->get_elem_solution(this->get_mesh_x_var()))(i) = this->get_elem().point(i)(0);
1452 
1453  if (this->get_mesh_y_var() != libMesh::invalid_uint)
1454  for (unsigned int i=0; i != n_nodes; ++i)
1455  (this->get_elem_solution(this->get_mesh_y_var()))(i) = this->get_elem().point(i)(1);
1456 
1457  if (this->get_mesh_z_var() != libMesh::invalid_uint)
1458  for (unsigned int i=0; i != n_nodes; ++i)
1459  (this->get_elem_solution(this->get_mesh_z_var()))(i) = this->get_elem().point(i)(2);
1460  // }
1461  // FIXME - If the coordinate data is not in our own system, someone
1462  // had better get around to implementing that... - RHS
1463  // else
1464  // {
1465  // libmesh_not_implemented();
1466  // }
1467 }
unsigned int n_threads()
Definition: libmesh_base.h:96
const unsigned int invalid_uint
Definition: libmesh.h:245
unsigned int get_mesh_x_var() const
Definition: fem_context.h:823
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const Elem & get_elem() const
Definition: fem_context.h:871
const dof_id_type n_nodes
Definition: tecplot_io.C:68
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:111
virtual unsigned int n_nodes() const =0
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:262
unsigned int get_mesh_y_var() const
Definition: fem_context.h:837
virtual Order default_order() const =0
const Point & point(const unsigned int i) const
Definition: elem.h:1892
unsigned int get_mesh_z_var() const
Definition: fem_context.h:851

◆ elem_position_set()

void libMesh::FEMContext::elem_position_set ( Real  theta)
inlineinherited

Uses the coordinate data specified by mesh_*_position configuration to set the geometry of elem to the value it would take after a fraction theta of a timestep.

Definition at line 1197 of file fem_context.h.

References libMesh::FEMContext::_do_elem_position_set(), and libMesh::FEMContext::_mesh_sys.

Referenced by libMesh::FEMContext::elem_edge_reinit(), libMesh::FEMContext::elem_reinit(), libMesh::FEMContext::elem_side_reinit(), and libMesh::FEMSystem::mesh_position_set().

1198 {
1199  if (_mesh_sys)
1200  this->_do_elem_position_set(theta);
1201 }
void _do_elem_position_set(Real theta)
Definition: fem_context.C:1476

◆ elem_reinit()

void libMesh::FEMContext::elem_reinit ( Real  theta)
overridevirtualinherited

Resets the current time in the context. Additionally, reinitialize Elem and FE objects if there's a moving mesh present in the system such that the mesh is deformed to its position at $ t_{\theta} $.

Reimplemented from libMesh::DiffContext.

Definition at line 1298 of file fem_context.C.

References libMesh::FEMContext::_mesh_sys, libMesh::FEMContext::_update_time_from_system(), libMesh::FEMContext::elem_fe_reinit(), libMesh::FEMContext::elem_position_set(), and libMesh::n_threads().

1299 {
1300  // Update the "time" variable of this context object
1301  this->_update_time_from_system(theta);
1302 
1303  // Handle a moving element if necessary.
1304  if (_mesh_sys)
1305  {
1306  // We assume that the ``default'' state
1307  // of the mesh is its final, theta=1.0
1308  // position, so we don't bother with
1309  // mesh motion in that case.
1310  if (theta != 1.0)
1311  {
1312  // FIXME - ALE is not threadsafe yet!
1313  libmesh_assert_equal_to (libMesh::n_threads(), 1);
1314 
1315  elem_position_set(theta);
1316  }
1317  elem_fe_reinit();
1318  }
1319 }
unsigned int n_threads()
Definition: libmesh_base.h:96
void elem_position_set(Real theta)
Definition: fem_context.h:1197
virtual void elem_fe_reinit(const std::vector< Point > *const pts=nullptr)
Definition: fem_context.C:1362
void _update_time_from_system(Real theta)
Definition: fem_context.C:1774

◆ elem_side_reinit()

void libMesh::FEMContext::elem_side_reinit ( Real  theta)
overridevirtualinherited

Resets the current time in the context. Additionally, reinitialize Elem and FE objects if there's a moving mesh present in the system such that the mesh is deformed to its position at $ t_{\theta} $.

Reimplemented from libMesh::DiffContext.

Definition at line 1322 of file fem_context.C.

References libMesh::FEMContext::_mesh_sys, libMesh::FEMContext::_update_time_from_system(), libMesh::FEMContext::elem_position_set(), and libMesh::FEMContext::side_fe_reinit().

1323 {
1324  // Update the "time" variable of this context object
1325  this->_update_time_from_system(theta);
1326 
1327  // Handle a moving element if necessary
1328  if (_mesh_sys)
1329  {
1330  // FIXME - not threadsafe yet!
1331  elem_position_set(theta);
1332  side_fe_reinit();
1333  }
1334 }
void elem_position_set(Real theta)
Definition: fem_context.h:1197
virtual void side_fe_reinit()
Definition: fem_context.C:1383
void _update_time_from_system(Real theta)
Definition: fem_context.C:1774

◆ fixed_interior_gradient() [1/2]

Gradient libMesh::FEMContext::fixed_interior_gradient ( unsigned int  var,
unsigned int  qp 
) const
inherited
Returns
The gradient of the fixed_solution variable var at the quadrature point qp on the current element interior.
Note
This API is currently present for backward compatibility.

Definition at line 976 of file fem_context.C.

977 {
978  Gradient du;
979 
980  this->fixed_interior_gradient( var, qp, du );
981 
982  return du;
983 }
NumberVectorValue Gradient
Gradient fixed_interior_gradient(unsigned int var, unsigned int qp) const
Definition: fem_context.C:976

◆ fixed_interior_gradient() [2/2]

template<typename OutputType >
void libMesh::FEMContext::fixed_interior_gradient ( unsigned int  var,
unsigned int  qp,
OutputType &  grad_u 
) const
inherited
Returns
The gradient of the fixed_solution variable var at the quadrature point qp on the current element interior.
Note
This is the preferred API.

Definition at line 987 of file fem_context.C.

References libMesh::DiffContext::get_elem_fixed_solution(), libMesh::FEMContext::get_element_fe(), and libMesh::FEMContext::some_gradient().

989 {
990  this->some_gradient
991  <OutputType,
993  <typename TensorTools::MakeReal
994  <typename TensorTools::DecrementRank
995  <OutputType>::type>::type>,
997  (var, qp, du);
998 }
const DenseVector< Number > & get_elem_fixed_solution() const
Definition: diff_context.h:215
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:262
void some_gradient(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:243

◆ fixed_interior_hessian() [1/2]

Tensor libMesh::FEMContext::fixed_interior_hessian ( unsigned int  var,
unsigned int  qp 
) const
inherited
Returns
The hessian of the fixed_solution variable var at the quadrature point qp on the current element interior.
Note
This API is currently present for backward compatibility.

Definition at line 1003 of file fem_context.C.

1004 {
1005  Tensor d2u;
1006 
1007  this->fixed_interior_hessian( var, qp, d2u );
1008 
1009  return d2u;
1010 }
NumberTensorValue Tensor
Tensor fixed_interior_hessian(unsigned int var, unsigned int qp) const
Definition: fem_context.C:1003

◆ fixed_interior_hessian() [2/2]

template<typename OutputType >
void libMesh::FEMContext::fixed_interior_hessian ( unsigned int  var,
unsigned int  qp,
OutputType &  hess_u 
) const
inherited
Returns
The hessian of the fixed_solution variable var at the quadrature point qp on the current element interior.
Note
This is the preferred API.

Definition at line 1014 of file fem_context.C.

References libMesh::DiffContext::get_elem_fixed_solution(), libMesh::FEMContext::get_element_fe(), and libMesh::FEMContext::some_hessian().

1016 {
1017  this->some_hessian<OutputType,
1019  <typename TensorTools::MakeReal
1020  <typename TensorTools::DecrementRank
1021  <typename TensorTools::DecrementRank
1022  <OutputType>::type>::type>::type>,
1023  &DiffContext::get_elem_fixed_solution>(var, qp, d2u);
1024 }
const DenseVector< Number > & get_elem_fixed_solution() const
Definition: diff_context.h:215
void some_hessian(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:276
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:262

◆ fixed_interior_value() [1/2]

Number libMesh::FEMContext::fixed_interior_value ( unsigned int  var,
unsigned int  qp 
) const
inherited
Returns
The value of the fixed_solution variable var at the quadrature point qp on the current element interior.
Note
This API is currently present for backward compatibility.

Definition at line 953 of file fem_context.C.

954 {
955  Number u = 0.;
956 
957  this->fixed_interior_value( var, qp, u );
958 
959  return u;
960 }
Number fixed_interior_value(unsigned int var, unsigned int qp) const
Definition: fem_context.C:953

◆ fixed_interior_value() [2/2]

template<typename OutputType >
void libMesh::FEMContext::fixed_interior_value ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
inherited
Returns
The value of the fixed_solution variable var at the quadrature point qp on the current element interior.
Note
This is the preferred API.

Definition at line 965 of file fem_context.C.

References libMesh::DiffContext::get_elem_fixed_solution(), libMesh::FEMContext::get_element_fe(), and libMesh::FEMContext::some_value().

967 {
968  this->some_value<OutputType,
972 }
const DenseVector< Number > & get_elem_fixed_solution() const
Definition: diff_context.h:215
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:214
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:262

◆ fixed_point_gradient() [1/2]

Gradient libMesh::FEMContext::fixed_point_gradient ( unsigned int  var,
const Point p 
) const
inherited
Returns
The gradient of the fixed_solution variable var at the physical point p on the current element.
Note
This API is currently present for backward compatibility.

Definition at line 1149 of file fem_context.C.

1150 {
1151  Gradient grad_u;
1152 
1153  this->fixed_point_gradient( var, p, grad_u );
1154 
1155  return grad_u;
1156 }
Gradient fixed_point_gradient(unsigned int var, const Point &p) const
Definition: fem_context.C:1149
NumberVectorValue Gradient

◆ fixed_point_gradient() [2/2]

template<typename OutputType >
void libMesh::FEMContext::fixed_point_gradient ( unsigned int  var,
const Point p,
OutputType &  grad_u,
const Real  tolerance = TOLERANCE 
) const
inherited
Returns
The gradient of the fixed_solution variable var at the physical point p on the current element.
Note
This is the preferred API.

Allows evaluation of points within a relative tolerance outside the element.

Definition at line 1161 of file fem_context.C.

References libMesh::DiffContext::_elem_fixed_subsolutions, libMesh::FEMContext::build_new_fe(), libMesh::DiffContext::get_dof_indices(), libMesh::FEMContext::get_elem_dim(), and libMesh::DiffContext::get_elem_fixed_solution().

1165 {
1166  typedef typename TensorTools::MakeReal
1168  OutputShape;
1169 
1170  // Get local-to-global dof index lookup
1171  const unsigned int n_dofs = cast_int<unsigned int>
1172  (this->get_dof_indices(var).size());
1173 
1174  // Get current local coefficients
1175  libmesh_assert_greater (_elem_fixed_subsolutions.size(), var);
1176  const DenseSubVector<Number> & coef = this->get_elem_fixed_solution(var);
1177 
1178  // Get finite element object
1179  FEGenericBase<OutputShape> * fe = nullptr;
1180  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
1181 
1182  // Build a FE for calculating u(p)
1183  FEGenericBase<OutputShape> * fe_new =
1184  this->build_new_fe( fe, p, tolerance );
1185 
1186  // Get the values of the shape function derivatives
1187  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient>> & dphi = fe_new->get_dphi();
1188 
1189  grad_u = 0.0;
1190 
1191  for (unsigned int l=0; l != n_dofs; l++)
1192  grad_u.add_scaled(dphi[l][0], coef(l));
1193 
1194  return;
1195 }
const DenseVector< Number > & get_elem_fixed_solution() const
Definition: diff_context.h:215
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
Definition: fem_context.C:1862
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_fixed_subsolutions
Definition: diff_context.h:604

◆ fixed_point_hessian() [1/2]

Tensor libMesh::FEMContext::fixed_point_hessian ( unsigned int  var,
const Point p 
) const
inherited
Returns
The hessian of the fixed_solution variable var at the physical point p on the current element.
Note
This API is currently present for backward compatibility.

Definition at line 1200 of file fem_context.C.

1201 {
1202  Tensor hess_u;
1203 
1204  this->fixed_point_hessian( var, p, hess_u );
1205 
1206  return hess_u;
1207 }
Tensor fixed_point_hessian(unsigned int var, const Point &p) const
Definition: fem_context.C:1200
NumberTensorValue Tensor

◆ fixed_point_hessian() [2/2]

template<typename OutputType >
void libMesh::FEMContext::fixed_point_hessian ( unsigned int  var,
const Point p,
OutputType &  hess_u,
const Real  tolerance = TOLERANCE 
) const
inherited
Returns
The hessian of the fixed_solution variable var at the physical point p on the current element.
Note
This is the preferred API.

Allows evaluation of points within a relative tolerance outside the element.

Definition at line 1212 of file fem_context.C.

References libMesh::DiffContext::_elem_fixed_subsolutions, libMesh::FEMContext::build_new_fe(), libMesh::DiffContext::get_dof_indices(), libMesh::FEMContext::get_elem_dim(), and libMesh::DiffContext::get_elem_fixed_solution().

1216 {
1217  typedef typename TensorTools::DecrementRank<OutputType>::type Rank1Decrement;
1218  typedef typename TensorTools::DecrementRank<Rank1Decrement>::type Rank2Decrement;
1219  typedef typename TensorTools::MakeReal<Rank2Decrement>::type OutputShape;
1220 
1221  // Get local-to-global dof index lookup
1222  const unsigned int n_dofs = cast_int<unsigned int>
1223  (this->get_dof_indices(var).size());
1224 
1225  // Get current local coefficients
1226  libmesh_assert_greater (_elem_fixed_subsolutions.size(), var);
1227  const DenseSubVector<Number> & coef = this->get_elem_fixed_solution(var);
1228 
1229  // Get finite element object
1230  FEGenericBase<OutputShape> * fe = nullptr;
1231  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
1232 
1233  // Build a FE for calculating u(p)
1234  FEGenericBase<OutputShape> * fe_new =
1235  this->build_new_fe( fe, p, tolerance );
1236 
1237  // Get the values of the shape function derivatives
1238  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor>> & d2phi = fe_new->get_d2phi();
1239 
1240  hess_u = 0.0;
1241 
1242  for (unsigned int l=0; l != n_dofs; l++)
1243  hess_u.add_scaled(d2phi[l][0], coef(l));
1244 
1245  return;
1246 }
const DenseVector< Number > & get_elem_fixed_solution() const
Definition: diff_context.h:215
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
Definition: fem_context.C:1862
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_fixed_subsolutions
Definition: diff_context.h:604

◆ fixed_point_value() [1/2]

Number libMesh::FEMContext::fixed_point_value ( unsigned int  var,
const Point p 
) const
inherited
Returns
The value of the fixed_solution variable var at the physical point p on the current element.
Note
This API is currently present for backward compatibility.

Definition at line 1103 of file fem_context.C.

1104 {
1105  Number u = 0.;
1106 
1107  this->fixed_point_value( var, p, u );
1108 
1109  return u;
1110 }
Number fixed_point_value(unsigned int var, const Point &p) const
Definition: fem_context.C:1103

◆ fixed_point_value() [2/2]

template<typename OutputType >
void libMesh::FEMContext::fixed_point_value ( unsigned int  var,
const Point p,
OutputType &  u,
const Real  tolerance = TOLERANCE 
) const
inherited
Returns
The value of the fixed_solution variable var at the physical point p on the current element.
Note
This is the preferred API.

Allows evaluation of points within a relative tolerance outside the element.

Definition at line 1113 of file fem_context.C.

References libMesh::DiffContext::_elem_fixed_subsolutions, libMesh::FEMContext::build_new_fe(), libMesh::DiffContext::get_dof_indices(), libMesh::FEMContext::get_elem_dim(), and libMesh::DiffContext::get_elem_fixed_solution().

1117 {
1118  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
1119 
1120  // Get local-to-global dof index lookup
1121  const unsigned int n_dofs = cast_int<unsigned int>
1122  (this->get_dof_indices(var).size());
1123 
1124  // Get current local coefficients
1125  libmesh_assert_greater (_elem_fixed_subsolutions.size(), var);
1126  const DenseSubVector<Number> & coef = this->get_elem_fixed_solution(var);
1127 
1128  // Get finite element object
1129  FEGenericBase<OutputShape> * fe = nullptr;
1130  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
1131 
1132  // Build a FE for calculating u(p)
1133  FEGenericBase<OutputShape> * fe_new =
1134  this->build_new_fe( fe, p, tolerance );
1135 
1136  // Get the values of the shape function derivatives
1137  const std::vector<std::vector<OutputShape>> & phi = fe_new->get_phi();
1138 
1139  u = 0.;
1140 
1141  for (unsigned int l=0; l != n_dofs; l++)
1142  u += phi[l][0] * coef(l);
1143 
1144  return;
1145 }
const DenseVector< Number > & get_elem_fixed_solution() const
Definition: diff_context.h:215
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
Definition: fem_context.C:1862
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_fixed_subsolutions
Definition: diff_context.h:604

◆ fixed_side_gradient() [1/2]

Gradient libMesh::FEMContext::fixed_side_gradient ( unsigned int  var,
unsigned int  qp 
) const
inherited
Returns
The gradient of the fixed_solution variable var at the quadrature point qp on the current element side.
Note
This API is currently present for backward compatibility.

Definition at line 1053 of file fem_context.C.

1054 {
1055  Gradient du;
1056 
1057  this->fixed_side_gradient( var, qp, du );
1058 
1059  return du;
1060 }
NumberVectorValue Gradient
Gradient fixed_side_gradient(unsigned int var, unsigned int qp) const
Definition: fem_context.C:1053

◆ fixed_side_gradient() [2/2]

template<typename OutputType >
void libMesh::FEMContext::fixed_side_gradient ( unsigned int  var,
unsigned int  qp,
OutputType &  grad_u 
) const
inherited
Returns
The gradient of the fixed_solution variable var at the quadrature point qp on the current element side.
Note
This is the preferred API.

Definition at line 1064 of file fem_context.C.

References libMesh::DiffContext::get_elem_fixed_solution(), libMesh::FEMContext::get_side_fe(), and libMesh::FEMContext::some_gradient().

1066 {
1067  this->some_gradient<OutputType,
1069  <typename TensorTools::MakeReal
1070  <typename TensorTools::DecrementRank
1071  <OutputType>::type>::type>,
1072  &DiffContext::get_elem_fixed_solution>(var, qp, du);
1073 }
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:299
const DenseVector< Number > & get_elem_fixed_solution() const
Definition: diff_context.h:215
void some_gradient(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:243

◆ fixed_side_hessian() [1/2]

Tensor libMesh::FEMContext::fixed_side_hessian ( unsigned int  var,
unsigned int  qp 
) const
inherited
Returns
The hessian of the fixed_solution variable var at the quadrature point qp on the current element side.
Note
This API is currently present for backward compatibility.

Definition at line 1078 of file fem_context.C.

1079 {
1080  Tensor d2u;
1081 
1082  this->fixed_side_hessian( var, qp, d2u );
1083 
1084  return d2u;
1085 }
Tensor fixed_side_hessian(unsigned int var, unsigned int qp) const
Definition: fem_context.C:1078
NumberTensorValue Tensor

◆ fixed_side_hessian() [2/2]

template<typename OutputType >
void libMesh::FEMContext::fixed_side_hessian ( unsigned int  var,
unsigned int  qp,
OutputType &  hess_u 
) const
inherited
Returns
The hessian of the fixed_solution variable var at the quadrature point qp on the current element side.
Note
This is the preferred API.

Definition at line 1088 of file fem_context.C.

References libMesh::DiffContext::get_elem_fixed_solution(), libMesh::FEMContext::get_side_fe(), and libMesh::FEMContext::some_hessian().

1090 {
1091  this->some_hessian<OutputType,
1093  <typename TensorTools::MakeReal
1094  <typename TensorTools::DecrementRank
1095  <typename TensorTools::DecrementRank
1096  <OutputType>::type>::type>::type>,
1097  &DiffContext::get_elem_fixed_solution>(var, qp, d2u);
1098 }
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:299
const DenseVector< Number > & get_elem_fixed_solution() const
Definition: diff_context.h:215
void some_hessian(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:276

◆ fixed_side_value() [1/2]

Number libMesh::FEMContext::fixed_side_value ( unsigned int  var,
unsigned int  qp 
) const
inherited
Returns
The value of the fixed_solution variable var at the quadrature point qp on the current element side.
Note
This API is currently present for backward compatibility.

Definition at line 1029 of file fem_context.C.

1030 {
1031  Number u = 0.;
1032 
1033  this->fixed_side_value( var, qp, u );
1034 
1035  return u;
1036 }
Number fixed_side_value(unsigned int var, unsigned int qp) const
Definition: fem_context.C:1029

◆ fixed_side_value() [2/2]

template<typename OutputType >
void libMesh::FEMContext::fixed_side_value ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
inherited
Returns
The value of the fixed_solution variable var at the quadrature point qp on the current element side.
Note
This is the preferred API.

Definition at line 1040 of file fem_context.C.

References libMesh::DiffContext::get_elem_fixed_solution(), libMesh::FEMContext::get_side_fe(), and libMesh::FEMContext::some_value().

1042 {
1043  this->some_value
1044  <OutputType,
1048  (var, qp, u);
1049 }
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:299
const DenseVector< Number > & get_elem_fixed_solution() const
Definition: diff_context.h:215
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:214

◆ get_deltat_value()

Real libMesh::DiffContext::get_deltat_value ( )
inherited
Returns
The value currently pointed to by this class's _deltat member

Definition at line 111 of file diff_context.C.

References libMesh::DiffContext::_deltat.

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

112 {
113  libmesh_assert(_deltat);
114 
115  return *_deltat;
116 }

◆ get_dim()

unsigned char libMesh::FEMContext::get_dim ( ) const
inlineinherited

Accessor for cached mesh dimension. This is the largest dimension of the elements in the mesh. For the dimension of this->_elem, use get_elem_dim();

Definition at line 899 of file fem_context.h.

References libMesh::FEMContext::_dim.

Referenced by libMesh::FEMContext::get_element_fe(), libMesh::FEMContext::get_side_fe(), and neighbor_side_fe_reinit().

900  { return this->_dim; }
unsigned char _dim
Definition: fem_context.h:1124

◆ get_dof_indices() [1/4]

const std::vector<dof_id_type>& libMesh::DiffContext::get_dof_indices ( ) const
inlineinherited

Accessor for element dof indices

Definition at line 367 of file diff_context.h.

References libMesh::DiffContext::_dof_indices.

Referenced by libMesh::EulerSolver::_general_residual(), libMesh::Euler2Solver::_general_residual(), libMesh::NewmarkSolver::_general_residual(), libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns(), libMesh::FEMContext::fixed_point_gradient(), libMesh::FEMContext::fixed_point_hessian(), libMesh::FEMContext::fixed_point_value(), libMesh::VectorSetAction< Val >::insert(), libMesh::MatrixFillAction< ValIn, ValOut >::insert(), libMesh::FEMContext::interior_curl(), libMesh::FEMContext::interior_div(), libMesh::FEMContext::interior_gradients(), libMesh::FEMContext::interior_hessians(), libMesh::FEMContext::interior_values(), libMesh::FEMSystem::mesh_position_get(), neighbor_side_fe_reinit(), libMesh::FEMSystem::numerical_jacobian(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()(), libMesh::FEMContext::point_curl(), libMesh::FEMContext::point_gradient(), libMesh::FEMContext::point_hessian(), libMesh::FEMContext::point_value(), libMesh::FEMContext::pre_fe_reinit(), libMesh::FEMContext::side_gradient(), libMesh::FEMContext::side_gradients(), libMesh::FEMContext::side_hessians(), libMesh::FEMContext::side_values(), libMesh::FEMContext::some_gradient(), libMesh::FEMContext::some_hessian(), and libMesh::FEMContext::some_value().

368  { return _dof_indices; }
std::vector< dof_id_type > _dof_indices
Definition: diff_context.h:637

◆ get_dof_indices() [2/4]

std::vector<dof_id_type>& libMesh::DiffContext::get_dof_indices ( )
inlineinherited

Non-const accessor for element dof indices

Definition at line 373 of file diff_context.h.

References libMesh::DiffContext::_dof_indices.

374  { return _dof_indices; }
std::vector< dof_id_type > _dof_indices
Definition: diff_context.h:637

◆ get_dof_indices() [3/4]

const std::vector<dof_id_type>& libMesh::DiffContext::get_dof_indices ( unsigned int  var) const
inlineinherited

Accessor for element dof indices of a particular variable corresponding to the index argument.

Definition at line 380 of file diff_context.h.

References libMesh::DiffContext::_dof_indices_var.

381  {
382  libmesh_assert_greater(_dof_indices_var.size(), var);
383  return _dof_indices_var[var];
384  }
std::vector< std::vector< dof_id_type > > _dof_indices_var
Definition: diff_context.h:638

◆ get_dof_indices() [4/4]

std::vector<dof_id_type>& libMesh::DiffContext::get_dof_indices ( unsigned int  var)
inlineinherited

Accessor for element dof indices of a particular variable corresponding to the index argument.

Definition at line 390 of file diff_context.h.

References libMesh::DiffContext::_dof_indices_var.

391  {
392  libmesh_assert_greater(_dof_indices_var.size(), var);
393  return _dof_indices_var[var];
394  }
std::vector< std::vector< dof_id_type > > _dof_indices_var
Definition: diff_context.h:638

◆ get_edge()

unsigned char libMesh::FEMContext::get_edge ( ) const
inlineinherited

Accessor for current edge of Elem object

Definition at line 891 of file fem_context.h.

References libMesh::FEMContext::edge.

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

892  { return edge; }
unsigned char edge
Definition: fem_context.h:984

◆ get_edge_fe() [1/2]

template<typename OutputShape >
void libMesh::FEMContext::get_edge_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe 
) const
inlineinherited

Accessor for edge (3D only!) finite element object for variable var.

Definition at line 1241 of file fem_context.h.

References libMesh::FEMContext::_edge_fe_var.

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

1242 {
1243  libmesh_assert_less ( var, _edge_fe_var.size() );
1244  fe = cast_ptr<FEGenericBase<OutputShape> *>( _edge_fe_var[var] );
1245 }
std::vector< FEAbstract * > _edge_fe_var
Definition: fem_context.h:1108

◆ get_edge_fe() [2/2]

FEBase * libMesh::FEMContext::get_edge_fe ( unsigned int  var) const
inlineinherited

Accessor for edge (3D only!) finite element object for scalar-valued variable var.

Definition at line 1248 of file fem_context.h.

References libMesh::FEMContext::_edge_fe_var.

1249 {
1250  libmesh_assert_less ( var, _edge_fe_var.size() );
1251  return cast_ptr<FEBase *>( _edge_fe_var[var] );
1252 }
std::vector< FEAbstract * > _edge_fe_var
Definition: fem_context.h:1108

◆ get_edge_qrule()

const QBase& libMesh::FEMContext::get_edge_qrule ( ) const
inlineinherited

Accessor for element edge quadrature rule.

Definition at line 794 of file fem_context.h.

References libMesh::FEMContext::_edge_qrule.

795  { return *(this->_edge_qrule); }
std::unique_ptr< QBase > _edge_qrule
Definition: fem_context.h:1160

◆ get_elem() [1/2]

◆ get_elem() [2/2]

Elem& libMesh::FEMContext::get_elem ( )
inlineinherited

Accessor for current Elem object

Definition at line 878 of file fem_context.h.

References libMesh::FEMContext::_elem.

879  { libmesh_assert(this->_elem);
880  return *(const_cast<Elem *>(this->_elem)); }
const Elem * _elem
Definition: fem_context.h:1119

◆ get_elem_dim()

◆ get_elem_elem_jacobian() [1/4]

const DenseMatrix<Number>& libMesh::DGFEMContext::get_elem_elem_jacobian ( ) const
inline

Const accessor for element-element Jacobian.

Definition at line 110 of file dg_fem_context.h.

References _elem_elem_jacobian.

111  { return _elem_elem_jacobian; }
DenseMatrix< Number > _elem_elem_jacobian

◆ get_elem_elem_jacobian() [2/4]

DenseMatrix<Number>& libMesh::DGFEMContext::get_elem_elem_jacobian ( )
inline

Non-const accessor for element-element Jacobian.

Definition at line 116 of file dg_fem_context.h.

References _elem_elem_jacobian.

117  { return _elem_elem_jacobian; }
DenseMatrix< Number > _elem_elem_jacobian

◆ get_elem_elem_jacobian() [3/4]

const DenseSubMatrix<Number>& libMesh::DGFEMContext::get_elem_elem_jacobian ( unsigned int  var1,
unsigned int  var2 
) const
inline

Const accessor for element-element Jacobian of particular variables corresponding to the variable index arguments.

Definition at line 123 of file dg_fem_context.h.

References _elem_elem_subjacobians.

124  { return *(_elem_elem_subjacobians[var1][var2]); }
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_elem_subjacobians

◆ get_elem_elem_jacobian() [4/4]

DenseSubMatrix<Number>& libMesh::DGFEMContext::get_elem_elem_jacobian ( unsigned int  var1,
unsigned int  var2 
)
inline

Non-const accessor for element-element Jacobian of particular variables corresponding to the variable index arguments.

Definition at line 130 of file dg_fem_context.h.

References _elem_elem_subjacobians.

131  { return *(_elem_elem_subjacobians[var1][var2]); }
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_elem_subjacobians

◆ get_elem_fixed_solution() [1/4]

◆ get_elem_fixed_solution() [2/4]

DenseVector<Number>& libMesh::DiffContext::get_elem_fixed_solution ( )
inlineinherited

Non-const accessor for element fixed solution.

Definition at line 221 of file diff_context.h.

References libMesh::DiffContext::_elem_fixed_solution.

222  { return _elem_fixed_solution; }
DenseVector< Number > _elem_fixed_solution
Definition: diff_context.h:603

◆ get_elem_fixed_solution() [3/4]

const DenseSubVector<Number>& libMesh::DiffContext::get_elem_fixed_solution ( unsigned int  var) const
inlineinherited

Accessor for element fixed solution of a particular variable corresponding to the variable index argument.

Definition at line 228 of file diff_context.h.

References libMesh::DiffContext::_elem_fixed_subsolutions.

229  {
230  libmesh_assert_greater(_elem_fixed_subsolutions.size(), var);
231  libmesh_assert(_elem_fixed_subsolutions[var]);
232  return *(_elem_fixed_subsolutions[var]);
233  }
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_fixed_subsolutions
Definition: diff_context.h:604

◆ get_elem_fixed_solution() [4/4]

DenseSubVector<Number>& libMesh::DiffContext::get_elem_fixed_solution ( unsigned int  var)
inlineinherited

Accessor for element fixed solution of a particular variable corresponding to the variable index argument.

Definition at line 239 of file diff_context.h.

References libMesh::DiffContext::_elem_fixed_subsolutions.

240  {
241  libmesh_assert_greater(_elem_fixed_subsolutions.size(), var);
242  libmesh_assert(_elem_fixed_subsolutions[var]);
243  return *(_elem_fixed_subsolutions[var]);
244  }
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_fixed_subsolutions
Definition: diff_context.h:604

◆ get_elem_jacobian() [1/4]

◆ get_elem_jacobian() [2/4]

DenseMatrix<Number>& libMesh::DiffContext::get_elem_jacobian ( )
inlineinherited

Non-const accessor for element Jacobian.

Definition at line 289 of file diff_context.h.

References libMesh::DiffContext::_elem_jacobian.

290  { return _elem_jacobian; }
DenseMatrix< Number > _elem_jacobian
Definition: diff_context.h:615

◆ get_elem_jacobian() [3/4]

const DenseSubMatrix<Number>& libMesh::DiffContext::get_elem_jacobian ( unsigned int  var1,
unsigned int  var2 
) const
inlineinherited

Const accessor for element Jacobian of particular variables corresponding to the variable index arguments.

Definition at line 296 of file diff_context.h.

References libMesh::DiffContext::_elem_subjacobians.

297  {
298  libmesh_assert_greater(_elem_subjacobians.size(), var1);
299  libmesh_assert_greater(_elem_subjacobians[var1].size(), var2);
300  libmesh_assert(_elem_subjacobians[var1][var2]);
301  return *(_elem_subjacobians[var1][var2]);
302  }
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_subjacobians
Definition: diff_context.h:632

◆ get_elem_jacobian() [4/4]

DenseSubMatrix<Number>& libMesh::DiffContext::get_elem_jacobian ( unsigned int  var1,
unsigned int  var2 
)
inlineinherited

Non-const accessor for element Jacobian of particular variables corresponding to the variable index arguments.

Definition at line 308 of file diff_context.h.

References libMesh::DiffContext::_elem_subjacobians.

309  {
310  libmesh_assert_greater(_elem_subjacobians.size(), var1);
311  libmesh_assert_greater(_elem_subjacobians[var1].size(), var2);
312  libmesh_assert(_elem_subjacobians[var1][var2]);
313  return *(_elem_subjacobians[var1][var2]);
314  }
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_subjacobians
Definition: diff_context.h:632

◆ get_elem_neighbor_jacobian() [1/4]

const DenseMatrix<Number>& libMesh::DGFEMContext::get_elem_neighbor_jacobian ( ) const
inline

Const accessor for element-neighbor Jacobian.

Definition at line 136 of file dg_fem_context.h.

References _elem_neighbor_jacobian.

137  { return _elem_neighbor_jacobian; }
DenseMatrix< Number > _elem_neighbor_jacobian

◆ get_elem_neighbor_jacobian() [2/4]

DenseMatrix<Number>& libMesh::DGFEMContext::get_elem_neighbor_jacobian ( )
inline

Non-const accessor for element -neighborJacobian.

Definition at line 142 of file dg_fem_context.h.

References _elem_neighbor_jacobian.

143  { return _elem_neighbor_jacobian; }
DenseMatrix< Number > _elem_neighbor_jacobian

◆ get_elem_neighbor_jacobian() [3/4]

const DenseSubMatrix<Number>& libMesh::DGFEMContext::get_elem_neighbor_jacobian ( unsigned int  var1,
unsigned int  var2 
) const
inline

Const accessor for element-neighbor Jacobian of particular variables corresponding to the variable index arguments.

Definition at line 149 of file dg_fem_context.h.

References _elem_neighbor_subjacobians.

150  { return *(_elem_neighbor_subjacobians[var1][var2]); }
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_neighbor_subjacobians

◆ get_elem_neighbor_jacobian() [4/4]

DenseSubMatrix<Number>& libMesh::DGFEMContext::get_elem_neighbor_jacobian ( unsigned int  var1,
unsigned int  var2 
)
inline

Non-const accessor for element-neighbor Jacobian of particular variables corresponding to the variable index arguments.

Definition at line 156 of file dg_fem_context.h.

References _elem_neighbor_subjacobians.

157  { return *(_elem_neighbor_subjacobians[var1][var2]); }
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_neighbor_subjacobians

◆ get_elem_residual() [1/4]

const DenseVector<Number>& libMesh::DiffContext::get_elem_residual ( ) const
inlineinherited

◆ get_elem_residual() [2/4]

DenseVector<Number>& libMesh::DiffContext::get_elem_residual ( )
inlineinherited

Non-const accessor for element residual.

Definition at line 255 of file diff_context.h.

References libMesh::DiffContext::_elem_residual.

256  { return _elem_residual; }
DenseVector< Number > _elem_residual
Definition: diff_context.h:609

◆ get_elem_residual() [3/4]

const DenseSubVector<Number>& libMesh::DiffContext::get_elem_residual ( unsigned int  var) const
inlineinherited

Const accessor for element residual of a particular variable corresponding to the variable index argument.

Definition at line 262 of file diff_context.h.

References libMesh::DiffContext::_elem_subresiduals.

263  {
264  libmesh_assert_greater(_elem_subresiduals.size(), var);
265  libmesh_assert(_elem_subresiduals[var]);
266  return *(_elem_subresiduals[var]);
267  }
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subresiduals
Definition: diff_context.h:631

◆ get_elem_residual() [4/4]

DenseSubVector<Number>& libMesh::DiffContext::get_elem_residual ( unsigned int  var)
inlineinherited

Non-const accessor for element residual of a particular variable corresponding to the variable index argument.

Definition at line 273 of file diff_context.h.

References libMesh::DiffContext::_elem_subresiduals.

274  {
275  libmesh_assert_greater(_elem_subresiduals.size(), var);
276  libmesh_assert(_elem_subresiduals[var]);
277  return *(_elem_subresiduals[var]);
278  }
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subresiduals
Definition: diff_context.h:631

◆ get_elem_solution() [1/4]

◆ get_elem_solution() [2/4]

DenseVector<Number>& libMesh::DiffContext::get_elem_solution ( )
inlineinherited

Non-const accessor for element solution.

Definition at line 117 of file diff_context.h.

References libMesh::DiffContext::_elem_solution.

118  { return _elem_solution; }
DenseVector< Number > _elem_solution
Definition: diff_context.h:581

◆ get_elem_solution() [3/4]

const DenseSubVector<Number>& libMesh::DiffContext::get_elem_solution ( unsigned int  var) const
inlineinherited

Accessor for element solution of a particular variable corresponding to the variable index argument.

Definition at line 124 of file diff_context.h.

References libMesh::DiffContext::_elem_subsolutions.

125  {
126  libmesh_assert_greater(_elem_subsolutions.size(), var);
127  libmesh_assert(_elem_subsolutions[var]);
128  return *(_elem_subsolutions[var]);
129  }
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subsolutions
Definition: diff_context.h:582

◆ get_elem_solution() [4/4]

DenseSubVector<Number>& libMesh::DiffContext::get_elem_solution ( unsigned int  var)
inlineinherited

Accessor for element solution of a particular variable corresponding to the variable index argument.

Definition at line 135 of file diff_context.h.

References libMesh::DiffContext::_elem_subsolutions.

136  {
137  libmesh_assert_greater(_elem_subsolutions.size(), var);
138  libmesh_assert(_elem_subsolutions[var]);
139  return *(_elem_subsolutions[var]);
140  }
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subsolutions
Definition: diff_context.h:582

◆ get_elem_solution_accel() [1/4]

const DenseVector<Number>& libMesh::DiffContext::get_elem_solution_accel ( ) const
inlineinherited

◆ get_elem_solution_accel() [2/4]

DenseVector<Number>& libMesh::DiffContext::get_elem_solution_accel ( )
inlineinherited

Non-const accessor for element solution accel of change w.r.t. time.

Definition at line 187 of file diff_context.h.

References libMesh::DiffContext::_elem_solution_accel.

188  { return _elem_solution_accel; }
DenseVector< Number > _elem_solution_accel
Definition: diff_context.h:595

◆ get_elem_solution_accel() [3/4]

const DenseSubVector<Number>& libMesh::DiffContext::get_elem_solution_accel ( unsigned int  var) const
inlineinherited

Accessor for element solution accel for a particular variable corresponding to the variable index argument.

Definition at line 194 of file diff_context.h.

References libMesh::DiffContext::_elem_subsolution_accels.

195  {
196  libmesh_assert_greater(_elem_subsolution_accels.size(), var);
197  libmesh_assert(_elem_subsolution_accels[var]);
198  return *(_elem_subsolution_accels[var]);
199  }
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subsolution_accels
Definition: diff_context.h:596

◆ get_elem_solution_accel() [4/4]

DenseSubVector<Number>& libMesh::DiffContext::get_elem_solution_accel ( unsigned int  var)
inlineinherited

Accessor for element solution accel for a particular variable corresponding to the variable index argument.

Definition at line 205 of file diff_context.h.

References libMesh::DiffContext::_elem_subsolution_accels.

206  {
207  libmesh_assert_greater(_elem_subsolution_accels.size(), var);
208  libmesh_assert(_elem_subsolution_accels[var]);
209  return *(_elem_subsolution_accels[var]);
210  }
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subsolution_accels
Definition: diff_context.h:596

◆ get_elem_solution_accel_derivative()

Real libMesh::DiffContext::get_elem_solution_accel_derivative ( ) const
inlineinherited

The derivative of the current elem_solution_accel w.r.t. the unknown solution. Corresponding Jacobian contributions should be multiplied by this amount, or may be skipped if get_elem_solution_accel_derivative() is 0.

Definition at line 454 of file diff_context.h.

References libMesh::DiffContext::elem_solution_accel_derivative.

Real elem_solution_accel_derivative
Definition: diff_context.h:514

◆ get_elem_solution_derivative()

Real libMesh::DiffContext::get_elem_solution_derivative ( ) const
inlineinherited

The derivative of the current elem_solution w.r.t. the unknown solution. Corresponding Jacobian contributions should be multiplied by this amount, or may be skipped if get_elem_solution_derivative() is 0.

Definition at line 436 of file diff_context.h.

References libMesh::DiffContext::elem_solution_derivative.

Referenced by libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns().

437  { return elem_solution_derivative; }

◆ get_elem_solution_rate() [1/4]

◆ get_elem_solution_rate() [2/4]

DenseVector<Number>& libMesh::DiffContext::get_elem_solution_rate ( )
inlineinherited

Non-const accessor for element solution rate of change w.r.t. time.

Definition at line 152 of file diff_context.h.

References libMesh::DiffContext::_elem_solution_rate.

153  { return _elem_solution_rate; }
DenseVector< Number > _elem_solution_rate
Definition: diff_context.h:588

◆ get_elem_solution_rate() [3/4]

const DenseSubVector<Number>& libMesh::DiffContext::get_elem_solution_rate ( unsigned int  var) const
inlineinherited

Accessor for element solution rate for a particular variable corresponding to the variable index argument.

Definition at line 159 of file diff_context.h.

References libMesh::DiffContext::_elem_subsolution_rates.

160  {
161  libmesh_assert_greater(_elem_subsolution_rates.size(), var);
162  libmesh_assert(_elem_subsolution_rates[var]);
163  return *(_elem_subsolution_rates[var]);
164  }
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subsolution_rates
Definition: diff_context.h:589

◆ get_elem_solution_rate() [4/4]

DenseSubVector<Number>& libMesh::DiffContext::get_elem_solution_rate ( unsigned int  var)
inlineinherited

Accessor for element solution rate for a particular variable corresponding to the variable index argument.

Definition at line 170 of file diff_context.h.

References libMesh::DiffContext::_elem_subsolution_rates.

171  {
172  libmesh_assert_greater(_elem_subsolution_rates.size(), var);
173  libmesh_assert(_elem_subsolution_rates[var]);
174  return *(_elem_subsolution_rates[var]);
175  }
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subsolution_rates
Definition: diff_context.h:589

◆ get_elem_solution_rate_derivative()

Real libMesh::DiffContext::get_elem_solution_rate_derivative ( ) const
inlineinherited

The derivative of the current elem_solution_rate w.r.t. the unknown solution. Corresponding Jacobian contributions should be multiplied by this amount, or may be skipped if get_elem_solution_rate_derivative() is 0.

Definition at line 445 of file diff_context.h.

References libMesh::DiffContext::elem_solution_rate_derivative.

Referenced by libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns(), and libMesh::FirstOrderUnsteadySolver::prepare_accel().

Real elem_solution_rate_derivative
Definition: diff_context.h:507

◆ get_element_fe() [1/4]

template<typename OutputShape >
void libMesh::FEMContext::get_element_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe 
) const
inlineinherited

Accessor for interior finite element object for variable var for the largest dimension in the mesh. We default to the largest mesh dim because this method may be called before the Elem * is set in the FEMContext, e.g. in FEMSystem::init_context (or a subclass). If you have lower dimensional elements in the mesh and need to query for those FE objects, use the alternative get_element_fe method.

Definition at line 262 of file fem_context.h.

References libMesh::FEMContext::get_dim().

Referenced by libMesh::FEMContext::_do_elem_position_set(), libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns(), libMesh::FEMContext::elem_position_get(), libMesh::FEMContext::fixed_interior_gradient(), libMesh::FEMContext::fixed_interior_hessian(), libMesh::FEMContext::fixed_interior_value(), libMesh::FEMContext::get_element_fe(), libMesh::ParsedFEMFunction< T >::init_context(), libMesh::FEMSystem::init_context(), libMesh::FEMContext::interior_accel(), libMesh::FEMContext::interior_gradient(), libMesh::FEMContext::interior_hessian(), libMesh::FEMContext::interior_rate(), and libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()().

263  { this->get_element_fe<OutputShape>(var,fe,this->get_dim()); }
unsigned char get_dim() const
Definition: fem_context.h:899

◆ get_element_fe() [2/4]

FEBase* libMesh::FEMContext::get_element_fe ( unsigned int  var) const
inlineinherited

Accessor for interior finite element object for scalar-valued variable var for the largest dimension in the mesh. We default to the largest mesh dim because this method may be called before the Elem * is set in the FEMContext, e.g. in FEMSystem::init_context (or a subclass). If you have lower dimensional elements in the mesh and need to query for those FE objects, use the alternative get_element_fe method.

Definition at line 273 of file fem_context.h.

References libMesh::FEMContext::get_dim(), and libMesh::FEMContext::get_element_fe().

274  { return this->get_element_fe(var,this->get_dim()); }
unsigned char get_dim() const
Definition: fem_context.h:899
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:262

◆ get_element_fe() [3/4]

template<typename OutputShape >
void libMesh::FEMContext::get_element_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe,
unsigned short  dim 
) const
inlineinherited

Accessor for interior finite element object for variable var for dimension dim.

Definition at line 1205 of file fem_context.h.

References libMesh::FEMContext::_element_fe_var.

1207 {
1208  libmesh_assert( !_element_fe_var[dim].empty() );
1209  libmesh_assert_less ( var, (_element_fe_var[dim].size() ) );
1210  fe = cast_ptr<FEGenericBase<OutputShape> *>( (_element_fe_var[dim][var] ) );
1211 }
std::vector< std::vector< FEAbstract * > > _element_fe_var
Definition: fem_context.h:1106

◆ get_element_fe() [4/4]

FEBase * libMesh::FEMContext::get_element_fe ( unsigned int  var,
unsigned short  dim 
) const
inlineinherited

Accessor for interior finite element object for scalar-valued variable var for dimension dim.

Definition at line 1214 of file fem_context.h.

References libMesh::FEMContext::_element_fe_var.

1215 {
1216  libmesh_assert( !_element_fe_var[dim].empty() );
1217  libmesh_assert_less ( var, (_element_fe_var[dim].size() ) );
1218  return cast_ptr<FEBase *>( (_element_fe_var[dim][var] ) );
1219 }
std::vector< std::vector< FEAbstract * > > _element_fe_var
Definition: fem_context.h:1106

◆ get_element_qrule() [1/2]

const QBase& libMesh::FEMContext::get_element_qrule ( ) const
inlineinherited

Accessor for element interior quadrature rule for the dimension of the current _elem.

Definition at line 765 of file fem_context.h.

References libMesh::FEMContext::get_elem_dim().

Referenced by libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns().

766  { return this->get_element_qrule(this->get_elem_dim()); }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const QBase & get_element_qrule() const
Definition: fem_context.h:765

◆ get_element_qrule() [2/2]

const QBase& libMesh::FEMContext::get_element_qrule ( unsigned short  dim) const
inlineinherited

Accessor for element interior quadrature rule.

Definition at line 778 of file fem_context.h.

References libMesh::FEMContext::_element_qrule.

779  { libmesh_assert(_element_qrule[dim]);
780  return *(this->_element_qrule[dim]); }
std::vector< std::unique_ptr< QBase > > _element_qrule
Definition: fem_context.h:1143

◆ get_fixed_solution_derivative()

Real libMesh::DiffContext::get_fixed_solution_derivative ( ) const
inlineinherited

The derivative of the current fixed_elem_solution w.r.t. the unknown solution. Corresponding Jacobian contributions should be multiplied by this amount, or may be skipped if get_fixed_elem_solution_derivative() is 0.

Definition at line 463 of file diff_context.h.

References libMesh::DiffContext::fixed_solution_derivative.

464  { return fixed_solution_derivative; }

◆ get_localized_subvector() [1/2]

DenseSubVector< Number > & libMesh::DiffContext::get_localized_subvector ( const NumericVector< Number > &  localized_vector,
unsigned int  var 
)
inherited

Return a reference to DenseSubVector localization of localized_vector at variable var contained in the _localized_vectors map

Definition at line 148 of file diff_context.C.

References libMesh::DiffContext::_localized_vectors.

Referenced by libMesh::FEMContext::interior_gradients(), libMesh::FEMContext::interior_hessians(), libMesh::FEMContext::interior_values(), libMesh::FEMContext::side_gradients(), libMesh::FEMContext::side_hessians(), and libMesh::FEMContext::side_values().

149 {
150  return *_localized_vectors[&localized_vector].second[var];
151 }
std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< std::unique_ptr< DenseSubVector< Number > > > > > _localized_vectors
Definition: diff_context.h:575

◆ get_localized_subvector() [2/2]

const DenseSubVector< Number > & libMesh::DiffContext::get_localized_subvector ( const NumericVector< Number > &  localized_vector,
unsigned int  var 
) const
inherited

const accessible version of get_localized_subvector function

Definition at line 154 of file diff_context.C.

References libMesh::DiffContext::_localized_vectors.

155 {
156  auto localized_vectors_it = _localized_vectors.find(&localized_vector);
157  libmesh_assert(localized_vectors_it != _localized_vectors.end());
158  return *localized_vectors_it->second.second[var];
159 }
std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< std::unique_ptr< DenseSubVector< Number > > > > > _localized_vectors
Definition: diff_context.h:575

◆ get_localized_vector() [1/2]

DenseVector< Number > & libMesh::DiffContext::get_localized_vector ( const NumericVector< Number > &  localized_vector)
inherited

Return a reference to DenseVector localization of localized_vector contained in the _localized_vectors map

Definition at line 134 of file diff_context.C.

References libMesh::DiffContext::_localized_vectors.

135 {
136  return _localized_vectors[&localized_vector].first;
137 }
std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< std::unique_ptr< DenseSubVector< Number > > > > > _localized_vectors
Definition: diff_context.h:575

◆ get_localized_vector() [2/2]

const DenseVector< Number > & libMesh::DiffContext::get_localized_vector ( const NumericVector< Number > &  localized_vector) const
inherited

const accessible version of get_localized_vector function

Definition at line 140 of file diff_context.C.

References libMesh::DiffContext::_localized_vectors.

141 {
142  auto localized_vectors_it = _localized_vectors.find(&localized_vector);
143  libmesh_assert(localized_vectors_it != _localized_vectors.end());
144  return localized_vectors_it->second.first;
145 }
std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< std::unique_ptr< DenseSubVector< Number > > > > > _localized_vectors
Definition: diff_context.h:575

◆ get_mesh_system() [1/2]

const System* libMesh::FEMContext::get_mesh_system ( ) const
inlineinherited

Accessor for moving mesh System

Definition at line 811 of file fem_context.h.

References libMesh::FEMContext::_mesh_sys.

812  { return this->_mesh_sys; }

◆ get_mesh_system() [2/2]

System* libMesh::FEMContext::get_mesh_system ( )
inlineinherited

Accessor for moving mesh System

Definition at line 817 of file fem_context.h.

References libMesh::FEMContext::_mesh_sys.

818  { return this->_mesh_sys; }

◆ get_mesh_x_var()

unsigned int libMesh::FEMContext::get_mesh_x_var ( ) const
inlineinherited

Accessor for x-variable of moving mesh System

Definition at line 823 of file fem_context.h.

References libMesh::FEMContext::_mesh_x_var.

Referenced by libMesh::FEMContext::_do_elem_position_set(), and libMesh::FEMContext::elem_position_get().

824  { return _mesh_x_var; }
unsigned int _mesh_x_var
Definition: fem_context.h:974

◆ get_mesh_y_var()

unsigned int libMesh::FEMContext::get_mesh_y_var ( ) const
inlineinherited

Accessor for y-variable of moving mesh System

Definition at line 837 of file fem_context.h.

References libMesh::FEMContext::_mesh_y_var.

Referenced by libMesh::FEMContext::_do_elem_position_set(), and libMesh::FEMContext::elem_position_get().

838  { return _mesh_y_var; }
unsigned int _mesh_y_var
Definition: fem_context.h:974

◆ get_mesh_z_var()

unsigned int libMesh::FEMContext::get_mesh_z_var ( ) const
inlineinherited

Accessor for z-variable of moving mesh System

Definition at line 851 of file fem_context.h.

References libMesh::FEMContext::_mesh_z_var.

Referenced by libMesh::FEMContext::_do_elem_position_set(), and libMesh::FEMContext::elem_position_get().

852  { return _mesh_z_var; }
unsigned int _mesh_z_var
Definition: fem_context.h:974

◆ get_neighbor()

const Elem& libMesh::DGFEMContext::get_neighbor ( ) const
inline

Accessor for current neighbor Elem object for assembling DG terms.

Definition at line 226 of file dg_fem_context.h.

References _neighbor.

Referenced by neighbor_side_fe_reinit().

227  { return *_neighbor; }

◆ get_neighbor_dof_indices() [1/2]

const std::vector<dof_id_type>& libMesh::DGFEMContext::get_neighbor_dof_indices ( ) const
inline

Accessor for neighbor dof indices

Definition at line 71 of file dg_fem_context.h.

References _neighbor_dof_indices.

72  { return _neighbor_dof_indices; }
std::vector< dof_id_type > _neighbor_dof_indices

◆ get_neighbor_dof_indices() [2/2]

const std::vector<dof_id_type>& libMesh::DGFEMContext::get_neighbor_dof_indices ( unsigned int  var) const
inline

Accessor for element dof indices of a particular variable corresponding to the index argument.

Definition at line 78 of file dg_fem_context.h.

References _neighbor_dof_indices_var.

79  { return _neighbor_dof_indices_var[var]; }
std::vector< std::vector< dof_id_type > > _neighbor_dof_indices_var

◆ get_neighbor_elem_jacobian() [1/4]

const DenseMatrix<Number>& libMesh::DGFEMContext::get_neighbor_elem_jacobian ( ) const
inline

Const accessor for element-neighbor Jacobian.

Definition at line 162 of file dg_fem_context.h.

References _neighbor_elem_jacobian.

163  { return _neighbor_elem_jacobian; }
DenseMatrix< Number > _neighbor_elem_jacobian

◆ get_neighbor_elem_jacobian() [2/4]

DenseMatrix<Number>& libMesh::DGFEMContext::get_neighbor_elem_jacobian ( )
inline

Non-const accessor for element Jacobian.

Definition at line 168 of file dg_fem_context.h.

References _neighbor_elem_jacobian.

169  { return _neighbor_elem_jacobian; }
DenseMatrix< Number > _neighbor_elem_jacobian

◆ get_neighbor_elem_jacobian() [3/4]

const DenseSubMatrix<Number>& libMesh::DGFEMContext::get_neighbor_elem_jacobian ( unsigned int  var1,
unsigned int  var2 
) const
inline

Const accessor for neighbor-element Jacobian of particular variables corresponding to the variable index arguments.

Definition at line 175 of file dg_fem_context.h.

References _neighbor_elem_subjacobians.

176  { return *(_neighbor_elem_subjacobians[var1][var2]); }
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _neighbor_elem_subjacobians

◆ get_neighbor_elem_jacobian() [4/4]

DenseSubMatrix<Number>& libMesh::DGFEMContext::get_neighbor_elem_jacobian ( unsigned int  var1,
unsigned int  var2 
)
inline

Non-const accessor for neighbor-element Jacobian of particular variables corresponding to the variable index arguments.

Definition at line 182 of file dg_fem_context.h.

References _neighbor_elem_subjacobians.

183  { return *(_neighbor_elem_subjacobians[var1][var2]); }
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _neighbor_elem_subjacobians

◆ get_neighbor_neighbor_jacobian() [1/4]

const DenseMatrix<Number>& libMesh::DGFEMContext::get_neighbor_neighbor_jacobian ( ) const
inline

Const accessor for element-neighbor Jacobian.

Definition at line 188 of file dg_fem_context.h.

References _neighbor_neighbor_jacobian.

189  { return _neighbor_neighbor_jacobian; }
DenseMatrix< Number > _neighbor_neighbor_jacobian

◆ get_neighbor_neighbor_jacobian() [2/4]

DenseMatrix<Number>& libMesh::DGFEMContext::get_neighbor_neighbor_jacobian ( )
inline

Non-const accessor for element Jacobian.

Definition at line 194 of file dg_fem_context.h.

References _neighbor_neighbor_jacobian.

195  { return _neighbor_neighbor_jacobian; }
DenseMatrix< Number > _neighbor_neighbor_jacobian

◆ get_neighbor_neighbor_jacobian() [3/4]

const DenseSubMatrix<Number>& libMesh::DGFEMContext::get_neighbor_neighbor_jacobian ( unsigned int  var1,
unsigned int  var2 
) const
inline

Const accessor for neighbor-neighbor Jacobian of particular variables corresponding to the variable index arguments.

Definition at line 201 of file dg_fem_context.h.

References _neighbor_neighbor_subjacobians.

202  { return *(_neighbor_neighbor_subjacobians[var1][var2]); }
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _neighbor_neighbor_subjacobians

◆ get_neighbor_neighbor_jacobian() [4/4]

DenseSubMatrix<Number>& libMesh::DGFEMContext::get_neighbor_neighbor_jacobian ( unsigned int  var1,
unsigned int  var2 
)
inline

Non-const accessor for neighbor-neighbor Jacobian of particular variables corresponding to the variable index arguments.

Definition at line 208 of file dg_fem_context.h.

References _neighbor_neighbor_subjacobians.

209  { return *(_neighbor_neighbor_subjacobians[var1][var2]); }
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _neighbor_neighbor_subjacobians

◆ get_neighbor_residual() [1/4]

const DenseVector<Number>& libMesh::DGFEMContext::get_neighbor_residual ( ) const
inline

Const accessor for neighbor residual.

Definition at line 84 of file dg_fem_context.h.

References _neighbor_residual.

85  { return _neighbor_residual; }
DenseVector< Number > _neighbor_residual

◆ get_neighbor_residual() [2/4]

DenseVector<Number>& libMesh::DGFEMContext::get_neighbor_residual ( )
inline

Non-const accessor for neighbor residual.

Definition at line 90 of file dg_fem_context.h.

References _neighbor_residual.

91  { return _neighbor_residual; }
DenseVector< Number > _neighbor_residual

◆ get_neighbor_residual() [3/4]

const DenseSubVector<Number>& libMesh::DGFEMContext::get_neighbor_residual ( unsigned int  var) const
inline

Const accessor for neighbor residual of a particular variable corresponding to the variable index argument.

Definition at line 97 of file dg_fem_context.h.

References _neighbor_subresiduals.

98  { return *(_neighbor_subresiduals[var]); }
std::vector< std::unique_ptr< DenseSubVector< Number > > > _neighbor_subresiduals

◆ get_neighbor_residual() [4/4]

DenseSubVector<Number>& libMesh::DGFEMContext::get_neighbor_residual ( unsigned int  var)
inline

Non-const accessor for neighbor residual of a particular variable corresponding to the variable index argument.

Definition at line 104 of file dg_fem_context.h.

References _neighbor_subresiduals.

105  { return *(_neighbor_subresiduals[var]); }
std::vector< std::unique_ptr< DenseSubVector< Number > > > _neighbor_subresiduals

◆ get_neighbor_side_fe()

template<typename OutputShape >
void libMesh::DGFEMContext::get_neighbor_side_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe 
) const
inline

Accessor for neighbor edge/face (2D/3D) finite element object for variable var.

Definition at line 301 of file dg_fem_context.h.

References _neighbor_side_fe_var.

302 {
303  libmesh_assert_less ( var, _neighbor_side_fe_var.size() );
304  fe = cast_ptr<FEGenericBase<OutputShape> *>( _neighbor_side_fe_var[var] );
305 }
std::vector< FEAbstract * > _neighbor_side_fe_var

◆ get_qoi_derivatives() [1/4]

const std::vector<DenseVector<Number> >& libMesh::DiffContext::get_qoi_derivatives ( ) const
inlineinherited

Const accessor for QoI derivatives.

Definition at line 331 of file diff_context.h.

References libMesh::DiffContext::_elem_qoi_derivative.

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

332  { return _elem_qoi_derivative; }
std::vector< DenseVector< Number > > _elem_qoi_derivative
Definition: diff_context.h:625

◆ get_qoi_derivatives() [2/4]

std::vector<DenseVector<Number> >& libMesh::DiffContext::get_qoi_derivatives ( )
inlineinherited

Non-const accessor for QoI derivatives.

Definition at line 337 of file diff_context.h.

References libMesh::DiffContext::_elem_qoi_derivative.

338  { return _elem_qoi_derivative; }
std::vector< DenseVector< Number > > _elem_qoi_derivative
Definition: diff_context.h:625

◆ get_qoi_derivatives() [3/4]

const DenseSubVector<Number>& libMesh::DiffContext::get_qoi_derivatives ( std::size_t  qoi,
unsigned int  var 
) const
inlineinherited

Const accessor for QoI derivative of a particular qoi and variable corresponding to the index arguments.

Definition at line 344 of file diff_context.h.

References libMesh::DiffContext::_elem_qoi_subderivatives.

345  {
346  libmesh_assert_greater(_elem_qoi_subderivatives.size(), qoi);
347  libmesh_assert_greater(_elem_qoi_subderivatives[qoi].size(), var);
348  libmesh_assert(_elem_qoi_subderivatives[qoi][var]);
349  return *(_elem_qoi_subderivatives[qoi][var]);
350  }
std::vector< std::vector< std::unique_ptr< DenseSubVector< Number > > > > _elem_qoi_subderivatives
Definition: diff_context.h:626

◆ get_qoi_derivatives() [4/4]

DenseSubVector<Number>& libMesh::DiffContext::get_qoi_derivatives ( std::size_t  qoi,
unsigned int  var 
)
inlineinherited

Non-const accessor for QoI derivative of a particular qoi and variable corresponding to the index arguments.

Definition at line 356 of file diff_context.h.

References libMesh::DiffContext::_elem_qoi_subderivatives.

357  {
358  libmesh_assert_greater(_elem_qoi_subderivatives.size(), qoi);
359  libmesh_assert_greater(_elem_qoi_subderivatives[qoi].size(), var);
360  libmesh_assert(_elem_qoi_subderivatives[qoi][var]);
361  return *(_elem_qoi_subderivatives[qoi][var]);
362  }
std::vector< std::vector< std::unique_ptr< DenseSubVector< Number > > > > _elem_qoi_subderivatives
Definition: diff_context.h:626

◆ get_qois() [1/2]

const std::vector<Number>& libMesh::DiffContext::get_qois ( ) const
inlineinherited

Const accessor for QoI vector.

Definition at line 319 of file diff_context.h.

References libMesh::DiffContext::_elem_qoi.

320  { return _elem_qoi; }
std::vector< Number > _elem_qoi
Definition: diff_context.h:620

◆ get_qois() [2/2]

std::vector<Number>& libMesh::DiffContext::get_qois ( )
inlineinherited

Non-const accessor for QoI vector.

Definition at line 325 of file diff_context.h.

References libMesh::DiffContext::_elem_qoi.

326  { return _elem_qoi; }
std::vector< Number > _elem_qoi
Definition: diff_context.h:620

◆ get_side()

unsigned char libMesh::FEMContext::get_side ( ) const
inlineinherited

Accessor for current side of Elem object

Definition at line 885 of file fem_context.h.

References libMesh::FEMContext::side.

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

886  { return side; }
unsigned char side
Definition: fem_context.h:979

◆ get_side_fe() [1/4]

template<typename OutputShape >
void libMesh::FEMContext::get_side_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe 
) const
inlineinherited

Accessor for edge/face (2D/3D) finite element object for variable var for the largest dimension in the mesh. We default to the largest mesh dim because this method may be called before the Elem * is set in the FEMContext, e.g. in FEMSystem::init_context (or a subclass). If you have lower dimensional elements in the mesh and need to query for those FE objects, use the alternative get_side_fe method.

Definition at line 299 of file fem_context.h.

References libMesh::FEMContext::get_dim().

Referenced by libMesh::ParsedFEMFunction< T >::eval_args(), libMesh::FEMContext::fixed_side_gradient(), libMesh::FEMContext::fixed_side_hessian(), libMesh::FEMContext::fixed_side_value(), libMesh::FEMContext::get_side_fe(), libMesh::ParsedFEMFunction< T >::init_context(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()(), libMesh::FEMContext::side_accel(), libMesh::FEMContext::side_hessian(), and libMesh::FEMContext::side_rate().

300  { this->get_side_fe<OutputShape>(var,fe,this->get_dim()); }
unsigned char get_dim() const
Definition: fem_context.h:899

◆ get_side_fe() [2/4]

FEBase* libMesh::FEMContext::get_side_fe ( unsigned int  var) const
inlineinherited

Accessor for side finite element object for scalar-valued variable var for the largest dimension in the mesh. We default to the largest mesh dim because this method may be called before the Elem * is set in the FEMContext, e.g. in FEMSystem::init_context (or a subclass). If you have lower dimensional elements in the mesh and need to query for those FE objects, use the alternative get_side_fe method.

Definition at line 310 of file fem_context.h.

References libMesh::FEMContext::get_dim(), and libMesh::FEMContext::get_side_fe().

311  { return this->get_side_fe(var,this->get_dim()); }
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:299
unsigned char get_dim() const
Definition: fem_context.h:899

◆ get_side_fe() [3/4]

template<typename OutputShape >
void libMesh::FEMContext::get_side_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe,
unsigned short  dim 
) const
inlineinherited

Accessor for edge/face (2D/3D) finite element object for variable var for dimension dim.

Definition at line 1223 of file fem_context.h.

References libMesh::FEMContext::_side_fe_var.

1225 {
1226  libmesh_assert( !_side_fe_var[dim].empty() );
1227  libmesh_assert_less ( var, (_side_fe_var[dim].size() ) );
1228  fe = cast_ptr<FEGenericBase<OutputShape> *>( (_side_fe_var[dim][var] ) );
1229 }
std::vector< std::vector< FEAbstract * > > _side_fe_var
Definition: fem_context.h:1107

◆ get_side_fe() [4/4]

FEBase * libMesh::FEMContext::get_side_fe ( unsigned int  var,
unsigned short  dim 
) const
inlineinherited

Accessor for side finite element object for scalar-valued variable var for dimension dim.

Definition at line 1232 of file fem_context.h.

References libMesh::FEMContext::_side_fe_var.

1233 {
1234  libmesh_assert( !_side_fe_var[dim].empty() );
1235  libmesh_assert_less ( var, (_side_fe_var[dim].size() ) );
1236  return cast_ptr<FEBase *>( (_side_fe_var[dim][var] ) );
1237 }
std::vector< std::vector< FEAbstract * > > _side_fe_var
Definition: fem_context.h:1107

◆ get_side_qrule() [1/2]

const QBase& libMesh::FEMContext::get_side_qrule ( ) const
inlineinherited

Accessor for element side quadrature rule for the dimension of the current _elem.

Definition at line 772 of file fem_context.h.

References libMesh::FEMContext::get_elem_dim().

773  { return this->get_side_qrule(this->get_elem_dim()); }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const QBase & get_side_qrule() const
Definition: fem_context.h:772

◆ get_side_qrule() [2/2]

const QBase& libMesh::FEMContext::get_side_qrule ( unsigned short  dim) const
inlineinherited

Accessor for element side quadrature rule.

Definition at line 785 of file fem_context.h.

References libMesh::FEMContext::_side_qrule.

786  {
787  libmesh_assert(_side_qrule[dim]);
788  return *(this->_side_qrule[dim]);
789  }
std::vector< std::unique_ptr< QBase > > _side_qrule
Definition: fem_context.h:1151

◆ get_system()

const System& libMesh::DiffContext::get_system ( ) const
inlineinherited

Accessor for associated system.

Definition at line 105 of file diff_context.h.

References libMesh::DiffContext::_system.

Referenced by libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns(), and neighbor_side_fe_reinit().

106  { return _system; }
const System & _system
Definition: diff_context.h:658

◆ get_system_time()

Real libMesh::DiffContext::get_system_time ( ) const
inlineinherited

Accessor for the time variable stored in the system class.

Definition at line 415 of file diff_context.h.

References libMesh::DiffContext::system_time.

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

416  { return system_time; }
const Real system_time
Definition: diff_context.h:494

◆ get_time()

Real libMesh::DiffContext::get_time ( ) const
inlineinherited

Accessor for the time for which the current nonlinear_solution is defined.

Definition at line 421 of file diff_context.h.

References libMesh::DiffContext::time.

422  { return time; }

◆ has_elem()

bool libMesh::FEMContext::has_elem ( ) const
inlineinherited

Test for current Elem object

Definition at line 865 of file fem_context.h.

References libMesh::FEMContext::_elem.

Referenced by libMesh::FEMContext::build_new_fe(), libMesh::FEMContext::cached_fe(), libMesh::FEMContext::elem_fe_reinit(), and libMesh::FEMContext::pre_fe_reinit().

866  { return (this->_elem != nullptr); }
const Elem * _elem
Definition: fem_context.h:1119

◆ has_side_boundary_id()

bool libMesh::FEMContext::has_side_boundary_id ( boundary_id_type  id) const
inherited

Reports if the boundary id is found on the current side

Definition at line 189 of file fem_context.C.

References libMesh::FEMContext::_boundary_info, libMesh::FEMContext::get_elem(), libMesh::BoundaryInfo::has_boundary_id(), and libMesh::FEMContext::side.

190 {
191  return _boundary_info.has_boundary_id(&(this->get_elem()), side, id);
192 }
bool has_boundary_id(const Node *const node, const boundary_id_type id) const
const Elem & get_elem() const
Definition: fem_context.h:871
const BoundaryInfo & _boundary_info
Definition: fem_context.h:1114
unsigned char side
Definition: fem_context.h:979

◆ interior_accel()

template<typename OutputType >
template void libMesh::FEMContext::interior_accel< Gradient > ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
inherited
Returns
The second time derivative (acceleration) of the solution variable var at the quadrature point qp on the current element interior.

Definition at line 1275 of file fem_context.C.

References libMesh::DiffContext::get_elem_solution_accel(), libMesh::FEMContext::get_element_fe(), and libMesh::FEMContext::some_value().

1277 {
1278  this->some_value<OutputType,
1282 }
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:214
const DenseVector< Number > & get_elem_solution_accel() const
Definition: diff_context.h:180
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:262

◆ interior_curl()

template<typename OutputType >
template void libMesh::FEMContext::interior_curl< Gradient > ( unsigned int  var,
unsigned int  qp,
OutputType &  curl_u 
) const
inherited
Returns
The curl of the solution variable var at the physical point p on the current element.

Definition at line 492 of file fem_context.C.

References libMesh::DiffContext::_elem_subsolutions, libMesh::FEGenericBase< OutputType >::get_curl_phi(), libMesh::DiffContext::get_dof_indices(), libMesh::FEMContext::get_elem_dim(), and libMesh::DiffContext::get_elem_solution().

494 {
495  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
496 
497  // Get local-to-global dof index lookup
498  const unsigned int n_dofs = cast_int<unsigned int>
499  (this->get_dof_indices(var).size());
500 
501  // Get current local coefficients
502  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
503  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
504 
505  // Get finite element object
506  FEGenericBase<OutputShape> * fe = nullptr;
507  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
508 
509  // Get shape function values at quadrature point
510  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputShape>> & curl_phi = fe->get_curl_phi();
511 
512  // Accumulate solution curl
513  curl_u = 0.;
514 
515  for (unsigned int l=0; l != n_dofs; l++)
516  curl_u.add_scaled(curl_phi[l][qp], coef(l));
517 
518  return;
519 }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:111
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subsolutions
Definition: diff_context.h:582
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367

◆ interior_div()

template<typename OutputType >
template void libMesh::FEMContext::interior_div< Number > ( unsigned int  var,
unsigned int  qp,
OutputType &  div_u 
) const
inherited
Returns
The divergence of the solution variable var at the physical point p on the current element.

Definition at line 523 of file fem_context.C.

References libMesh::DiffContext::_elem_subsolutions, libMesh::FEGenericBase< OutputType >::get_div_phi(), libMesh::DiffContext::get_dof_indices(), libMesh::FEMContext::get_elem_dim(), and libMesh::DiffContext::get_elem_solution().

525 {
526  typedef typename
527  TensorTools::IncrementRank
528  <typename TensorTools::MakeReal<OutputType>::type>::type OutputShape;
529 
530  // Get local-to-global dof index lookup
531  const unsigned int n_dofs = cast_int<unsigned int>
532  (this->get_dof_indices(var).size());
533 
534  // Get current local coefficients
535  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
536  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
537 
538  // Get finite element object
539  FEGenericBase<OutputShape> * fe = nullptr;
540  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
541 
542  // Get shape function values at quadrature point
543  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputDivergence>> & div_phi = fe->get_div_phi();
544 
545  // Accumulate solution curl
546  div_u = 0.;
547 
548  for (unsigned int l=0; l != n_dofs; l++)
549  div_u += div_phi[l][qp] * coef(l);
550 
551  return;
552 }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:111
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subsolutions
Definition: diff_context.h:582
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367

◆ interior_gradient() [1/2]

Gradient libMesh::FEMContext::interior_gradient ( unsigned int  var,
unsigned int  qp 
) const
inherited
Returns
The gradient of the solution variable var at the quadrature point qp on the current element interior.
Note
This API is currently present for backward compatibility.

Definition at line 361 of file fem_context.C.

363 {
364  Gradient du;
365 
366  this->interior_gradient( var, qp, du );
367 
368  return du;
369 }
Gradient interior_gradient(unsigned int var, unsigned int qp) const
Definition: fem_context.C:361
NumberVectorValue Gradient

◆ interior_gradient() [2/2]

template<typename OutputType >
void libMesh::FEMContext::interior_gradient ( unsigned int  var,
unsigned int  qp,
OutputType &  du 
) const
inherited
Returns
The gradient of the solution variable var at the quadrature point qp on the current element interior.
Note
This is the preferred API.

Definition at line 374 of file fem_context.C.

References libMesh::DiffContext::get_elem_solution(), libMesh::FEMContext::get_element_fe(), and libMesh::FEMContext::some_gradient().

377 {
378  this->some_gradient<OutputType,
379  &FEMContext::get_element_fe<typename TensorTools::MakeReal
380  <typename TensorTools::DecrementRank
381  <OutputType>::type>::type>,
382  &DiffContext::get_elem_solution>(var, qp, du);
383 }
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:111
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:262
void some_gradient(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:243

◆ interior_gradients()

template<typename OutputType >
template void libMesh::FEMContext::interior_gradients< Tensor > ( unsigned int  var,
const NumericVector< Number > &  _system_vector,
std::vector< OutputType > &  interior_gradients_vector 
) const
inherited

Fills a vector with the gradient of the solution variable var at all the quadrature points in the current element interior.

Note
This is the preferred API.

Definition at line 388 of file fem_context.C.

References libMesh::DiffContext::get_dof_indices(), libMesh::FEGenericBase< OutputType >::get_dphi(), libMesh::FEMContext::get_elem_dim(), and libMesh::DiffContext::get_localized_subvector().

391 {
392  typedef typename TensorTools::MakeReal
394  OutputShape;
395 
396  // Get local-to-global dof index lookup
397  const unsigned int n_dofs = cast_int<unsigned int>
398  (this->get_dof_indices(var).size());
399 
400  // Get current local coefficients
401  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
402 
403  // Get finite element object
404  FEGenericBase<OutputShape> * fe = nullptr;
405  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
406 
407  // Get shape function values at quadrature point
408  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient>> & dphi = fe->get_dphi();
409 
410  // Loop over all the q_points in this finite element
411  for (std::size_t qp=0; qp != du_vals.size(); qp++)
412  {
413  OutputType & du = du_vals[qp];
414 
415  // Compute the gradient at this q_point
416  du = 0;
417 
418  for (unsigned int l=0; l != n_dofs; l++)
419  du.add_scaled(dphi[l][qp], coef(l));
420  }
421 
422  return;
423 }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367
DenseSubVector< Number > & get_localized_subvector(const NumericVector< Number > &localized_vector, unsigned int var)
Definition: diff_context.C:148

◆ interior_hessian() [1/2]

Tensor libMesh::FEMContext::interior_hessian ( unsigned int  var,
unsigned int  qp 
) const
inherited
Returns
The hessian of the solution variable var at the quadrature point qp on the current element interior.
Note
This API is currently present for backward compatibility.

Definition at line 426 of file fem_context.C.

427 {
428  Tensor d2u;
429 
430  this->interior_hessian( var, qp, d2u );
431 
432  return d2u;
433 }
Tensor interior_hessian(unsigned int var, unsigned int qp) const
Definition: fem_context.C:426
NumberTensorValue Tensor

◆ interior_hessian() [2/2]

template<typename OutputType >
void libMesh::FEMContext::interior_hessian ( unsigned int  var,
unsigned int  qp,
OutputType &  d2u 
) const
inherited
Returns
The hessian of the solution variable var at the quadrature point qp on the current element interior.
Note
This is the preferred API.

Definition at line 436 of file fem_context.C.

References libMesh::DiffContext::get_elem_solution(), libMesh::FEMContext::get_element_fe(), and libMesh::FEMContext::some_hessian().

438 {
439  this->some_hessian<OutputType,
441  <typename TensorTools::MakeReal
442  <typename TensorTools::DecrementRank
443  <typename TensorTools::DecrementRank
444  <OutputType>::type>::type>::type>,
445  &DiffContext::get_elem_solution>(var, qp, d2u);
446 }
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:111
void some_hessian(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:276
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:262

◆ interior_hessians()

template<typename OutputType >
template void libMesh::FEMContext::interior_hessians< Tensor > ( unsigned int  var,
const NumericVector< Number > &  _system_vector,
std::vector< OutputType > &  d2u_vals 
) const
inherited

Fills a vector of hessians of the _system_vector at the all the quadrature points in the current element interior. This is the preferred API.

Definition at line 450 of file fem_context.C.

References libMesh::FEGenericBase< OutputType >::get_d2phi(), libMesh::DiffContext::get_dof_indices(), libMesh::FEMContext::get_elem_dim(), and libMesh::DiffContext::get_localized_subvector().

453 {
454  typedef typename TensorTools::DecrementRank<OutputType>::type Rank1Decrement;
455  typedef typename TensorTools::DecrementRank<Rank1Decrement>::type Rank2Decrement;
456  typedef typename TensorTools::MakeReal<Rank2Decrement>::type OutputShape;
457 
458  // Get local-to-global dof index lookup
459  const unsigned int n_dofs = cast_int<unsigned int>
460  (this->get_dof_indices(var).size());
461 
462  // Get current local coefficients
463  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
464 
465  // Get finite element object
466  FEGenericBase<OutputShape> * fe = nullptr;
467  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
468 
469  // Get shape function values at quadrature point
470  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor>> & d2phi = fe->get_d2phi();
471 
472  // Loop over all the q_points in this finite element
473  for (std::size_t qp=0; qp != d2u_vals.size(); qp++)
474  {
475  OutputType & d2u = d2u_vals[qp];
476 
477  // Compute the gradient at this q_point
478  d2u = 0;
479 
480  for (unsigned int l=0; l != n_dofs; l++)
481  d2u.add_scaled(d2phi[l][qp], coef(l));
482  }
483 
484  return;
485 }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367
DenseSubVector< Number > & get_localized_subvector(const NumericVector< Number > &localized_vector, unsigned int var)
Definition: diff_context.C:148

◆ interior_rate()

template<typename OutputType >
template void libMesh::FEMContext::interior_rate< Gradient > ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
inherited
Returns
The time derivative (rate) of the solution variable var at the quadrature point qp on the current element interior.

Definition at line 1253 of file fem_context.C.

References libMesh::DiffContext::get_elem_solution_rate(), libMesh::FEMContext::get_element_fe(), and libMesh::FEMContext::some_value().

Referenced by libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns().

1255 {
1256  this->some_value<OutputType,
1260 }
const DenseVector< Number > & get_elem_solution_rate() const
Definition: diff_context.h:145
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:214
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:262

◆ interior_value() [1/2]

Number libMesh::FEMContext::interior_value ( unsigned int  var,
unsigned int  qp 
) const
inherited
Returns
The value of the solution variable var at the quadrature point qp on the current element interior.
Note
This API is currently present for backward compatibility.

Definition at line 306 of file fem_context.C.

Referenced by libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns().

307 {
308  Number u;
309 
310  this->interior_value( var, qp, u );
311 
312  return u;
313 }
Number interior_value(unsigned int var, unsigned int qp) const
Definition: fem_context.C:306

◆ interior_value() [2/2]

template<typename OutputType >
void libMesh::FEMContext::interior_value ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
inherited
Returns
The value of the solution variable var at the quadrature point qp on the current element interior.
Note
This is the preferred API.

Definition at line 316 of file fem_context.C.

References libMesh::DiffContext::get_elem_solution(), and libMesh::FEMContext::some_value().

318 {
319  this->some_value<OutputType,
320  &FEMContext::get_element_fe<typename TensorTools::MakeReal<OutputType>::type>,
321  &DiffContext::get_elem_solution>(var, qp, u);
322 }
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:111
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:214

◆ interior_values()

template<typename OutputType >
template void libMesh::FEMContext::interior_values< Gradient > ( unsigned int  var,
const NumericVector< Number > &  _system_vector,
std::vector< OutputType > &  interior_values_vector 
) const
inherited

Fills a vector of values of the _system_vector at the all the quadrature points in the current element interior.

Definition at line 326 of file fem_context.C.

References libMesh::DiffContext::get_dof_indices(), libMesh::FEMContext::get_elem_dim(), libMesh::DiffContext::get_localized_subvector(), and libMesh::FEGenericBase< OutputType >::get_phi().

329 {
330  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
331 
332  // Get local-to-global dof index lookup
333  const unsigned int n_dofs = cast_int<unsigned int>
334  (this->get_dof_indices(var).size());
335 
336  // Get current local coefficients
337  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
338 
339  // Get the finite element object
340  FEGenericBase<OutputShape> * fe = nullptr;
341  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
342 
343  // Get shape function values at quadrature point
344  const std::vector<std::vector<OutputShape>> & phi = fe->get_phi();
345 
346  // Loop over all the q_points on this element
347  for (std::size_t qp=0; qp != u_vals.size(); qp++)
348  {
349  OutputType & u = u_vals[qp];
350 
351  // Compute the value at this q_point
352  u = 0.;
353 
354  for (unsigned int l=0; l != n_dofs; l++)
355  u += phi[l][qp] * coef(l);
356  }
357 
358  return;
359 }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367
DenseSubVector< Number > & get_localized_subvector(const NumericVector< Number > &localized_vector, unsigned int var)
Definition: diff_context.C:148

◆ is_adjoint() [1/2]

bool libMesh::DiffContext::is_adjoint ( ) const
inlineinherited

Accessor for querying whether we need to do a primal or adjoint solve

Definition at line 470 of file diff_context.h.

References libMesh::DiffContext::_is_adjoint.

Referenced by libMesh::FEMSystem::build_context().

471  { return _is_adjoint; }

◆ is_adjoint() [2/2]

bool& libMesh::DiffContext::is_adjoint ( )
inlineinherited

Accessor for setting whether we need to do a primal or adjoint solve

Definition at line 477 of file diff_context.h.

References libMesh::DiffContext::_is_adjoint.

478  { return _is_adjoint; }

◆ n_dof_indices() [1/2]

unsigned int libMesh::DiffContext::n_dof_indices ( ) const
inlineinherited

Total number of dof indices on the element

Definition at line 399 of file diff_context.h.

References libMesh::DiffContext::_dof_indices.

400  { return cast_int<unsigned int>(_dof_indices.size()); }
std::vector< dof_id_type > _dof_indices
Definition: diff_context.h:637

◆ n_dof_indices() [2/2]

unsigned int libMesh::DiffContext::n_dof_indices ( unsigned int  var) const
inlineinherited

Total number of dof indices of the particular variable corresponding to the index argument

Definition at line 406 of file diff_context.h.

References libMesh::DiffContext::_dof_indices_var.

407  {
408  libmesh_assert_greater(_dof_indices_var.size(), var);
409  return cast_int<unsigned int>(_dof_indices_var[var].size());
410  }
std::vector< std::vector< dof_id_type > > _dof_indices_var
Definition: diff_context.h:638

◆ n_vars()

unsigned int libMesh::DiffContext::n_vars ( ) const
inlineinherited

◆ neighbor_side_fe_reinit()

void libMesh::DGFEMContext::neighbor_side_fe_reinit ( )

Initialize neighbor side data needed to assemble DG terms. The neighbor element is determined by the current value of get_neighbor().

Definition at line 86 of file dg_fem_context.C.

References _dg_terms_active, _elem_elem_jacobian, _elem_elem_subjacobians, _elem_neighbor_jacobian, _elem_neighbor_subjacobians, _neighbor_dof_indices, _neighbor_dof_indices_var, _neighbor_elem_jacobian, _neighbor_elem_subjacobians, _neighbor_neighbor_jacobian, _neighbor_neighbor_subjacobians, _neighbor_residual, _neighbor_side_fe, _neighbor_subresiduals, libMesh::FEMContext::_side_fe, libMesh::DofMap::dof_indices(), libMesh::FEMContext::get_dim(), libMesh::DiffContext::get_dof_indices(), libMesh::System::get_dof_map(), get_neighbor(), libMesh::DiffContext::get_system(), libMesh::FEAbstract::get_xyz(), libMesh::FEInterface::inverse_map(), libMesh::System::n_vars(), libMesh::DenseVector< T >::resize(), and libMesh::DenseMatrix< T >::resize().

87 {
88  // Call this *after* side_fe_reinit
89 
90  // Initialize all the neighbor side FE objects based on inverse mapping
91  // the quadrature points on the current side
92  std::vector<Point> qface_side_points;
93  std::vector<Point> qface_neighbor_points;
94  for (auto & pr : _neighbor_side_fe)
95  {
96  FEType neighbor_side_fe_type = pr.first;
97  FEAbstract * side_fe = _side_fe[this->get_dim()][neighbor_side_fe_type].get();
98  qface_side_points = side_fe->get_xyz();
99 
101  neighbor_side_fe_type,
102  &get_neighbor(),
103  qface_side_points,
104  qface_neighbor_points);
105 
106  pr.second->reinit(&get_neighbor(), &qface_neighbor_points);
107  }
108 
109  // Set boolean flag to indicate that the DG terms are active on this element
110  _dg_terms_active = true;
111 
112  // Also, initialize data required for DG assembly on the current side,
113  // analogously to FEMContext::pre_fe_reinit
114 
115  // Initialize the per-element data for elem.
117 
118  const unsigned int n_dofs = cast_int<unsigned int>
119  (this->get_dof_indices().size());
120  const unsigned int n_neighbor_dofs = cast_int<unsigned int>
121  (_neighbor_dof_indices.size());
122 
123  // These resize calls also zero out the residual and jacobian
124  _neighbor_residual.resize(n_neighbor_dofs);
125  _elem_elem_jacobian.resize(n_dofs, n_dofs);
126  _elem_neighbor_jacobian.resize(n_dofs, n_neighbor_dofs);
127  _neighbor_elem_jacobian.resize(n_neighbor_dofs, n_dofs);
128  _neighbor_neighbor_jacobian.resize(n_neighbor_dofs, n_neighbor_dofs);
129 
130  // Initialize the per-variable data for elem.
131  {
132  unsigned int sub_dofs = 0;
133  for (unsigned int i=0; i != get_system().n_vars(); ++i)
134  {
136 
137  const unsigned int n_dofs_var = cast_int<unsigned int>
138  (_neighbor_dof_indices_var[i].size());
139 
140  _neighbor_subresiduals[i]->reposition
141  (sub_dofs, n_dofs_var);
142 
143  for (unsigned int j=0; j != i; ++j)
144  {
145  const unsigned int n_dofs_var_j =
146  cast_int<unsigned int>
147  (this->get_dof_indices(j).size());
148 
149  _elem_elem_subjacobians[i][j]->reposition
150  (sub_dofs, _neighbor_subresiduals[j]->i_off(),
151  n_dofs_var, n_dofs_var_j);
152  _elem_elem_subjacobians[j][i]->reposition
153  (_neighbor_subresiduals[j]->i_off(), sub_dofs,
154  n_dofs_var_j, n_dofs_var);
155 
156  _elem_neighbor_subjacobians[i][j]->reposition
157  (sub_dofs, _neighbor_subresiduals[j]->i_off(),
158  n_dofs_var, n_dofs_var_j);
159  _elem_neighbor_subjacobians[j][i]->reposition
160  (_neighbor_subresiduals[j]->i_off(), sub_dofs,
161  n_dofs_var_j, n_dofs_var);
162 
163  _neighbor_elem_subjacobians[i][j]->reposition
164  (sub_dofs, _neighbor_subresiduals[j]->i_off(),
165  n_dofs_var, n_dofs_var_j);
166  _neighbor_elem_subjacobians[j][i]->reposition
167  (_neighbor_subresiduals[j]->i_off(), sub_dofs,
168  n_dofs_var_j, n_dofs_var);
169 
170  _neighbor_neighbor_subjacobians[i][j]->reposition
171  (sub_dofs, _neighbor_subresiduals[j]->i_off(),
172  n_dofs_var, n_dofs_var_j);
173  _neighbor_neighbor_subjacobians[j][i]->reposition
174  (_neighbor_subresiduals[j]->i_off(), sub_dofs,
175  n_dofs_var_j, n_dofs_var);
176  }
177  _elem_elem_subjacobians[i][i]->reposition
178  (sub_dofs, sub_dofs,
179  n_dofs_var,
180  n_dofs_var);
181  _elem_neighbor_subjacobians[i][i]->reposition
182  (sub_dofs, sub_dofs,
183  n_dofs_var,
184  n_dofs_var);
185  _neighbor_elem_subjacobians[i][i]->reposition
186  (sub_dofs, sub_dofs,
187  n_dofs_var,
188  n_dofs_var);
189  _neighbor_neighbor_subjacobians[i][i]->reposition
190  (sub_dofs, sub_dofs,
191  n_dofs_var,
192  n_dofs_var);
193  sub_dofs += n_dofs_var;
194  }
195  libmesh_assert_equal_to (sub_dofs, n_dofs);
196  }
197 
198 }
std::vector< dof_id_type > _neighbor_dof_indices
DenseVector< Number > _neighbor_residual
DenseMatrix< Number > _elem_elem_jacobian
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Definition: dof_map.C:1930
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_elem_subjacobians
void resize(const unsigned int n)
Definition: dense_vector.h:355
std::vector< std::vector< dof_id_type > > _neighbor_dof_indices_var
unsigned char get_dim() const
Definition: fem_context.h:899
const System & get_system() const
Definition: diff_context.h:105
DenseMatrix< Number > _neighbor_elem_jacobian
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:590
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367
DenseMatrix< Number > _elem_neighbor_jacobian
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_neighbor_subjacobians
std::vector< std::map< FEType, std::unique_ptr< FEAbstract > > > _side_fe
Definition: fem_context.h:1096
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _neighbor_elem_subjacobians
DenseMatrix< Number > _neighbor_neighbor_jacobian
void resize(const unsigned int new_m, const unsigned int new_n)
Definition: dense_matrix.h:792
std::vector< std::unique_ptr< DenseSubVector< Number > > > _neighbor_subresiduals
unsigned int n_vars() const
Definition: system.h:2105
std::map< FEType, std::unique_ptr< FEAbstract > > _neighbor_side_fe
const DofMap & get_dof_map() const
Definition: system.h:2049
const Elem & get_neighbor() const
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _neighbor_neighbor_subjacobians

◆ nonlocal_reinit()

void libMesh::FEMContext::nonlocal_reinit ( Real  theta)
overridevirtualinherited

Gives derived classes the opportunity to reinitialize data needed for nonlocal calculations at a new point within a timestep

Reimplemented from libMesh::DiffContext.

Definition at line 1352 of file fem_context.C.

References libMesh::FEMContext::_update_time_from_system(), and libMesh::FEMContext::elem_fe_reinit().

1353 {
1354  // Update the "time" variable of this context object
1355  this->_update_time_from_system(theta);
1356 
1357  // We can reuse the Elem FE safely here.
1358  elem_fe_reinit();
1359 }
virtual void elem_fe_reinit(const std::vector< Point > *const pts=nullptr)
Definition: fem_context.C:1362
void _update_time_from_system(Real theta)
Definition: fem_context.C:1774

◆ point_accel()

template<typename OutputType >
void libMesh::FEMContext::point_accel ( unsigned int  var,
const Point p,
OutputType &  u 
) const
inherited
Returns
The second time derivative (acceleration) of the solution variable var at the physical point p on the current element.

◆ point_curl()

template<typename OutputType >
template void libMesh::FEMContext::point_curl< Gradient > ( unsigned int  var,
const Point p,
OutputType &  curl_u,
const Real  tolerance = TOLERANCE 
) const
inherited
Returns
The curl of the solution variable var at the physical point p on the current element.

Allows evaluation of points within a relative tolerance outside the element.

Definition at line 917 of file fem_context.C.

References libMesh::DiffContext::_elem_subsolutions, libMesh::FEMContext::build_new_fe(), libMesh::DiffContext::get_dof_indices(), libMesh::FEMContext::get_elem_dim(), and libMesh::DiffContext::get_elem_solution().

921 {
922  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
923 
924  // Get local-to-global dof index lookup
925  const unsigned int n_dofs = cast_int<unsigned int>
926  (this->get_dof_indices(var).size());
927 
928  // Get current local coefficients
929  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
930  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
931 
932  // Get finite element object
933  FEGenericBase<OutputShape> * fe = nullptr;
934  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
935 
936  // Build a FE for calculating u(p)
937  FEGenericBase<OutputShape> * fe_new =
938  this->build_new_fe( fe, p, tolerance );
939 
940  // Get the values of the shape function derivatives
941  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputShape>> & curl_phi = fe_new->get_curl_phi();
942 
943  curl_u = 0.0;
944 
945  for (unsigned int l=0; l != n_dofs; l++)
946  curl_u.add_scaled(curl_phi[l][0], coef(l));
947 
948  return;
949 }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:111
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subsolutions
Definition: diff_context.h:582
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
Definition: fem_context.C:1862

◆ point_gradient() [1/2]

Gradient libMesh::FEMContext::point_gradient ( unsigned int  var,
const Point p 
) const
inherited
Returns
The gradient of the solution variable var at the physical point p on the current element.
Note
This API is currently present for backward compatibility.

Definition at line 814 of file fem_context.C.

Referenced by libMesh::ParsedFEMFunction< T >::eval_args().

815 {
816  Gradient grad_u;
817 
818  this->point_gradient( var, p, grad_u );
819 
820  return grad_u;
821 }
NumberVectorValue Gradient
Gradient point_gradient(unsigned int var, const Point &p) const
Definition: fem_context.C:814

◆ point_gradient() [2/2]

template<typename OutputType >
void libMesh::FEMContext::point_gradient ( unsigned int  var,
const Point p,
OutputType &  grad_u,
const Real  tolerance = TOLERANCE 
) const
inherited
Returns
The gradient of the solution variable var at the physical point p on the current element.
Note
This is the preferred API.

Allows evaluation of points within a relative tolerance outside the element.

Definition at line 826 of file fem_context.C.

References libMesh::DiffContext::_elem_subsolutions, libMesh::FEMContext::build_new_fe(), libMesh::DiffContext::get_dof_indices(), libMesh::FEMContext::get_elem_dim(), and libMesh::DiffContext::get_elem_solution().

830 {
831  typedef typename TensorTools::MakeReal
833  OutputShape;
834 
835  // Get local-to-global dof index lookup
836  const unsigned int n_dofs = cast_int<unsigned int>
837  (this->get_dof_indices(var).size());
838 
839  // Get current local coefficients
840  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
841  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
842 
843  // Get finite element object
844  FEGenericBase<OutputShape> * fe = nullptr;
845  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
846 
847  // Build a FE for calculating u(p)
848  FEGenericBase<OutputShape> * fe_new =
849  this->build_new_fe( fe, p, tolerance );
850 
851  // Get the values of the shape function derivatives
852  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient>> & dphi = fe_new->get_dphi();
853 
854  grad_u = 0.0;
855 
856  for (unsigned int l=0; l != n_dofs; l++)
857  grad_u.add_scaled(dphi[l][0], coef(l));
858 
859  return;
860 }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:111
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subsolutions
Definition: diff_context.h:582
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
Definition: fem_context.C:1862

◆ point_hessian() [1/2]

Tensor libMesh::FEMContext::point_hessian ( unsigned int  var,
const Point p 
) const
inherited
Returns
The hessian of the solution variable var at the physical point p on the current element.
Note
This API currently present for backward compatibility.

Definition at line 866 of file fem_context.C.

Referenced by libMesh::ParsedFEMFunction< T >::eval_args().

867 {
868  Tensor hess_u;
869 
870  this->point_hessian( var, p, hess_u );
871 
872  return hess_u;
873 }
Tensor point_hessian(unsigned int var, const Point &p) const
Definition: fem_context.C:866
NumberTensorValue Tensor

◆ point_hessian() [2/2]

template<typename OutputType >
void libMesh::FEMContext::point_hessian ( unsigned int  var,
const Point p,
OutputType &  hess_u,
const Real  tolerance = TOLERANCE 
) const
inherited
Returns
The hessian of the solution variable var at the physical point p on the current element.
Note
This is the preferred API.

Allows evaluation of points within a relative tolerance outside the element.

Definition at line 877 of file fem_context.C.

References libMesh::DiffContext::_elem_subsolutions, libMesh::FEMContext::build_new_fe(), libMesh::DiffContext::get_dof_indices(), libMesh::FEMContext::get_elem_dim(), and libMesh::DiffContext::get_elem_solution().

881 {
882  typedef typename TensorTools::DecrementRank<OutputType>::type Rank1Decrement;
883  typedef typename TensorTools::DecrementRank<Rank1Decrement>::type Rank2Decrement;
884  typedef typename TensorTools::MakeReal<Rank2Decrement>::type OutputShape;
885 
886  // Get local-to-global dof index lookup
887  const unsigned int n_dofs = cast_int<unsigned int>
888  (this->get_dof_indices(var).size());
889 
890  // Get current local coefficients
891  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
892  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
893 
894  // Get finite element object
895  FEGenericBase<OutputShape> * fe = nullptr;
896  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
897 
898  // Build a FE for calculating u(p)
899  FEGenericBase<OutputShape> * fe_new =
900  this->build_new_fe( fe, p, tolerance );
901 
902  // Get the values of the shape function derivatives
903  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor>> & d2phi = fe_new->get_d2phi();
904 
905  hess_u = 0.0;
906 
907  for (unsigned int l=0; l != n_dofs; l++)
908  hess_u.add_scaled(d2phi[l][0], coef(l));
909 
910  return;
911 }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:111
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subsolutions
Definition: diff_context.h:582
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
Definition: fem_context.C:1862

◆ point_rate()

template<typename OutputType >
void libMesh::FEMContext::point_rate ( unsigned int  var,
const Point p,
OutputType &  u 
) const
inherited
Returns
The time derivative (rate) of the solution variable var at the physical point p on the current element.

◆ point_value() [1/2]

Number libMesh::FEMContext::point_value ( unsigned int  var,
const Point p 
) const
inherited
Returns
The value of the solution variable var at the physical point p on the current element.
Note
This API is currently present for backward compatibility.

Definition at line 768 of file fem_context.C.

Referenced by libMesh::ParsedFEMFunction< T >::eval_args().

769 {
770  Number u = 0.;
771 
772  this->point_value( var, p, u );
773 
774  return u;
775 }
Number point_value(unsigned int var, const Point &p) const
Definition: fem_context.C:768

◆ point_value() [2/2]

template<typename OutputType >
void libMesh::FEMContext::point_value ( unsigned int  var,
const Point p,
OutputType &  u,
const Real  tolerance = TOLERANCE 
) const
inherited
Returns
The value of the solution variable var at the physical point p on the current element.
Note
This is the preferred API.

Allows evaluation of points within a relative tolerance outside the element.

Definition at line 778 of file fem_context.C.

References libMesh::DiffContext::_elem_subsolutions, libMesh::FEMContext::build_new_fe(), libMesh::DiffContext::get_dof_indices(), libMesh::FEMContext::get_elem_dim(), and libMesh::DiffContext::get_elem_solution().

782 {
783  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
784 
785  // Get local-to-global dof index lookup
786  const unsigned int n_dofs = cast_int<unsigned int>
787  (this->get_dof_indices(var).size());
788 
789  // Get current local coefficients
790  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
791  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
792 
793  // Get finite element object
794  FEGenericBase<OutputShape> * fe = nullptr;
795  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
796 
797  // Build a FE for calculating u(p)
798  FEGenericBase<OutputShape> * fe_new =
799  this->build_new_fe( fe, p, tolerance );
800 
801  // Get the values of the shape function derivatives
802  const std::vector<std::vector<OutputShape>> & phi = fe_new->get_phi();
803 
804  u = 0.;
805 
806  for (unsigned int l=0; l != n_dofs; l++)
807  u += phi[l][0] * coef(l);
808 
809  return;
810 }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:111
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subsolutions
Definition: diff_context.h:582
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
Definition: fem_context.C:1862

◆ pre_fe_reinit()

void libMesh::FEMContext::pre_fe_reinit ( const System sys,
const Elem e 
)
virtualinherited

Reinitializes local data vectors/matrices on the current geometric element

Definition at line 1552 of file fem_context.C.

References libMesh::FEMContext::_custom_solution, libMesh::DiffContext::_elem_qoi_subderivatives, libMesh::DiffContext::_localized_vectors, libMesh::FEMContext::algebraic_type(), libMesh::FEMContext::CURRENT, libMesh::System::current_local_solution, libMesh::DofMap::dof_indices(), libMesh::FEMContext::DOFS_ONLY, libMesh::NumericVector< T >::get(), libMesh::DiffContext::get_dof_indices(), libMesh::System::get_dof_map(), libMesh::FEMContext::get_elem(), libMesh::DiffContext::get_elem_fixed_solution(), libMesh::DiffContext::get_elem_jacobian(), libMesh::DiffContext::get_elem_residual(), libMesh::DiffContext::get_elem_solution(), libMesh::DiffContext::get_elem_solution_accel(), libMesh::DiffContext::get_elem_solution_rate(), libMesh::DiffContext::get_qoi_derivatives(), libMesh::DifferentiablePhysics::get_second_order_vars(), libMesh::DifferentiableSystem::get_time_solver(), libMesh::DenseVector< T >::get_values(), libMesh::FEMContext::has_elem(), libMesh::TimeSolver::is_steady(), libMesh::System::n_qois(), libMesh::System::n_vars(), libMesh::FEMContext::NONE, libMesh::FEMContext::OLD, libMesh::DofMap::old_dof_indices(), libMesh::FEMContext::OLD_DOFS_ONLY, libMesh::DenseVector< T >::resize(), libMesh::DenseMatrix< T >::resize(), libMesh::FEMContext::set_elem(), libMesh::UnsteadySolver::time_order(), and libMesh::System::use_fixed_solution.

Referenced by libMesh::FEMSystem::assembly(), libMesh::FEMSystem::mesh_position_get(), libMesh::FEMSystem::mesh_position_set(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), and libMesh::System::project_vector().

1553 {
1554  this->set_elem(e);
1555 
1556  if (algebraic_type() == CURRENT ||
1558  {
1559  // Initialize the per-element data for elem.
1560  if (this->has_elem())
1561  sys.get_dof_map().dof_indices (&(this->get_elem()), this->get_dof_indices());
1562  else
1563  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1564  sys.get_dof_map().dof_indices
1565  (static_cast<Elem*>(nullptr), this->get_dof_indices());
1566  }
1567 #ifdef LIBMESH_ENABLE_AMR
1568  else if (algebraic_type() == OLD ||
1570  {
1571  // Initialize the per-element data for elem.
1572  if (this->has_elem())
1573  sys.get_dof_map().old_dof_indices (&(this->get_elem()), this->get_dof_indices());
1574  else
1575  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1576  sys.get_dof_map().old_dof_indices
1577  (static_cast<Elem*>(nullptr), this->get_dof_indices());
1578  }
1579 #endif // LIBMESH_ENABLE_AMR
1580 
1581  const unsigned int n_dofs = cast_int<unsigned int>
1582  (this->get_dof_indices().size());
1583  const unsigned int n_qoi = sys.n_qois();
1584 
1585  if (this->algebraic_type() != NONE &&
1586  this->algebraic_type() != DOFS_ONLY &&
1587  this->algebraic_type() != OLD_DOFS_ONLY)
1588  {
1589  // This also resizes elem_solution
1590  if (_custom_solution == nullptr)
1591  sys.current_local_solution->get(this->get_dof_indices(), this->get_elem_solution().get_values());
1592  else
1593  _custom_solution->get(this->get_dof_indices(), this->get_elem_solution().get_values());
1594 
1595  if (sys.use_fixed_solution)
1596  this->get_elem_fixed_solution().resize(n_dofs);
1597 
1598  // Only make space for these if we're using DiffSystem
1599  // This is assuming *only* DiffSystem is using elem_solution_rate/accel
1600  const DifferentiableSystem * diff_system = dynamic_cast<const DifferentiableSystem *>(&sys);
1601  if (diff_system)
1602  {
1603  // Now, we only need these if the solver is unsteady
1604  if (!diff_system->get_time_solver().is_steady())
1605  {
1606  this->get_elem_solution_rate().resize(n_dofs);
1607 
1608  // We only need accel space if the TimeSolver is second order
1609  const UnsteadySolver & time_solver = cast_ref<const UnsteadySolver &>(diff_system->get_time_solver());
1610 
1611  if (time_solver.time_order() >= 2 || !diff_system->get_second_order_vars().empty())
1612  this->get_elem_solution_accel().resize(n_dofs);
1613  }
1614  }
1615 
1616  if (algebraic_type() != OLD)
1617  {
1618  // These resize calls also zero out the residual and jacobian
1619  this->get_elem_residual().resize(n_dofs);
1620  this->get_elem_jacobian().resize(n_dofs, n_dofs);
1621 
1622  this->get_qoi_derivatives().resize(n_qoi);
1623  this->_elem_qoi_subderivatives.resize(n_qoi);
1624  for (std::size_t q=0; q != n_qoi; ++q)
1625  (this->get_qoi_derivatives())[q].resize(n_dofs);
1626  }
1627  }
1628 
1629  // Initialize the per-variable data for elem.
1630  {
1631  unsigned int sub_dofs = 0;
1632  for (unsigned int i=0; i != sys.n_vars(); ++i)
1633  {
1634  if (algebraic_type() == CURRENT ||
1636  {
1637  if (this->has_elem())
1638  sys.get_dof_map().dof_indices (&(this->get_elem()), this->get_dof_indices(i), i);
1639  else
1640  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1641  sys.get_dof_map().dof_indices
1642  (static_cast<Elem*>(nullptr), this->get_dof_indices(i), i);
1643  }
1644 #ifdef LIBMESH_ENABLE_AMR
1645  else if (algebraic_type() == OLD ||
1647  {
1648  if (this->has_elem())
1649  sys.get_dof_map().old_dof_indices (&(this->get_elem()), this->get_dof_indices(i), i);
1650  else
1651  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1652  sys.get_dof_map().old_dof_indices
1653  (static_cast<Elem*>(nullptr), this->get_dof_indices(i), i);
1654  }
1655 #endif // LIBMESH_ENABLE_AMR
1656 
1657  if (this->algebraic_type() != NONE &&
1658  this->algebraic_type() != DOFS_ONLY &&
1659  this->algebraic_type() != OLD_DOFS_ONLY)
1660  {
1661  const unsigned int n_dofs_var = cast_int<unsigned int>
1662  (this->get_dof_indices(i).size());
1663 
1664  this->get_elem_solution(i).reposition
1665  (sub_dofs, n_dofs_var);
1666 
1667  // Only make space for these if we're using DiffSystem
1668  // This is assuming *only* DiffSystem is using elem_solution_rate/accel
1669  const DifferentiableSystem * diff_system = dynamic_cast<const DifferentiableSystem *>(&sys);
1670  if (diff_system)
1671  {
1672  // Now, we only need these if the solver is unsteady
1673  if (!diff_system->get_time_solver().is_steady())
1674  {
1675  this->get_elem_solution_rate(i).reposition
1676  (sub_dofs, n_dofs_var);
1677 
1678  // We only need accel space if the TimeSolver is second order
1679  const UnsteadySolver & time_solver = cast_ref<const UnsteadySolver &>(diff_system->get_time_solver());
1680 
1681  if (time_solver.time_order() >= 2 || !diff_system->get_second_order_vars().empty())
1682  this->get_elem_solution_accel(i).reposition
1683  (sub_dofs, n_dofs_var);
1684  }
1685  }
1686 
1687  if (sys.use_fixed_solution)
1688  this->get_elem_fixed_solution(i).reposition
1689  (sub_dofs, n_dofs_var);
1690 
1691  if (algebraic_type() != OLD)
1692  {
1693  this->get_elem_residual(i).reposition
1694  (sub_dofs, n_dofs_var);
1695 
1696  for (std::size_t q=0; q != n_qoi; ++q)
1697  this->get_qoi_derivatives(q,i).reposition
1698  (sub_dofs, n_dofs_var);
1699 
1700  for (unsigned int j=0; j != i; ++j)
1701  {
1702  const unsigned int n_dofs_var_j =
1703  cast_int<unsigned int>
1704  (this->get_dof_indices(j).size());
1705 
1706  this->get_elem_jacobian(i,j).reposition
1707  (sub_dofs, this->get_elem_residual(j).i_off(),
1708  n_dofs_var, n_dofs_var_j);
1709  this->get_elem_jacobian(j,i).reposition
1710  (this->get_elem_residual(j).i_off(), sub_dofs,
1711  n_dofs_var_j, n_dofs_var);
1712  }
1713  this->get_elem_jacobian(i,i).reposition
1714  (sub_dofs, sub_dofs,
1715  n_dofs_var,
1716  n_dofs_var);
1717  }
1718 
1719  sub_dofs += n_dofs_var;
1720  }
1721  }
1722 
1723  if (this->algebraic_type() != NONE &&
1724  this->algebraic_type() != DOFS_ONLY &&
1725  this->algebraic_type() != OLD &&
1726  this->algebraic_type() != OLD_DOFS_ONLY)
1727  libmesh_assert_equal_to (sub_dofs, n_dofs);
1728  }
1729 
1730  // Now do the localization for the user requested vectors
1731  if (this->algebraic_type() != NONE &&
1732  this->algebraic_type() != DOFS_ONLY &&
1733  this->algebraic_type() != OLD_DOFS_ONLY)
1734  {
1735  DiffContext::localized_vectors_iterator localized_vec_it = this->_localized_vectors.begin();
1736  const DiffContext::localized_vectors_iterator localized_vec_end = this->_localized_vectors.end();
1737 
1738  for (; localized_vec_it != localized_vec_end; ++localized_vec_it)
1739  {
1740  const NumericVector<Number> & current_localized_vector = *localized_vec_it->first;
1741  DenseVector<Number> & target_vector = localized_vec_it->second.first;
1742 
1743  current_localized_vector.get(this->get_dof_indices(), target_vector.get_values());
1744 
1745  // Initialize the per-variable data for elem.
1746  unsigned int sub_dofs = 0;
1747  for (unsigned int i=0; i != sys.n_vars(); ++i)
1748  {
1749  const unsigned int n_dofs_var = cast_int<unsigned int>
1750  (this->get_dof_indices(i).size());
1751 
1752  // This is redundant with earlier initialization, isn't it? - RHS
1753  // sys.get_dof_map().dof_indices (&(this->get_elem()), this->get_dof_indices(i), i);
1754 
1755  localized_vec_it->second.second[i]->reposition
1756  (sub_dofs, n_dofs_var);
1757 
1758  sub_dofs += n_dofs_var;
1759  }
1760  libmesh_assert_equal_to (sub_dofs, n_dofs);
1761  }
1762  }
1763 }
const DenseMatrix< Number > & get_elem_jacobian() const
Definition: diff_context.h:283
const NumericVector< Number > * _custom_solution
Definition: fem_context.h:1004
void set_elem(const Elem *e)
Definition: fem_context.C:1765
virtual void get(const std::vector< numeric_index_type > &index, T *values) const
const DenseVector< Number > & get_elem_fixed_solution() const
Definition: diff_context.h:215
const DenseVector< Number > & get_elem_solution_rate() const
Definition: diff_context.h:145
const Elem & get_elem() const
Definition: fem_context.h:871
void resize(const unsigned int n)
Definition: dense_vector.h:355
std::vector< std::vector< std::unique_ptr< DenseSubVector< Number > > > > _elem_qoi_subderivatives
Definition: diff_context.h:626
std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< std::unique_ptr< DenseSubVector< Number > > > > > _localized_vectors
Definition: diff_context.h:575
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:111
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367
const DenseVector< Number > & get_elem_residual() const
Definition: diff_context.h:249
const DenseVector< Number > & get_elem_solution_accel() const
Definition: diff_context.h:180
void resize(const unsigned int new_m, const unsigned int new_n)
Definition: dense_matrix.h:792
AlgebraicType algebraic_type() const
Definition: fem_context.h:954
const std::vector< DenseVector< Number > > & get_qoi_derivatives() const
Definition: diff_context.h:331
bool has_elem() const
Definition: fem_context.h:865
std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< std::unique_ptr< DenseSubVector< Number > > > > >::iterator localized_vectors_iterator
Definition: diff_context.h:544

◆ set_algebraic_type()

void libMesh::FEMContext::set_algebraic_type ( const AlgebraicType  atype)
inlineinherited

Setting which determines whether to initialize algebraic structures (elem_*) on each element and set their values from current_local_solution. Algebraic initialization may be disabled for efficiency in cases where FEMContext is only used as a convenient container of FE objects.

Definition at line 948 of file fem_context.h.

References libMesh::FEMContext::_atype.

Referenced by libMesh::OldSolutionBase< Output, point_output >::init_context().

949  { _atype = atype; }
AlgebraicType _atype
Definition: fem_context.h:999

◆ set_custom_solution()

void libMesh::FEMContext::set_custom_solution ( const NumericVector< Number > *  custom_sol)
inlineinherited

Set a NumericVector to be used in place of current_local_solution for calculating elem_solution. Set to nullptr to restore the current_local_solution behavior. Advanced DifferentiableSystem specific capabilities will only be enabled in the current_local_solution case.

Definition at line 963 of file fem_context.h.

References libMesh::FEMContext::_custom_solution.

964  { _custom_solution = custom_sol; }
const NumericVector< Number > * _custom_solution
Definition: fem_context.h:1004

◆ set_deltat_pointer()

void libMesh::DiffContext::set_deltat_pointer ( Real dt)
inherited

Points the _deltat member of this class at a timestep value stored in the creating System, for example DiffSystem::deltat

Definition at line 103 of file diff_context.C.

References libMesh::DiffContext::_deltat.

Referenced by libMesh::FEMSystem::build_context(), libMesh::DifferentiableSystem::build_context(), and libMesh::FEMSystem::init_context().

104 {
105  // We may actually want to be able to set this pointer to nullptr, so
106  // don't report an error for that.
107  _deltat = dt;
108 }

◆ set_elem()

void libMesh::FEMContext::set_elem ( const Elem e)
protectedinherited

Helper function to promote accessor usage

Definition at line 1765 of file fem_context.C.

References libMesh::FEMContext::_elem, libMesh::FEMContext::_elem_dim, and libMesh::Elem::dim().

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

1766 {
1767  this->_elem = e;
1768 
1769  // If e is nullptr, we assume it's SCALAR and set _elem_dim to 0.
1770  this->_elem_dim =
1771  cast_int<unsigned char>(this->_elem ? this->_elem->dim() : 0);
1772 }
unsigned char _elem_dim
Definition: fem_context.h:1129
virtual unsigned short dim() const =0
const Elem * _elem
Definition: fem_context.h:1119

◆ set_mesh_system()

virtual void libMesh::FEMContext::set_mesh_system ( System sys)
inlinevirtualinherited

Tells the FEMContext that system sys contains the isoparametric Lagrangian variables which correspond to the coordinates of mesh nodes, in problems where the mesh itself is expected to move in time.

This should be set automatically if the FEMPhysics requires it.

Definition at line 805 of file fem_context.h.

References libMesh::FEMContext::_mesh_sys.

Referenced by libMesh::FEMSystem::build_context().

806  { this->_mesh_sys = sys; }

◆ set_mesh_x_var()

void libMesh::FEMContext::set_mesh_x_var ( unsigned int  x_var)
inlineinherited

Accessor for x-variable of moving mesh System

This should be set automatically if the FEMPhysics requires it.

Definition at line 831 of file fem_context.h.

References libMesh::FEMContext::_mesh_x_var.

Referenced by libMesh::FEMSystem::build_context().

832  { _mesh_x_var = x_var; }
unsigned int _mesh_x_var
Definition: fem_context.h:974

◆ set_mesh_y_var()

void libMesh::FEMContext::set_mesh_y_var ( unsigned int  y_var)
inlineinherited

Accessor for y-variable of moving mesh System

This should be set automatically if the FEMPhysics requires it.

Definition at line 845 of file fem_context.h.

References libMesh::FEMContext::_mesh_y_var.

Referenced by libMesh::FEMSystem::build_context().

846  { _mesh_y_var = y_var; }
unsigned int _mesh_y_var
Definition: fem_context.h:974

◆ set_mesh_z_var()

void libMesh::FEMContext::set_mesh_z_var ( unsigned int  z_var)
inlineinherited

Accessor for z-variable of moving mesh System

This should be set automatically if the FEMPhysics requires it.

Definition at line 859 of file fem_context.h.

References libMesh::FEMContext::_mesh_z_var.

Referenced by libMesh::FEMSystem::build_context().

860  { _mesh_z_var = z_var; }
unsigned int _mesh_z_var
Definition: fem_context.h:974

◆ set_neighbor()

void libMesh::DGFEMContext::set_neighbor ( const Elem neighbor)
inline

Set the neighbor element which we will use to assemble DG terms.

Note
We do not assume that this element is get_elem().neighbor(side) because we also need to be able to handle the special case of DG terms on "cracks" in a mesh to model certain types of interface conditions. In this case, we need to be able to specify the neighbor element manually. Also, this should give us more flexibility to handle non-conforming meshes.

Definition at line 220 of file dg_fem_context.h.

References _neighbor.

221  { _neighbor = &neighbor; }

◆ set_time()

void libMesh::DiffContext::set_time ( Real  time_in)
inlineinherited

Set the time for which the current nonlinear_solution is defined.

Definition at line 427 of file diff_context.h.

References libMesh::DiffContext::time.

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

428  { time = time_in; }

◆ side_accel()

template<typename OutputType >
template void libMesh::FEMContext::side_accel< Gradient > ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
inherited
Returns
The second time derivative (acceleration) of the solution variable var at the quadrature point qp on the current element side.

Definition at line 1287 of file fem_context.C.

References libMesh::DiffContext::get_elem_solution_accel(), libMesh::FEMContext::get_side_fe(), and libMesh::FEMContext::some_value().

1289 {
1290  this->some_value<OutputType,
1294 }
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:299
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:214
const DenseVector< Number > & get_elem_solution_accel() const
Definition: diff_context.h:180

◆ side_boundary_ids() [1/2]

std::vector< boundary_id_type > libMesh::FEMContext::side_boundary_ids ( ) const
inherited

Lists the boundary ids found on the current side

Deprecated:
Instead, use the version that takes a reference to a std::set.

Definition at line 196 of file fem_context.C.

References libMesh::FEMContext::_boundary_info, libMesh::BoundaryInfo::boundary_ids(), libMesh::FEMContext::get_elem(), and libMesh::FEMContext::side.

197 {
198  libmesh_deprecated();
199  return _boundary_info.boundary_ids(&(this->get_elem()), side);
200 }
const Elem & get_elem() const
Definition: fem_context.h:871
std::vector< boundary_id_type > boundary_ids(const Node *node) const
const BoundaryInfo & _boundary_info
Definition: fem_context.h:1114
unsigned char side
Definition: fem_context.h:979

◆ side_boundary_ids() [2/2]

void libMesh::FEMContext::side_boundary_ids ( std::vector< boundary_id_type > &  vec_to_fill) const
inherited

As above, but fills in the std::set provided by the user.

Definition at line 204 of file fem_context.C.

References libMesh::FEMContext::_boundary_info, libMesh::BoundaryInfo::boundary_ids(), libMesh::FEMContext::get_elem(), and libMesh::FEMContext::side.

205 {
206  _boundary_info.boundary_ids(&(this->get_elem()), side, vec_to_fill);
207 }
const Elem & get_elem() const
Definition: fem_context.h:871
std::vector< boundary_id_type > boundary_ids(const Node *node) const
const BoundaryInfo & _boundary_info
Definition: fem_context.h:1114
unsigned char side
Definition: fem_context.h:979

◆ side_fe_reinit()

void libMesh::DGFEMContext::side_fe_reinit ( )
overridevirtual

Override side_fe_reinit to set a boolean flag so that by default DG terms are assumed to be inactive. DG terms are only active if neighbor_side_fe_reinit is called.

Reimplemented from libMesh::FEMContext.

Definition at line 77 of file dg_fem_context.C.

References _dg_terms_active, and libMesh::FEMContext::side_fe_reinit().

78 {
80 
81  // By default we assume that the DG terms are inactive
82  // They are only active if neighbor_side_fe_reinit is called
83  _dg_terms_active = false;
84 }
virtual void side_fe_reinit()
Definition: fem_context.C:1383

◆ side_gradient() [1/2]

Gradient libMesh::FEMContext::side_gradient ( unsigned int  var,
unsigned int  qp 
) const
inherited
Returns
The gradient of the solution variable var at the quadrature point qp on the current element side.
Note
This API is currently present for backward compatibility.

Definition at line 613 of file fem_context.C.

614 {
615  Gradient du;
616 
617  this->side_gradient( var, qp, du );
618 
619  return du;
620 }
NumberVectorValue Gradient
Gradient side_gradient(unsigned int var, unsigned int qp) const
Definition: fem_context.C:613

◆ side_gradient() [2/2]

template<typename OutputType >
void libMesh::FEMContext::side_gradient ( unsigned int  var,
unsigned int  qp,
OutputType &  du 
) const
inherited
Returns
The gradient of the solution variable var at the quadrature point qp on the current element side.
Note
This is the preferred API.

Definition at line 624 of file fem_context.C.

References libMesh::DiffContext::_elem_subsolutions, libMesh::DiffContext::get_dof_indices(), libMesh::FEGenericBase< OutputType >::get_dphi(), libMesh::FEMContext::get_elem_dim(), and libMesh::DiffContext::get_elem_solution().

626 {
627  typedef typename TensorTools::MakeReal
629  OutputShape;
630 
631  // Get local-to-global dof index lookup
632  const unsigned int n_dofs = cast_int<unsigned int>
633  (this->get_dof_indices(var).size());
634 
635  // Get current local coefficients
636  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
637  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
638 
639  // Get finite element object
640  FEGenericBase<OutputShape> * the_side_fe = nullptr;
641  this->get_side_fe<OutputShape>( var, the_side_fe, this->get_elem_dim() );
642 
643  // Get shape function values at quadrature point
644  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient>> & dphi = the_side_fe->get_dphi();
645 
646  // Accumulate solution derivatives
647  du = 0.;
648 
649  for (unsigned int l=0; l != n_dofs; l++)
650  du.add_scaled(dphi[l][qp], coef(l));
651 
652  return;
653 }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:111
std::vector< std::unique_ptr< DenseSubVector< Number > > > _elem_subsolutions
Definition: diff_context.h:582
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367

◆ side_gradients()

template<typename OutputType >
template void libMesh::FEMContext::side_gradients< Tensor > ( unsigned int  var,
const NumericVector< Number > &  _system_vector,
std::vector< OutputType > &  side_gradients_vector 
) const
inherited

Fills a vector with the gradient of the solution variable var at all the quadrature points on the current element side.

Note
This is the preferred API.

Definition at line 658 of file fem_context.C.

References libMesh::DiffContext::get_dof_indices(), libMesh::FEGenericBase< OutputType >::get_dphi(), libMesh::FEMContext::get_elem_dim(), and libMesh::DiffContext::get_localized_subvector().

661 {
662  typedef typename TensorTools::MakeReal
664  OutputShape;
665 
666  // Get local-to-global dof index lookup
667  const unsigned int n_dofs = cast_int<unsigned int>
668  (this->get_dof_indices(var).size());
669 
670  // Get current local coefficients
671  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
672 
673  // Get finite element object
674  FEGenericBase<OutputShape> * the_side_fe = nullptr;
675  this->get_side_fe<OutputShape>( var, the_side_fe, this->get_elem_dim() );
676 
677  // Get shape function values at quadrature point
678  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient>> & dphi = the_side_fe->get_dphi();
679 
680  // Loop over all the q_points in this finite element
681  for (std::size_t qp=0; qp != du_vals.size(); qp++)
682  {
683  OutputType & du = du_vals[qp];
684 
685  du = 0;
686 
687  // Compute the gradient at this q_point
688  for (unsigned int l=0; l != n_dofs; l++)
689  du.add_scaled(dphi[l][qp], coef(l));
690  }
691 
692  return;
693 }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367
DenseSubVector< Number > & get_localized_subvector(const NumericVector< Number > &localized_vector, unsigned int var)
Definition: diff_context.C:148

◆ side_hessian() [1/2]

Tensor libMesh::FEMContext::side_hessian ( unsigned int  var,
unsigned int  qp 
) const
inherited
Returns
The hessian of the solution variable var at the quadrature point qp on the current element side.
Note
This API is currently present for backward compatibility.

Definition at line 696 of file fem_context.C.

698 {
699  Tensor d2u;
700 
701  this->side_hessian( var, qp, d2u );
702 
703  return d2u;
704 }
Tensor side_hessian(unsigned int var, unsigned int qp) const
Definition: fem_context.C:696
NumberTensorValue Tensor

◆ side_hessian() [2/2]

template<typename OutputType >
void libMesh::FEMContext::side_hessian ( unsigned int  var,
unsigned int  qp,
OutputType &  d2u 
) const
inherited
Returns
The hessian of the solution variable var at the quadrature point qp on the current element side.
Note
This is the preferred API.

Definition at line 709 of file fem_context.C.

References libMesh::DiffContext::get_elem_solution(), libMesh::FEMContext::get_side_fe(), and libMesh::FEMContext::some_hessian().

712 {
713  this->some_hessian<OutputType,
715  <typename TensorTools::MakeReal
716  <typename TensorTools::DecrementRank
717  <typename TensorTools::DecrementRank
718  <OutputType>::type>::type>::type>,
719  &DiffContext::get_elem_solution>(var, qp, d2u);
720 }
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:299
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:111
void some_hessian(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:276

◆ side_hessians()

template<typename OutputType >
template void libMesh::FEMContext::side_hessians< Tensor > ( unsigned int  var,
const NumericVector< Number > &  _system_vector,
std::vector< OutputType > &  d2u_vals 
) const
inherited

Fills a vector of hessians of the _system_vector at the all the quadrature points on the current element side. This is the preferred API.

Definition at line 725 of file fem_context.C.

References libMesh::FEGenericBase< OutputType >::get_d2phi(), libMesh::DiffContext::get_dof_indices(), libMesh::FEMContext::get_elem_dim(), and libMesh::DiffContext::get_localized_subvector().

728 {
729  typedef typename TensorTools::DecrementRank<OutputType>::type Rank1Decrement;
730  typedef typename TensorTools::DecrementRank<Rank1Decrement>::type Rank2Decrement;
731  typedef typename TensorTools::MakeReal<Rank2Decrement>::type OutputShape;
732 
733  // Get local-to-global dof index lookup
734  const unsigned int n_dofs = cast_int<unsigned int>
735  (this->get_dof_indices(var).size());
736 
737  // Get current local coefficients
738  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
739 
740  // Get finite element object
741  FEGenericBase<OutputShape> * the_side_fe = nullptr;
742  this->get_side_fe<OutputShape>( var, the_side_fe, this->get_elem_dim() );
743 
744  // Get shape function values at quadrature point
745  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor>> & d2phi = the_side_fe->get_d2phi();
746 
747  // Loop over all the q_points in this finite element
748  for (std::size_t qp=0; qp != d2u_vals.size(); qp++)
749  {
750  OutputType & d2u = d2u_vals[qp];
751 
752  // Compute the gradient at this q_point
753  d2u = 0;
754 
755  for (unsigned int l=0; l != n_dofs; l++)
756  d2u.add_scaled(d2phi[l][qp], coef(l));
757  }
758 
759  return;
760 }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367
DenseSubVector< Number > & get_localized_subvector(const NumericVector< Number > &localized_vector, unsigned int var)
Definition: diff_context.C:148

◆ side_rate()

template<typename OutputType >
template void libMesh::FEMContext::side_rate< Gradient > ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
inherited
Returns
The time derivative (rate) of the solution variable var at the quadrature point qp on the current element side.

Definition at line 1265 of file fem_context.C.

References libMesh::DiffContext::get_elem_solution_rate(), libMesh::FEMContext::get_side_fe(), and libMesh::FEMContext::some_value().

1267 {
1268  this->some_value<OutputType,
1272 }
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:299
const DenseVector< Number > & get_elem_solution_rate() const
Definition: diff_context.h:145
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:214

◆ side_value() [1/2]

Number libMesh::FEMContext::side_value ( unsigned int  var,
unsigned int  qp 
) const
inherited
Returns
The value of the solution variable var at the quadrature point qp on the current element side.
Note
This API currently is present for backward compatibility.

Definition at line 555 of file fem_context.C.

557 {
558  Number u = 0.;
559 
560  this->side_value( var, qp, u );
561 
562  return u;
563 }
Number side_value(unsigned int var, unsigned int qp) const
Definition: fem_context.C:555

◆ side_value() [2/2]

template<typename OutputType >
void libMesh::FEMContext::side_value ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
inherited
Returns
The value of the solution variable var at the quadrature point qp on the current element side.
Note
This is the preferred API.

Definition at line 567 of file fem_context.C.

References libMesh::DiffContext::get_elem_solution(), and libMesh::FEMContext::some_value().

570 {
571  this->some_value<OutputType,
572  &FEMContext::get_side_fe<typename TensorTools::MakeReal<OutputType>::type>,
573  &DiffContext::get_elem_solution>(var, qp, u);
574 }
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:111
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:214

◆ side_values()

template<typename OutputType >
template void libMesh::FEMContext::side_values< Gradient > ( unsigned int  var,
const NumericVector< Number > &  _system_vector,
std::vector< OutputType > &  side_values_vector 
) const
inherited

Fills a vector of values of the _system_vector at the all the quadrature points on the current element side.

Definition at line 578 of file fem_context.C.

References libMesh::DiffContext::get_dof_indices(), libMesh::FEMContext::get_elem_dim(), libMesh::DiffContext::get_localized_subvector(), and libMesh::FEGenericBase< OutputType >::get_phi().

581 {
582  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
583 
584  // Get local-to-global dof index lookup
585  const unsigned int n_dofs = cast_int<unsigned int>
586  (this->get_dof_indices(var).size());
587 
588  // Get current local coefficients
589  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
590 
591  // Get the finite element object
592  FEGenericBase<OutputShape> * the_side_fe = nullptr;
593  this->get_side_fe<OutputShape>( var, the_side_fe, this->get_elem_dim() );
594 
595  // Get shape function values at quadrature point
596  const std::vector<std::vector<OutputShape>> & phi = the_side_fe->get_phi();
597 
598  // Loop over all the q_points on this element
599  for (std::size_t qp=0; qp != u_vals.size(); qp++)
600  {
601  OutputType & u = u_vals[qp];
602 
603  // Compute the value at this q_point
604  u = 0.;
605 
606  for (unsigned int l=0; l != n_dofs; l++)
607  u += phi[l][qp] * coef(l);
608  }
609 
610  return;
611 }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367
DenseSubVector< Number > & get_localized_subvector(const NumericVector< Number > &localized_vector, unsigned int var)
Definition: diff_context.C:148

◆ some_gradient()

template<typename OutputType , typename FEMContext::FENeeded< OutputType >::grad_getter fe_getter, FEMContext::diff_subsolution_getter subsolution_getter>
void libMesh::FEMContext::some_gradient ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
protectedinherited

Helper function to reduce some code duplication in the *interior_gradient methods.

Definition at line 243 of file fem_context.C.

References libMesh::DiffContext::get_dof_indices(), libMesh::FEGenericBase< OutputType >::get_dphi(), and libMesh::FEMContext::get_elem_dim().

Referenced by libMesh::FEMContext::fixed_interior_gradient(), libMesh::FEMContext::fixed_side_gradient(), and libMesh::FEMContext::interior_gradient().

244 {
245  // Get local-to-global dof index lookup
246  const unsigned int n_dofs = cast_int<unsigned int>
247  (this->get_dof_indices(var).size());
248 
249  // Get current local coefficients
250  const DenseSubVector<Number> & coef = (this->*subsolution_getter)(var);
251 
252  // Get finite element object
253  typename FENeeded<OutputType>::grad_base * fe = nullptr;
254  (this->*fe_getter)( var, fe, this->get_elem_dim() );
255 
256  // Get shape function values at quadrature point
257  const std::vector<std::vector
259  & dphi = fe->get_dphi();
260 
261  // Accumulate solution derivatives
262  du = 0;
263 
264  for (unsigned int l=0; l != n_dofs; l++)
265  du.add_scaled(dphi[l][qp], coef(l));
266 
267  return;
268 }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
TensorTools::IncrementRank< OutputShape >::type OutputGradient
Definition: fe_base.h:120
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367
FEGenericBase< grad_shape > grad_base
Definition: fem_context.h:1050

◆ some_hessian()

template<typename OutputType , typename FEMContext::FENeeded< OutputType >::hess_getter fe_getter, FEMContext::diff_subsolution_getter subsolution_getter>
void libMesh::FEMContext::some_hessian ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
protectedinherited

Helper function to reduce some code duplication in the *interior_hessian methods.

Definition at line 276 of file fem_context.C.

References libMesh::FEGenericBase< OutputType >::get_d2phi(), libMesh::DiffContext::get_dof_indices(), and libMesh::FEMContext::get_elem_dim().

Referenced by libMesh::FEMContext::fixed_interior_hessian(), libMesh::FEMContext::fixed_side_hessian(), libMesh::FEMContext::interior_hessian(), and libMesh::FEMContext::side_hessian().

277 {
278  // Get local-to-global dof index lookup
279  const unsigned int n_dofs = cast_int<unsigned int>
280  (this->get_dof_indices(var).size());
281 
282  // Get current local coefficients
283  const DenseSubVector<Number> & coef = (this->*subsolution_getter)(var);
284 
285  // Get finite element object
286  typename FENeeded<OutputType>::hess_base * fe = nullptr;
287  (this->*fe_getter)( var, fe, this->get_elem_dim() );
288 
289  // Get shape function values at quadrature point
290  const std::vector<std::vector
292  & d2phi = fe->get_d2phi();
293 
294  // Accumulate solution second derivatives
295  d2u = 0.0;
296 
297  for (unsigned int l=0; l != n_dofs; l++)
298  d2u.add_scaled(d2phi[l][qp], coef(l));
299 
300  return;
301 }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
FEGenericBase< hess_shape > hess_base
Definition: fem_context.h:1055
TensorTools::IncrementRank< OutputGradient >::type OutputTensor
Definition: fe_base.h:121
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367

◆ some_value()

template<typename OutputType , typename FEMContext::FENeeded< OutputType >::value_getter fe_getter, FEMContext::diff_subsolution_getter subsolution_getter>
void libMesh::FEMContext::some_value ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
protectedinherited

Helper function to reduce some code duplication in the *interior_value methods.

Definition at line 214 of file fem_context.C.

References libMesh::DiffContext::get_dof_indices(), libMesh::FEMContext::get_elem_dim(), and libMesh::FEGenericBase< OutputType >::get_phi().

Referenced by libMesh::FEMContext::fixed_interior_value(), libMesh::FEMContext::fixed_side_value(), libMesh::FEMContext::interior_accel(), libMesh::FEMContext::interior_rate(), libMesh::FEMContext::interior_value(), libMesh::FEMContext::side_accel(), libMesh::FEMContext::side_rate(), and libMesh::FEMContext::side_value().

215 {
216  // Get local-to-global dof index lookup
217  const unsigned int n_dofs = cast_int<unsigned int>
218  (this->get_dof_indices(var).size());
219 
220  // Get current local coefficients
221  const DenseSubVector<Number> & coef = (this->*subsolution_getter)(var);
222 
223  // Get finite element object
224  typename FENeeded<OutputType>::value_base * fe = nullptr;
225  (this->*fe_getter)( var, fe, this->get_elem_dim() );
226 
227  // Get shape function values at quadrature point
228  const std::vector<std::vector
229  <typename FENeeded<OutputType>::value_shape>> & phi = fe->get_phi();
230 
231  // Accumulate solution value
232  u = 0.;
233 
234  for (unsigned int l=0; l != n_dofs; l++)
235  u += phi[l][qp] * coef(l);
236 }
unsigned char get_elem_dim() const
Definition: fem_context.h:906
TensorTools::MakeReal< OutputType >::type value_shape
Definition: fem_context.h:1044
FEGenericBase< value_shape > value_base
Definition: fem_context.h:1045
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:367

Member Data Documentation

◆ _atype

AlgebraicType libMesh::FEMContext::_atype
protectedinherited

Keep track of what type of algebra reinitialization is to be done

Definition at line 999 of file fem_context.h.

Referenced by libMesh::FEMContext::algebraic_type(), and libMesh::FEMContext::set_algebraic_type().

◆ _boundary_info

const BoundaryInfo& libMesh::FEMContext::_boundary_info
protectedinherited

Saved reference to BoundaryInfo on the mesh for this System. Used to answer boundary id requests.

Definition at line 1114 of file fem_context.h.

Referenced by libMesh::FEMContext::has_side_boundary_id(), and libMesh::FEMContext::side_boundary_ids().

◆ _custom_solution

const NumericVector<Number>* libMesh::FEMContext::_custom_solution
protectedinherited

Data with which to do algebra reinitialization

Definition at line 1004 of file fem_context.h.

Referenced by libMesh::FEMContext::pre_fe_reinit(), and libMesh::FEMContext::set_custom_solution().

◆ _dg_terms_active

bool libMesh::DGFEMContext::_dg_terms_active
private

Boolean flag to indicate whether or not the DG terms have been assembled and should be used in the global matrix assembly.

Definition at line 296 of file dg_fem_context.h.

Referenced by dg_terms_are_active(), neighbor_side_fe_reinit(), and side_fe_reinit().

◆ _dim

unsigned char libMesh::FEMContext::_dim
protectedinherited

Cached dimension of largest dimension element in this mesh

Definition at line 1124 of file fem_context.h.

Referenced by DGFEMContext(), and libMesh::FEMContext::get_dim().

◆ _dof_indices

std::vector<dof_id_type> libMesh::DiffContext::_dof_indices
protectedinherited

Global Degree of freedom index lists

Definition at line 637 of file diff_context.h.

Referenced by libMesh::DiffContext::get_dof_indices(), and libMesh::DiffContext::n_dof_indices().

◆ _dof_indices_var

std::vector<std::vector<dof_id_type> > libMesh::DiffContext::_dof_indices_var
protectedinherited

◆ _edge_fe

std::map<FEType, std::unique_ptr<FEAbstract> > libMesh::FEMContext::_edge_fe
protectedinherited

◆ _edge_fe_var

std::vector<FEAbstract *> libMesh::FEMContext::_edge_fe_var
protectedinherited

◆ _edge_qrule

std::unique_ptr<QBase> libMesh::FEMContext::_edge_qrule
protectedinherited

Quadrature rules for element edges. If the FEM context is told to prepare for edge integration on 3D elements, it will try to find a quadrature rule that correctly integrates all variables. Because edge rules only apply to 3D elements, we don't need to worry about multiple dimensions

Definition at line 1160 of file fem_context.h.

Referenced by libMesh::FEMContext::get_edge_qrule(), and libMesh::FEMContext::init_internal_data().

◆ _elem

const Elem* libMesh::FEMContext::_elem
protectedinherited

Current element for element_* to examine

Definition at line 1119 of file fem_context.h.

Referenced by libMesh::FEMContext::get_elem(), libMesh::FEMContext::has_elem(), and libMesh::FEMContext::set_elem().

◆ _elem_dim

unsigned char libMesh::FEMContext::_elem_dim
protectedinherited

Cached dimension of this->_elem.

Definition at line 1129 of file fem_context.h.

Referenced by libMesh::FEMContext::get_elem_dim(), and libMesh::FEMContext::set_elem().

◆ _elem_dims

std::set<unsigned char> libMesh::FEMContext::_elem_dims
protectedinherited

Cached dimensions of elements in the mesh, plus dimension 0 if SCALAR variables are in use.

Definition at line 1135 of file fem_context.h.

Referenced by libMesh::FEMContext::elem_dimensions(), and libMesh::FEMContext::init_internal_data().

◆ _elem_elem_jacobian

DenseMatrix<Number> libMesh::DGFEMContext::_elem_elem_jacobian
private

The DG Jacobian terms. Trial and test functions come from either element or neighbor.

Definition at line 257 of file dg_fem_context.h.

Referenced by DGFEMContext(), get_elem_elem_jacobian(), and neighbor_side_fe_reinit().

◆ _elem_elem_subjacobians

std::vector<std::vector<std::unique_ptr<DenseSubMatrix<Number> > > > libMesh::DGFEMContext::_elem_elem_subjacobians
private

Definition at line 266 of file dg_fem_context.h.

Referenced by DGFEMContext(), get_elem_elem_jacobian(), and neighbor_side_fe_reinit().

◆ _elem_fixed_solution

DenseVector<Number> libMesh::DiffContext::_elem_fixed_solution
protectedinherited

Element by element components of nonlinear_solution at a fixed point in a timestep, for optional use by e.g. stabilized methods

Definition at line 603 of file diff_context.h.

Referenced by libMesh::DiffContext::DiffContext(), and libMesh::DiffContext::get_elem_fixed_solution().

◆ _elem_fixed_subsolutions

◆ _elem_jacobian

DenseMatrix<Number> libMesh::DiffContext::_elem_jacobian
protectedinherited

Element jacobian: derivatives of elem_residual with respect to elem_solution

Definition at line 615 of file diff_context.h.

Referenced by libMesh::DiffContext::DiffContext(), and libMesh::DiffContext::get_elem_jacobian().

◆ _elem_neighbor_jacobian

DenseMatrix<Number> libMesh::DGFEMContext::_elem_neighbor_jacobian
private

◆ _elem_neighbor_subjacobians

std::vector<std::vector<std::unique_ptr<DenseSubMatrix<Number> > > > libMesh::DGFEMContext::_elem_neighbor_subjacobians
private

◆ _elem_qoi

std::vector<Number> libMesh::DiffContext::_elem_qoi
protectedinherited

Element quantity of interest contributions

Definition at line 620 of file diff_context.h.

Referenced by libMesh::DiffContext::DiffContext(), and libMesh::DiffContext::get_qois().

◆ _elem_qoi_derivative

std::vector<DenseVector<Number> > libMesh::DiffContext::_elem_qoi_derivative
protectedinherited

Element quantity of interest derivative contributions

Definition at line 625 of file diff_context.h.

Referenced by libMesh::DiffContext::DiffContext(), and libMesh::DiffContext::get_qoi_derivatives().

◆ _elem_qoi_subderivatives

std::vector<std::vector<std::unique_ptr<DenseSubVector<Number> > > > libMesh::DiffContext::_elem_qoi_subderivatives
protectedinherited

◆ _elem_residual

DenseVector<Number> libMesh::DiffContext::_elem_residual
protectedinherited

Element residual vector

Definition at line 609 of file diff_context.h.

Referenced by libMesh::DiffContext::DiffContext(), and libMesh::DiffContext::get_elem_residual().

◆ _elem_solution

DenseVector<Number> libMesh::DiffContext::_elem_solution
protectedinherited

Element by element components of nonlinear_solution as adjusted by a time_solver

Definition at line 581 of file diff_context.h.

Referenced by libMesh::DiffContext::DiffContext(), and libMesh::DiffContext::get_elem_solution().

◆ _elem_solution_accel

DenseVector<Number> libMesh::DiffContext::_elem_solution_accel
protectedinherited

Element by element components of du/dt as adjusted by a time_solver

Definition at line 595 of file diff_context.h.

Referenced by libMesh::DiffContext::DiffContext(), and libMesh::DiffContext::get_elem_solution_accel().

◆ _elem_solution_rate

DenseVector<Number> libMesh::DiffContext::_elem_solution_rate
protectedinherited

Element by element components of du/dt as adjusted by a time_solver

Definition at line 588 of file diff_context.h.

Referenced by libMesh::DiffContext::DiffContext(), and libMesh::DiffContext::get_elem_solution_rate().

◆ _elem_subjacobians

std::vector<std::vector<std::unique_ptr<DenseSubMatrix<Number> > > > libMesh::DiffContext::_elem_subjacobians
protectedinherited

◆ _elem_subresiduals

std::vector<std::unique_ptr<DenseSubVector<Number> > > libMesh::DiffContext::_elem_subresiduals
protectedinherited

Element residual subvectors and Jacobian submatrices

Definition at line 631 of file diff_context.h.

Referenced by libMesh::DiffContext::DiffContext(), and libMesh::DiffContext::get_elem_residual().

◆ _elem_subsolution_accels

std::vector<std::unique_ptr<DenseSubVector<Number> > > libMesh::DiffContext::_elem_subsolution_accels
protectedinherited

◆ _elem_subsolution_rates

std::vector<std::unique_ptr<DenseSubVector<Number> > > libMesh::DiffContext::_elem_subsolution_rates
protectedinherited

◆ _elem_subsolutions

◆ _element_fe

std::vector<std::map<FEType, std::unique_ptr<FEAbstract> > > libMesh::FEMContext::_element_fe
protectedinherited

Finite element objects for each variable's interior, sides and edges. We store FE objects for each element dimension present in the mesh, except for edge_fe which only applies to 3D elements.

Definition at line 1095 of file fem_context.h.

Referenced by libMesh::FEMContext::elem_fe_reinit(), and libMesh::FEMContext::init_internal_data().

◆ _element_fe_var

std::vector<std::vector<FEAbstract *> > libMesh::FEMContext::_element_fe_var
protectedinherited

Pointers to the same finite element objects, but indexed by variable number. We store FE objects for each element dimension present in the mesh, except for edge_fe_var which only applies for 3D elements.

Definition at line 1106 of file fem_context.h.

Referenced by libMesh::FEMContext::get_element_fe(), and libMesh::FEMContext::init_internal_data().

◆ _element_qrule

std::vector<std::unique_ptr<QBase> > libMesh::FEMContext::_element_qrule
protectedinherited

Quadrature rule for element interior. The FEM context will try to find a quadrature rule that correctly integrates all variables. We prepare quadrature rules for each element dimension in the mesh.

Definition at line 1143 of file fem_context.h.

Referenced by libMesh::FEMContext::get_element_qrule(), and libMesh::FEMContext::init_internal_data().

◆ _extra_quadrature_order

int libMesh::FEMContext::_extra_quadrature_order
protectedinherited

The extra quadrature order for this context.

Definition at line 1165 of file fem_context.h.

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

◆ _localized_vectors

std::map<const NumericVector<Number> *, std::pair<DenseVector<Number>, std::vector<std::unique_ptr<DenseSubVector<Number> > > > > libMesh::DiffContext::_localized_vectors
protectedinherited

Contains pointers to vectors the user has asked to be localized, keyed with pairs of element localized versions of that vector and per variable views

Definition at line 575 of file diff_context.h.

Referenced by libMesh::DiffContext::add_localized_vector(), libMesh::DiffContext::get_localized_subvector(), libMesh::DiffContext::get_localized_vector(), and libMesh::FEMContext::pre_fe_reinit().

◆ _mesh_sys

◆ _mesh_x_var

unsigned int libMesh::FEMContext::_mesh_x_var
inherited

Variables from which to acquire moving mesh information

Definition at line 974 of file fem_context.h.

Referenced by libMesh::FEMContext::get_mesh_x_var(), and libMesh::FEMContext::set_mesh_x_var().

◆ _mesh_y_var

unsigned int libMesh::FEMContext::_mesh_y_var
inherited

◆ _mesh_z_var

unsigned int libMesh::FEMContext::_mesh_z_var
inherited

◆ _neighbor

const Elem* libMesh::DGFEMContext::_neighbor
private

Current neighbor element for assembling DG terms.

Definition at line 246 of file dg_fem_context.h.

Referenced by get_neighbor(), and set_neighbor().

◆ _neighbor_dof_indices

std::vector<dof_id_type> libMesh::DGFEMContext::_neighbor_dof_indices
private

Global Degree of freedom index lists for the neighbor element

Definition at line 274 of file dg_fem_context.h.

Referenced by get_neighbor_dof_indices(), and neighbor_side_fe_reinit().

◆ _neighbor_dof_indices_var

std::vector<std::vector<dof_id_type> > libMesh::DGFEMContext::_neighbor_dof_indices_var
private

Definition at line 275 of file dg_fem_context.h.

Referenced by get_neighbor_dof_indices(), and neighbor_side_fe_reinit().

◆ _neighbor_elem_jacobian

DenseMatrix<Number> libMesh::DGFEMContext::_neighbor_elem_jacobian
private

◆ _neighbor_elem_subjacobians

std::vector<std::vector<std::unique_ptr<DenseSubMatrix<Number> > > > libMesh::DGFEMContext::_neighbor_elem_subjacobians
private

◆ _neighbor_neighbor_jacobian

DenseMatrix<Number> libMesh::DGFEMContext::_neighbor_neighbor_jacobian
private

◆ _neighbor_neighbor_subjacobians

std::vector<std::vector<std::unique_ptr<DenseSubMatrix<Number> > > > libMesh::DGFEMContext::_neighbor_neighbor_subjacobians
private

◆ _neighbor_residual

DenseVector<Number> libMesh::DGFEMContext::_neighbor_residual
private

Residual vector of the neighbor component.

Definition at line 251 of file dg_fem_context.h.

Referenced by DGFEMContext(), get_neighbor_residual(), and neighbor_side_fe_reinit().

◆ _neighbor_side_fe

std::map<FEType, std::unique_ptr<FEAbstract> > libMesh::DGFEMContext::_neighbor_side_fe
private

Finite element objects for each variable's sides on the neighbor element. We do not need FE objects for neighbor element interior since we just need to handle DG interface terms here.

Definition at line 284 of file dg_fem_context.h.

Referenced by DGFEMContext(), and neighbor_side_fe_reinit().

◆ _neighbor_side_fe_var

std::vector<FEAbstract *> libMesh::DGFEMContext::_neighbor_side_fe_var
private

Pointers to the same finite element objects on the neighbor element, but indexed by variable number

Definition at line 290 of file dg_fem_context.h.

Referenced by DGFEMContext(), and get_neighbor_side_fe().

◆ _neighbor_subresiduals

std::vector<std::unique_ptr<DenseSubVector<Number> > > libMesh::DGFEMContext::_neighbor_subresiduals
private

Element residual subvectors and Jacobian submatrices

Definition at line 265 of file dg_fem_context.h.

Referenced by DGFEMContext(), get_neighbor_residual(), and neighbor_side_fe_reinit().

◆ _real_fe

std::unique_ptr<FEGenericBase<Real> > libMesh::FEMContext::_real_fe
mutableprotectedinherited

Definition at line 1006 of file fem_context.h.

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

◆ _real_fe_is_inf

bool libMesh::FEMContext::_real_fe_is_inf
mutableprotectedinherited

Definition at line 1010 of file fem_context.h.

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

◆ _real_grad_fe

std::unique_ptr<FEGenericBase<RealGradient> > libMesh::FEMContext::_real_grad_fe
mutableprotectedinherited

Definition at line 1007 of file fem_context.h.

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

◆ _real_grad_fe_is_inf

bool libMesh::FEMContext::_real_grad_fe_is_inf
mutableprotectedinherited

Definition at line 1011 of file fem_context.h.

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

◆ _side_fe

std::vector<std::map<FEType, std::unique_ptr<FEAbstract> > > libMesh::FEMContext::_side_fe
protectedinherited

◆ _side_fe_var

std::vector<std::vector<FEAbstract *> > libMesh::FEMContext::_side_fe_var
protectedinherited

◆ _side_qrule

std::vector<std::unique_ptr<QBase> > libMesh::FEMContext::_side_qrule
protectedinherited

Quadrature rules for element sides The FEM context will try to find a quadrature rule that correctly integrates all variables. We prepare quadrature rules for each element dimension in the mesh.

Definition at line 1151 of file fem_context.h.

Referenced by libMesh::FEMContext::get_side_qrule(), and libMesh::FEMContext::init_internal_data().

◆ edge

unsigned char libMesh::FEMContext::edge
inherited

◆ elem_solution_accel_derivative

Real libMesh::DiffContext::elem_solution_accel_derivative
inherited

The derivative of elem_solution_accel with respect to the current nonlinear solution, for use by systems with non default mass_residual terms.

Definition at line 514 of file diff_context.h.

Referenced by libMesh::NewmarkSolver::_general_residual(), libMesh::DiffContext::get_elem_solution_accel_derivative(), and libMesh::FirstOrderUnsteadySolver::prepare_accel().

◆ elem_solution_derivative

Real libMesh::DiffContext::elem_solution_derivative
inherited

◆ elem_solution_rate_derivative

Real libMesh::DiffContext::elem_solution_rate_derivative
inherited

The derivative of elem_solution_rate with respect to the current nonlinear solution, for use by systems with non default mass_residual terms.

Definition at line 507 of file diff_context.h.

Referenced by libMesh::EulerSolver::_general_residual(), libMesh::Euler2Solver::_general_residual(), libMesh::NewmarkSolver::_general_residual(), libMesh::EigenTimeSolver::element_residual(), libMesh::DiffContext::get_elem_solution_rate_derivative(), and libMesh::EigenTimeSolver::side_residual().

◆ fixed_solution_derivative

Real libMesh::DiffContext::fixed_solution_derivative
inherited

The derivative of elem_fixed_solution with respect to the nonlinear solution, for use by systems constructing jacobians with elem_fixed_solution based methods

Definition at line 521 of file diff_context.h.

Referenced by libMesh::EulerSolver::_general_residual(), libMesh::Euler2Solver::_general_residual(), libMesh::SteadySolver::_general_residual(), and libMesh::DiffContext::get_fixed_solution_derivative().

◆ side

◆ system_time

const Real libMesh::DiffContext::system_time
inherited

This is the time stored in the System class at the time this context was created, i.e. the time at the beginning of the current timestep. This value gets set in the constructor and unlike DiffContext::time, is not tweaked mid-timestep by transient solvers: it remains equal to the value it was assigned at construction.

Definition at line 494 of file diff_context.h.

Referenced by libMesh::DiffContext::get_system_time().

◆ time

Real libMesh::DiffContext::time
inherited

For time-dependent problems, this is the time t for which the current nonlinear_solution is defined. FIXME - this needs to be tweaked mid-timestep by all transient solvers!

Definition at line 485 of file diff_context.h.

Referenced by libMesh::DiffContext::get_time(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()(), and libMesh::DiffContext::set_time().


The documentation for this class was generated from the following files: