libMesh
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
libMesh::DGFEMContext Class Reference

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. More...

#include <dg_fem_context.h>

Inheritance diagram for libMesh::DGFEMContext:
[legend]

Public Types

enum  AlgebraicType {
  NONE = 0, DOFS_ONLY, CURRENT, OLD,
  OLD_DOFS_ONLY
}
 Enum describing what data to use when initializing algebraic structures on each element. More...
 
typedef const DenseSubVector< Number > &(DiffContext::* diff_subsolution_getter) (unsigned int) const
 Helper typedef to simplify refactoring. More...
 
typedef std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< DenseSubVector< Number > > > >::iterator localized_vectors_iterator
 Typedef for the localized_vectors iterator. More...
 

Public Member Functions

 DGFEMContext (const System &sys)
 Constructor. More...
 
virtual ~DGFEMContext ()
 Destructor. More...
 
virtual void side_fe_reinit () override
 Override side_fe_reinit to set a boolean flag so that by default DG terms are assumed to be inactive. More...
 
void neighbor_side_fe_reinit ()
 Initialize neighbor side data needed to assemble DG terms. More...
 
const std::vector< dof_id_type > & get_neighbor_dof_indices () const
 Accessor for neighbor dof indices. More...
 
const std::vector< dof_id_type > & get_neighbor_dof_indices (unsigned int var) const
 Accessor for element dof indices of a particular variable corresponding to the index argument. More...
 
const DenseVector< Number > & get_neighbor_residual () const
 Const accessor for neighbor residual. More...
 
DenseVector< Number > & get_neighbor_residual ()
 Non-const accessor for neighbor residual. More...
 
const DenseSubVector< Number > & get_neighbor_residual (unsigned int var) const
 Const accessor for neighbor residual of a particular variable corresponding to the variable index argument. More...
 
DenseSubVector< Number > & get_neighbor_residual (unsigned int var)
 Non-const accessor for neighbor residual of a particular variable corresponding to the variable index argument. More...
 
const DenseMatrix< Number > & get_elem_elem_jacobian () const
 Const accessor for element-element Jacobian. More...
 
DenseMatrix< Number > & get_elem_elem_jacobian ()
 Non-const accessor for element-element Jacobian. More...
 
const DenseSubMatrix< Number > & get_elem_elem_jacobian (unsigned int var1, unsigned int var2) const
 Const accessor for element-element Jacobian of particular variables corresponding to the variable index arguments. More...
 
DenseSubMatrix< Number > & get_elem_elem_jacobian (unsigned int var1, unsigned int var2)
 Non-const accessor for element-element Jacobian of particular variables corresponding to the variable index arguments. More...
 
const DenseMatrix< Number > & get_elem_neighbor_jacobian () const
 Const accessor for element-neighbor Jacobian. More...
 
DenseMatrix< Number > & get_elem_neighbor_jacobian ()
 Non-const accessor for element -neighborJacobian. More...
 
const DenseSubMatrix< Number > & get_elem_neighbor_jacobian (unsigned int var1, unsigned int var2) const
 Const accessor for element-neighbor Jacobian of particular variables corresponding to the variable index arguments. More...
 
DenseSubMatrix< Number > & get_elem_neighbor_jacobian (unsigned int var1, unsigned int var2)
 Non-const accessor for element-neighbor Jacobian of particular variables corresponding to the variable index arguments. More...
 
const DenseMatrix< Number > & get_neighbor_elem_jacobian () const
 Const accessor for element-neighbor Jacobian. More...
 
DenseMatrix< Number > & get_neighbor_elem_jacobian ()
 Non-const accessor for element Jacobian. More...
 
const DenseSubMatrix< Number > & get_neighbor_elem_jacobian (unsigned int var1, unsigned int var2) const
 Const accessor for neighbor-element Jacobian of particular variables corresponding to the variable index arguments. More...
 
DenseSubMatrix< Number > & get_neighbor_elem_jacobian (unsigned int var1, unsigned int var2)
 Non-const accessor for neighbor-element Jacobian of particular variables corresponding to the variable index arguments. More...
 
const DenseMatrix< Number > & get_neighbor_neighbor_jacobian () const
 Const accessor for element-neighbor Jacobian. More...
 
DenseMatrix< Number > & get_neighbor_neighbor_jacobian ()
 Non-const accessor for element Jacobian. More...
 
const DenseSubMatrix< Number > & get_neighbor_neighbor_jacobian (unsigned int var1, unsigned int var2) const
 Const accessor for neighbor-neighbor Jacobian of particular variables corresponding to the variable index arguments. More...
 
DenseSubMatrix< Number > & get_neighbor_neighbor_jacobian (unsigned int var1, unsigned int var2)
 Non-const accessor for neighbor-neighbor Jacobian of particular variables corresponding to the variable index arguments. More...
 
void set_neighbor (const Elem &neighbor)
 Set the neighbor element which we will use to assemble DG terms. More...
 
const Elemget_neighbor () const
 Accessor for current neighbor Elem object for assembling DG terms. More...
 
bool dg_terms_are_active () const
 Are the DG terms active, i.e. More...
 
template<typename OutputShape >
void get_neighbor_side_fe (unsigned int var, FEGenericBase< OutputShape > *&fe) const
 Accessor for neighbor edge/face (2D/3D) finite element object for variable var. More...
 
void use_default_quadrature_rules (int extra_quadrature_order=0)
 Use quadrature rules designed to over-integrate a mass matrix, plus extra_quadrature_order. More...
 
void use_unweighted_quadrature_rules (int extra_quadrature_order=0)
 Use quadrature rules designed to exactly integrate unweighted undistorted basis functions, plus extra_quadrature_order. More...
 
bool has_side_boundary_id (boundary_id_type id) const
 Reports if the boundary id is found on the current side. More...
 
void side_boundary_ids (std::vector< boundary_id_type > &vec_to_fill) const
 As above, but fills in the std::set provided by the user. More...
 
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
 Accessor for interior finite element object for variable var for the largest dimension in the mesh. More...
 
FEBaseget_element_fe (unsigned int var) const
 Accessor for interior finite element object for scalar-valued variable var for the largest dimension in the mesh. More...
 
template<typename OutputShape >
void get_element_fe (unsigned int var, FEGenericBase< OutputShape > *&fe, unsigned short dim) const
 Accessor for interior finite element object for variable var for dimension dim. More...
 
void get_element_fe (unsigned int var, FEAbstract *&fe, unsigned short dim) const
 Accessor for interior finite element object for variable var for dimension dim. More...
 
FEBaseget_element_fe (unsigned int var, unsigned short dim) const
 Accessor for interior finite element object for scalar-valued variable var for dimension dim. More...
 
template<typename OutputShape >
void get_side_fe (unsigned int var, FEGenericBase< OutputShape > *&fe) const
 Accessor for edge/face (2D/3D) finite element object for variable var for the largest dimension in the mesh. More...
 
FEBaseget_side_fe (unsigned int var) const
 Accessor for side finite element object for scalar-valued variable var for the largest dimension in the mesh. More...
 
template<typename OutputShape >
void get_side_fe (unsigned int var, FEGenericBase< OutputShape > *&fe, unsigned short dim) const
 Accessor for edge/face (2D/3D) finite element object for variable var for dimension dim. More...
 
void get_side_fe (unsigned int var, FEAbstract *&fe, unsigned short dim) const
 Accessor for edge/face (2D/3D) finite element object for variable var for dimension dim. More...
 
FEBaseget_side_fe (unsigned int var, unsigned short dim) const
 Accessor for side finite element object for scalar-valued variable var for dimension dim. More...
 
template<typename OutputShape >
void get_edge_fe (unsigned int var, FEGenericBase< OutputShape > *&fe) const
 Accessor for edge (3D only!) finite element object for variable var. More...
 
void get_edge_fe (unsigned int var, FEAbstract *&fe) const
 
FEBaseget_edge_fe (unsigned int var) const
 Accessor for edge (3D only!) finite element object for scalar-valued variable var. More...
 
template<typename OutputType >
void interior_values (unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &interior_values_vector) const
 Fills a vector of values of the _system_vector at the all the quadrature points in the current element interior. More...
 
template<typename OutputType >
void side_values (unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &side_values_vector) const
 Fills a vector of values of the _system_vector at the all the quadrature points on the current element side. More...
 
template<typename OutputType >
void interior_gradients (unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &interior_gradients_vector) const
 Fills a vector with the gradient of the solution variable var at all the quadrature points in the current element interior. More...
 
template<typename OutputType >
void side_gradients (unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &side_gradients_vector) const
 Fills a vector with the gradient of the solution variable var at all the quadrature points on the current element side. More...
 
template<typename OutputType >
void interior_hessians (unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &d2u_vals) const
 Fills a vector of hessians of the _system_vector at the all the quadrature points in the current element interior. More...
 
template<typename OutputType >
void side_hessians (unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &d2u_vals) const
 Fills a vector of hessians of the _system_vector at the all the quadrature points on the current element side. More...
 
template<typename OutputType >
void interior_rate (unsigned int var, unsigned int qp, OutputType &u) const
 
template<typename OutputType >
void interior_rate_gradient (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
 Resets the current time in the context. More...
 
virtual void elem_side_reinit (Real theta) override
 Resets the current time in the context. More...
 
virtual void elem_edge_reinit (Real theta) override
 Resets the current time in the context. More...
 
virtual void nonlocal_reinit (Real theta) override
 Gives derived classes the opportunity to reinitialize data needed for nonlocal calculations at a new point within a timestep. More...
 
virtual void pre_fe_reinit (const System &, const Elem *e)
 Reinitializes local data vectors/matrices on the current geometric element. More...
 
virtual void elem_fe_reinit (const std::vector< Point > *const pts=nullptr)
 Reinitializes interior FE objects on the current geometric element. More...
 
virtual void edge_fe_reinit ()
 Reinitializes edge FE objects on the current geometric element. More...
 
const QBaseget_element_qrule () const
 Accessor for element interior quadrature rule for the dimension of the current _elem. More...
 
const QBaseget_element_qrule (unsigned short dim) const
 Accessor for element interior quadrature rule. More...
 
const QBaseget_side_qrule () const
 Accessor for element side quadrature rule for the dimension of the current _elem. More...
 
const QBaseget_side_qrule (unsigned short dim) const
 Accessor for element side quadrature rule. More...
 
const QBaseget_edge_qrule () const
 Accessor for element edge quadrature rule. More...
 
virtual void set_mesh_system (System *sys)
 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. More...
 
const Systemget_mesh_system () const
 Accessor for moving mesh System. More...
 
Systemget_mesh_system ()
 Accessor for moving mesh System. More...
 
unsigned int get_mesh_x_var () const
 Accessor for x-variable of moving mesh System. More...
 
void set_mesh_x_var (unsigned int x_var)
 Accessor for x-variable of moving mesh System. More...
 
unsigned int get_mesh_y_var () const
 Accessor for y-variable of moving mesh System. More...
 
void set_mesh_y_var (unsigned int y_var)
 Accessor for y-variable of moving mesh System. More...
 
unsigned int get_mesh_z_var () const
 Accessor for z-variable of moving mesh System. More...
 
void set_mesh_z_var (unsigned int z_var)
 Accessor for z-variable of moving mesh System. More...
 
bool has_elem () const
 Test for current Elem object. More...
 
const Elemget_elem () const
 Accessor for current Elem object. More...
 
Elemget_elem ()
 Accessor for current Elem object. More...
 
unsigned char get_side () const
 Accessor for current side of Elem object. More...
 
unsigned char get_edge () const
 Accessor for current edge of Elem object. More...
 
unsigned char get_dim () const
 Accessor for cached mesh dimension. More...
 
unsigned char get_elem_dim () const
 
const std::set< unsigned char > & elem_dimensions () const
 
void elem_position_set (Real theta)
 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. More...
 
void elem_position_get ()
 Uses the geometry of elem to set the coordinate data specified by mesh_*_position configuration. More...
 
void set_algebraic_type (const AlgebraicType atype)
 Setting which determines whether to initialize algebraic structures (elem_*) on each element and set their values from current_local_solution. More...
 
AlgebraicType algebraic_type () const
 
void set_custom_solution (const NumericVector< Number > *custom_sol)
 Set a NumericVector to be used in place of current_local_solution for calculating elem_solution. More...
 
void set_jacobian_tolerance (Real tol)
 Calls set_jacobian_tolerance() on all the FE objects controlled by this class. More...
 
FEType find_hardest_fe_type ()
 Helper function for creating quadrature rules. More...
 
void attach_quadrature_rules ()
 Helper function for attaching quadrature rules. More...
 
const std::vector< unsigned int > * active_vars () const
 Return a pointer to the vector of active variables being computed for, or a null pointer if all variables in the system are active. More...
 
template<typename OutputShape >
FEGenericBase< OutputShape > * build_new_fe (const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE, const int get_derivative_level=-1) const
 Helper function to reduce some code duplication in the *_point_* methods. More...
 
template<>
FEGenericBase< Real > * cached_fe (const unsigned int elem_dim, const FEType fe_type, const int get_derivative_level) const
 
template<>
FEGenericBase< RealGradient > * cached_fe (const unsigned int elem_dim, const FEType fe_type, const int get_derivative_level) const
 
unsigned int n_vars () const
 Number of variables in solution. More...
 
const Systemget_system () const
 Accessor for associated system. More...
 
const DenseVector< Number > & get_elem_solution () const
 Accessor for element solution. More...
 
DenseVector< Number > & get_elem_solution ()
 Non-const accessor for element solution. More...
 
const DenseSubVector< Number > & get_elem_solution (unsigned int var) const
 Accessor for element solution of a particular variable corresponding to the variable index argument. More...
 
DenseSubVector< Number > & get_elem_solution (unsigned int var)
 Accessor for element solution of a particular variable corresponding to the variable index argument. More...
 
const DenseVector< Number > & get_elem_solution_rate () const
 Accessor for element solution rate of change w.r.t. More...
 
DenseVector< Number > & get_elem_solution_rate ()
 Non-const accessor for element solution rate of change w.r.t. More...
 
const DenseSubVector< Number > & get_elem_solution_rate (unsigned int var) const
 Accessor for element solution rate for a particular variable corresponding to the variable index argument. More...
 
DenseSubVector< Number > & get_elem_solution_rate (unsigned int var)
 Accessor for element solution rate for a particular variable corresponding to the variable index argument. More...
 
const DenseVector< Number > & get_elem_solution_accel () const
 Accessor for element solution accel of change w.r.t. More...
 
DenseVector< Number > & get_elem_solution_accel ()
 Non-const accessor for element solution accel of change w.r.t. More...
 
const DenseSubVector< Number > & get_elem_solution_accel (unsigned int var) const
 Accessor for element solution accel for a particular variable corresponding to the variable index argument. More...
 
DenseSubVector< Number > & get_elem_solution_accel (unsigned int var)
 Accessor for element solution accel for a particular variable corresponding to the variable index argument. More...
 
const DenseVector< Number > & get_elem_fixed_solution () const
 Accessor for element fixed solution. More...
 
DenseVector< Number > & get_elem_fixed_solution ()
 Non-const accessor for element fixed solution. More...
 
const DenseSubVector< Number > & get_elem_fixed_solution (unsigned int var) const
 Accessor for element fixed solution of a particular variable corresponding to the variable index argument. More...
 
DenseSubVector< Number > & get_elem_fixed_solution (unsigned int var)
 Accessor for element fixed solution of a particular variable corresponding to the variable index argument. More...
 
const DenseVector< Number > & get_elem_residual () const
 Const accessor for element residual. More...
 
DenseVector< Number > & get_elem_residual ()
 Non-const accessor for element residual. More...
 
const DenseSubVector< Number > & get_elem_residual (unsigned int var) const
 Const accessor for element residual of a particular variable corresponding to the variable index argument. More...
 
DenseSubVector< Number > & get_elem_residual (unsigned int var)
 Non-const accessor for element residual of a particular variable corresponding to the variable index argument. More...
 
const DenseMatrix< Number > & get_elem_jacobian () const
 Const accessor for element Jacobian. More...
 
DenseMatrix< Number > & get_elem_jacobian ()
 Non-const accessor for element Jacobian. More...
 
const DenseSubMatrix< Number > & get_elem_jacobian (unsigned int var1, unsigned int var2) const
 Const accessor for element Jacobian of particular variables corresponding to the variable index arguments. More...
 
DenseSubMatrix< Number > & get_elem_jacobian (unsigned int var1, unsigned int var2)
 Non-const accessor for element Jacobian of particular variables corresponding to the variable index arguments. More...
 
const std::vector< Number > & get_qois () const
 Const accessor for QoI vector. More...
 
std::vector< Number > & get_qois ()
 Non-const accessor for QoI vector. More...
 
const std::vector< DenseVector< Number > > & get_qoi_derivatives () const
 Const accessor for QoI derivatives. More...
 
std::vector< DenseVector< Number > > & get_qoi_derivatives ()
 Non-const accessor for QoI derivatives. More...
 
const DenseSubVector< Number > & get_qoi_derivatives (std::size_t qoi, unsigned int var) const
 Const accessor for QoI derivative of a particular qoi and variable corresponding to the index arguments. More...
 
DenseSubVector< Number > & get_qoi_derivatives (std::size_t qoi, unsigned int var)
 Non-const accessor for QoI derivative of a particular qoi and variable corresponding to the index arguments. More...
 
const std::vector< dof_id_type > & get_dof_indices () const
 Accessor for element dof indices. More...
 
std::vector< dof_id_type > & get_dof_indices ()
 Non-const accessor for element dof indices. More...
 
const std::vector< dof_id_type > & get_dof_indices (unsigned int var) const
 Accessor for element dof indices of a particular variable corresponding to the index argument. More...
 
std::vector< dof_id_type > & get_dof_indices (unsigned int var)
 Accessor for element dof indices of a particular variable corresponding to the index argument. More...
 
unsigned int n_dof_indices () const
 Total number of dof indices on the element. More...
 
unsigned int n_dof_indices (unsigned int var) const
 Total number of dof indices of the particular variable corresponding to the index argument. More...
 
Real get_system_time () const
 Accessor for the time variable stored in the system class. More...
 
Real get_time () const
 Accessor for the time for which the current nonlinear_solution is defined. More...
 
void set_time (Real time_in)
 Set the time for which the current nonlinear_solution is defined. More...
 
Real get_elem_solution_derivative () const
 The derivative of the current elem_solution w.r.t. More...
 
Real get_elem_solution_rate_derivative () const
 The derivative of the current elem_solution_rate w.r.t. More...
 
Real get_elem_solution_accel_derivative () const
 The derivative of the current elem_solution_accel w.r.t. More...
 
Real get_fixed_solution_derivative () const
 The derivative of the current fixed_elem_solution w.r.t. More...
 
bool is_adjoint () const
 Accessor for querying whether we need to do a primal or adjoint solve. More...
 
bool & is_adjoint ()
 Accessor for setting whether we need to do a primal or adjoint solve. More...
 
void set_deltat_pointer (Real *dt)
 Points the _deltat member of this class at a timestep value stored in the creating System, for example DiffSystem::deltat. More...
 
Real get_deltat_value ()
 
void add_localized_vector (NumericVector< Number > &localized_vector, const System &sys)
 Adds a vector to the map of localized vectors. More...
 
DenseVector< Number > & get_localized_vector (const NumericVector< Number > &localized_vector)
 Return a reference to DenseVector localization of localized_vector contained in the _localized_vectors map. More...
 
const DenseVector< Number > & get_localized_vector (const NumericVector< Number > &localized_vector) const
 const accessible version of get_localized_vector function More...
 
DenseSubVector< Number > & get_localized_subvector (const NumericVector< Number > &localized_vector, unsigned int var)
 Return a reference to DenseSubVector localization of localized_vector at variable var contained in the _localized_vectors map. More...
 
const DenseSubVector< Number > & get_localized_subvector (const NumericVector< Number > &localized_vector, unsigned int var) const
 const accessible version of get_localized_subvector function More...
 

Public Attributes

unsigned char side
 Current side for side_* to examine. More...
 
unsigned char edge
 Current edge for edge_* to examine. More...
 
Real time
 For time-dependent problems, this is the time t for which the current nonlinear_solution is defined. More...
 
const Real system_time
 This is the time stored in the System class at the time this context was created, i.e. More...
 
Real elem_solution_derivative
 The derivative of elem_solution with respect to the current nonlinear solution. More...
 
Real elem_solution_rate_derivative
 The derivative of elem_solution_rate with respect to the current nonlinear solution, for use by systems with non default mass_residual terms. More...
 
Real elem_solution_accel_derivative
 The derivative of elem_solution_accel with respect to the current nonlinear solution, for use by systems with non default mass_residual terms. More...
 
Real fixed_solution_derivative
 The derivative of elem_fixed_solution with respect to the nonlinear solution, for use by systems constructing jacobians with elem_fixed_solution based methods. More...
 

Protected Member Functions

template<typename OutputShape >
FEGenericBase< OutputShape > * cached_fe (const unsigned int elem_dim, const FEType fe_type, const int get_derivative_level) const
 
void set_elem (const Elem *e)
 Helper function to promote accessor usage. More...
 
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
 Helper function to reduce some code duplication in the *interior_value methods. More...
 
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
 Helper function to reduce some code duplication in the *interior_gradient methods. More...
 
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
 Helper function to reduce some code duplication in the *interior_hessian methods. More...
 

Protected Attributes

std::unique_ptr< const std::vector< unsigned int > > _active_vars
 Variables on which to enable calculations, or nullptr if all variables in the System are to be enabled. More...
 
System_mesh_sys
 System from which to acquire moving mesh information. More...
 
unsigned int _mesh_x_var
 Variables from which to acquire moving mesh information. More...
 
unsigned int _mesh_y_var
 
unsigned int _mesh_z_var
 
AlgebraicType _atype
 Keep track of what type of algebra reinitialization is to be done. More...
 
const NumericVector< Number > * _custom_solution
 Data with which to do algebra reinitialization. More...
 
std::unique_ptr< FEGenericBase< Real > > _real_fe
 
std::unique_ptr< FEGenericBase< RealGradient > > _real_grad_fe
 
int _real_fe_derivative_level
 
int _real_grad_fe_derivative_level
 
bool _real_fe_is_inf
 
bool _real_grad_fe_is_inf
 
std::vector< std::map< FEType, std::unique_ptr< FEAbstract > > > _element_fe
 Finite element objects for each variable's interior, sides and edges. More...
 
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
 Pointers to the same finite element objects, but indexed by variable number. More...
 
std::vector< std::vector< FEAbstract * > > _side_fe_var
 
std::vector< FEAbstract * > _edge_fe_var
 
const BoundaryInfo_boundary_info
 Saved reference to BoundaryInfo on the mesh for this System. More...
 
const Elem_elem
 Current element for element_* to examine. More...
 
unsigned char _dim
 Cached dimension of largest dimension element in this mesh. More...
 
unsigned char _elem_dim
 Cached dimension of this->_elem. More...
 
std::set< unsigned char > _elem_dims
 Cached dimensions of elements in the mesh, plus dimension 0 if SCALAR variables are in use. More...
 
std::vector< std::unique_ptr< QBase > > _element_qrule
 Quadrature rule for element interior. More...
 
std::vector< std::unique_ptr< QBase > > _side_qrule
 Quadrature rules for element sides The FEM context will try to find a quadrature rule that correctly integrates all variables. More...
 
std::unique_ptr< QBase_edge_qrule
 Quadrature rules for element edges. More...
 
int _extra_quadrature_order
 The extra quadrature order for this context. More...
 
std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< DenseSubVector< Number > > > > _localized_vectors
 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. More...
 
const bool _have_local_matrices
 Whether we have local matrices allocated/initialized. More...
 
DenseVector< Number_elem_solution
 Element by element components of nonlinear_solution as adjusted by a time_solver. More...
 
std::vector< DenseSubVector< Number > > _elem_subsolutions
 
DenseVector< Number_elem_solution_rate
 Element by element components of du/dt as adjusted by a time_solver. More...
 
std::vector< DenseSubVector< Number > > _elem_subsolution_rates
 
DenseVector< Number_elem_solution_accel
 Element by element components of du/dt as adjusted by a time_solver. More...
 
std::vector< DenseSubVector< Number > > _elem_subsolution_accels
 
DenseVector< Number_elem_fixed_solution
 Element by element components of nonlinear_solution at a fixed point in a timestep, for optional use by e.g. More...
 
std::vector< DenseSubVector< Number > > _elem_fixed_subsolutions
 
DenseVector< Number_elem_residual
 Element residual vector. More...
 
DenseMatrix< Number_elem_jacobian
 Element jacobian: derivatives of elem_residual with respect to elem_solution. More...
 
std::vector< Number_elem_qoi
 Element quantity of interest contributions. More...
 
std::vector< DenseVector< Number > > _elem_qoi_derivative
 Element quantity of interest derivative contributions. More...
 
std::vector< std::vector< DenseSubVector< Number > > > _elem_qoi_subderivatives
 
std::vector< DenseSubVector< Number > > _elem_subresiduals
 Element residual subvectors and (if _have_local_matrices) Jacobian submatrices. More...
 
std::vector< std::vector< DenseSubMatrix< Number > > > _elem_subjacobians
 
std::vector< dof_id_type_dof_indices
 Global Degree of freedom index lists. More...
 
std::vector< std::vector< dof_id_type > > _dof_indices_var
 

Private Attributes

const Elem_neighbor
 Current neighbor element for assembling DG terms. More...
 
DenseVector< Number_neighbor_residual
 Residual vector of the neighbor component. More...
 
DenseMatrix< Number_elem_elem_jacobian
 The DG Jacobian terms. More...
 
DenseMatrix< Number_elem_neighbor_jacobian
 
DenseMatrix< Number_neighbor_elem_jacobian
 
DenseMatrix< Number_neighbor_neighbor_jacobian
 
std::vector< std::unique_ptr< DenseSubVector< Number > > > _neighbor_subresiduals
 Element residual subvectors and Jacobian submatrices. More...
 
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
 Global Degree of freedom index lists for the neighbor element. More...
 
std::vector< std::vector< dof_id_type > > _neighbor_dof_indices_var
 
std::map< FEType, std::unique_ptr< FEAbstract > > _neighbor_side_fe
 Finite element objects for each variable's sides on the neighbor element. More...
 
std::vector< FEAbstract * > _neighbor_side_fe_var
 Pointers to the same finite element objects on the neighbor element, but indexed by variable number. More...
 
bool _dg_terms_active
 Boolean flag to indicate whether or not the DG terms have been assembled and should be used in the global matrix assembly. More...
 

Detailed Description

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 Extends FEMContext to work for DG problems.

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 1103 of file fem_context.h.

◆ localized_vectors_iterator

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

Typedef for the localized_vectors iterator.

Definition at line 540 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 971 of file fem_context.h.

971  { NONE = 0, // Do not reinitialize dof_indices
972  DOFS_ONLY, // Reinitialize dof_indices, not
973  // algebraic structures
974  CURRENT, // Use dof_indices, current solution
975  OLD, // Use old_dof_indices, custom solution
976  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::libmesh_assert(), 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(std::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(std::make_unique<DenseSubMatrix<Number>>(_elem_elem_jacobian));
55  _elem_neighbor_subjacobians[i].emplace_back(std::make_unique<DenseSubMatrix<Number>>(_elem_neighbor_jacobian));
56  _neighbor_elem_subjacobians[i].emplace_back(std::make_unique<DenseSubMatrix<Number>>(_neighbor_elem_jacobian));
57  _neighbor_neighbor_subjacobians[i].emplace_back(std::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
Residual vector of the neighbor component.
DenseMatrix< Number > _elem_elem_jacobian
The DG Jacobian terms.
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_elem_subjacobians
FEMContext(const System &sys, const std::vector< unsigned int > *active_vars=nullptr, bool allocate_local_matrices=true)
Constructor.
Definition: fem_context.C:39
std::vector< std::vector< dof_id_type > > _neighbor_dof_indices_var
std::vector< FEAbstract * > _neighbor_side_fe_var
Pointers to the same finite element objects on the neighbor element, but indexed by variable number...
DenseMatrix< Number > _neighbor_elem_jacobian
libmesh_assert(ctx)
DenseMatrix< Number > _elem_neighbor_jacobian
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_neighbor_subjacobians
bool _dg_terms_active
Boolean flag to indicate whether or not the DG terms have been assembled and should be used in the gl...
unsigned char _dim
Cached dimension of largest dimension element in this mesh.
Definition: fem_context.h:1197
const Elem * _neighbor
Current neighbor element for assembling DG terms.
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)
Builds a specific finite element type.
Definition: fe_abstract.C:78
DenseMatrix< Number > _neighbor_neighbor_jacobian
std::vector< std::unique_ptr< DenseSubVector< Number > > > _neighbor_subresiduals
Element residual subvectors and Jacobian submatrices.
std::map< FEType, std::unique_ptr< FEAbstract > > _neighbor_side_fe
Finite element objects for each variable&#39;s sides on the neighbor element.
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _neighbor_neighbor_subjacobians

◆ ~DGFEMContext()

libMesh::DGFEMContext::~DGFEMContext ( )
virtualdefault

Destructor.

Member Function Documentation

◆ active_vars()

const std::vector<unsigned int>* libMesh::FEMContext::active_vars ( ) const
inlineinherited

Return a pointer to the vector of active variables being computed for, or a null pointer if all variables in the system are active.

Definition at line 1034 of file fem_context.h.

References libMesh::FEMContext::_active_vars.

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

1034 { return _active_vars.get(); }
std::unique_ptr< const std::vector< unsigned int > > _active_vars
Variables on which to enable calculations, or nullptr if all variables in the System are to be enable...
Definition: fem_context.h:1054

◆ 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 125 of file diff_context.C.

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

126 {
127  // Make an empty pair keyed with a reference to this _localized_vector
128  _localized_vectors[&localized_vector] = std::make_pair(DenseVector<Number>(), std::vector<DenseSubVector<Number>>());
129 
130  unsigned int nv = sys.n_vars();
131 
132  _localized_vectors[&localized_vector].second.reserve(nv);
133 
134  // Fill the DenseSubVector with nv copies of DenseVector
135  for (unsigned int i=0; i != nv; ++i)
136  _localized_vectors[&localized_vector].second.emplace_back(_localized_vectors[&localized_vector].first);
137 }
std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< DenseSubVector< Number > > > > _localized_vectors
Contains pointers to vectors the user has asked to be localized, keyed with pairs of element localize...
Definition: diff_context.h:571

◆ algebraic_type()

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

Definition at line 992 of file fem_context.h.

References libMesh::FEMContext::_atype.

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

992 { return _atype; }
AlgebraicType _atype
Keep track of what type of algebra reinitialization is to be done.
Definition: fem_context.h:1069

◆ attach_quadrature_rules()

void libMesh::FEMContext::attach_quadrature_rules ( )
inherited

Helper function for attaching quadrature rules.

Definition at line 127 of file fem_context.C.

References libMesh::FEMContext::_active_vars, libMesh::FEMContext::_edge_fe, libMesh::FEMContext::_edge_qrule, libMesh::FEMContext::_elem_dims, libMesh::FEMContext::_element_fe, libMesh::FEMContext::_element_qrule, libMesh::FEMContext::_side_fe, libMesh::FEMContext::_side_qrule, dim, libMesh::DiffContext::get_system(), libMesh::make_range(), libMesh::System::n_vars(), and libMesh::System::variable_type().

Referenced by libMesh::FEMContext::use_default_quadrature_rules(), and libMesh::FEMContext::use_unweighted_quadrature_rules().

128 {
129  const System & sys = this->get_system();
130 
131  auto attach_rules = [this, &sys](unsigned int v)
132  {
133  for (const auto & dim : _elem_dims)
134  {
135  FEType fe_type = sys.variable_type(v);
136 
137  _element_fe[dim][fe_type]->attach_quadrature_rule(_element_qrule[dim].get());
138  if (dim)
139  _side_fe[dim][fe_type]->attach_quadrature_rule(_side_qrule[dim].get());
140  if (dim == 3)
141  _edge_fe[fe_type]->attach_quadrature_rule(_edge_qrule.get());
142  };
143  };
144 
145  if (_active_vars)
146  for (auto v : *_active_vars)
147  attach_rules(v);
148  else
149  for (auto v : make_range(sys.n_vars()))
150  attach_rules(v);
151 }
std::unique_ptr< const std::vector< unsigned int > > _active_vars
Variables on which to enable calculations, or nullptr if all variables in the System are to be enable...
Definition: fem_context.h:1054
unsigned int dim
std::vector< std::map< FEType, std::unique_ptr< FEAbstract > > > _element_fe
Finite element objects for each variable&#39;s interior, sides and edges.
Definition: fem_context.h:1168
std::set< unsigned char > _elem_dims
Cached dimensions of elements in the mesh, plus dimension 0 if SCALAR variables are in use...
Definition: fem_context.h:1208
std::map< FEType, std::unique_ptr< FEAbstract > > _edge_fe
Definition: fem_context.h:1170
const System & get_system() const
Accessor for associated system.
Definition: diff_context.h:106
std::vector< std::unique_ptr< QBase > > _side_qrule
Quadrature rules for element sides The FEM context will try to find a quadrature rule that correctly ...
Definition: fem_context.h:1224
std::vector< std::map< FEType, std::unique_ptr< FEAbstract > > > _side_fe
Definition: fem_context.h:1169
std::vector< std::unique_ptr< QBase > > _element_qrule
Quadrature rule for element interior.
Definition: fem_context.h:1216
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
std::unique_ptr< QBase > _edge_qrule
Quadrature rules for element edges.
Definition: fem_context.h:1233

◆ build_new_fe()

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

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

get_derivative_level should be -1 to get_ everything, 0 to get_phi, 1 to get_dphi, 2 to get_d2phi, or 3 to get_curl_phi

Definition at line 2023 of file fem_context.C.

References libMesh::FEAbstract::add_p_level_in_reinit(), libMesh::FEMContext::algebraic_type(), libMesh::Elem::dim(), libMesh::FEType::family, libMesh::FEGenericBase< OutputType >::get_curl_phi(), libMesh::FEGenericBase< OutputType >::get_d2phi(), libMesh::FEGenericBase< OutputType >::get_dphi(), libMesh::FEMContext::get_elem(), libMesh::FEAbstract::get_fe_type(), libMesh::FEGenericBase< OutputType >::get_phi(), libMesh::FEMContext::has_elem(), libMesh::FEMap::inverse_map(), libMesh::Elem::JUST_COARSENED, libMesh::Elem::JUST_REFINED, libMesh::libmesh_assert(), libMesh::FEMContext::OLD, libMesh::FEType::order, 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().

2027 {
2028  FEType fe_type = fe->get_fe_type();
2029 
2030  // If we don't have an Elem to evaluate on, then the only functions
2031  // we can sensibly evaluate are the scalar dofs which are the same
2032  // everywhere.
2033  libmesh_assert(this->has_elem() || fe_type.family == SCALAR);
2034 
2035 #ifdef LIBMESH_ENABLE_AMR
2036  const int add_p_level = fe->add_p_level_in_reinit();
2037  if ((algebraic_type() == OLD) &&
2038  this->has_elem())
2039  {
2040  if (this->get_elem().p_refinement_flag() == Elem::JUST_REFINED)
2041  fe_type.order -= add_p_level;
2042  else if (this->get_elem().p_refinement_flag() == Elem::JUST_COARSENED)
2043  fe_type.order += add_p_level;
2044  }
2045 #endif // LIBMESH_ENABLE_AMR
2046 
2047  const unsigned int elem_dim = this->has_elem() ? this->get_elem().dim() : 0;
2048 
2049  FEGenericBase<OutputShape>* fe_new =
2050  cached_fe<OutputShape>(elem_dim, fe_type, get_derivative_level);
2051 #ifdef LIBMESH_ENABLE_AMR
2052  fe_new->add_p_level_in_reinit(add_p_level);
2053 #endif // LIBMESH_ENABLE_AMR
2054 
2055  // Map the physical co-ordinates to the master co-ordinates using the inverse_map from fe_interface.h
2056  // Build a vector of point co-ordinates to send to reinit
2057  Point master_point = this->has_elem() ?
2058  FEMap::inverse_map (elem_dim, &this->get_elem(), p, tolerance) :
2059  Point(0);
2060 
2061  std::vector<Point> coor(1, master_point);
2062 
2063  switch (get_derivative_level)
2064  {
2065  case -1:
2066  fe_new->get_phi();
2067  fe_new->get_dphi();
2068 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
2069  fe_new->get_d2phi();
2070 #endif
2071  fe_new->get_curl_phi();
2072  break;
2073  case 0:
2074  fe_new->get_phi();
2075  break;
2076  case 1:
2077  fe_new->get_dphi();
2078  break;
2079  case 2:
2080 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
2081  fe_new->get_d2phi();
2082 #else
2083  // here a different configuration is required.
2084  libmesh_not_implemented();
2085 #endif
2086  break;
2087  case 3:
2088  fe_new->get_curl_phi();
2089  break;
2090  default:
2091  libmesh_error();
2092  }
2093 
2094  // Reinitialize the element and compute the shape function values at coor
2095  if (this->has_elem())
2096  fe_new->reinit (&this->get_elem(), &coor);
2097  else
2098  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
2099  fe_new->reinit (nullptr, &coor);
2100 
2101  return fe_new;
2102 }
const Elem & get_elem() const
Accessor for current Elem object.
Definition: fem_context.h:908
static Point inverse_map(const unsigned int dim, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true, const bool extra_checks=true)
Definition: fe_map.C:1628
libmesh_assert(ctx)
virtual unsigned short dim() const =0
AlgebraicType algebraic_type() const
Definition: fem_context.h:992
bool has_elem() const
Test for current Elem object.
Definition: fem_context.h:902

◆ cached_fe() [1/3]

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

◆ cached_fe() [2/3]

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

Definition at line 1938 of file fem_context.C.

References libMesh::FEMContext::_real_fe, libMesh::FEMContext::_real_fe_derivative_level, 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().

1941 {
1942 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1943  const bool fe_needs_inf =
1944  this->has_elem() && this->get_elem().infinite();
1945 #endif
1946 
1947  if (!_real_fe ||
1948  elem_dim != _real_fe->get_dim() ||
1949  fe_type != _real_fe->get_fe_type() ||
1950  get_derivative_level != _real_fe_derivative_level)
1951  {
1952  _real_fe_derivative_level = get_derivative_level;
1953 
1954  _real_fe =
1955 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1956  fe_needs_inf ?
1957  FEGenericBase<Real>::build_InfFE(elem_dim, fe_type) :
1958 #endif
1959  FEGenericBase<Real>::build(elem_dim, fe_type);
1960  }
1961 
1962 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1963  else if (fe_needs_inf && !_real_fe_is_inf)
1964  _real_fe =
1965  FEGenericBase<Real>::build_InfFE(elem_dim, fe_type);
1966  else if (!fe_needs_inf && _real_fe_is_inf)
1967  _real_fe =
1968  FEGenericBase<Real>::build(elem_dim, fe_type);
1969 
1970  _real_fe_is_inf =
1971  (this->has_elem() && this->get_elem().infinite());
1972 #endif
1973 
1974  return _real_fe.get();
1975 }
const Elem & get_elem() const
Accessor for current Elem object.
Definition: fem_context.h:908
std::unique_ptr< FEGenericBase< Real > > _real_fe
Definition: fem_context.h:1076
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static std::unique_ptr< FEGenericBase > build_InfFE(const unsigned int dim, const FEType &type)
Builds a specific infinite element type.
virtual bool infinite() const =0
bool has_elem() const
Test for current Elem object.
Definition: fem_context.h:902

◆ cached_fe() [3/3]

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

Definition at line 1980 of file fem_context.C.

References libMesh::FEMContext::_real_grad_fe, libMesh::FEMContext::_real_grad_fe_derivative_level, 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().

1983 {
1984 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1985  const bool fe_needs_inf =
1986  this->has_elem() && this->get_elem().infinite();
1987 #endif
1988 
1989  if (!_real_grad_fe ||
1990  elem_dim != _real_grad_fe->get_dim() ||
1991  fe_type != _real_grad_fe->get_fe_type() ||
1992  get_derivative_level != _real_grad_fe_derivative_level)
1993  {
1994  _real_grad_fe_derivative_level = get_derivative_level;
1995 
1996  _real_grad_fe =
1997 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1998  fe_needs_inf ?
1999  FEGenericBase<RealGradient>::build_InfFE(elem_dim, fe_type) :
2000 #endif
2001  FEGenericBase<RealGradient>::build(elem_dim, fe_type);
2002  }
2003 
2004 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2005  else if (fe_needs_inf && !_real_grad_fe_is_inf)
2006  _real_grad_fe =
2007  FEGenericBase<RealGradient>::build_InfFE(elem_dim, fe_type);
2008  else if (!fe_needs_inf && _real_grad_fe_is_inf)
2009  _real_grad_fe =
2010  FEGenericBase<RealGradient>::build(elem_dim, fe_type);
2011 
2013  (this->has_elem() && this->get_elem().infinite());
2014 #endif
2015 
2016  return _real_grad_fe.get();
2017 }
RealVectorValue RealGradient
std::unique_ptr< FEGenericBase< RealGradient > > _real_grad_fe
Definition: fem_context.h:1077
const Elem & get_elem() const
Accessor for current Elem object.
Definition: fem_context.h:908
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
int _real_grad_fe_derivative_level
Definition: fem_context.h:1079
static std::unique_ptr< FEGenericBase > build_InfFE(const unsigned int dim, const FEType &type)
Builds a specific infinite element type.
virtual bool infinite() const =0
bool has_elem() const
Test for current Elem object.
Definition: fem_context.h:902

◆ 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.

Referenced by libMesh::RBConstruction::add_scaled_matrix_and_vector().

233  { return _dg_terms_active; }
bool _dg_terms_active
Boolean flag to indicate whether or not the DG terms have been assembled and should be used in the gl...

◆ edge_fe_reinit()

void libMesh::FEMContext::edge_fe_reinit ( )
virtualinherited

Reinitializes edge FE objects on the current geometric element.

Definition at line 1514 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().

1515 {
1516  libmesh_assert_equal_to (this->get_elem_dim(), 3);
1517 
1518  // Initialize all the interior FE objects on elem/edge.
1519  // Logging of FE::reinit is done in the FE functions
1520  for (auto & pr : _edge_fe)
1521  pr.second->edge_reinit(&(this->get_elem()), this->get_edge());
1522 }
unsigned char get_edge() const
Accessor for current edge of Elem object.
Definition: fem_context.h:928
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const Elem & get_elem() const
Accessor for current Elem object.
Definition: fem_context.h:908
std::map< FEType, std::unique_ptr< FEAbstract > > _edge_fe
Definition: fem_context.h:1170

◆ elem_dimensions()

const std::set<unsigned char>& libMesh::FEMContext::elem_dimensions ( ) const
inlineinherited

◆ 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 1452 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().

1453 {
1454  // Update the "time" variable of this context object
1455  this->_update_time_from_system(theta);
1456 
1457  // Handle a moving element if necessary
1458  if (_mesh_sys)
1459  {
1460  // FIXME - not threadsafe yet!
1461  elem_position_set(theta);
1462  edge_fe_reinit();
1463  }
1464 }
void elem_position_set(Real theta)
Uses the coordinate data specified by mesh_*_position configuration to set the geometry of elem to th...
Definition: fem_context.h:1270
void _update_time_from_system(Real theta)
Update the time in the context object for the given value of theta, based on the values of "time" and...
Definition: fem_context.C:1923
System * _mesh_sys
System from which to acquire moving mesh information.
Definition: fem_context.h:1059
virtual void edge_fe_reinit()
Reinitializes edge FE objects on the current geometric element.
Definition: fem_context.C:1514

◆ 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 1477 of file fem_context.C.

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

Referenced by libMesh::ExactSolution::_compute_error(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), assembly_with_dg_fem_context(), libMesh::VariationalSmootherSystem::compute_element_reference_volume(), libMesh::FEMContext::elem_reinit(), HilbertSystem::element_time_derivative(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_sides(), libMesh::RBEIMConstruction::initialize_qp_data(), libMesh::FEMSystem::mesh_position_set(), libMesh::FEMContext::nonlocal_reinit(), Integrate::operator()(), OverlappingAlgebraicGhostingTest::run_ghosting_test(), and OverlappingCouplingGhostingTest::run_sparsity_pattern_test().

1478 {
1479  // Initialize all the interior FE objects on elem.
1480  // Logging of FE::reinit is done in the FE functions
1481  // We only reinit the FE objects for the current element
1482  // dimension
1483  const unsigned char dim = this->get_elem_dim();
1484 
1485  libmesh_assert( !_element_fe[dim].empty() );
1486 
1487  for (const auto & pr : _element_fe[dim])
1488  {
1489  if (this->has_elem())
1490  pr.second->reinit(&(this->get_elem()), pts);
1491  else
1492  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1493  pr.second->reinit(nullptr);
1494  }
1495 }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const Elem & get_elem() const
Accessor for current Elem object.
Definition: fem_context.h:908
unsigned int dim
std::vector< std::map< FEType, std::unique_ptr< FEAbstract > > > _element_fe
Finite element objects for each variable&#39;s interior, sides and edges.
Definition: fem_context.h:1168
libmesh_assert(ctx)
bool has_elem() const
Test for current Elem object.
Definition: fem_context.h:902

◆ 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 1526 of file fem_context.C.

References libMesh::FEMContext::_mesh_sys, libMesh::Elem::default_order(), dim, 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::libmesh_assert(), libMesh::FEMap::map_fe_type(), n_nodes, libMesh::Elem::n_nodes(), libMesh::n_threads(), and libMesh::Elem::point().

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

1527 {
1528  // This is too expensive to call unless we've been asked to move the mesh
1530 
1531  // This will probably break with threading when two contexts are
1532  // operating on elements which share a node
1533  libmesh_assert_equal_to (libMesh::n_threads(), 1);
1534 
1535  // If the coordinate data is in our own system, it's already
1536  // been set up for us
1537  // if (_mesh_sys == this->number())
1538  // {
1539  unsigned int n_nodes = this->get_elem().n_nodes();
1540 
1541 #ifndef NDEBUG
1542  const unsigned char dim = this->get_elem_dim();
1543 
1544  // For simplicity we demand that mesh coordinates be stored
1545  // in a format that allows a direct copy
1547  (this->get_element_fe(this->get_mesh_x_var(), dim)->get_fe_type().family
1548  == FEMap::map_fe_type(this->get_elem()) &&
1549  this->get_element_fe(this->get_mesh_x_var(), dim)->get_fe_type().order.get_order()
1550  == this->get_elem().default_order()));
1552  (this->get_element_fe(this->get_mesh_y_var(), dim)->get_fe_type().family
1553  == FEMap::map_fe_type(this->get_elem()) &&
1554  this->get_element_fe(this->get_mesh_y_var(), dim)->get_fe_type().order.get_order()
1555  == this->get_elem().default_order()));
1557  (this->get_element_fe(this->get_mesh_z_var(), dim)->get_fe_type().family
1558  == FEMap::map_fe_type(this->get_elem()) &&
1559  this->get_element_fe(this->get_mesh_z_var(), dim)->get_fe_type().order.get_order()
1560  == this->get_elem().default_order()));
1561 #endif
1562 
1563  // Get degree of freedom coefficients from point coordinates
1564  if (this->get_mesh_x_var() != libMesh::invalid_uint)
1565  for (unsigned int i=0; i != n_nodes; ++i)
1566  (this->get_elem_solution(this->get_mesh_x_var()))(i) = this->get_elem().point(i)(0);
1567 
1568  if (this->get_mesh_y_var() != libMesh::invalid_uint)
1569  for (unsigned int i=0; i != n_nodes; ++i)
1570  (this->get_elem_solution(this->get_mesh_y_var()))(i) = this->get_elem().point(i)(1);
1571 
1572  if (this->get_mesh_z_var() != libMesh::invalid_uint)
1573  for (unsigned int i=0; i != n_nodes; ++i)
1574  (this->get_elem_solution(this->get_mesh_z_var()))(i) = this->get_elem().point(i)(2);
1575  // }
1576  // FIXME - If the coordinate data is not in our own system, someone
1577  // had better get around to implementing that... - RHS
1578  // else
1579  // {
1580  // libmesh_not_implemented();
1581  // }
1582 }
unsigned int n_threads()
Definition: libmesh_base.h:96
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:310
unsigned int get_mesh_x_var() const
Accessor for x-variable of moving mesh System.
Definition: fem_context.h:860
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const Elem & get_elem() const
Accessor for current Elem object.
Definition: fem_context.h:908
unsigned int dim
const dof_id_type n_nodes
Definition: tecplot_io.C:67
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:112
virtual unsigned int n_nodes() const =0
System * _mesh_sys
System from which to acquire moving mesh information.
Definition: fem_context.h:1059
libmesh_assert(ctx)
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for interior finite element object for variable var for the largest dimension in the mesh...
Definition: fem_context.h:277
unsigned int get_mesh_y_var() const
Accessor for y-variable of moving mesh System.
Definition: fem_context.h:874
virtual Order default_order() const =0
const Point & point(const unsigned int i) const
Definition: elem.h:2453
unsigned int get_mesh_z_var() const
Accessor for z-variable of moving mesh System.
Definition: fem_context.h:888
static FEFamily map_fe_type(const Elem &elem)
Definition: fe_map.C:46

◆ 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 1270 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().

1271 {
1272  if (_mesh_sys)
1273  this->_do_elem_position_set(theta);
1274 }
System * _mesh_sys
System from which to acquire moving mesh information.
Definition: fem_context.h:1059
void _do_elem_position_set(Real theta)
Uses the coordinate data specified by mesh_*_position configuration to set the geometry of elem to th...
Definition: fem_context.C:1607

◆ 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 1413 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().

1414 {
1415  // Update the "time" variable of this context object
1416  this->_update_time_from_system(theta);
1417 
1418  // Handle a moving element if necessary.
1419  if (_mesh_sys)
1420  {
1421  // We assume that the ``default'' state
1422  // of the mesh is its final, theta=1.0
1423  // position, so we don't bother with
1424  // mesh motion in that case.
1425  if (theta != 1.0)
1426  {
1427  // FIXME - ALE is not threadsafe yet!
1428  libmesh_assert_equal_to (libMesh::n_threads(), 1);
1429 
1430  elem_position_set(theta);
1431  }
1432  elem_fe_reinit();
1433  }
1434 }
unsigned int n_threads()
Definition: libmesh_base.h:96
void elem_position_set(Real theta)
Uses the coordinate data specified by mesh_*_position configuration to set the geometry of elem to th...
Definition: fem_context.h:1270
virtual void elem_fe_reinit(const std::vector< Point > *const pts=nullptr)
Reinitializes interior FE objects on the current geometric element.
Definition: fem_context.C:1477
void _update_time_from_system(Real theta)
Update the time in the context object for the given value of theta, based on the values of "time" and...
Definition: fem_context.C:1923
System * _mesh_sys
System from which to acquire moving mesh information.
Definition: fem_context.h:1059

◆ 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 1437 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().

1438 {
1439  // Update the "time" variable of this context object
1440  this->_update_time_from_system(theta);
1441 
1442  // Handle a moving element if necessary
1443  if (_mesh_sys)
1444  {
1445  // FIXME - not threadsafe yet!
1446  elem_position_set(theta);
1447  side_fe_reinit();
1448  }
1449 }
void elem_position_set(Real theta)
Uses the coordinate data specified by mesh_*_position configuration to set the geometry of elem to th...
Definition: fem_context.h:1270
virtual void side_fe_reinit()
Reinitializes side FE objects on the current geometric element.
Definition: fem_context.C:1498
void _update_time_from_system(Real theta)
Update the time in the context object for the given value of theta, based on the values of "time" and...
Definition: fem_context.C:1923
System * _mesh_sys
System from which to acquire moving mesh information.
Definition: fem_context.h:1059

◆ find_hardest_fe_type()

FEType libMesh::FEMContext::find_hardest_fe_type ( )
inherited

Helper function for creating quadrature rules.

Definition at line 86 of file fem_context.C.

References libMesh::FEMContext::_active_vars, libMesh::FEType::family, libMesh::DiffContext::get_system(), libMesh::make_range(), libMesh::System::n_vars(), libMesh::FEType::order, libMesh::SCALAR, and libMesh::System::variable_type().

Referenced by libMesh::FEMContext::use_default_quadrature_rules(), and libMesh::FEMContext::use_unweighted_quadrature_rules().

87 {
88  const System & sys = this->get_system();
89  FEType hardest_fe_type =
90  sys.variable_type(_active_vars ?
91  (*_active_vars)[0] : 0);
92 
93  auto check_var = [&hardest_fe_type, &sys](unsigned int v)
94  {
95  FEType fe_type = sys.variable_type(v);
96 
97  // Make sure we find a non-SCALAR FE family, even in the case
98  // where the first variable(s) weren't
99  if (hardest_fe_type.family == SCALAR)
100  {
101  hardest_fe_type.family = fe_type.family;
102  hardest_fe_type.order = fe_type.order;
103  }
104 
105  // FIXME - we don't yet handle mixed finite elements from
106  // different families which require different quadrature rules
107  // libmesh_assert_equal_to (fe_type.family, hardest_fe_type.family);
108 
109  // We need to detect SCALAR's so we can prepare FE objects for
110  // them, and so we don't mistake high order scalars as a reason
111  // to crank up the quadrature order on other types.
112  if (fe_type.family != SCALAR && fe_type.order > hardest_fe_type.order)
113  hardest_fe_type = fe_type;
114  };
115 
116  if (_active_vars)
117  for (auto v : *_active_vars)
118  check_var(v);
119  else
120  for (auto v : make_range(sys.n_vars()))
121  check_var(v);
122 
123  return hardest_fe_type;
124 }
std::unique_ptr< const std::vector< unsigned int > > _active_vars
Variables on which to enable calculations, or nullptr if all variables in the System are to be enable...
Definition: fem_context.h:1054
const System & get_system() const
Accessor for associated system.
Definition: diff_context.h:106
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140

◆ 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 1082 of file fem_context.C.

1083 {
1084  Gradient du;
1085 
1086  this->fixed_interior_gradient( var, qp, du );
1087 
1088  return du;
1089 }
NumberVectorValue Gradient
Gradient fixed_interior_gradient(unsigned int var, unsigned int qp) const
Definition: fem_context.C:1082

◆ 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 1093 of file fem_context.C.

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

1095 {
1096  this->some_gradient
1097  <OutputType,
1099  <typename TensorTools::MakeReal
1100  <typename TensorTools::DecrementRank
1101  <OutputType>::type>::type>,
1103  (var, qp, du);
1104 }
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:210
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for interior finite element object for variable var for the largest dimension in the mesh...
Definition: fem_context.h:277
void some_gradient(unsigned int var, unsigned int qp, OutputType &u) const
Helper function to reduce some code duplication in the *interior_gradient methods.
Definition: fem_context.C:349

◆ 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 1109 of file fem_context.C.

1110 {
1111  Tensor d2u;
1112 
1113  this->fixed_interior_hessian( var, qp, d2u );
1114 
1115  return d2u;
1116 }
NumberTensorValue Tensor
Tensor fixed_interior_hessian(unsigned int var, unsigned int qp) const
Definition: fem_context.C:1109

◆ 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 1120 of file fem_context.C.

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

1122 {
1123  this->some_hessian<OutputType,
1125  <typename TensorTools::MakeReal
1126  <typename TensorTools::DecrementRank
1127  <typename TensorTools::DecrementRank
1128  <OutputType>::type>::type>::type>,
1129  &DiffContext::get_elem_fixed_solution>(var, qp, d2u);
1130 }
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:210
void some_hessian(unsigned int var, unsigned int qp, OutputType &u) const
Helper function to reduce some code duplication in the *interior_hessian methods. ...
Definition: fem_context.C:382
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for interior finite element object for variable var for the largest dimension in the mesh...
Definition: fem_context.h:277

◆ 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 1059 of file fem_context.C.

1060 {
1061  Number u = 0.;
1062 
1063  this->fixed_interior_value( var, qp, u );
1064 
1065  return u;
1066 }
Number fixed_interior_value(unsigned int var, unsigned int qp) const
Definition: fem_context.C:1059

◆ 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 1071 of file fem_context.C.

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

1073 {
1074  this->some_value<OutputType,
1078 }
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:210
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Helper function to reduce some code duplication in the *interior_value methods.
Definition: fem_context.C:315
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for interior finite element object for variable var for the largest dimension in the mesh...
Definition: fem_context.h:277

◆ 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 1255 of file fem_context.C.

1256 {
1257  Gradient grad_u;
1258 
1259  this->fixed_point_gradient( var, p, grad_u );
1260 
1261  return grad_u;
1262 }
Gradient fixed_point_gradient(unsigned int var, const Point &p) const
Definition: fem_context.C:1255
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 1267 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().

1271 {
1272  typedef typename TensorTools::MakeReal
1274  OutputShape;
1275 
1276  // Get local-to-global dof index lookup
1277  const unsigned int n_dofs = cast_int<unsigned int>
1278  (this->get_dof_indices(var).size());
1279 
1280  // Get current local coefficients
1281  libmesh_assert_greater (_elem_fixed_subsolutions.size(), var);
1282  const DenseSubVector<Number> & coef = this->get_elem_fixed_solution(var);
1283 
1284  // Get finite element object
1285  FEGenericBase<OutputShape> * fe = nullptr;
1286  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
1287 
1288  // Build a FE for calculating u(p)
1289  FEGenericBase<OutputShape> * fe_new =
1290  this->build_new_fe( fe, p, tolerance, 1 );
1291 
1292  // Get the values of the shape function derivatives
1293  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient>> & dphi = fe_new->get_dphi();
1294 
1295  grad_u = 0.0;
1296 
1297  for (unsigned int l=0; l != n_dofs; l++)
1298  grad_u.add_scaled(dphi[l][0], coef(l));
1299 
1300  return;
1301 }
std::vector< DenseSubVector< Number > > _elem_fixed_subsolutions
Definition: diff_context.h:605
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:210
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE, const int get_derivative_level=-1) const
Helper function to reduce some code duplication in the *_point_* methods.
Definition: fem_context.C:2023

◆ 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 1306 of file fem_context.C.

1307 {
1308  Tensor hess_u;
1309 
1310  this->fixed_point_hessian( var, p, hess_u );
1311 
1312  return hess_u;
1313 }
Tensor fixed_point_hessian(unsigned int var, const Point &p) const
Definition: fem_context.C:1306
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 1318 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().

1322 {
1323  typedef typename TensorTools::DecrementRank<OutputType>::type Rank1Decrement;
1324  typedef typename TensorTools::DecrementRank<Rank1Decrement>::type Rank2Decrement;
1325  typedef typename TensorTools::MakeReal<Rank2Decrement>::type OutputShape;
1326 
1327  // Get local-to-global dof index lookup
1328  const unsigned int n_dofs = cast_int<unsigned int>
1329  (this->get_dof_indices(var).size());
1330 
1331  // Get current local coefficients
1332  libmesh_assert_greater (_elem_fixed_subsolutions.size(), var);
1333  const DenseSubVector<Number> & coef = this->get_elem_fixed_solution(var);
1334 
1335  // Get finite element object
1336  FEGenericBase<OutputShape> * fe = nullptr;
1337  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
1338 
1339  // Build a FE for calculating u(p)
1340  FEGenericBase<OutputShape> * fe_new =
1341  this->build_new_fe( fe, p, tolerance, 2 );
1342 
1343  // Get the values of the shape function derivatives
1344  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor>> & d2phi = fe_new->get_d2phi();
1345 
1346  hess_u = 0.0;
1347 
1348  for (unsigned int l=0; l != n_dofs; l++)
1349  hess_u.add_scaled(d2phi[l][0], coef(l));
1350 
1351  return;
1352 }
std::vector< DenseSubVector< Number > > _elem_fixed_subsolutions
Definition: diff_context.h:605
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:210
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE, const int get_derivative_level=-1) const
Helper function to reduce some code duplication in the *_point_* methods.
Definition: fem_context.C:2023

◆ 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 1209 of file fem_context.C.

1210 {
1211  Number u = 0.;
1212 
1213  this->fixed_point_value( var, p, u );
1214 
1215  return u;
1216 }
Number fixed_point_value(unsigned int var, const Point &p) const
Definition: fem_context.C:1209

◆ 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 1219 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().

1223 {
1224  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
1225 
1226  // Get local-to-global dof index lookup
1227  const unsigned int n_dofs = cast_int<unsigned int>
1228  (this->get_dof_indices(var).size());
1229 
1230  // Get current local coefficients
1231  libmesh_assert_greater (_elem_fixed_subsolutions.size(), var);
1232  const DenseSubVector<Number> & coef = this->get_elem_fixed_solution(var);
1233 
1234  // Get finite element object
1235  FEGenericBase<OutputShape> * fe = nullptr;
1236  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
1237 
1238  // Build a FE for calculating u(p)
1239  FEGenericBase<OutputShape> * fe_new =
1240  this->build_new_fe( fe, p, tolerance, 0 );
1241 
1242  // Get the values of the shape function derivatives
1243  const std::vector<std::vector<OutputShape>> & phi = fe_new->get_phi();
1244 
1245  u = 0.;
1246 
1247  for (unsigned int l=0; l != n_dofs; l++)
1248  u += phi[l][0] * coef(l);
1249 
1250  return;
1251 }
std::vector< DenseSubVector< Number > > _elem_fixed_subsolutions
Definition: diff_context.h:605
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:210
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE, const int get_derivative_level=-1) const
Helper function to reduce some code duplication in the *_point_* methods.
Definition: fem_context.C:2023

◆ 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 1159 of file fem_context.C.

1160 {
1161  Gradient du;
1162 
1163  this->fixed_side_gradient( var, qp, du );
1164 
1165  return du;
1166 }
NumberVectorValue Gradient
Gradient fixed_side_gradient(unsigned int var, unsigned int qp) const
Definition: fem_context.C:1159

◆ 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 1170 of file fem_context.C.

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

1172 {
1173  this->some_gradient<OutputType,
1175  <typename TensorTools::MakeReal
1176  <typename TensorTools::DecrementRank
1177  <OutputType>::type>::type>,
1178  &DiffContext::get_elem_fixed_solution>(var, qp, du);
1179 }
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for edge/face (2D/3D) finite element object for variable var for the largest dimension in th...
Definition: fem_context.h:317
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:210
void some_gradient(unsigned int var, unsigned int qp, OutputType &u) const
Helper function to reduce some code duplication in the *interior_gradient methods.
Definition: fem_context.C:349

◆ 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 1184 of file fem_context.C.

1185 {
1186  Tensor d2u;
1187 
1188  this->fixed_side_hessian( var, qp, d2u );
1189 
1190  return d2u;
1191 }
Tensor fixed_side_hessian(unsigned int var, unsigned int qp) const
Definition: fem_context.C:1184
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 1194 of file fem_context.C.

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

1196 {
1197  this->some_hessian<OutputType,
1199  <typename TensorTools::MakeReal
1200  <typename TensorTools::DecrementRank
1201  <typename TensorTools::DecrementRank
1202  <OutputType>::type>::type>::type>,
1203  &DiffContext::get_elem_fixed_solution>(var, qp, d2u);
1204 }
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for edge/face (2D/3D) finite element object for variable var for the largest dimension in th...
Definition: fem_context.h:317
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:210
void some_hessian(unsigned int var, unsigned int qp, OutputType &u) const
Helper function to reduce some code duplication in the *interior_hessian methods. ...
Definition: fem_context.C:382

◆ 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 1135 of file fem_context.C.

1136 {
1137  Number u = 0.;
1138 
1139  this->fixed_side_value( var, qp, u );
1140 
1141  return u;
1142 }
Number fixed_side_value(unsigned int var, unsigned int qp) const
Definition: fem_context.C:1135

◆ 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 1146 of file fem_context.C.

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

1148 {
1149  this->some_value
1150  <OutputType,
1154  (var, qp, u);
1155 }
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for edge/face (2D/3D) finite element object for variable var for the largest dimension in th...
Definition: fem_context.h:317
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:210
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Helper function to reduce some code duplication in the *interior_value methods.
Definition: fem_context.C:315

◆ 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 117 of file diff_context.C.

References libMesh::DiffContext::_deltat, and libMesh::libmesh_assert().

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

118 {
120 
121  return *_deltat;
122 }
Real * _deltat
Defaults to nullptr, can optionally be used to point to a timestep value in the System-derived class ...
Definition: diff_context.h:655
libmesh_assert(ctx)

◆ 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 936 of file fem_context.h.

References libMesh::FEMContext::_dim.

Referenced by libMesh::VariationalSmootherSystem::element_time_derivative(), neighbor_side_fe_reinit(), and SolidSystem::side_time_derivative().

937  { return this->_dim; }
unsigned char _dim
Cached dimension of largest dimension element in this mesh.
Definition: fem_context.h:1197

◆ 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 363 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::RBConstruction::add_scaled_matrix_and_vector(), assembly_with_dg_fem_context(), AssemblyA0::boundary_assembly(), AssemblyA1::boundary_assembly(), AssemblyF0::boundary_assembly(), AssemblyF1::boundary_assembly(), AssemblyA2::boundary_assembly(), AssemblyF2::boundary_assembly(), A2::boundary_assembly(), A3::boundary_assembly(), F0::boundary_assembly(), Output0::boundary_assembly(), libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns(), SecondOrderScalarSystemSecondOrderTimeSolverBase::damping_residual(), SecondOrderScalarSystemFirstOrderTimeSolverBase::damping_residual(), FirstOrderScalarSystemBase::element_time_derivative(), SecondOrderScalarSystemFirstOrderTimeSolverBase::element_time_derivative(), libMesh::FEMContext::fixed_point_gradient(), libMesh::FEMContext::fixed_point_hessian(), libMesh::FEMContext::fixed_point_value(), A0::interior_assembly(), B::interior_assembly(), M0::interior_assembly(), A1::interior_assembly(), AssemblyA0::interior_assembly(), AcousticsInnerProduct::interior_assembly(), AssemblyA1::interior_assembly(), A2::interior_assembly(), AssemblyA2::interior_assembly(), F0::interior_assembly(), OutputAssembly::interior_assembly(), EIM_IP_assembly::interior_assembly(), EIM_F::interior_assembly(), AssemblyEIM::interior_assembly(), InnerProductAssembly::interior_assembly(), AssemblyF0::interior_assembly(), AssemblyF1::interior_assembly(), Ex6InnerProduct::interior_assembly(), libMesh::FEMContext::interior_curl(), libMesh::FEMContext::interior_div(), libMesh::FEMContext::interior_gradients(), libMesh::FEMContext::interior_hessians(), libMesh::FEMContext::interior_values(), libMesh::FEMPhysics::mass_residual(), FirstOrderScalarSystemBase::mass_residual(), SecondOrderScalarSystemSecondOrderTimeSolverBase::mass_residual(), SecondOrderScalarSystemFirstOrderTimeSolverBase::mass_residual(), libMesh::FEMSystem::mesh_position_get(), neighbor_side_fe_reinit(), libMesh::DifferentiablePhysics::nonlocal_mass_residual(), libMesh::FEMSystem::numerical_jacobian(), libMesh::FEMContext::point_curl(), libMesh::FEMContext::point_gradient(), libMesh::FEMContext::point_hessian(), libMesh::FEMContext::point_value(), libMesh::FEMContext::pre_fe_reinit(), OverlappingCouplingGhostingTest::run_sparsity_pattern_test(), 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().

364  { return _dof_indices; }
std::vector< dof_id_type > _dof_indices
Global Degree of freedom index lists.
Definition: diff_context.h:639

◆ 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 369 of file diff_context.h.

References libMesh::DiffContext::_dof_indices.

370  { return _dof_indices; }
std::vector< dof_id_type > _dof_indices
Global Degree of freedom index lists.
Definition: diff_context.h:639

◆ 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 376 of file diff_context.h.

References libMesh::DiffContext::_dof_indices_var.

377  {
378  libmesh_assert_greater(_dof_indices_var.size(), var);
379  return _dof_indices_var[var];
380  }
std::vector< std::vector< dof_id_type > > _dof_indices_var
Definition: diff_context.h:640

◆ 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 386 of file diff_context.h.

References libMesh::DiffContext::_dof_indices_var.

387  {
388  libmesh_assert_greater(_dof_indices_var.size(), var);
389  return _dof_indices_var[var];
390  }
std::vector< std::vector< dof_id_type > > _dof_indices_var
Definition: diff_context.h:640

◆ get_edge()

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

Accessor for current edge of Elem object.

Definition at line 928 of file fem_context.h.

References libMesh::FEMContext::edge.

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

929  { return edge; }
unsigned char edge
Current edge for edge_* to examine.
Definition: fem_context.h:1018

◆ get_edge_fe() [1/3]

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 1332 of file fem_context.h.

References libMesh::FEMContext::_edge_fe_var.

1333 {
1334  libmesh_assert_less ( var, _edge_fe_var.size() );
1335  fe = cast_ptr<FEGenericBase<OutputShape> *>( _edge_fe_var[var] );
1336 }
std::vector< FEAbstract * > _edge_fe_var
Definition: fem_context.h:1181

◆ get_edge_fe() [2/3]

void libMesh::FEMContext::get_edge_fe ( unsigned int  var,
FEAbstract *&  fe 
) const
inlineinherited

Definition at line 1339 of file fem_context.h.

References libMesh::FEMContext::_edge_fe_var.

1340 {
1341  libmesh_assert_less ( var, _edge_fe_var.size() );
1342  fe = _edge_fe_var[var];
1343 }
std::vector< FEAbstract * > _edge_fe_var
Definition: fem_context.h:1181

◆ get_edge_fe() [3/3]

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 1346 of file fem_context.h.

References libMesh::FEMContext::_edge_fe_var.

1347 {
1348  libmesh_assert_less ( var, _edge_fe_var.size() );
1349  return cast_ptr<FEBase *>( _edge_fe_var[var] );
1350 }
std::vector< FEAbstract * > _edge_fe_var
Definition: fem_context.h:1181

◆ get_edge_qrule()

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

Accessor for element edge quadrature rule.

Definition at line 831 of file fem_context.h.

References libMesh::FEMContext::_edge_qrule.

832  { return *(this->_edge_qrule); }
std::unique_ptr< QBase > _edge_qrule
Quadrature rules for element edges.
Definition: fem_context.h:1233

◆ get_elem() [1/2]

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

Accessor for current Elem object.

Definition at line 908 of file fem_context.h.

References libMesh::FEMContext::_elem, and libMesh::libmesh_assert().

Referenced by libMesh::FEMContext::_do_elem_position_set(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), AssemblyA0::boundary_assembly(), AssemblyA1::boundary_assembly(), AssemblyF0::boundary_assembly(), AssemblyF1::boundary_assembly(), AssemblyA2::boundary_assembly(), AssemblyF2::boundary_assembly(), libMesh::FEMContext::build_new_fe(), libMesh::FEMContext::cached_fe(), libMesh::OldSolutionBase< Output, point_output >::check_old_context(), libMesh::FEMContext::edge_fe_reinit(), libMesh::FEMContext::elem_fe_reinit(), libMesh::FEMContext::elem_position_get(), SolidSystem::element_time_derivative(), libMesh::VariationalSmootherSystem::element_time_derivative(), HilbertSystem::element_time_derivative(), HeatSystem::element_time_derivative(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::FEMContext::has_side_boundary_id(), libMesh::RBEIMConstruction::initialize_qp_data(), A0::interior_assembly(), A1::interior_assembly(), OutputAssembly::interior_assembly(), EIM_F::interior_assembly(), AssemblyEIM::interior_assembly(), libMesh::FEMSystem::mesh_position_set(), libMesh::FEMSystem::numerical_jacobian(), SlitFunc::operator()(), libMesh::FEMContext::pre_fe_reinit(), libMesh::FEMContext::side_boundary_ids(), NavierSystem::side_constraint(), libMesh::FEMContext::side_fe_reinit(), and SolidSystem::side_time_derivative().

909  { libmesh_assert(this->_elem);
910  return *(this->_elem); }
libmesh_assert(ctx)
const Elem * _elem
Current element for element_* to examine.
Definition: fem_context.h:1192

◆ get_elem() [2/2]

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

Accessor for current Elem object.

Definition at line 915 of file fem_context.h.

References libMesh::FEMContext::_elem, and libMesh::libmesh_assert().

916  { libmesh_assert(this->_elem);
917  return *(const_cast<Elem *>(this->_elem)); }
libmesh_assert(ctx)
const Elem * _elem
Current element for element_* to examine.
Definition: fem_context.h:1192

◆ get_elem_dim()

unsigned char libMesh::FEMContext::get_elem_dim ( ) const
inlineinherited
Returns
The dimension of this->_elem. For mixed dimension meshes, this may be different from get_dim(). If no element init has happened yet, fall back on get_dim().

Definition at line 944 of file fem_context.h.

References libMesh::FEMContext::_dim, libMesh::FEMContext::_elem, and libMesh::FEMContext::_elem_dim.

Referenced by libMesh::FEMContext::_do_elem_position_set(), libMesh::FEMContext::edge_fe_reinit(), libMesh::FEMContext::elem_fe_reinit(), libMesh::FEMContext::elem_position_get(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::FEMContext::fixed_point_gradient(), libMesh::FEMContext::fixed_point_hessian(), libMesh::FEMContext::fixed_point_value(), libMesh::FEMContext::get_element_fe(), libMesh::FEMContext::get_element_qrule(), libMesh::FEMContext::get_side_fe(), libMesh::FEMContext::get_side_qrule(), libMesh::FEMContext::interior_curl(), libMesh::FEMContext::interior_div(), libMesh::FEMContext::interior_gradients(), libMesh::FEMContext::interior_hessians(), libMesh::FEMContext::interior_values(), libMesh::FEMContext::point_curl(), libMesh::FEMContext::point_gradient(), libMesh::FEMContext::point_hessian(), libMesh::FEMContext::point_value(), libMesh::RBParametrizedFunction::preevaluate_parametrized_function_on_mesh(), libMesh::FEMContext::side_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().

945  { return this->_elem ? this->_elem_dim : this->_dim; }
unsigned char _elem_dim
Cached dimension of this->_elem.
Definition: fem_context.h:1202
unsigned char _dim
Cached dimension of largest dimension element in this mesh.
Definition: fem_context.h:1197
const Elem * _elem
Current element for element_* to examine.
Definition: fem_context.h:1192

◆ 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.

Referenced by libMesh::RBConstruction::add_scaled_matrix_and_vector(), and assembly_with_dg_fem_context().

111  { return _elem_elem_jacobian; }
DenseMatrix< Number > _elem_elem_jacobian
The DG Jacobian terms.

◆ 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
The DG Jacobian terms.

◆ 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]

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

◆ 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 216 of file diff_context.h.

References libMesh::DiffContext::_elem_fixed_solution.

217  { return _elem_fixed_solution; }
DenseVector< Number > _elem_fixed_solution
Element by element components of nonlinear_solution at a fixed point in a timestep, for optional use by e.g.
Definition: diff_context.h:604

◆ 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 223 of file diff_context.h.

References libMesh::DiffContext::_elem_fixed_subsolutions.

224  {
225  libmesh_assert_greater(_elem_fixed_subsolutions.size(), var);
226  return _elem_fixed_subsolutions[var];
227  }
std::vector< DenseSubVector< Number > > _elem_fixed_subsolutions
Definition: diff_context.h:605

◆ 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 233 of file diff_context.h.

References libMesh::DiffContext::_elem_fixed_subsolutions.

234  {
235  libmesh_assert_greater(_elem_fixed_subsolutions.size(), var);
236  return _elem_fixed_subsolutions[var];
237  }
std::vector< DenseSubVector< Number > > _elem_fixed_subsolutions
Definition: diff_context.h:605

◆ get_elem_jacobian() [1/4]

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

Const accessor for element Jacobian.

Definition at line 274 of file diff_context.h.

References libMesh::DiffContext::_elem_jacobian, libMesh::DiffContext::_have_local_matrices, and libMesh::libmesh_assert().

Referenced by libMesh::EulerSolver::_general_residual(), libMesh::Euler2Solver::_general_residual(), libMesh::NewmarkSolver::_general_residual(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::FEMSystem::assembly(), assembly_with_dg_fem_context(), AssemblyA0::boundary_assembly(), AssemblyA1::boundary_assembly(), AssemblyA2::boundary_assembly(), A2::boundary_assembly(), A3::boundary_assembly(), libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns(), SecondOrderScalarSystemSecondOrderTimeSolverBase::damping_residual(), SecondOrderScalarSystemFirstOrderTimeSolverBase::damping_residual(), NavierSystem::element_constraint(), CoupledSystem::element_constraint(), libMesh::EigenTimeSolver::element_residual(), NavierSystem::element_time_derivative(), SolidSystem::element_time_derivative(), LaplaceSystem::element_time_derivative(), PoissonSystem::element_time_derivative(), CurlCurlSystem::element_time_derivative(), ElasticitySystem::element_time_derivative(), CoupledSystem::element_time_derivative(), libMesh::VariationalSmootherSystem::element_time_derivative(), HilbertSystem::element_time_derivative(), HeatSystem::element_time_derivative(), B::interior_assembly(), A0::interior_assembly(), M0::interior_assembly(), A1::interior_assembly(), AssemblyA0::interior_assembly(), AcousticsInnerProduct::interior_assembly(), AssemblyA1::interior_assembly(), A2::interior_assembly(), AssemblyA2::interior_assembly(), EIM_IP_assembly::interior_assembly(), AssemblyEIM::interior_assembly(), InnerProductAssembly::interior_assembly(), Ex6InnerProduct::interior_assembly(), NavierSystem::mass_residual(), ElasticitySystem::mass_residual(), libMesh::FEMPhysics::mass_residual(), FirstOrderScalarSystemBase::mass_residual(), SecondOrderScalarSystemSecondOrderTimeSolverBase::mass_residual(), SecondOrderScalarSystemFirstOrderTimeSolverBase::mass_residual(), libMesh::DifferentiablePhysics::nonlocal_mass_residual(), libMesh::EigenTimeSolver::nonlocal_residual(), libMesh::FEMSystem::numerical_jacobian(), libMesh::FEMContext::pre_fe_reinit(), OverlappingCouplingGhostingTest::run_sparsity_pattern_test(), NavierSystem::side_constraint(), LaplaceSystem::side_constraint(), libMesh::EigenTimeSolver::side_residual(), SolidSystem::side_time_derivative(), and CurlCurlSystem::side_time_derivative().

275  {
277  return _elem_jacobian;
278  }
DenseMatrix< Number > _elem_jacobian
Element jacobian: derivatives of elem_residual with respect to elem_solution.
Definition: diff_context.h:616
const bool _have_local_matrices
Whether we have local matrices allocated/initialized.
Definition: diff_context.h:576
libmesh_assert(ctx)

◆ get_elem_jacobian() [2/4]

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

Non-const accessor for element Jacobian.

Definition at line 283 of file diff_context.h.

References libMesh::DiffContext::_elem_jacobian, libMesh::DiffContext::_have_local_matrices, and libMesh::libmesh_assert().

284  {
286  return _elem_jacobian;
287  }
DenseMatrix< Number > _elem_jacobian
Element jacobian: derivatives of elem_residual with respect to elem_solution.
Definition: diff_context.h:616
const bool _have_local_matrices
Whether we have local matrices allocated/initialized.
Definition: diff_context.h:576
libmesh_assert(ctx)

◆ 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 293 of file diff_context.h.

References libMesh::DiffContext::_elem_subjacobians, libMesh::DiffContext::_have_local_matrices, and libMesh::libmesh_assert().

294  {
296  libmesh_assert_greater(_elem_subjacobians.size(), var1);
297  libmesh_assert_greater(_elem_subjacobians[var1].size(), var2);
298  return _elem_subjacobians[var1][var2];
299  }
const bool _have_local_matrices
Whether we have local matrices allocated/initialized.
Definition: diff_context.h:576
libmesh_assert(ctx)
std::vector< std::vector< DenseSubMatrix< Number > > > _elem_subjacobians
Definition: diff_context.h:634

◆ 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.

Only available if _have_local_matrices

Definition at line 306 of file diff_context.h.

References libMesh::DiffContext::_elem_subjacobians, libMesh::DiffContext::_have_local_matrices, and libMesh::libmesh_assert().

307  {
309  libmesh_assert_greater(_elem_subjacobians.size(), var1);
310  libmesh_assert_greater(_elem_subjacobians[var1].size(), var2);
311  return _elem_subjacobians[var1][var2];
312  }
const bool _have_local_matrices
Whether we have local matrices allocated/initialized.
Definition: diff_context.h:576
libmesh_assert(ctx)
std::vector< std::vector< DenseSubMatrix< Number > > > _elem_subjacobians
Definition: diff_context.h:634

◆ 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.

Referenced by libMesh::RBConstruction::add_scaled_matrix_and_vector(), and assembly_with_dg_fem_context().

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

Const accessor for element residual.

Definition at line 242 of file diff_context.h.

References libMesh::DiffContext::_elem_residual.

Referenced by libMesh::Euler2Solver::_general_residual(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::FEMSystem::assembly(), assembly_with_dg_fem_context(), AssemblyF0::boundary_assembly(), AssemblyF1::boundary_assembly(), AssemblyF2::boundary_assembly(), F0::boundary_assembly(), Output0::boundary_assembly(), libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns(), SecondOrderScalarSystemSecondOrderTimeSolverBase::damping_residual(), SecondOrderScalarSystemFirstOrderTimeSolverBase::damping_residual(), NavierSystem::element_constraint(), CoupledSystem::element_constraint(), NavierSystem::element_time_derivative(), SolidSystem::element_time_derivative(), LaplaceSystem::element_time_derivative(), PoissonSystem::element_time_derivative(), CurlCurlSystem::element_time_derivative(), ElasticitySystem::element_time_derivative(), libMesh::VariationalSmootherSystem::element_time_derivative(), CoupledSystem::element_time_derivative(), HilbertSystem::element_time_derivative(), HeatSystem::element_time_derivative(), FirstOrderScalarSystemBase::element_time_derivative(), SecondOrderScalarSystemFirstOrderTimeSolverBase::element_time_derivative(), F0::interior_assembly(), OutputAssembly::interior_assembly(), EIM_F::interior_assembly(), AssemblyF0::interior_assembly(), AssemblyF1::interior_assembly(), NavierSystem::mass_residual(), ElasticitySystem::mass_residual(), libMesh::FEMPhysics::mass_residual(), FirstOrderScalarSystemBase::mass_residual(), SecondOrderScalarSystemSecondOrderTimeSolverBase::mass_residual(), SecondOrderScalarSystemFirstOrderTimeSolverBase::mass_residual(), libMesh::DifferentiablePhysics::nonlocal_mass_residual(), libMesh::FEMSystem::numerical_jacobian(), libMesh::FEMContext::pre_fe_reinit(), NavierSystem::side_constraint(), LaplaceSystem::side_constraint(), SolidSystem::side_time_derivative(), CurlCurlSystem::side_time_derivative(), and ElasticitySystem::side_time_derivative().

243  { return _elem_residual; }
DenseVector< Number > _elem_residual
Element residual vector.
Definition: diff_context.h:610

◆ get_elem_residual() [2/4]

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

Non-const accessor for element residual.

Definition at line 248 of file diff_context.h.

References libMesh::DiffContext::_elem_residual.

249  { return _elem_residual; }
DenseVector< Number > _elem_residual
Element residual vector.
Definition: diff_context.h:610

◆ 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 255 of file diff_context.h.

References libMesh::DiffContext::_elem_subresiduals.

256  {
257  libmesh_assert_greater(_elem_subresiduals.size(), var);
258  return _elem_subresiduals[var];
259  }
std::vector< DenseSubVector< Number > > _elem_subresiduals
Element residual subvectors and (if _have_local_matrices) Jacobian submatrices.
Definition: diff_context.h:633

◆ 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 265 of file diff_context.h.

References libMesh::DiffContext::_elem_subresiduals.

266  {
267  libmesh_assert_greater(_elem_subresiduals.size(), var);
268  return _elem_subresiduals[var];
269  }
std::vector< DenseSubVector< Number > > _elem_subresiduals
Element residual subvectors and (if _have_local_matrices) Jacobian submatrices.
Definition: diff_context.h:633

◆ get_elem_solution() [1/4]

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

◆ get_elem_solution() [2/4]

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

Non-const accessor for element solution.

Definition at line 118 of file diff_context.h.

References libMesh::DiffContext::_elem_solution.

119  { return _elem_solution; }
DenseVector< Number > _elem_solution
Element by element components of nonlinear_solution as adjusted by a time_solver. ...
Definition: diff_context.h:582

◆ 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 125 of file diff_context.h.

References libMesh::DiffContext::_elem_subsolutions.

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

◆ 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  return _elem_subsolutions[var];
139  }
std::vector< DenseSubVector< Number > > _elem_subsolutions
Definition: diff_context.h:583

◆ get_elem_solution_accel() [1/4]

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

Accessor for element solution accel of change w.r.t.

time.

Definition at line 177 of file diff_context.h.

References libMesh::DiffContext::_elem_solution_accel.

Referenced by libMesh::NewmarkSolver::_general_residual(), libMesh::FEMContext::interior_accel(), libMesh::FEMContext::pre_fe_reinit(), libMesh::FirstOrderUnsteadySolver::prepare_accel(), and libMesh::FEMContext::side_accel().

178  { return _elem_solution_accel; }
DenseVector< Number > _elem_solution_accel
Element by element components of du/dt as adjusted by a time_solver.
Definition: diff_context.h:596

◆ 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 184 of file diff_context.h.

References libMesh::DiffContext::_elem_solution_accel.

185  { return _elem_solution_accel; }
DenseVector< Number > _elem_solution_accel
Element by element components of du/dt as adjusted by a time_solver.
Definition: diff_context.h:596

◆ 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 191 of file diff_context.h.

References libMesh::DiffContext::_elem_subsolution_accels.

192  {
193  libmesh_assert_greater(_elem_subsolution_accels.size(), var);
194  return _elem_subsolution_accels[var];
195  }
std::vector< DenseSubVector< Number > > _elem_subsolution_accels
Definition: diff_context.h:597

◆ 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 201 of file diff_context.h.

References libMesh::DiffContext::_elem_subsolution_accels.

202  {
203  libmesh_assert_greater(_elem_subsolution_accels.size(), var);
204  return _elem_subsolution_accels[var];
205  }
std::vector< DenseSubVector< Number > > _elem_subsolution_accels
Definition: diff_context.h:597

◆ 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 450 of file diff_context.h.

References libMesh::DiffContext::elem_solution_accel_derivative.

Referenced by ElasticitySystem::mass_residual(), SecondOrderScalarSystemSecondOrderTimeSolverBase::mass_residual(), and SecondOrderScalarSystemFirstOrderTimeSolverBase::mass_residual().

Real elem_solution_accel_derivative
The derivative of elem_solution_accel with respect to the current nonlinear solution, for use by systems with non default mass_residual terms.
Definition: diff_context.h:510

◆ 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 432 of file diff_context.h.

References libMesh::DiffContext::elem_solution_derivative.

Referenced by libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns(), NavierSystem::element_constraint(), ElasticitySystem::element_time_derivative(), HilbertSystem::element_time_derivative(), HeatSystem::element_time_derivative(), NavierSystem::mass_residual(), and NavierSystem::side_constraint().

433  { return elem_solution_derivative; }
Real elem_solution_derivative
The derivative of elem_solution with respect to the current nonlinear solution.
Definition: diff_context.h:496

◆ get_elem_solution_rate() [1/4]

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

◆ 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 151 of file diff_context.h.

References libMesh::DiffContext::_elem_solution_rate.

152  { return _elem_solution_rate; }
DenseVector< Number > _elem_solution_rate
Element by element components of du/dt as adjusted by a time_solver.
Definition: diff_context.h:589

◆ 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 158 of file diff_context.h.

References libMesh::DiffContext::_elem_subsolution_rates.

159  {
160  libmesh_assert_greater(_elem_subsolution_rates.size(), var);
161  return _elem_subsolution_rates[var];
162  }
std::vector< DenseSubVector< Number > > _elem_subsolution_rates
Definition: diff_context.h:590

◆ 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 168 of file diff_context.h.

References libMesh::DiffContext::_elem_subsolution_rates.

169  {
170  libmesh_assert_greater(_elem_subsolution_rates.size(), var);
171  return _elem_subsolution_rates[var];
172  }
std::vector< DenseSubVector< Number > > _elem_subsolution_rates
Definition: diff_context.h:590

◆ 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 441 of file diff_context.h.

References libMesh::DiffContext::elem_solution_rate_derivative.

Referenced by libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns(), SecondOrderScalarSystemSecondOrderTimeSolverBase::damping_residual(), SecondOrderScalarSystemFirstOrderTimeSolverBase::damping_residual(), FirstOrderScalarSystemBase::mass_residual(), and libMesh::FirstOrderUnsteadySolver::prepare_accel().

Real elem_solution_rate_derivative
The derivative of elem_solution_rate with respect to the current nonlinear solution, for use by systems with non default mass_residual terms.
Definition: diff_context.h:503

◆ get_element_fe() [1/5]

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 if this method is called before the Elem * is set in the FEMContext, e.g. in FEMSystem::init_context (or a subclass).

Definition at line 277 of file fem_context.h.

References libMesh::FEMContext::get_elem_dim().

Referenced by libMesh::ExactSolution::_compute_error(), libMesh::FEMContext::_do_elem_position_set(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), assembly_with_dg_fem_context(), libMesh::VariationalSmootherSystem::compute_element_reference_volume(), libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns(), libMesh::FEMContext::elem_position_get(), NavierSystem::element_constraint(), CoupledSystem::element_constraint(), PoissonSystem::element_postprocess(), LaplaceSystem::element_postprocess(), LaplaceQoI::element_qoi(), HeatSystem::element_qoi(), LaplaceQoI::element_qoi_derivative(), LaplaceSystem::element_qoi_derivative(), HeatSystem::element_qoi_derivative(), NavierSystem::element_time_derivative(), SolidSystem::element_time_derivative(), PoissonSystem::element_time_derivative(), LaplaceSystem::element_time_derivative(), CurlCurlSystem::element_time_derivative(), ElasticitySystem::element_time_derivative(), libMesh::VariationalSmootherSystem::element_time_derivative(), CoupledSystem::element_time_derivative(), HilbertSystem::element_time_derivative(), HeatSystem::element_time_derivative(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_sides(), libMesh::FEMContext::fixed_interior_gradient(), libMesh::FEMContext::fixed_interior_hessian(), libMesh::FEMContext::fixed_interior_value(), libMesh::FEMContext::get_element_fe(), CoupledSystemQoI::init_context(), LaplaceQoI::init_context(), NavierSystem::init_context(), SolidSystem::init_context(), PoissonSystem::init_context(), LaplaceSystem::init_context(), CurlCurlSystem::init_context(), ElasticitySystem::init_context(), libMesh::VariationalSmootherSystem::init_context(), CoupledSystem::init_context(), HilbertSystem::init_context(), libMesh::ParsedFEMFunction< T >::init_context(), libMesh::WrappedFunctor< Output >::init_context(), HeatSystem::init_context(), ElasticityRBConstruction::init_context(), SimpleRBConstruction::init_context(), libMesh::FEMSystem::init_context(), libMesh::RBEIMConstruction::init_context(), libMesh::RBEIMConstruction::initialize_qp_data(), libMesh::FEMContext::interior_accel(), B::interior_assembly(), A0::interior_assembly(), M0::interior_assembly(), A1::interior_assembly(), AssemblyA0::interior_assembly(), AcousticsInnerProduct::interior_assembly(), AssemblyA1::interior_assembly(), A2::interior_assembly(), AssemblyA2::interior_assembly(), F0::interior_assembly(), OutputAssembly::interior_assembly(), EIM_IP_assembly::interior_assembly(), EIM_F::interior_assembly(), AssemblyEIM::interior_assembly(), InnerProductAssembly::interior_assembly(), AssemblyF0::interior_assembly(), AssemblyF1::interior_assembly(), Ex6InnerProduct::interior_assembly(), libMesh::FEMContext::interior_gradient(), libMesh::FEMContext::interior_hessian(), libMesh::FEMContext::interior_rate(), libMesh::FEMContext::interior_rate_gradient(), NavierSystem::mass_residual(), ElasticitySystem::mass_residual(), libMesh::FEMPhysics::mass_residual(), Integrate::operator()(), libMesh::RBParametrizedFunction::preevaluate_parametrized_function_on_mesh(), libMesh::RBParametrizedFunction::preevaluate_parametrized_function_on_mesh_sides(), OverlappingAlgebraicGhostingTest::run_ghosting_test(), OverlappingCouplingGhostingTest::run_sparsity_pattern_test(), and NavierSystem::side_constraint().

278  { this->get_element_fe<OutputShape>(var,fe,this->get_elem_dim()); }
unsigned char get_elem_dim() const
Definition: fem_context.h:944

◆ get_element_fe() [2/5]

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 if this method is called before the Elem * is set in the FEMContext, e.g. in FEMSystem::init_context (or a subclass).

Definition at line 286 of file fem_context.h.

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

287  { return this->get_element_fe(var,this->get_elem_dim()); }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for interior finite element object for variable var for the largest dimension in the mesh...
Definition: fem_context.h:277

◆ get_element_fe() [3/5]

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 1278 of file fem_context.h.

References libMesh::FEMContext::_element_fe_var, dim, and libMesh::libmesh_assert().

1280 {
1281  libmesh_assert( !_element_fe_var[dim].empty() );
1282  libmesh_assert_less ( var, (_element_fe_var[dim].size() ) );
1283  fe = cast_ptr<FEGenericBase<OutputShape> *>( (_element_fe_var[dim][var] ) );
1284 }
unsigned int dim
libmesh_assert(ctx)
std::vector< std::vector< FEAbstract * > > _element_fe_var
Pointers to the same finite element objects, but indexed by variable number.
Definition: fem_context.h:1179

◆ get_element_fe() [4/5]

void libMesh::FEMContext::get_element_fe ( unsigned int  var,
FEAbstract *&  fe,
unsigned short  dim 
) const
inlineinherited

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

Definition at line 1287 of file fem_context.h.

References libMesh::FEMContext::_element_fe_var, dim, and libMesh::libmesh_assert().

1289 {
1290  libmesh_assert( !_element_fe_var[dim].empty() );
1291  libmesh_assert_less ( var, (_element_fe_var[dim].size() ) );
1292  fe = _element_fe_var[dim][var];
1293 }
unsigned int dim
libmesh_assert(ctx)
std::vector< std::vector< FEAbstract * > > _element_fe_var
Pointers to the same finite element objects, but indexed by variable number.
Definition: fem_context.h:1179

◆ get_element_fe() [5/5]

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 1296 of file fem_context.h.

References libMesh::FEMContext::_element_fe_var, dim, and libMesh::libmesh_assert().

1297 {
1298  libmesh_assert( !_element_fe_var[dim].empty() );
1299  libmesh_assert_less ( var, (_element_fe_var[dim].size() ) );
1300  return cast_ptr<FEBase *>( (_element_fe_var[dim][var] ) );
1301 }
unsigned int dim
libmesh_assert(ctx)
std::vector< std::vector< FEAbstract * > > _element_fe_var
Pointers to the same finite element objects, but indexed by variable number.
Definition: fem_context.h:1179

◆ 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 802 of file fem_context.h.

References libMesh::FEMContext::get_elem_dim().

Referenced by assembly_with_dg_fem_context(), libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns(), SecondOrderScalarSystemSecondOrderTimeSolverBase::damping_residual(), SecondOrderScalarSystemFirstOrderTimeSolverBase::damping_residual(), NavierSystem::element_constraint(), CoupledSystem::element_constraint(), PoissonSystem::element_postprocess(), LaplaceSystem::element_postprocess(), LaplaceQoI::element_qoi(), HeatSystem::element_qoi(), LaplaceQoI::element_qoi_derivative(), LaplaceSystem::element_qoi_derivative(), HeatSystem::element_qoi_derivative(), NavierSystem::element_time_derivative(), SolidSystem::element_time_derivative(), LaplaceSystem::element_time_derivative(), PoissonSystem::element_time_derivative(), CurlCurlSystem::element_time_derivative(), ElasticitySystem::element_time_derivative(), CoupledSystem::element_time_derivative(), libMesh::VariationalSmootherSystem::element_time_derivative(), HilbertSystem::element_time_derivative(), HeatSystem::element_time_derivative(), FirstOrderScalarSystemBase::element_time_derivative(), SecondOrderScalarSystemFirstOrderTimeSolverBase::element_time_derivative(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::FEMPhysics::eulerian_residual(), B::interior_assembly(), A0::interior_assembly(), M0::interior_assembly(), A1::interior_assembly(), AssemblyA0::interior_assembly(), AcousticsInnerProduct::interior_assembly(), AssemblyA1::interior_assembly(), A2::interior_assembly(), AssemblyA2::interior_assembly(), F0::interior_assembly(), OutputAssembly::interior_assembly(), EIM_IP_assembly::interior_assembly(), EIM_F::interior_assembly(), AssemblyEIM::interior_assembly(), InnerProductAssembly::interior_assembly(), AssemblyF0::interior_assembly(), AssemblyF1::interior_assembly(), Ex6InnerProduct::interior_assembly(), NavierSystem::mass_residual(), ElasticitySystem::mass_residual(), libMesh::FEMPhysics::mass_residual(), FirstOrderScalarSystemBase::mass_residual(), SecondOrderScalarSystemSecondOrderTimeSolverBase::mass_residual(), SecondOrderScalarSystemFirstOrderTimeSolverBase::mass_residual(), and libMesh::RBParametrizedFunction::preevaluate_parametrized_function_on_mesh().

803  { return this->get_element_qrule(this->get_elem_dim()); }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const QBase & get_element_qrule() const
Accessor for element interior quadrature rule for the dimension of the current _elem.
Definition: fem_context.h:802

◆ 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 815 of file fem_context.h.

References libMesh::FEMContext::_element_qrule, dim, and libMesh::libmesh_assert().

817  return *(this->_element_qrule[dim]); }
unsigned int dim
libmesh_assert(ctx)
std::vector< std::unique_ptr< QBase > > _element_qrule
Quadrature rule for element interior.
Definition: fem_context.h:1216

◆ 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 459 of file diff_context.h.

References libMesh::DiffContext::fixed_solution_derivative.

460  { return fixed_solution_derivative; }
Real fixed_solution_derivative
The derivative of elem_fixed_solution with respect to the nonlinear solution, for use by systems cons...
Definition: diff_context.h:517

◆ 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 154 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().

155 {
156  return _localized_vectors[&localized_vector].second[var];
157 }
std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< DenseSubVector< Number > > > > _localized_vectors
Contains pointers to vectors the user has asked to be localized, keyed with pairs of element localize...
Definition: diff_context.h:571

◆ 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 160 of file diff_context.C.

References libMesh::DiffContext::_localized_vectors, and libMesh::libmesh_assert().

161 {
162  auto localized_vectors_it = _localized_vectors.find(&localized_vector);
163  libmesh_assert(localized_vectors_it != _localized_vectors.end());
164  return localized_vectors_it->second.second[var];
165 }
libmesh_assert(ctx)
std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< DenseSubVector< Number > > > > _localized_vectors
Contains pointers to vectors the user has asked to be localized, keyed with pairs of element localize...
Definition: diff_context.h:571

◆ 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 140 of file diff_context.C.

References libMesh::DiffContext::_localized_vectors.

141 {
142  return _localized_vectors[&localized_vector].first;
143 }
std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< DenseSubVector< Number > > > > _localized_vectors
Contains pointers to vectors the user has asked to be localized, keyed with pairs of element localize...
Definition: diff_context.h:571

◆ 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 146 of file diff_context.C.

References libMesh::DiffContext::_localized_vectors, and libMesh::libmesh_assert().

147 {
148  auto localized_vectors_it = _localized_vectors.find(&localized_vector);
149  libmesh_assert(localized_vectors_it != _localized_vectors.end());
150  return localized_vectors_it->second.first;
151 }
libmesh_assert(ctx)
std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< DenseSubVector< Number > > > > _localized_vectors
Contains pointers to vectors the user has asked to be localized, keyed with pairs of element localize...
Definition: diff_context.h:571

◆ get_mesh_system() [1/2]

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

Accessor for moving mesh System.

Definition at line 848 of file fem_context.h.

References libMesh::FEMContext::_mesh_sys.

849  { return this->_mesh_sys; }
System * _mesh_sys
System from which to acquire moving mesh information.
Definition: fem_context.h:1059

◆ get_mesh_system() [2/2]

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

Accessor for moving mesh System.

Definition at line 854 of file fem_context.h.

References libMesh::FEMContext::_mesh_sys.

855  { return this->_mesh_sys; }
System * _mesh_sys
System from which to acquire moving mesh information.
Definition: fem_context.h:1059

◆ 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 860 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().

861  { return _mesh_x_var; }
unsigned int _mesh_x_var
Variables from which to acquire moving mesh information.
Definition: fem_context.h:1064

◆ 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 874 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().

875  { return _mesh_y_var; }
unsigned int _mesh_y_var
Definition: fem_context.h:1064

◆ 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 888 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().

889  { return _mesh_z_var; }
unsigned int _mesh_z_var
Definition: fem_context.h:1064

◆ 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; }
const Elem * _neighbor
Current neighbor element for assembling DG terms.

◆ 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.

Referenced by libMesh::RBConstruction::add_scaled_matrix_and_vector(), and assembly_with_dg_fem_context().

72  { return _neighbor_dof_indices; }
std::vector< dof_id_type > _neighbor_dof_indices
Global Degree of freedom index lists for the neighbor element.

◆ 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.

Referenced by libMesh::RBConstruction::add_scaled_matrix_and_vector(), and assembly_with_dg_fem_context().

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.

Referenced by libMesh::RBConstruction::add_scaled_matrix_and_vector(), and assembly_with_dg_fem_context().

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
Residual vector of the neighbor component.

◆ 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
Residual vector of the neighbor component.

◆ 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
Element residual subvectors and Jacobian submatrices.

◆ 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
Element residual subvectors and Jacobian submatrices.

◆ 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.

Referenced by assembly_with_dg_fem_context().

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
Pointers to the same finite element objects on the neighbor element, but indexed by variable number...

◆ 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 329 of file diff_context.h.

References libMesh::DiffContext::_elem_qoi_derivative.

Referenced by LaplaceQoI::element_qoi_derivative(), LaplaceSystem::element_qoi_derivative(), HeatSystem::element_qoi_derivative(), libMesh::FEMContext::pre_fe_reinit(), CoupledSystemQoI::side_qoi_derivative(), and LaplaceSystem::side_qoi_derivative().

330  { return _elem_qoi_derivative; }
std::vector< DenseVector< Number > > _elem_qoi_derivative
Element quantity of interest derivative contributions.
Definition: diff_context.h:626

◆ get_qoi_derivatives() [2/4]

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

Non-const accessor for QoI derivatives.

Definition at line 335 of file diff_context.h.

References libMesh::DiffContext::_elem_qoi_derivative.

336  { return _elem_qoi_derivative; }
std::vector< DenseVector< Number > > _elem_qoi_derivative
Element quantity of interest derivative contributions.
Definition: diff_context.h:626

◆ 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 342 of file diff_context.h.

References libMesh::DiffContext::_elem_qoi_subderivatives.

343  {
344  libmesh_assert_greater(_elem_qoi_subderivatives.size(), qoi);
345  libmesh_assert_greater(_elem_qoi_subderivatives[qoi].size(), var);
346  return _elem_qoi_subderivatives[qoi][var];
347  }
std::vector< std::vector< DenseSubVector< Number > > > _elem_qoi_subderivatives
Definition: diff_context.h:627

◆ 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 353 of file diff_context.h.

References libMesh::DiffContext::_elem_qoi_subderivatives.

354  {
355  libmesh_assert_greater(_elem_qoi_subderivatives.size(), qoi);
356  libmesh_assert_greater(_elem_qoi_subderivatives[qoi].size(), var);
357  return _elem_qoi_subderivatives[qoi][var];
358  }
std::vector< std::vector< DenseSubVector< Number > > > _elem_qoi_subderivatives
Definition: diff_context.h:627

◆ get_qois() [1/2]

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

Const accessor for QoI vector.

Definition at line 317 of file diff_context.h.

References libMesh::DiffContext::_elem_qoi.

Referenced by LaplaceQoI::element_qoi(), HeatSystem::element_qoi(), and CoupledSystemQoI::side_qoi().

318  { return _elem_qoi; }
std::vector< Number > _elem_qoi
Element quantity of interest contributions.
Definition: diff_context.h:621

◆ get_qois() [2/2]

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

Non-const accessor for QoI vector.

Definition at line 323 of file diff_context.h.

References libMesh::DiffContext::_elem_qoi.

324  { return _elem_qoi; }
std::vector< Number > _elem_qoi
Element quantity of interest contributions.
Definition: diff_context.h:621

◆ get_side()

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

Accessor for current side of Elem object.

Definition at line 922 of file fem_context.h.

References libMesh::FEMContext::side.

Referenced by libMesh::RBConstruction::add_scaled_matrix_and_vector(), assembly_with_dg_fem_context(), libMesh::FEMContext::side_fe_reinit(), and SolidSystem::side_time_derivative().

923  { return side; }
unsigned char side
Current side for side_* to examine.
Definition: fem_context.h:1013

◆ get_side_fe() [1/5]

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 if this method is called before the Elem * is set in the FEMContext, e.g. in FEMSystem::init_context (or a subclass).

Definition at line 317 of file fem_context.h.

References libMesh::FEMContext::get_elem_dim().

Referenced by assembly_with_dg_fem_context(), AssemblyA0::boundary_assembly(), AssemblyA1::boundary_assembly(), AssemblyF0::boundary_assembly(), AssemblyF1::boundary_assembly(), AssemblyA2::boundary_assembly(), AssemblyF2::boundary_assembly(), A2::boundary_assembly(), A3::boundary_assembly(), F0::boundary_assembly(), Output0::boundary_assembly(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_sides(), 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(), CoupledSystemQoI::init_context(), NavierSystem::init_context(), SolidSystem::init_context(), PoissonSystem::init_context(), LaplaceSystem::init_context(), CurlCurlSystem::init_context(), ElasticitySystem::init_context(), libMesh::LaplacianErrorEstimator::init_context(), CoupledSystem::init_context(), libMesh::VariationalSmootherSystem::init_context(), HilbertSystem::init_context(), libMesh::DiscontinuityMeasure::init_context(), libMesh::ParsedFEMFunction< T >::init_context(), HeatSystem::init_context(), libMesh::KellyErrorEstimator::init_context(), ElasticityRBConstruction::init_context(), SimpleRBConstruction::init_context(), libMesh::RBEIMConstruction::init_context(), libMesh::RBEIMConstruction::initialize_qp_data(), libMesh::RBParametrizedFunction::preevaluate_parametrized_function_on_mesh_sides(), libMesh::FEMContext::side_accel(), LaplaceSystem::side_constraint(), libMesh::FEMContext::side_hessian(), LaplaceSystem::side_postprocess(), CoupledSystemQoI::side_qoi(), CoupledSystemQoI::side_qoi_derivative(), LaplaceSystem::side_qoi_derivative(), libMesh::FEMContext::side_rate(), SolidSystem::side_time_derivative(), CurlCurlSystem::side_time_derivative(), and ElasticitySystem::side_time_derivative().

318  { this->get_side_fe<OutputShape>(var,fe,this->get_elem_dim()); }
unsigned char get_elem_dim() const
Definition: fem_context.h:944

◆ get_side_fe() [2/5]

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 if this method is called before the Elem * is set in the FEMContext, e.g. in FEMSystem::init_context (or a subclass).

Definition at line 326 of file fem_context.h.

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

327  { return this->get_side_fe(var,this->get_elem_dim()); }
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for edge/face (2D/3D) finite element object for variable var for the largest dimension in th...
Definition: fem_context.h:317
unsigned char get_elem_dim() const
Definition: fem_context.h:944

◆ get_side_fe() [3/5]

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 1305 of file fem_context.h.

References libMesh::FEMContext::_side_fe_var, dim, and libMesh::libmesh_assert().

1307 {
1308  libmesh_assert( !_side_fe_var[dim].empty() );
1309  libmesh_assert_less ( var, (_side_fe_var[dim].size() ) );
1310  fe = cast_ptr<FEGenericBase<OutputShape> *>( (_side_fe_var[dim][var] ) );
1311 }
unsigned int dim
libmesh_assert(ctx)
std::vector< std::vector< FEAbstract * > > _side_fe_var
Definition: fem_context.h:1180

◆ get_side_fe() [4/5]

void libMesh::FEMContext::get_side_fe ( unsigned int  var,
FEAbstract *&  fe,
unsigned short  dim 
) const
inlineinherited

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

Definition at line 1314 of file fem_context.h.

References libMesh::FEMContext::_side_fe_var, dim, and libMesh::libmesh_assert().

1316 {
1317  libmesh_assert( !_side_fe_var[dim].empty() );
1318  libmesh_assert_less ( var, (_side_fe_var[dim].size() ) );
1319  fe = _side_fe_var[dim][var];
1320 }
unsigned int dim
libmesh_assert(ctx)
std::vector< std::vector< FEAbstract * > > _side_fe_var
Definition: fem_context.h:1180

◆ get_side_fe() [5/5]

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 1323 of file fem_context.h.

References libMesh::FEMContext::_side_fe_var, dim, and libMesh::libmesh_assert().

1324 {
1325  libmesh_assert( !_side_fe_var[dim].empty() );
1326  libmesh_assert_less ( var, (_side_fe_var[dim].size() ) );
1327  return cast_ptr<FEBase *>( (_side_fe_var[dim][var] ) );
1328 }
unsigned int dim
libmesh_assert(ctx)
std::vector< std::vector< FEAbstract * > > _side_fe_var
Definition: fem_context.h:1180

◆ get_side_qrule() [1/2]

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

◆ 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 822 of file fem_context.h.

References libMesh::FEMContext::_side_qrule, dim, and libMesh::libmesh_assert().

823  {
825  return *(this->_side_qrule[dim]);
826  }
unsigned int dim
libmesh_assert(ctx)
std::vector< std::unique_ptr< QBase > > _side_qrule
Quadrature rules for element sides The FEM context will try to find a quadrature rule that correctly ...
Definition: fem_context.h:1224

◆ get_system()

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

◆ get_system_time()

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

Accessor for the time variable stored in the system class.

Definition at line 411 of file diff_context.h.

References libMesh::DiffContext::system_time.

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

412  { return system_time; }
const Real system_time
This is the time stored in the System class at the time this context was created, i...
Definition: diff_context.h:490

◆ get_time()

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

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

Definition at line 417 of file diff_context.h.

References libMesh::DiffContext::time.

418  { return time; }
Real time
For time-dependent problems, this is the time t for which the current nonlinear_solution is defined...
Definition: diff_context.h:481

◆ has_elem()

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

Test for current Elem object.

Definition at line 902 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().

903  { return (this->_elem != nullptr); }
const Elem * _elem
Current element for element_* to examine.
Definition: fem_context.h:1192

◆ 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 298 of file fem_context.C.

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

Referenced by A2::boundary_assembly(), A3::boundary_assembly(), F0::boundary_assembly(), Output0::boundary_assembly(), CoupledSystemQoI::side_qoi(), CoupledSystemQoI::side_qoi_derivative(), and ElasticitySystem::side_time_derivative().

299 {
300  return _boundary_info.has_boundary_id(&(this->get_elem()), side, id);
301 }
bool has_boundary_id(const Node *const node, const boundary_id_type id) const
const Elem & get_elem() const
Accessor for current Elem object.
Definition: fem_context.h:908
const BoundaryInfo & _boundary_info
Saved reference to BoundaryInfo on the mesh for this System.
Definition: fem_context.h:1187
unsigned char side
Current side for side_* to examine.
Definition: fem_context.h:1013

◆ interior_accel()

template<typename OutputType >
template LIBMESH_EXPORT 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 1390 of file fem_context.C.

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

Referenced by ElasticitySystem::mass_residual(), SecondOrderScalarSystemSecondOrderTimeSolverBase::mass_residual(), and SecondOrderScalarSystemFirstOrderTimeSolverBase::mass_residual().

1392 {
1393  this->some_value<OutputType,
1397 }
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Helper function to reduce some code duplication in the *interior_value methods.
Definition: fem_context.C:315
const DenseVector< Number > & get_elem_solution_accel() const
Accessor for element solution accel of change w.r.t.
Definition: diff_context.h:177
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for interior finite element object for variable var for the largest dimension in the mesh...
Definition: fem_context.h:277

◆ interior_curl()

template<typename OutputType >
template LIBMESH_EXPORT 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 598 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().

Referenced by CurlCurlSystem::element_time_derivative().

600 {
601  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
602 
603  // Get local-to-global dof index lookup
604  const unsigned int n_dofs = cast_int<unsigned int>
605  (this->get_dof_indices(var).size());
606 
607  // Get current local coefficients
608  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
609  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
610 
611  // Get finite element object
612  FEGenericBase<OutputShape> * fe = nullptr;
613  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
614 
615  // Get shape function values at quadrature point
616  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputShape>> & curl_phi = fe->get_curl_phi();
617 
618  // Accumulate solution curl
619  curl_u = 0.;
620 
621  for (unsigned int l=0; l != n_dofs; l++)
622  curl_u.add_scaled(curl_phi[l][qp], coef(l));
623 
624  return;
625 }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:112
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
std::vector< DenseSubVector< Number > > _elem_subsolutions
Definition: diff_context.h:583

◆ interior_div()

template<typename OutputType >
template LIBMESH_EXPORT 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 629 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().

631 {
632  typedef typename
633  TensorTools::IncrementRank
634  <typename TensorTools::MakeReal<OutputType>::type>::type OutputShape;
635 
636  // Get local-to-global dof index lookup
637  const unsigned int n_dofs = cast_int<unsigned int>
638  (this->get_dof_indices(var).size());
639 
640  // Get current local coefficients
641  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
642  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
643 
644  // Get finite element object
645  FEGenericBase<OutputShape> * fe = nullptr;
646  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
647 
648  // Get shape function values at quadrature point
649  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputDivergence>> & div_phi = fe->get_div_phi();
650 
651  // Accumulate solution curl
652  div_u = 0.;
653 
654  for (unsigned int l=0; l != n_dofs; l++)
655  div_u += div_phi[l][qp] * coef(l);
656 
657  return;
658 }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:112
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
std::vector< DenseSubVector< Number > > _elem_subsolutions
Definition: diff_context.h:583

◆ 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 467 of file fem_context.C.

Referenced by NavierSystem::element_constraint(), CoupledSystem::element_constraint(), PoissonSystem::element_postprocess(), NavierSystem::element_time_derivative(), LaplaceSystem::element_time_derivative(), PoissonSystem::element_time_derivative(), ElasticitySystem::element_time_derivative(), CoupledSystem::element_time_derivative(), HilbertSystem::element_time_derivative(), HeatSystem::element_time_derivative(), and libMesh::FEMPhysics::eulerian_residual().

469 {
470  Gradient du;
471 
472  this->interior_gradient( var, qp, du );
473 
474  return du;
475 }
Gradient interior_gradient(unsigned int var, unsigned int qp) const
Definition: fem_context.C:467
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 480 of file fem_context.C.

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

483 {
484  this->some_gradient<OutputType,
485  &FEMContext::get_element_fe<typename TensorTools::MakeReal
486  <typename TensorTools::DecrementRank
487  <OutputType>::type>::type>,
488  &DiffContext::get_elem_solution>(var, qp, du);
489 }
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:112
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for interior finite element object for variable var for the largest dimension in the mesh...
Definition: fem_context.h:277
void some_gradient(unsigned int var, unsigned int qp, OutputType &u) const
Helper function to reduce some code duplication in the *interior_gradient methods.
Definition: fem_context.C:349

◆ interior_gradients()

template<typename OutputType >
template LIBMESH_EXPORT 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 494 of file fem_context.C.

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

497 {
498  typedef typename TensorTools::MakeReal
500  OutputShape;
501 
502  // Get local-to-global dof index lookup
503  const unsigned int n_dofs = cast_int<unsigned int>
504  (this->get_dof_indices(var).size());
505 
506  // Get current local coefficients
507  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
508 
509  // Get finite element object
510  FEGenericBase<OutputShape> * fe = nullptr;
511  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
512 
513  // Get shape function values at quadrature point
514  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient>> & dphi = fe->get_dphi();
515 
516  // Loop over all the q_points in this finite element
517  for (auto qp : index_range(du_vals))
518  {
519  OutputType & du = du_vals[qp];
520 
521  // Compute the gradient at this q_point
522  du = 0;
523 
524  for (unsigned int l=0; l != n_dofs; l++)
525  du.add_scaled(dphi[l][qp], coef(l));
526  }
527 
528  return;
529 }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
DenseSubVector< Number > & get_localized_subvector(const NumericVector< Number > &localized_vector, unsigned int var)
Return a reference to DenseSubVector localization of localized_vector at variable var contained in th...
Definition: diff_context.C:154
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition: int_range.h:117

◆ 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 532 of file fem_context.C.

533 {
534  Tensor d2u;
535 
536  this->interior_hessian( var, qp, d2u );
537 
538  return d2u;
539 }
Tensor interior_hessian(unsigned int var, unsigned int qp) const
Definition: fem_context.C:532
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 542 of file fem_context.C.

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

544 {
545  this->some_hessian<OutputType,
547  <typename TensorTools::MakeReal
548  <typename TensorTools::DecrementRank
549  <typename TensorTools::DecrementRank
550  <OutputType>::type>::type>::type>,
551  &DiffContext::get_elem_solution>(var, qp, d2u);
552 }
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:112
void some_hessian(unsigned int var, unsigned int qp, OutputType &u) const
Helper function to reduce some code duplication in the *interior_hessian methods. ...
Definition: fem_context.C:382
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for interior finite element object for variable var for the largest dimension in the mesh...
Definition: fem_context.h:277

◆ interior_hessians()

template<typename OutputType >
template LIBMESH_EXPORT 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 556 of file fem_context.C.

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

559 {
560  typedef typename TensorTools::DecrementRank<OutputType>::type Rank1Decrement;
561  typedef typename TensorTools::DecrementRank<Rank1Decrement>::type Rank2Decrement;
562  typedef typename TensorTools::MakeReal<Rank2Decrement>::type OutputShape;
563 
564  // Get local-to-global dof index lookup
565  const unsigned int n_dofs = cast_int<unsigned int>
566  (this->get_dof_indices(var).size());
567 
568  // Get current local coefficients
569  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
570 
571  // Get finite element object
572  FEGenericBase<OutputShape> * fe = nullptr;
573  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
574 
575  // Get shape function values at quadrature point
576  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor>> & d2phi = fe->get_d2phi();
577 
578  // Loop over all the q_points in this finite element
579  for (auto qp : index_range(d2u_vals))
580  {
581  OutputType & d2u = d2u_vals[qp];
582 
583  // Compute the gradient at this q_point
584  d2u = 0;
585 
586  for (unsigned int l=0; l != n_dofs; l++)
587  d2u.add_scaled(d2phi[l][qp], coef(l));
588  }
589 
590  return;
591 }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
DenseSubVector< Number > & get_localized_subvector(const NumericVector< Number > &localized_vector, unsigned int var)
Return a reference to DenseSubVector localization of localized_vector at variable var contained in th...
Definition: diff_context.C:154
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition: int_range.h:117

◆ interior_rate()

template<typename OutputType >
template LIBMESH_EXPORT 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 1359 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(), SecondOrderScalarSystemSecondOrderTimeSolverBase::damping_residual(), SecondOrderScalarSystemFirstOrderTimeSolverBase::damping_residual(), NavierSystem::mass_residual(), libMesh::FEMPhysics::mass_residual(), and FirstOrderScalarSystemBase::mass_residual().

1361 {
1362  this->some_value<OutputType,
1366 }
const DenseVector< Number > & get_elem_solution_rate() const
Accessor for element solution rate of change w.r.t.
Definition: diff_context.h:144
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Helper function to reduce some code duplication in the *interior_value methods.
Definition: fem_context.C:315
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for interior finite element object for variable var for the largest dimension in the mesh...
Definition: fem_context.h:277

◆ interior_rate_gradient()

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

Definition at line 1369 of file fem_context.C.

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

1371 {
1372  this->some_gradient<OutputType,
1373  &FEMContext::get_element_fe<typename TensorTools::MakeReal
1374  <typename TensorTools::DecrementRank
1375  <OutputType>::type>::type>,
1376  &DiffContext::get_elem_solution_rate>(var, qp, dudot);
1377 }
const DenseVector< Number > & get_elem_solution_rate() const
Accessor for element solution rate of change w.r.t.
Definition: diff_context.h:144
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for interior finite element object for variable var for the largest dimension in the mesh...
Definition: fem_context.h:277
void some_gradient(unsigned int var, unsigned int qp, OutputType &u) const
Helper function to reduce some code duplication in the *interior_gradient methods.
Definition: fem_context.C:349

◆ 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 412 of file fem_context.C.

Referenced by libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns(), LaplaceSystem::element_postprocess(), LaplaceQoI::element_qoi(), HeatSystem::element_qoi(), NavierSystem::element_time_derivative(), CurlCurlSystem::element_time_derivative(), CoupledSystem::element_time_derivative(), and HilbertSystem::element_time_derivative().

413 {
414  Number u;
415 
416  this->interior_value( var, qp, u );
417 
418  return u;
419 }
Number interior_value(unsigned int var, unsigned int qp) const
Definition: fem_context.C:412

◆ 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 422 of file fem_context.C.

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

424 {
425  this->some_value<OutputType,
426  &FEMContext::get_element_fe<typename TensorTools::MakeReal<OutputType>::type>,
427  &DiffContext::get_elem_solution>(var, qp, u);
428 }
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:112
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Helper function to reduce some code duplication in the *interior_value methods.
Definition: fem_context.C:315

◆ interior_values()

template<typename OutputType >
template LIBMESH_EXPORT 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 432 of file fem_context.C.

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

Referenced by HeatSystem::element_qoi_derivative().

435 {
436  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
437 
438  // Get local-to-global dof index lookup
439  const unsigned int n_dofs = cast_int<unsigned int>
440  (this->get_dof_indices(var).size());
441 
442  // Get current local coefficients
443  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
444 
445  // Get the finite element object
446  FEGenericBase<OutputShape> * fe = nullptr;
447  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
448 
449  // Get shape function values at quadrature point
450  const std::vector<std::vector<OutputShape>> & phi = fe->get_phi();
451 
452  // Loop over all the q_points on this element
453  for (auto qp : index_range(u_vals))
454  {
455  OutputType & u = u_vals[qp];
456 
457  // Compute the value at this q_point
458  u = 0.;
459 
460  for (unsigned int l=0; l != n_dofs; l++)
461  u += phi[l][qp] * coef(l);
462  }
463 
464  return;
465 }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
DenseSubVector< Number > & get_localized_subvector(const NumericVector< Number > &localized_vector, unsigned int var)
Return a reference to DenseSubVector localization of localized_vector at variable var contained in th...
Definition: diff_context.C:154
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition: int_range.h:117

◆ 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 466 of file diff_context.h.

References libMesh::DiffContext::_is_adjoint.

467  { return _is_adjoint; }
bool _is_adjoint
Is this context to be used for a primal or adjoint solve?
Definition: diff_context.h:665

◆ 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 473 of file diff_context.h.

References libMesh::DiffContext::_is_adjoint.

474  { return _is_adjoint; }
bool _is_adjoint
Is this context to be used for a primal or adjoint solve?
Definition: diff_context.h:665

◆ n_dof_indices() [1/2]

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

◆ 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 402 of file diff_context.h.

References libMesh::DiffContext::_dof_indices_var.

403  {
404  libmesh_assert_greater(_dof_indices_var.size(), var);
405  return cast_int<unsigned int>(_dof_indices_var[var].size());
406  }
std::vector< std::vector< dof_id_type > > _dof_indices_var
Definition: diff_context.h:640

◆ 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 84 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::FEMap::inverse_map(), libMesh::make_range(), libMesh::DiffContext::n_vars(), libMesh::DenseVector< T >::resize(), and libMesh::DenseMatrix< T >::resize().

Referenced by assembly_with_dg_fem_context().

85 {
86  // Call this *after* side_fe_reinit
87 
88  // Initialize all the neighbor side FE objects based on inverse mapping
89  // the quadrature points on the current side
90  std::vector<Point> qface_side_points;
91  std::vector<Point> qface_neighbor_points;
92  for (auto & [neighbor_side_fe_type, fe] : _neighbor_side_fe)
93  {
94  FEAbstract * side_fe = _side_fe[this->get_dim()][neighbor_side_fe_type].get();
95  qface_side_points = side_fe->get_xyz();
96 
98  qface_side_points, qface_neighbor_points);
99 
100  fe->reinit(&get_neighbor(), &qface_neighbor_points);
101  }
102 
103  // Set boolean flag to indicate that the DG terms are active on this element
104  _dg_terms_active = true;
105 
106  // Also, initialize data required for DG assembly on the current side,
107  // analogously to FEMContext::pre_fe_reinit
108 
109  // Initialize the per-element data for elem.
111 
112  const unsigned int n_dofs = cast_int<unsigned int>
113  (this->get_dof_indices().size());
114  const unsigned int n_neighbor_dofs = cast_int<unsigned int>
115  (_neighbor_dof_indices.size());
116 
117  // These resize calls also zero out the residual and jacobian
118  _neighbor_residual.resize(n_neighbor_dofs);
119  _elem_elem_jacobian.resize(n_dofs, n_dofs);
120  _elem_neighbor_jacobian.resize(n_dofs, n_neighbor_dofs);
121  _neighbor_elem_jacobian.resize(n_neighbor_dofs, n_dofs);
122  _neighbor_neighbor_jacobian.resize(n_neighbor_dofs, n_neighbor_dofs);
123 
124  // Initialize the per-variable data for elem.
125  {
126  unsigned int sub_dofs = 0;
127  for (auto i : make_range(get_system().n_vars()))
128  {
130 
131  const unsigned int n_dofs_var = cast_int<unsigned int>
132  (_neighbor_dof_indices_var[i].size());
133 
134  _neighbor_subresiduals[i]->reposition
135  (sub_dofs, n_dofs_var);
136 
137  for (unsigned int j=0; j != i; ++j)
138  {
139  const unsigned int n_dofs_var_j =
140  cast_int<unsigned int>
141  (this->get_dof_indices(j).size());
142 
143  _elem_elem_subjacobians[i][j]->reposition
144  (sub_dofs, _neighbor_subresiduals[j]->i_off(),
145  n_dofs_var, n_dofs_var_j);
146  _elem_elem_subjacobians[j][i]->reposition
147  (_neighbor_subresiduals[j]->i_off(), sub_dofs,
148  n_dofs_var_j, n_dofs_var);
149 
150  _elem_neighbor_subjacobians[i][j]->reposition
151  (sub_dofs, _neighbor_subresiduals[j]->i_off(),
152  n_dofs_var, n_dofs_var_j);
153  _elem_neighbor_subjacobians[j][i]->reposition
154  (_neighbor_subresiduals[j]->i_off(), sub_dofs,
155  n_dofs_var_j, n_dofs_var);
156 
157  _neighbor_elem_subjacobians[i][j]->reposition
158  (sub_dofs, _neighbor_subresiduals[j]->i_off(),
159  n_dofs_var, n_dofs_var_j);
160  _neighbor_elem_subjacobians[j][i]->reposition
161  (_neighbor_subresiduals[j]->i_off(), sub_dofs,
162  n_dofs_var_j, n_dofs_var);
163 
164  _neighbor_neighbor_subjacobians[i][j]->reposition
165  (sub_dofs, _neighbor_subresiduals[j]->i_off(),
166  n_dofs_var, n_dofs_var_j);
167  _neighbor_neighbor_subjacobians[j][i]->reposition
168  (_neighbor_subresiduals[j]->i_off(), sub_dofs,
169  n_dofs_var_j, n_dofs_var);
170  }
171  _elem_elem_subjacobians[i][i]->reposition
172  (sub_dofs, sub_dofs,
173  n_dofs_var,
174  n_dofs_var);
175  _elem_neighbor_subjacobians[i][i]->reposition
176  (sub_dofs, sub_dofs,
177  n_dofs_var,
178  n_dofs_var);
179  _neighbor_elem_subjacobians[i][i]->reposition
180  (sub_dofs, sub_dofs,
181  n_dofs_var,
182  n_dofs_var);
183  _neighbor_neighbor_subjacobians[i][i]->reposition
184  (sub_dofs, sub_dofs,
185  n_dofs_var,
186  n_dofs_var);
187  sub_dofs += n_dofs_var;
188  }
189  libmesh_assert_equal_to (sub_dofs, n_dofs);
190  }
191 
192 }
std::vector< dof_id_type > _neighbor_dof_indices
Global Degree of freedom index lists for the neighbor element.
DenseVector< Number > _neighbor_residual
Residual vector of the neighbor component.
DenseMatrix< Number > _elem_elem_jacobian
The DG Jacobian terms.
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Definition: dof_map.C:2164
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_elem_subjacobians
static Point inverse_map(const unsigned int dim, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true, const bool extra_checks=true)
Definition: fe_map.C:1628
void resize(const unsigned int n)
Resize the vector.
Definition: dense_vector.h:396
std::vector< std::vector< dof_id_type > > _neighbor_dof_indices_var
unsigned char get_dim() const
Accessor for cached mesh dimension.
Definition: fem_context.h:936
const System & get_system() const
Accessor for associated system.
Definition: diff_context.h:106
DenseMatrix< Number > _neighbor_elem_jacobian
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
DenseMatrix< Number > _elem_neighbor_jacobian
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_neighbor_subjacobians
bool _dg_terms_active
Boolean flag to indicate whether or not the DG terms have been assembled and should be used in the gl...
std::vector< std::map< FEType, std::unique_ptr< FEAbstract > > > _side_fe
Definition: fem_context.h:1169
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)
Resizes the matrix to the specified size and calls zero().
Definition: dense_matrix.h:895
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
std::vector< std::unique_ptr< DenseSubVector< Number > > > _neighbor_subresiduals
Element residual subvectors and Jacobian submatrices.
unsigned int n_vars() const
Number of variables in solution.
Definition: diff_context.h:100
std::map< FEType, std::unique_ptr< FEAbstract > > _neighbor_side_fe
Finite element objects for each variable&#39;s sides on the neighbor element.
const DofMap & get_dof_map() const
Definition: system.h:2374
const Elem & get_neighbor() const
Accessor for current neighbor Elem object for assembling DG terms.
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 1467 of file fem_context.C.

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

1468 {
1469  // Update the "time" variable of this context object
1470  this->_update_time_from_system(theta);
1471 
1472  // We can reuse the Elem FE safely here.
1473  elem_fe_reinit();
1474 }
virtual void elem_fe_reinit(const std::vector< Point > *const pts=nullptr)
Reinitializes interior FE objects on the current geometric element.
Definition: fem_context.C:1477
void _update_time_from_system(Real theta)
Update the time in the context object for the given value of theta, based on the values of "time" and...
Definition: fem_context.C:1923

◆ 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 LIBMESH_EXPORT 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 1023 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().

1027 {
1028  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
1029 
1030  // Get local-to-global dof index lookup
1031  const unsigned int n_dofs = cast_int<unsigned int>
1032  (this->get_dof_indices(var).size());
1033 
1034  // Get current local coefficients
1035  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
1036  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
1037 
1038  // Get finite element object
1039  FEGenericBase<OutputShape> * fe = nullptr;
1040  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
1041 
1042  // Build a FE for calculating u(p)
1043  FEGenericBase<OutputShape> * fe_new =
1044  this->build_new_fe( fe, p, tolerance, 3 );
1045 
1046  // Get the values of the shape function derivatives
1047  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputShape>> & curl_phi = fe_new->get_curl_phi();
1048 
1049  curl_u = 0.0;
1050 
1051  for (unsigned int l=0; l != n_dofs; l++)
1052  curl_u.add_scaled(curl_phi[l][0], coef(l));
1053 
1054  return;
1055 }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:112
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
std::vector< DenseSubVector< Number > > _elem_subsolutions
Definition: diff_context.h:583
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE, const int get_derivative_level=-1) const
Helper function to reduce some code duplication in the *_point_* methods.
Definition: fem_context.C:2023

◆ 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 920 of file fem_context.C.

Referenced by libMesh::ParsedFEMFunction< T >::eval_args(), CoupledFEMFunctionsx::operator()(), and CoupledFEMFunctionsy::operator()().

921 {
922  Gradient grad_u;
923 
924  this->point_gradient( var, p, grad_u );
925 
926  return grad_u;
927 }
NumberVectorValue Gradient
Gradient point_gradient(unsigned int var, const Point &p) const
Definition: fem_context.C:920

◆ 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 932 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().

936 {
937  typedef typename TensorTools::MakeReal
939  OutputShape;
940 
941  // Get local-to-global dof index lookup
942  const unsigned int n_dofs = cast_int<unsigned int>
943  (this->get_dof_indices(var).size());
944 
945  // Get current local coefficients
946  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
947  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
948 
949  // Get finite element object
950  FEGenericBase<OutputShape> * fe = nullptr;
951  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
952 
953  // Build a FE for calculating u(p)
954  FEGenericBase<OutputShape> * fe_new =
955  this->build_new_fe( fe, p, tolerance, 1 );
956 
957  // Get the values of the shape function derivatives
958  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient>> & dphi = fe_new->get_dphi();
959 
960  grad_u = 0.0;
961 
962  for (unsigned int l=0; l != n_dofs; l++)
963  grad_u.add_scaled(dphi[l][0], coef(l));
964 
965  return;
966 }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:112
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
std::vector< DenseSubVector< Number > > _elem_subsolutions
Definition: diff_context.h:583
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE, const int get_derivative_level=-1) const
Helper function to reduce some code duplication in the *_point_* methods.
Definition: fem_context.C:2023

◆ 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 972 of file fem_context.C.

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

973 {
974  Tensor hess_u;
975 
976  this->point_hessian( var, p, hess_u );
977 
978  return hess_u;
979 }
Tensor point_hessian(unsigned int var, const Point &p) const
Definition: fem_context.C:972
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 983 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().

987 {
988  typedef typename TensorTools::DecrementRank<OutputType>::type Rank1Decrement;
989  typedef typename TensorTools::DecrementRank<Rank1Decrement>::type Rank2Decrement;
990  typedef typename TensorTools::MakeReal<Rank2Decrement>::type OutputShape;
991 
992  // Get local-to-global dof index lookup
993  const unsigned int n_dofs = cast_int<unsigned int>
994  (this->get_dof_indices(var).size());
995 
996  // Get current local coefficients
997  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
998  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
999 
1000  // Get finite element object
1001  FEGenericBase<OutputShape> * fe = nullptr;
1002  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
1003 
1004  // Build a FE for calculating u(p)
1005  FEGenericBase<OutputShape> * fe_new =
1006  this->build_new_fe( fe, p, tolerance, 2 );
1007 
1008  // Get the values of the shape function derivatives
1009  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor>> & d2phi = fe_new->get_d2phi();
1010 
1011  hess_u = 0.0;
1012 
1013  for (unsigned int l=0; l != n_dofs; l++)
1014  hess_u.add_scaled(d2phi[l][0], coef(l));
1015 
1016  return;
1017 }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:112
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
std::vector< DenseSubVector< Number > > _elem_subsolutions
Definition: diff_context.h:583
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE, const int get_derivative_level=-1) const
Helper function to reduce some code duplication in the *_point_* methods.
Definition: fem_context.C:2023

◆ 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 874 of file fem_context.C.

Referenced by libMesh::ParsedFEMFunction< T >::eval_args(), CoupledFEMFunctionsx::operator()(), CoupledFEMFunctionsy::operator()(), and NavierSystem::side_constraint().

875 {
876  Number u = 0.;
877 
878  this->point_value( var, p, u );
879 
880  return u;
881 }
Number point_value(unsigned int var, const Point &p) const
Definition: fem_context.C:874

◆ 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 884 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().

888 {
889  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
890 
891  // Get local-to-global dof index lookup
892  const unsigned int n_dofs = cast_int<unsigned int>
893  (this->get_dof_indices(var).size());
894 
895  // Get current local coefficients
896  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
897  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
898 
899  // Get finite element object
900  FEGenericBase<OutputShape> * fe = nullptr;
901  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
902 
903  // Build a FE for calculating u(p)
904  FEGenericBase<OutputShape> * fe_new =
905  this->build_new_fe( fe, p, tolerance, 0 );
906 
907  // Get the values of the shape function derivatives
908  const std::vector<std::vector<OutputShape>> & phi = fe_new->get_phi();
909 
910  u = 0.;
911 
912  for (unsigned int l=0; l != n_dofs; l++)
913  u += phi[l][0] * coef(l);
914 
915  return;
916 }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:112
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
std::vector< DenseSubVector< Number > > _elem_subsolutions
Definition: diff_context.h:583
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE, const int get_derivative_level=-1) const
Helper function to reduce some code duplication in the *_point_* methods.
Definition: fem_context.C:2023

◆ 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 1683 of file fem_context.C.

References libMesh::FEMContext::_active_vars, libMesh::FEMContext::_custom_solution, libMesh::DiffContext::_elem_qoi_subderivatives, libMesh::DiffContext::_have_local_matrices, 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::make_range(), 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::ExactSolution::_compute_error(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::FEMSystem::assembly(), assembly_with_dg_fem_context(), libMesh::VariationalSmootherSystem::compute_element_reference_volume(), HilbertSystem::element_time_derivative(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_sides(), libMesh::RBEIMConstruction::initialize_qp_data(), libMesh::FEMSystem::mesh_position_get(), libMesh::FEMSystem::mesh_position_set(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), Integrate::operator()(), libMesh::RBParametrizedFunction::preevaluate_parametrized_function_on_mesh(), libMesh::RBParametrizedFunction::preevaluate_parametrized_function_on_mesh_sides(), libMesh::System::project_vector(), OverlappingAlgebraicGhostingTest::run_ghosting_test(), and OverlappingCouplingGhostingTest::run_sparsity_pattern_test().

1684 {
1685  this->set_elem(e);
1686 
1687  if (algebraic_type() == CURRENT ||
1689  {
1690  // Initialize the per-element data for elem.
1691  if (this->has_elem())
1692  sys.get_dof_map().dof_indices (&(this->get_elem()), this->get_dof_indices());
1693  else
1694  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1695  sys.get_dof_map().dof_indices
1696  (static_cast<Elem*>(nullptr), this->get_dof_indices());
1697  }
1698 #ifdef LIBMESH_ENABLE_AMR
1699  else if (algebraic_type() == OLD ||
1701  {
1702  // Initialize the per-element data for elem.
1703  if (this->has_elem())
1704  sys.get_dof_map().old_dof_indices (&(this->get_elem()), this->get_dof_indices());
1705  else
1706  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1707  sys.get_dof_map().old_dof_indices
1708  (static_cast<Elem*>(nullptr), this->get_dof_indices());
1709  }
1710 #endif // LIBMESH_ENABLE_AMR
1711 
1712  const unsigned int n_dofs = cast_int<unsigned int>
1713  (this->get_dof_indices().size());
1714  const unsigned int n_qoi = sys.n_qois();
1715 
1716  if (this->algebraic_type() != NONE &&
1717  this->algebraic_type() != DOFS_ONLY &&
1718  this->algebraic_type() != OLD_DOFS_ONLY)
1719  {
1720  // This also resizes elem_solution
1721  if (_custom_solution == nullptr)
1722  sys.current_local_solution->get(this->get_dof_indices(), this->get_elem_solution().get_values());
1723  else
1724  _custom_solution->get(this->get_dof_indices(), this->get_elem_solution().get_values());
1725 
1726  if (sys.use_fixed_solution)
1727  this->get_elem_fixed_solution().resize(n_dofs);
1728 
1729  // Only make space for these if we're using DiffSystem
1730  // This is assuming *only* DiffSystem is using elem_solution_rate/accel
1731  const DifferentiableSystem * diff_system = dynamic_cast<const DifferentiableSystem *>(&sys);
1732  if (diff_system)
1733  {
1734  // Now, we only need these if the solver is unsteady
1735  if (!diff_system->get_time_solver().is_steady())
1736  {
1737  this->get_elem_solution_rate().resize(n_dofs);
1738 
1739  // We only need accel space if the TimeSolver is second order
1740  const UnsteadySolver & time_solver = cast_ref<const UnsteadySolver &>(diff_system->get_time_solver());
1741 
1742  if (time_solver.time_order() >= 2 || !diff_system->get_second_order_vars().empty())
1743  this->get_elem_solution_accel().resize(n_dofs);
1744  }
1745  }
1746 
1747  if (algebraic_type() != OLD)
1748  {
1749  // These resize calls also zero out the residual and jacobian
1750  this->get_elem_residual().resize(n_dofs);
1751  if (this->_have_local_matrices)
1752  this->get_elem_jacobian().resize(n_dofs, n_dofs);
1753 
1754  this->get_qoi_derivatives().resize(n_qoi);
1755  this->_elem_qoi_subderivatives.resize(n_qoi);
1756  for (std::size_t q=0; q != n_qoi; ++q)
1757  (this->get_qoi_derivatives())[q].resize(n_dofs);
1758  }
1759  }
1760 
1761  // Initialize the per-variable data for elem.
1762  {
1763  unsigned int sub_dofs = 0;
1764  for (auto i : make_range(sys.n_vars()))
1765  {
1766  if (algebraic_type() == CURRENT ||
1768  {
1769  if (this->has_elem())
1770  sys.get_dof_map().dof_indices (&(this->get_elem()), this->get_dof_indices(i), i);
1771  else
1772  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1773  sys.get_dof_map().dof_indices
1774  (static_cast<Elem*>(nullptr), this->get_dof_indices(i), i);
1775  }
1776 #ifdef LIBMESH_ENABLE_AMR
1777  else if (algebraic_type() == OLD ||
1779  {
1780  if (this->has_elem())
1781  sys.get_dof_map().old_dof_indices (&(this->get_elem()), this->get_dof_indices(i), i);
1782  else
1783  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1784  sys.get_dof_map().old_dof_indices
1785  (static_cast<Elem*>(nullptr), this->get_dof_indices(i), i);
1786  }
1787 #endif // LIBMESH_ENABLE_AMR
1788 
1789  if (this->algebraic_type() != NONE &&
1790  this->algebraic_type() != DOFS_ONLY &&
1791  this->algebraic_type() != OLD_DOFS_ONLY)
1792  {
1793  const unsigned int n_dofs_var = cast_int<unsigned int>
1794  (this->get_dof_indices(i).size());
1795 
1796 
1797  if (!_active_vars ||
1798  std::binary_search(_active_vars->begin(),
1799  _active_vars->end(), i))
1800  {
1801  this->get_elem_solution(i).reposition
1802  (sub_dofs, n_dofs_var);
1803 
1804  // Only make space for these if we're using DiffSystem
1805  // This is assuming *only* DiffSystem is using elem_solution_rate/accel
1806  const DifferentiableSystem * diff_system = dynamic_cast<const DifferentiableSystem *>(&sys);
1807  if (diff_system)
1808  {
1809  // Now, we only need these if the solver is unsteady
1810  if (!diff_system->get_time_solver().is_steady())
1811  {
1812  this->get_elem_solution_rate(i).reposition
1813  (sub_dofs, n_dofs_var);
1814 
1815  // We only need accel space if the TimeSolver is second order
1816  const UnsteadySolver & time_solver = cast_ref<const UnsteadySolver &>(diff_system->get_time_solver());
1817 
1818  if (time_solver.time_order() >= 2 || !diff_system->get_second_order_vars().empty())
1819  this->get_elem_solution_accel(i).reposition
1820  (sub_dofs, n_dofs_var);
1821  }
1822  }
1823 
1824  if (sys.use_fixed_solution)
1825  this->get_elem_fixed_solution(i).reposition
1826  (sub_dofs, n_dofs_var);
1827 
1828  if (algebraic_type() != OLD)
1829  {
1830  this->get_elem_residual(i).reposition
1831  (sub_dofs, n_dofs_var);
1832 
1833  for (std::size_t q=0; q != n_qoi; ++q)
1834  this->get_qoi_derivatives(q,i).reposition
1835  (sub_dofs, n_dofs_var);
1836 
1837  if (this->_have_local_matrices)
1838  {
1839  for (unsigned int j=0; j != i; ++j)
1840  {
1841  const unsigned int n_dofs_var_j =
1842  cast_int<unsigned int>
1843  (this->get_dof_indices(j).size());
1844 
1845  this->get_elem_jacobian(i,j).reposition
1846  (sub_dofs, this->get_elem_residual(j).i_off(),
1847  n_dofs_var, n_dofs_var_j);
1848  this->get_elem_jacobian(j,i).reposition
1849  (this->get_elem_residual(j).i_off(), sub_dofs,
1850  n_dofs_var_j, n_dofs_var);
1851  }
1852  this->get_elem_jacobian(i,i).reposition
1853  (sub_dofs, sub_dofs,
1854  n_dofs_var,
1855  n_dofs_var);
1856  }
1857  }
1858  }
1859 
1860  sub_dofs += n_dofs_var;
1861  }
1862  }
1863 
1864  if (this->algebraic_type() != NONE &&
1865  this->algebraic_type() != DOFS_ONLY &&
1866  this->algebraic_type() != OLD &&
1867  this->algebraic_type() != OLD_DOFS_ONLY)
1868  libmesh_assert_equal_to (sub_dofs, n_dofs);
1869  }
1870 
1871  // Now do the localization for the user requested vectors
1872  if (this->algebraic_type() != NONE &&
1873  this->algebraic_type() != DOFS_ONLY &&
1874  this->algebraic_type() != OLD_DOFS_ONLY)
1875  {
1876  DiffContext::localized_vectors_iterator localized_vec_it = this->_localized_vectors.begin();
1877  const DiffContext::localized_vectors_iterator localized_vec_end = this->_localized_vectors.end();
1878 
1879  for (; localized_vec_it != localized_vec_end; ++localized_vec_it)
1880  {
1881  const NumericVector<Number> & current_localized_vector = *localized_vec_it->first;
1882  DenseVector<Number> & target_vector = localized_vec_it->second.first;
1883 
1884  current_localized_vector.get(this->get_dof_indices(), target_vector.get_values());
1885 
1886  // Initialize the per-variable data for elem.
1887  unsigned int sub_dofs = 0;
1888  auto init_localized_var_data = [this, localized_vec_it, &sub_dofs](unsigned int i)
1889  {
1890  const unsigned int n_dofs_var = cast_int<unsigned int>
1891  (this->get_dof_indices(i).size());
1892 
1893  // This is redundant with earlier initialization, isn't it? - RHS
1894  // sys.get_dof_map().dof_indices (&(this->get_elem()), this->get_dof_indices(i), i);
1895 
1896  localized_vec_it->second.second[i].reposition
1897  (sub_dofs, n_dofs_var);
1898 
1899  sub_dofs += n_dofs_var;
1900  };
1901 
1902  if (_active_vars)
1903  for (auto v : *_active_vars)
1904  init_localized_var_data(v);
1905  else
1906  for (auto v : make_range(sys.n_vars()))
1907  init_localized_var_data(v);
1908 
1909  libmesh_assert_equal_to (sub_dofs, n_dofs);
1910  }
1911  }
1912 }
const DenseMatrix< Number > & get_elem_jacobian() const
Const accessor for element Jacobian.
Definition: diff_context.h:274
std::unique_ptr< const std::vector< unsigned int > > _active_vars
Variables on which to enable calculations, or nullptr if all variables in the System are to be enable...
Definition: fem_context.h:1054
const NumericVector< Number > * _custom_solution
Data with which to do algebra reinitialization.
Definition: fem_context.h:1074
void set_elem(const Elem *e)
Helper function to promote accessor usage.
Definition: fem_context.C:1914
virtual void get(const std::vector< numeric_index_type > &index, T *values) const
Access multiple components at once.
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:210
const DenseVector< Number > & get_elem_solution_rate() const
Accessor for element solution rate of change w.r.t.
Definition: diff_context.h:144
const Elem & get_elem() const
Accessor for current Elem object.
Definition: fem_context.h:908
void resize(const unsigned int n)
Resize the vector.
Definition: dense_vector.h:396
std::vector< std::vector< DenseSubVector< Number > > > _elem_qoi_subderivatives
Definition: diff_context.h:627
const bool _have_local_matrices
Whether we have local matrices allocated/initialized.
Definition: diff_context.h:576
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:112
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< DenseSubVector< Number > > > >::iterator localized_vectors_iterator
Typedef for the localized_vectors iterator.
Definition: diff_context.h:540
std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< DenseSubVector< Number > > > > _localized_vectors
Contains pointers to vectors the user has asked to be localized, keyed with pairs of element localize...
Definition: diff_context.h:571
const DenseVector< Number > & get_elem_residual() const
Const accessor for element residual.
Definition: diff_context.h:242
const DenseVector< Number > & get_elem_solution_accel() const
Accessor for element solution accel of change w.r.t.
Definition: diff_context.h:177
void resize(const unsigned int new_m, const unsigned int new_n)
Resizes the matrix to the specified size and calls zero().
Definition: dense_matrix.h:895
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
AlgebraicType algebraic_type() const
Definition: fem_context.h:992
const std::vector< DenseVector< Number > > & get_qoi_derivatives() const
Const accessor for QoI derivatives.
Definition: diff_context.h:329
bool has_elem() const
Test for current Elem object.
Definition: fem_context.h:902
template class LIBMESH_EXPORT NumericVector< Number >

◆ 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 986 of file fem_context.h.

References libMesh::FEMContext::_atype.

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

987  { _atype = atype; }
AlgebraicType _atype
Keep track of what type of algebra reinitialization is to be done.
Definition: fem_context.h:1069

◆ 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 1001 of file fem_context.h.

References libMesh::FEMContext::_custom_solution.

1002  { _custom_solution = custom_sol; }
const NumericVector< Number > * _custom_solution
Data with which to do algebra reinitialization.
Definition: fem_context.h:1074

◆ 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 109 of file diff_context.C.

References libMesh::DiffContext::_deltat.

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

110 {
111  // We may actually want to be able to set this pointer to nullptr, so
112  // don't report an error for that.
113  _deltat = dt;
114 }
Real * _deltat
Defaults to nullptr, can optionally be used to point to a timestep value in the System-derived class ...
Definition: diff_context.h:655

◆ set_elem()

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

Helper function to promote accessor usage.

Definition at line 1914 of file fem_context.C.

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

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

1915 {
1916  this->_elem = e;
1917 
1918  // If e is nullptr, we assume it's SCALAR and set _elem_dim to 0.
1919  this->_elem_dim =
1920  cast_int<unsigned char>(this->_elem ? this->_elem->dim() : 0);
1921 }
unsigned char _elem_dim
Cached dimension of this->_elem.
Definition: fem_context.h:1202
virtual unsigned short dim() const =0
const Elem * _elem
Current element for element_* to examine.
Definition: fem_context.h:1192

◆ set_jacobian_tolerance()

void libMesh::FEMContext::set_jacobian_tolerance ( Real  tol)
inherited

Calls set_jacobian_tolerance() on all the FE objects controlled by this class.

(Actually, it calls this on the underlying)

Definition at line 1586 of file fem_context.C.

References libMesh::FEMContext::_edge_fe, libMesh::FEMContext::_element_fe, and libMesh::FEMContext::_side_fe.

1587 {
1588  for (auto & m : _element_fe)
1589  for (auto & pr : m)
1590  pr.second->get_fe_map().set_jacobian_tolerance(tol);
1591 
1592  for (auto & m : _side_fe)
1593  for (auto & pr : m)
1594  pr.second->get_fe_map().set_jacobian_tolerance(tol);
1595 
1596  for (auto & pr : _edge_fe)
1597  pr.second->get_fe_map().set_jacobian_tolerance(tol);
1598 }
std::vector< std::map< FEType, std::unique_ptr< FEAbstract > > > _element_fe
Finite element objects for each variable&#39;s interior, sides and edges.
Definition: fem_context.h:1168
std::map< FEType, std::unique_ptr< FEAbstract > > _edge_fe
Definition: fem_context.h:1170
std::vector< std::map< FEType, std::unique_ptr< FEAbstract > > > _side_fe
Definition: fem_context.h:1169

◆ 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 842 of file fem_context.h.

References libMesh::FEMContext::_mesh_sys.

843  { this->_mesh_sys = sys; }
System * _mesh_sys
System from which to acquire moving mesh information.
Definition: fem_context.h:1059

◆ 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 868 of file fem_context.h.

References libMesh::FEMContext::_mesh_x_var.

869  { _mesh_x_var = x_var; }
unsigned int _mesh_x_var
Variables from which to acquire moving mesh information.
Definition: fem_context.h:1064

◆ 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 882 of file fem_context.h.

References libMesh::FEMContext::_mesh_y_var.

883  { _mesh_y_var = y_var; }
unsigned int _mesh_y_var
Definition: fem_context.h:1064

◆ 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 896 of file fem_context.h.

References libMesh::FEMContext::_mesh_z_var.

897  { _mesh_z_var = z_var; }
unsigned int _mesh_z_var
Definition: fem_context.h:1064

◆ 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.

Referenced by assembly_with_dg_fem_context().

221  { _neighbor = &neighbor; }
const Elem * _neighbor
Current neighbor element for assembling DG terms.

◆ 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 423 of file diff_context.h.

References libMesh::DiffContext::time.

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

424  { time = time_in; }
Real time
For time-dependent problems, this is the time t for which the current nonlinear_solution is defined...
Definition: diff_context.h:481

◆ side_accel()

template<typename OutputType >
template LIBMESH_EXPORT 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 1402 of file fem_context.C.

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

1404 {
1405  this->some_value<OutputType,
1409 }
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for edge/face (2D/3D) finite element object for variable var for the largest dimension in th...
Definition: fem_context.h:317
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Helper function to reduce some code duplication in the *interior_value methods.
Definition: fem_context.C:315
const DenseVector< Number > & get_elem_solution_accel() const
Accessor for element solution accel of change w.r.t.
Definition: diff_context.h:177

◆ side_boundary_ids()

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 305 of file fem_context.C.

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

306 {
307  _boundary_info.boundary_ids(&(this->get_elem()), side, vec_to_fill);
308 }
const Elem & get_elem() const
Accessor for current Elem object.
Definition: fem_context.h:908
void boundary_ids(const Node *node, std::vector< boundary_id_type > &vec_to_fill) const
Fills a user-provided std::vector with the boundary ids associated with Node node.
const BoundaryInfo & _boundary_info
Saved reference to BoundaryInfo on the mesh for this System.
Definition: fem_context.h:1187
unsigned char side
Current side for side_* to examine.
Definition: fem_context.h:1013

◆ 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 75 of file dg_fem_context.C.

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

Referenced by libMesh::RBConstruction::add_scaled_matrix_and_vector(), and assembly_with_dg_fem_context().

76 {
78 
79  // By default we assume that the DG terms are inactive
80  // They are only active if neighbor_side_fe_reinit is called
81  _dg_terms_active = false;
82 }
virtual void side_fe_reinit()
Reinitializes side FE objects on the current geometric element.
Definition: fem_context.C:1498
bool _dg_terms_active
Boolean flag to indicate whether or not the DG terms have been assembled and should be used in the gl...

◆ 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 719 of file fem_context.C.

Referenced by LaplaceSystem::side_postprocess().

720 {
721  Gradient du;
722 
723  this->side_gradient( var, qp, du );
724 
725  return du;
726 }
NumberVectorValue Gradient
Gradient side_gradient(unsigned int var, unsigned int qp) const
Definition: fem_context.C:719

◆ 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 730 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().

732 {
733  typedef typename TensorTools::MakeReal
735  OutputShape;
736 
737  // Get local-to-global dof index lookup
738  const unsigned int n_dofs = cast_int<unsigned int>
739  (this->get_dof_indices(var).size());
740 
741  // Get current local coefficients
742  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
743  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
744 
745  // Get finite element object
746  FEGenericBase<OutputShape> * the_side_fe = nullptr;
747  this->get_side_fe<OutputShape>( var, the_side_fe, this->get_elem_dim() );
748 
749  // Get shape function values at quadrature point
750  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient>> & dphi = the_side_fe->get_dphi();
751 
752  // Accumulate solution derivatives
753  du = 0.;
754 
755  for (unsigned int l=0; l != n_dofs; l++)
756  du.add_scaled(dphi[l][qp], coef(l));
757 
758  return;
759 }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:112
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
std::vector< DenseSubVector< Number > > _elem_subsolutions
Definition: diff_context.h:583

◆ side_gradients()

template<typename OutputType >
template LIBMESH_EXPORT 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 764 of file fem_context.C.

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

767 {
768  typedef typename TensorTools::MakeReal
770  OutputShape;
771 
772  // Get local-to-global dof index lookup
773  const unsigned int n_dofs = cast_int<unsigned int>
774  (this->get_dof_indices(var).size());
775 
776  // Get current local coefficients
777  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
778 
779  // Get finite element object
780  FEGenericBase<OutputShape> * the_side_fe = nullptr;
781  this->get_side_fe<OutputShape>( var, the_side_fe, this->get_elem_dim() );
782 
783  // Get shape function values at quadrature point
784  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient>> & dphi = the_side_fe->get_dphi();
785 
786  // Loop over all the q_points in this finite element
787  for (auto qp : index_range(du_vals))
788  {
789  OutputType & du = du_vals[qp];
790 
791  du = 0;
792 
793  // Compute the gradient at this q_point
794  for (unsigned int l=0; l != n_dofs; l++)
795  du.add_scaled(dphi[l][qp], coef(l));
796  }
797 
798  return;
799 }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
DenseSubVector< Number > & get_localized_subvector(const NumericVector< Number > &localized_vector, unsigned int var)
Return a reference to DenseSubVector localization of localized_vector at variable var contained in th...
Definition: diff_context.C:154
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition: int_range.h:117

◆ 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 802 of file fem_context.C.

804 {
805  Tensor d2u;
806 
807  this->side_hessian( var, qp, d2u );
808 
809  return d2u;
810 }
Tensor side_hessian(unsigned int var, unsigned int qp) const
Definition: fem_context.C:802
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 815 of file fem_context.C.

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

818 {
819  this->some_hessian<OutputType,
821  <typename TensorTools::MakeReal
822  <typename TensorTools::DecrementRank
823  <typename TensorTools::DecrementRank
824  <OutputType>::type>::type>::type>,
825  &DiffContext::get_elem_solution>(var, qp, d2u);
826 }
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for edge/face (2D/3D) finite element object for variable var for the largest dimension in th...
Definition: fem_context.h:317
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:112
void some_hessian(unsigned int var, unsigned int qp, OutputType &u) const
Helper function to reduce some code duplication in the *interior_hessian methods. ...
Definition: fem_context.C:382

◆ side_hessians()

template<typename OutputType >
template LIBMESH_EXPORT 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 831 of file fem_context.C.

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

834 {
835  typedef typename TensorTools::DecrementRank<OutputType>::type Rank1Decrement;
836  typedef typename TensorTools::DecrementRank<Rank1Decrement>::type Rank2Decrement;
837  typedef typename TensorTools::MakeReal<Rank2Decrement>::type OutputShape;
838 
839  // Get local-to-global dof index lookup
840  const unsigned int n_dofs = cast_int<unsigned int>
841  (this->get_dof_indices(var).size());
842 
843  // Get current local coefficients
844  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
845 
846  // Get finite element object
847  FEGenericBase<OutputShape> * the_side_fe = nullptr;
848  this->get_side_fe<OutputShape>( var, the_side_fe, this->get_elem_dim() );
849 
850  // Get shape function values at quadrature point
851  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor>> & d2phi = the_side_fe->get_d2phi();
852 
853  // Loop over all the q_points in this finite element
854  for (auto qp : index_range(d2u_vals))
855  {
856  OutputType & d2u = d2u_vals[qp];
857 
858  // Compute the gradient at this q_point
859  d2u = 0;
860 
861  for (unsigned int l=0; l != n_dofs; l++)
862  d2u.add_scaled(d2phi[l][qp], coef(l));
863  }
864 
865  return;
866 }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
DenseSubVector< Number > & get_localized_subvector(const NumericVector< Number > &localized_vector, unsigned int var)
Return a reference to DenseSubVector localization of localized_vector at variable var contained in th...
Definition: diff_context.C:154
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition: int_range.h:117

◆ side_rate()

template<typename OutputType >
template LIBMESH_EXPORT 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 1380 of file fem_context.C.

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

1382 {
1383  this->some_value<OutputType,
1387 }
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for edge/face (2D/3D) finite element object for variable var for the largest dimension in th...
Definition: fem_context.h:317
const DenseVector< Number > & get_elem_solution_rate() const
Accessor for element solution rate of change w.r.t.
Definition: diff_context.h:144
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Helper function to reduce some code duplication in the *interior_value methods.
Definition: fem_context.C:315

◆ 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 661 of file fem_context.C.

Referenced by LaplaceSystem::side_constraint(), CoupledSystemQoI::side_qoi(), CoupledSystemQoI::side_qoi_derivative(), and CurlCurlSystem::side_time_derivative().

663 {
664  Number u = 0.;
665 
666  this->side_value( var, qp, u );
667 
668  return u;
669 }
Number side_value(unsigned int var, unsigned int qp) const
Definition: fem_context.C:661

◆ 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 673 of file fem_context.C.

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

676 {
677  this->some_value<OutputType,
678  &FEMContext::get_side_fe<typename TensorTools::MakeReal<OutputType>::type>,
679  &DiffContext::get_elem_solution>(var, qp, u);
680 }
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:112
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Helper function to reduce some code duplication in the *interior_value methods.
Definition: fem_context.C:315

◆ side_values()

template<typename OutputType >
template LIBMESH_EXPORT 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 684 of file fem_context.C.

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

687 {
688  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
689 
690  // Get local-to-global dof index lookup
691  const unsigned int n_dofs = cast_int<unsigned int>
692  (this->get_dof_indices(var).size());
693 
694  // Get current local coefficients
695  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
696 
697  // Get the finite element object
698  FEGenericBase<OutputShape> * the_side_fe = nullptr;
699  this->get_side_fe<OutputShape>( var, the_side_fe, this->get_elem_dim() );
700 
701  // Get shape function values at quadrature point
702  const std::vector<std::vector<OutputShape>> & phi = the_side_fe->get_phi();
703 
704  // Loop over all the q_points on this element
705  for (auto qp : index_range(u_vals))
706  {
707  OutputType & u = u_vals[qp];
708 
709  // Compute the value at this q_point
710  u = 0.;
711 
712  for (unsigned int l=0; l != n_dofs; l++)
713  u += phi[l][qp] * coef(l);
714  }
715 
716  return;
717 }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
DenseSubVector< Number > & get_localized_subvector(const NumericVector< Number > &localized_vector, unsigned int var)
Return a reference to DenseSubVector localization of localized_vector at variable var contained in th...
Definition: diff_context.C:154
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition: int_range.h:117

◆ 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 349 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(), libMesh::FEMContext::interior_gradient(), and libMesh::FEMContext::interior_rate_gradient().

350 {
351  // Get local-to-global dof index lookup
352  const unsigned int n_dofs = cast_int<unsigned int>
353  (this->get_dof_indices(var).size());
354 
355  // Get current local coefficients
356  const DenseSubVector<Number> & coef = (this->*subsolution_getter)(var);
357 
358  // Get finite element object
359  typename FENeeded<OutputType>::grad_base * fe = nullptr;
360  (this->*fe_getter)( var, fe, this->get_elem_dim() );
361 
362  // Get shape function values at quadrature point
363  const std::vector<std::vector
365  & dphi = fe->get_dphi();
366 
367  // Accumulate solution derivatives
368  du = 0;
369 
370  for (unsigned int l=0; l != n_dofs; l++)
371  du.add_scaled(dphi[l][qp], coef(l));
372 
373  return;
374 }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
TensorTools::IncrementRank< OutputShape >::type OutputGradient
Definition: fe_base.h:120
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363
FEGenericBase< grad_shape > grad_base
Definition: fem_context.h:1123

◆ 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 382 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().

383 {
384  // Get local-to-global dof index lookup
385  const unsigned int n_dofs = cast_int<unsigned int>
386  (this->get_dof_indices(var).size());
387 
388  // Get current local coefficients
389  const DenseSubVector<Number> & coef = (this->*subsolution_getter)(var);
390 
391  // Get finite element object
392  typename FENeeded<OutputType>::hess_base * fe = nullptr;
393  (this->*fe_getter)( var, fe, this->get_elem_dim() );
394 
395  // Get shape function values at quadrature point
396  const std::vector<std::vector
398  & d2phi = fe->get_d2phi();
399 
400  // Accumulate solution second derivatives
401  d2u = 0.0;
402 
403  for (unsigned int l=0; l != n_dofs; l++)
404  d2u.add_scaled(d2phi[l][qp], coef(l));
405 
406  return;
407 }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
FEGenericBase< hess_shape > hess_base
Definition: fem_context.h:1128
TensorTools::IncrementRank< OutputGradient >::type OutputTensor
Definition: fe_base.h:121
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363

◆ 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 315 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().

316 {
317  // Get local-to-global dof index lookup
318  const unsigned int n_dofs = cast_int<unsigned int>
319  (this->get_dof_indices(var).size());
320 
321  // Get current local coefficients
322  const DenseSubVector<Number> & coef = (this->*subsolution_getter)(var);
323  libmesh_assert_equal_to(coef.size(), n_dofs);
324 
325  // Get finite element object
326  typename FENeeded<OutputType>::value_base * fe = nullptr;
327  (this->*fe_getter)( var, fe, this->get_elem_dim() );
328 
329  // Get shape function values at quadrature point
330  const std::vector<std::vector
331  <typename FENeeded<OutputType>::value_shape>> & phi = fe->get_phi();
332  libmesh_assert_equal_to(phi.size(), n_dofs);
333 
334  // Accumulate solution value
335  u = 0.;
336 
337  for (unsigned int l=0; l != n_dofs; l++)
338  {
339  libmesh_assert_less(qp, phi[l].size());
340  u += phi[l][qp] * coef(l);
341  }
342 }
unsigned char get_elem_dim() const
Definition: fem_context.h:944
TensorTools::MakeReal< OutputType >::type value_shape
Definition: fem_context.h:1117
FEGenericBase< value_shape > value_base
Definition: fem_context.h:1118
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:363

◆ use_default_quadrature_rules()

void libMesh::FEMContext::use_default_quadrature_rules ( int  extra_quadrature_order = 0)
inherited

Use quadrature rules designed to over-integrate a mass matrix, plus extra_quadrature_order.

Definition at line 155 of file fem_context.C.

References libMesh::FEMContext::_edge_qrule, libMesh::FEMContext::_elem_dims, libMesh::FEMContext::_element_qrule, libMesh::FEMContext::_extra_quadrature_order, libMesh::FEMContext::_side_qrule, libMesh::FEMContext::attach_quadrature_rules(), libMesh::FEType::default_quadrature_rule(), dim, and libMesh::FEMContext::find_hardest_fe_type().

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

156 {
157  _extra_quadrature_order = extra_quadrature_order;
158 
159  FEType hardest_fe_type = this->find_hardest_fe_type();
160 
161  for (const auto & dim : _elem_dims)
162  {
163  // Create an adequate quadrature rule
165  hardest_fe_type.default_quadrature_rule(dim, _extra_quadrature_order);
166  if (dim)
167  _side_qrule[dim] =
168  hardest_fe_type.default_quadrature_rule(dim-1, _extra_quadrature_order);
169  if (dim == 3)
170  _edge_qrule = hardest_fe_type.default_quadrature_rule(1, _extra_quadrature_order);
171  }
172 
173  this->attach_quadrature_rules();
174 }
unsigned int dim
int _extra_quadrature_order
The extra quadrature order for this context.
Definition: fem_context.h:1238
std::set< unsigned char > _elem_dims
Cached dimensions of elements in the mesh, plus dimension 0 if SCALAR variables are in use...
Definition: fem_context.h:1208
FEType find_hardest_fe_type()
Helper function for creating quadrature rules.
Definition: fem_context.C:86
std::vector< std::unique_ptr< QBase > > _side_qrule
Quadrature rules for element sides The FEM context will try to find a quadrature rule that correctly ...
Definition: fem_context.h:1224
std::vector< std::unique_ptr< QBase > > _element_qrule
Quadrature rule for element interior.
Definition: fem_context.h:1216
std::unique_ptr< QBase > _edge_qrule
Quadrature rules for element edges.
Definition: fem_context.h:1233
void attach_quadrature_rules()
Helper function for attaching quadrature rules.
Definition: fem_context.C:127

◆ use_unweighted_quadrature_rules()

void libMesh::FEMContext::use_unweighted_quadrature_rules ( int  extra_quadrature_order = 0)
inherited

Use quadrature rules designed to exactly integrate unweighted undistorted basis functions, plus extra_quadrature_order.

Definition at line 177 of file fem_context.C.

References libMesh::FEMContext::_edge_qrule, libMesh::FEMContext::_elem_dims, libMesh::FEMContext::_element_qrule, libMesh::FEMContext::_extra_quadrature_order, libMesh::FEMContext::_side_qrule, libMesh::FEMContext::attach_quadrature_rules(), dim, libMesh::FEMContext::find_hardest_fe_type(), and libMesh::FEType::unweighted_quadrature_rule().

178 {
179  _extra_quadrature_order = extra_quadrature_order;
180 
181  FEType hardest_fe_type = this->find_hardest_fe_type();
182 
183  for (const auto & dim : _elem_dims)
184  {
185  // Create an adequate quadrature rule
187  hardest_fe_type.unweighted_quadrature_rule(dim, _extra_quadrature_order);
188  _side_qrule[dim] =
189  hardest_fe_type.unweighted_quadrature_rule(dim-1, _extra_quadrature_order);
190  if (dim == 3)
191  _edge_qrule = hardest_fe_type.unweighted_quadrature_rule(1, _extra_quadrature_order);
192  }
193 
194  this->attach_quadrature_rules();
195 }
unsigned int dim
int _extra_quadrature_order
The extra quadrature order for this context.
Definition: fem_context.h:1238
std::set< unsigned char > _elem_dims
Cached dimensions of elements in the mesh, plus dimension 0 if SCALAR variables are in use...
Definition: fem_context.h:1208
FEType find_hardest_fe_type()
Helper function for creating quadrature rules.
Definition: fem_context.C:86
std::vector< std::unique_ptr< QBase > > _side_qrule
Quadrature rules for element sides The FEM context will try to find a quadrature rule that correctly ...
Definition: fem_context.h:1224
std::vector< std::unique_ptr< QBase > > _element_qrule
Quadrature rule for element interior.
Definition: fem_context.h:1216
std::unique_ptr< QBase > _edge_qrule
Quadrature rules for element edges.
Definition: fem_context.h:1233
void attach_quadrature_rules()
Helper function for attaching quadrature rules.
Definition: fem_context.C:127

Member Data Documentation

◆ _active_vars

std::unique_ptr<const std::vector<unsigned int> > libMesh::FEMContext::_active_vars
protectedinherited

◆ _atype

AlgebraicType libMesh::FEMContext::_atype
protectedinherited

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

Definition at line 1069 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 1187 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 1074 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 1197 of file fem_context.h.

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

◆ _dof_indices

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

Global Degree of freedom index lists.

Definition at line 639 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 1233 of file fem_context.h.

Referenced by libMesh::FEMContext::attach_quadrature_rules(), libMesh::FEMContext::get_edge_qrule(), libMesh::FEMContext::use_default_quadrature_rules(), and libMesh::FEMContext::use_unweighted_quadrature_rules().

◆ _elem

const Elem* libMesh::FEMContext::_elem
protectedinherited

Current element for element_* to examine.

Definition at line 1192 of file fem_context.h.

Referenced by libMesh::FEMContext::get_elem(), libMesh::FEMContext::get_elem_dim(), 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 1202 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

◆ _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 604 of file diff_context.h.

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

◆ _elem_fixed_subsolutions

std::vector<DenseSubVector<Number> > libMesh::DiffContext::_elem_fixed_subsolutions
protectedinherited

◆ _elem_jacobian

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

Element jacobian: derivatives of elem_residual with respect to elem_solution.

Only initialized if _have_local_matrices

Definition at line 616 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 621 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 626 of file diff_context.h.

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

◆ _elem_qoi_subderivatives

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

◆ _elem_residual

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

Element residual vector.

Definition at line 610 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 582 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 596 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 589 of file diff_context.h.

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

◆ _elem_subjacobians

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

◆ _elem_subresiduals

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

Element residual subvectors and (if _have_local_matrices) Jacobian submatrices.

Definition at line 633 of file diff_context.h.

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

◆ _elem_subsolution_accels

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

◆ _elem_subsolution_rates

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

◆ _elem_subsolutions

std::vector<DenseSubVector<Number> > libMesh::DiffContext::_elem_subsolutions
protectedinherited

◆ _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 1168 of file fem_context.h.

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

◆ _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 1179 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 1216 of file fem_context.h.

Referenced by libMesh::FEMContext::attach_quadrature_rules(), libMesh::FEMContext::get_element_qrule(), libMesh::FEMContext::use_default_quadrature_rules(), and libMesh::FEMContext::use_unweighted_quadrature_rules().

◆ _extra_quadrature_order

int libMesh::FEMContext::_extra_quadrature_order
protectedinherited

◆ _have_local_matrices

const bool libMesh::DiffContext::_have_local_matrices
protectedinherited

Whether we have local matrices allocated/initialized.

Definition at line 576 of file diff_context.h.

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

◆ _localized_vectors

std::map<const NumericVector<Number> *, std::pair<DenseVector<Number>, std::vector<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 571 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

System* libMesh::FEMContext::_mesh_sys
protectedinherited

◆ _mesh_x_var

unsigned int libMesh::FEMContext::_mesh_x_var
protectedinherited

Variables from which to acquire moving mesh information.

Definition at line 1064 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
protectedinherited

◆ _mesh_z_var

unsigned int libMesh::FEMContext::_mesh_z_var
protectedinherited

◆ _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 1076 of file fem_context.h.

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

◆ _real_fe_derivative_level

int libMesh::FEMContext::_real_fe_derivative_level
mutableprotectedinherited

Definition at line 1078 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 1082 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 1077 of file fem_context.h.

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

◆ _real_grad_fe_derivative_level

int libMesh::FEMContext::_real_grad_fe_derivative_level
mutableprotectedinherited

Definition at line 1079 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 1083 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 1224 of file fem_context.h.

Referenced by libMesh::FEMContext::attach_quadrature_rules(), libMesh::FEMContext::get_side_qrule(), libMesh::FEMContext::use_default_quadrature_rules(), and libMesh::FEMContext::use_unweighted_quadrature_rules().

◆ edge

unsigned char libMesh::FEMContext::edge
inherited

Current edge for edge_* to examine.

Definition at line 1018 of file fem_context.h.

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

◆ 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 510 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

◆ 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 517 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

unsigned char libMesh::FEMContext::side
inherited

◆ 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 490 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 481 of file diff_context.h.

Referenced by libMesh::DiffContext::get_time(), and libMesh::DiffContext::set_time().


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