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 }
 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 () libmesh_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...
 
bool has_side_boundary_id (boundary_id_type id) const
 Reports if the boundary id is found on the current side. More...
 
std::vector< boundary_id_typeside_boundary_ids () const
 Lists the boundary ids 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 char dim) const
 Accessor for interior finite element object for variable var for dimension dim. More...
 
FEBaseget_element_fe (unsigned int var, unsigned char 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 char 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 char 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...
 
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 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) libmesh_override
 Resets the current time in the context. More...
 
virtual void elem_side_reinit (Real theta) libmesh_override
 Resets the current time in the context. More...
 
virtual void elem_edge_reinit (Real theta) libmesh_override
 Resets the current time in the context. More...
 
virtual void nonlocal_reinit (Real theta) libmesh_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=libmesh_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 char 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 char 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...
 
template<>
FEGenericBase< Real > * cached_fe (const unsigned int elem_dim, const FEType fe_type) const
 
template<>
FEGenericBase< RealGradient > * cached_fe (const unsigned int elem_dim, const FEType fe_type) const
 
unsigned int n_vars () const
 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 (unsigned int 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 (unsigned int 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...
 
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

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
 
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 > * build_new_fe (const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
 Helper function to reduce some code duplication in the *_point_* methods. More...
 
template<typename OutputShape >
FEGenericBase< OutputShape > * cached_fe (const unsigned int elem_dim, const FEType fe_type) 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

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...
 
UniquePtr< FEGenericBase< Real > > _real_fe
 
UniquePtr< FEGenericBase< RealGradient > > _real_grad_fe
 
bool _real_fe_is_inf
 
bool _real_grad_fe_is_inf
 
std::vector< std::map< FEType, FEAbstract * > > _element_fe
 Finite element objects for each variable's interior, sides and edges. More...
 
std::vector< std::map< FEType, FEAbstract * > > _side_fe
 
std::map< FEType, 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< QBase * > _element_qrule
 Quadrature rule for element interior. More...
 
std::vector< QBase * > _side_qrule
 Quadrature rules for element sides The FEM context will try to find a quadrature rule that correctly integrates all variables. More...
 
UniquePtr< 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...
 
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 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< DenseSubVector< Number > * > _neighbor_subresiduals
 Element residual subvectors and Jacobian submatrices. More...
 
std::vector< std::vector< DenseSubMatrix< Number > * > > _elem_elem_subjacobians
 
std::vector< std::vector< DenseSubMatrix< Number > * > > _elem_neighbor_subjacobians
 
std::vector< std::vector< DenseSubMatrix< Number > * > > _neighbor_elem_subjacobians
 
std::vector< std::vector< 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, 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

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

Helper typedef to simplify refactoring.

Definition at line 1028 of file fem_context.h.

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

Member Enumeration Documentation

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

Enumerator
NONE 
DOFS_ONLY 
CURRENT 
OLD 

Definition at line 933 of file fem_context.h.

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

Constructor & Destructor Documentation

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_nullptr, libMesh::System::n_vars(), and libMesh::System::variable_type().

30  : FEMContext(sys),
33  _dg_terms_active(false)
34 {
35  libmesh_experimental();
36 
37  unsigned int nv = sys.n_vars();
38  libmesh_assert (nv);
39 
40  _neighbor_subresiduals.reserve(nv);
41  _elem_elem_subjacobians.resize(nv);
42  _elem_neighbor_subjacobians.resize(nv);
43  _neighbor_elem_subjacobians.resize(nv);
45 
46  for (unsigned int i=0; i != nv; ++i)
47  {
48  _neighbor_subresiduals.push_back(new DenseSubVector<Number>(_neighbor_residual));
49  _elem_elem_subjacobians[i].reserve(nv);
50  _elem_neighbor_subjacobians[i].reserve(nv);
51  _neighbor_elem_subjacobians[i].reserve(nv);
52  _neighbor_neighbor_subjacobians[i].reserve(nv);
53 
54  for (unsigned int j=0; j != nv; ++j)
55  {
56  _elem_elem_subjacobians[i].push_back
57  (new DenseSubMatrix<Number>(_elem_elem_jacobian));
58  _elem_neighbor_subjacobians[i].push_back
59  (new DenseSubMatrix<Number>(_elem_neighbor_jacobian));
60  _neighbor_elem_subjacobians[i].push_back
61  (new DenseSubMatrix<Number>(_neighbor_elem_jacobian));
63  (new DenseSubMatrix<Number>(_neighbor_neighbor_jacobian));
64  }
65  }
66 
67  _neighbor_side_fe_var.resize(nv);
68  for (unsigned int i=0; i != nv; ++i)
69  {
70  FEType fe_type = sys.variable_type(i);
71 
72  if (_neighbor_side_fe[fe_type] == libmesh_nullptr)
73  _neighbor_side_fe[fe_type] = FEAbstract::build(this->_dim, fe_type).release();
74 
76  }
77 }
DenseVector< Number > _neighbor_residual
Residual vector of the neighbor component.
DenseMatrix< Number > _elem_elem_jacobian
The DG Jacobian terms.
ImplicitSystem & sys
std::vector< std::vector< dof_id_type > > _neighbor_dof_indices_var
std::map< FEType, FEAbstract * > _neighbor_side_fe
Finite element objects for each variable&#39;s sides on the neighbor element.
const class libmesh_nullptr_t libmesh_nullptr
std::vector< FEAbstract * > _neighbor_side_fe_var
Pointers to the same finite element objects on the neighbor element, but indexed by variable number...
const FEType & variable_type(const unsigned int i) const
Definition: system.h:2164
libmesh_assert(j)
std::vector< std::vector< DenseSubMatrix< Number > * > > _elem_elem_subjacobians
std::vector< std::vector< DenseSubMatrix< Number > * > > _neighbor_neighbor_subjacobians
std::vector< std::vector< DenseSubMatrix< Number > * > > _elem_neighbor_subjacobians
DenseMatrix< Number > _neighbor_elem_jacobian
DenseMatrix< Number > _elem_neighbor_jacobian
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:1122
const Elem * _neighbor
Current neighbor element for assembling DG terms.
std::vector< std::vector< DenseSubMatrix< Number > * > > _neighbor_elem_subjacobians
DenseMatrix< Number > _neighbor_neighbor_jacobian
std::vector< DenseSubVector< Number > * > _neighbor_subresiduals
Element residual subvectors and Jacobian submatrices.
FEMContext(const System &sys)
Constructor.
Definition: fem_context.C:37
unsigned int n_vars() const
Definition: system.h:2086
static UniquePtr< FEAbstract > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
Definition: fe_abstract.C:44
libMesh::DGFEMContext::~DGFEMContext ( )
virtual

Destructor.

Definition at line 79 of file dg_fem_context.C.

References _elem_elem_subjacobians, _elem_neighbor_subjacobians, _neighbor_elem_subjacobians, _neighbor_neighbor_subjacobians, _neighbor_side_fe, and _neighbor_subresiduals.

80 {
81 
82  for (std::size_t i=0; i != _neighbor_subresiduals.size(); ++i)
83  {
84  delete _neighbor_subresiduals[i];
85 
86  for (std::size_t j=0; j != _elem_elem_subjacobians[i].size(); ++j)
87  {
88  delete _elem_elem_subjacobians[i][j];
89  delete _elem_neighbor_subjacobians[i][j];
90  delete _neighbor_elem_subjacobians[i][j];
92  }
93  }
94 
95  // Delete the FE objects
96  for (std::map<FEType, FEAbstract *>::iterator i = _neighbor_side_fe.begin();
97  i != _neighbor_side_fe.end(); ++i)
98  delete i->second;
99  _neighbor_side_fe.clear();
100 }
std::map< FEType, FEAbstract * > _neighbor_side_fe
Finite element objects for each variable&#39;s sides on the neighbor element.
std::vector< std::vector< DenseSubMatrix< Number > * > > _elem_elem_subjacobians
std::vector< std::vector< DenseSubMatrix< Number > * > > _neighbor_neighbor_subjacobians
std::vector< std::vector< DenseSubMatrix< Number > * > > _elem_neighbor_subjacobians
std::vector< std::vector< DenseSubMatrix< Number > * > > _neighbor_elem_subjacobians
std::vector< DenseSubVector< Number > * > _neighbor_subresiduals
Element residual subvectors and Jacobian submatrices.

Member Function Documentation

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

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

155 {
156  // Make an empty pair keyed with a reference to this _localized_vector
157  _localized_vectors[&localized_vector] = std::make_pair(DenseVector<Number>(), std::vector<DenseSubVector<Number> *>());
158 
159  unsigned int nv = sys.n_vars();
160 
161  _localized_vectors[&localized_vector].second.reserve(nv);
162 
163  // Fill the DenseSubVector with nv copies of DenseVector
164  for (unsigned int i=0; i != nv; ++i)
165  _localized_vectors[&localized_vector].second.push_back(new DenseSubVector<Number>(_localized_vectors[&localized_vector].first));
166 }
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:558
ImplicitSystem & sys
unsigned int n_vars() const
Definition: system.h:2086
AlgebraicType libMesh::FEMContext::algebraic_type ( ) const
inherited

Definition at line 952 of file fem_context.h.

References libMesh::FEMContext::_atype.

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

952 { return _atype; }
AlgebraicType _atype
Keep track of what type of algebra reinitialization is to be done.
Definition: fem_context.h:989
template<typename OutputShape >
template FEGenericBase< RealGradient > * libMesh::FEMContext::build_new_fe ( const FEGenericBase< OutputShape > *  fe,
const Point p,
const Real  tolerance = TOLERANCE 
) const
protectedinherited

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

Definition at line 1884 of file fem_context.C.

References libMesh::FEMContext::algebraic_type(), libMesh::Elem::dim(), libMesh::FEType::family, libMesh::FEMContext::get_elem(), libMesh::FEAbstract::get_fe_type(), libMesh::FEMContext::has_elem(), int, libMesh::FEInterface::inverse_map(), libMesh::Elem::JUST_COARSENED, libMesh::Elem::JUST_REFINED, libMesh::libmesh_assert(), libmesh_nullptr, libMesh::FEMContext::OLD, libMesh::FEType::order, libMesh::Elem::p_refinement_flag(), libMesh::Real, 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().

1887 {
1888  FEType fe_type = fe->get_fe_type();
1889 
1890  // If we don't have an Elem to evaluate on, then the only functions
1891  // we can sensibly evaluate are the scalar dofs which are the same
1892  // everywhere.
1893  libmesh_assert(this->has_elem() || fe_type.family == SCALAR);
1894 
1895 #ifdef LIBMESH_ENABLE_AMR
1896  if ((algebraic_type() == OLD) &&
1897  this->has_elem())
1898  {
1899  if (this->get_elem().p_refinement_flag() == Elem::JUST_REFINED)
1900  fe_type.order = static_cast<Order>(fe_type.order - 1);
1901  else if (this->get_elem().p_refinement_flag() == Elem::JUST_COARSENED)
1902  fe_type.order = static_cast<Order>(fe_type.order + 1);
1903  }
1904 #endif // LIBMESH_ENABLE_AMR
1905 
1906  const unsigned int elem_dim = this->has_elem() ? this->get_elem().dim() : 0;
1907 
1908  FEGenericBase<OutputShape>* fe_new = cached_fe<OutputShape>(elem_dim, fe_type);
1909 
1910  // Map the physical co-ordinates to the master co-ordinates using the inverse_map from fe_interface.h
1911  // Build a vector of point co-ordinates to send to reinit
1912  Point master_point = this->has_elem() ?
1913  FEInterface::inverse_map (elem_dim,
1914  fe_type,
1915  &this->get_elem(),
1916  p,
1917  tolerance) : Point(0);
1918 
1919  std::vector<Point> coor(1, master_point);
1920 
1921  // Reinitialize the element and compute the shape function values at coor
1922  if (this->has_elem())
1923  fe_new->reinit (&this->get_elem(), &coor);
1924  else
1925  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1926  fe_new->reinit (libmesh_nullptr, &coor);
1927 
1928  return fe_new;
1929 }
bool has_elem() const
Test for current Elem object.
Definition: fem_context.h:865
const class libmesh_nullptr_t libmesh_nullptr
const Elem & get_elem() const
Accessor for current Elem object.
Definition: fem_context.h:871
libmesh_assert(j)
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_interface.C:569
RefinementState p_refinement_flag() const
Definition: elem.h:2521
AlgebraicType algebraic_type() const
Definition: fem_context.h:952
virtual unsigned int dim() const =0
Order
defines an enum for polynomial orders.
Definition: enum_order.h:32
template<typename OutputShape >
FEGenericBase<OutputShape>* libMesh::FEMContext::cached_fe ( const unsigned int  elem_dim,
const FEType  fe_type 
) const
protectedinherited
template<>
FEGenericBase<Real>* libMesh::FEMContext::cached_fe ( const unsigned int  elem_dim,
const FEType  fe_type 
) const
inherited

Definition at line 1811 of file fem_context.C.

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

1813 {
1814 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1815  const bool fe_needs_inf =
1816  this->has_elem() && this->get_elem().infinite();
1817 #endif
1818 
1819  if (!_real_fe ||
1820  elem_dim != _real_fe->get_dim() ||
1821  fe_type != _real_fe->get_fe_type())
1822  _real_fe =
1823 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1824  fe_needs_inf ?
1825  FEGenericBase<Real>::build_InfFE(elem_dim, fe_type) :
1826 #endif
1827  FEGenericBase<Real>::build(elem_dim, fe_type);
1828 
1829 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1830  else if (fe_needs_inf && !_real_fe_is_inf)
1831  _real_fe =
1832  FEGenericBase<Real>::build_InfFE(elem_dim, fe_type);
1833  else if (!fe_needs_inf && _real_fe_is_inf)
1834  _real_fe =
1835  FEGenericBase<Real>::build(elem_dim, fe_type);
1836 
1837  _real_fe_is_inf =
1838  (this->has_elem() && this->get_elem().infinite());
1839 #endif
1840 
1841  return _real_fe.get();
1842 }
bool has_elem() const
Test for current Elem object.
Definition: fem_context.h:865
UniquePtr< FEGenericBase< Real > > _real_fe
Definition: fem_context.h:1004
const Elem & get_elem() const
Accessor for current Elem object.
Definition: fem_context.h:871
virtual bool infinite() const =0
static UniquePtr< FEGenericBase > build_InfFE(const unsigned int dim, const FEType &type)
Builds a specific infinite element type.
static UniquePtr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
template<>
FEGenericBase<RealGradient>* libMesh::FEMContext::cached_fe ( const unsigned int  elem_dim,
const FEType  fe_type 
) const
inherited

Definition at line 1847 of file fem_context.C.

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

1849 {
1850 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1851  const bool fe_needs_inf =
1852  this->has_elem() && this->get_elem().infinite();
1853 #endif
1854 
1855  if (!_real_grad_fe ||
1856  elem_dim != _real_grad_fe->get_dim() ||
1857  fe_type != _real_grad_fe->get_fe_type())
1858  _real_grad_fe =
1859 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1860  fe_needs_inf ?
1861  FEGenericBase<RealGradient>::build_InfFE(elem_dim, fe_type) :
1862 #endif
1863  FEGenericBase<RealGradient>::build(elem_dim, fe_type);
1864 
1865 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1866  else if (fe_needs_inf && !_real_grad_fe_is_inf)
1867  _real_grad_fe =
1868  FEGenericBase<RealGradient>::build_InfFE(elem_dim, fe_type);
1869  else if (!fe_needs_inf && _real_grad_fe_is_inf)
1870  _real_grad_fe =
1871  FEGenericBase<RealGradient>::build(elem_dim, fe_type);
1872 
1874  (this->has_elem() && this->get_elem().infinite());
1875 #endif
1876 
1877  return _real_grad_fe.get();
1878 }
bool has_elem() const
Test for current Elem object.
Definition: fem_context.h:865
const Elem & get_elem() const
Accessor for current Elem object.
Definition: fem_context.h:871
UniquePtr< FEGenericBase< RealGradient > > _real_grad_fe
Definition: fem_context.h:1005
virtual bool infinite() const =0
static UniquePtr< FEGenericBase > build_InfFE(const unsigned int dim, const FEType &type)
Builds a specific infinite element type.
static UniquePtr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
bool libMesh::DGFEMContext::dg_terms_are_active ( ) const

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, and get_neighbor_side_fe().

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...
void libMesh::FEMContext::edge_fe_reinit ( )
virtualinherited

Reinitializes edge FE objects on the current geometric element.

Definition at line 1425 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(), libMesh::FEMContext::get_side_fe(), and libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()().

1426 {
1427  libmesh_assert_equal_to (this->get_elem_dim(), 3);
1428 
1429  // Initialize all the interior FE objects on elem/edge.
1430  // Logging of FE::reinit is done in the FE functions
1431  std::map<FEType, FEAbstract *>::iterator local_fe_end = _edge_fe.end();
1432  for (std::map<FEType, FEAbstract *>::iterator i = _edge_fe.begin();
1433  i != local_fe_end; ++i)
1434  {
1435  i->second->edge_reinit(&(this->get_elem()), this->get_edge());
1436  }
1437 }
const Elem & get_elem() const
Accessor for current Elem object.
Definition: fem_context.h:871
std::map< FEType, FEAbstract * > _edge_fe
Definition: fem_context.h:1095
unsigned char get_edge() const
Accessor for current edge of Elem object.
Definition: fem_context.h:891
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const std::set<unsigned char>& libMesh::FEMContext::elem_dimensions ( ) const
inherited
Returns
Set of dimensions of elements present in the mesh at context initialization.

Definition at line 913 of file fem_context.h.

References libMesh::FEMContext::_elem_dims, libMesh::FEMContext::elem_position_get(), libMesh::FEMContext::elem_position_set(), and libMesh::Real.

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

914  { return _elem_dims; }
std::set< unsigned char > _elem_dims
Cached dimensions of elements in the mesh, plus dimension 0 if SCALAR variables are in use...
Definition: fem_context.h:1133
void libMesh::FEMContext::elem_edge_reinit ( Real  theta)
virtualinherited

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 1357 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().

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

1358 {
1359  // Update the "time" variable of this context object
1360  this->_update_time_from_system(theta);
1361 
1362  // Handle a moving element if necessary
1363  if (_mesh_sys)
1364  {
1365  // FIXME - not threadsafe yet!
1366  elem_position_set(theta);
1367  edge_fe_reinit();
1368  }
1369 }
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:1195
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:1796
System * _mesh_sys
System from which to acquire moving mesh information.
Definition: fem_context.h:967
virtual void edge_fe_reinit()
Reinitializes edge FE objects on the current geometric element.
Definition: fem_context.C:1425
void libMesh::FEMContext::elem_fe_reinit ( const std::vector< Point > *const  pts = libmesh_nullptr)
virtualinherited

Reinitializes interior FE objects on the current geometric element.

Definition at line 1382 of file fem_context.C.

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

Referenced by libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::FEMContext::elem_reinit(), libMesh::RBEIMConstruction::enrich_RB_space(), libMesh::FEMContext::get_side_fe(), libMesh::FEMSystem::mesh_position_set(), libMesh::FEMContext::nonlocal_reinit(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()(), and libMesh::RBEIMConstruction::truth_solve().

1383 {
1384  // Initialize all the interior FE objects on elem.
1385  // Logging of FE::reinit is done in the FE functions
1386  // We only reinit the FE objects for the current element
1387  // dimension
1388  const unsigned char dim = this->get_elem_dim();
1389 
1390  libmesh_assert( !_element_fe[dim].empty() );
1391 
1392  std::map<FEType, FEAbstract *>::iterator local_fe_end = _element_fe[dim].end();
1393  for (std::map<FEType, FEAbstract *>::iterator i = _element_fe[dim].begin();
1394  i != local_fe_end; ++i)
1395  {
1396  if (this->has_elem())
1397  i->second->reinit(&(this->get_elem()), pts);
1398  else
1399  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1400  i->second->reinit(libmesh_nullptr);
1401  }
1402 }
unsigned int dim
bool has_elem() const
Test for current Elem object.
Definition: fem_context.h:865
const class libmesh_nullptr_t libmesh_nullptr
const Elem & get_elem() const
Accessor for current Elem object.
Definition: fem_context.h:871
libmesh_assert(j)
std::vector< std::map< FEType, FEAbstract * > > _element_fe
Finite element objects for each variable&#39;s interior, sides and edges.
Definition: fem_context.h:1093
unsigned char get_elem_dim() const
Definition: fem_context.h:906
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 1441 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::LAGRANGE, libMesh::libmesh_assert(), n_nodes, libMesh::Elem::n_nodes(), libMesh::n_threads(), and libMesh::Elem::point().

Referenced by libMesh::FEMContext::elem_dimensions(), and libMesh::FEMSystem::mesh_position_get().

1442 {
1443  // This is too expensive to call unless we've been asked to move the mesh
1445 
1446  // This will probably break with threading when two contexts are
1447  // operating on elements which share a node
1448  libmesh_assert_equal_to (libMesh::n_threads(), 1);
1449 
1450  // If the coordinate data is in our own system, it's already
1451  // been set up for us
1452  // if (_mesh_sys == this->number())
1453  // {
1454  unsigned int n_nodes = this->get_elem().n_nodes();
1455 
1456 #ifndef NDEBUG
1457  const unsigned char dim = this->get_elem_dim();
1458 
1459  // For simplicity we demand that mesh coordinates be stored
1460  // in a format that allows a direct copy
1462  (this->get_element_fe(this->get_mesh_x_var(), dim)->get_fe_type().family
1463  == LAGRANGE &&
1464  this->get_element_fe(this->get_mesh_x_var(), dim)->get_fe_type().order.get_order()
1465  == this->get_elem().default_order()));
1467  (this->get_element_fe(this->get_mesh_y_var(), dim)->get_fe_type().family
1468  == LAGRANGE &&
1469  this->get_element_fe(this->get_mesh_y_var(), dim)->get_fe_type().order.get_order()
1470  == this->get_elem().default_order()));
1472  (this->get_element_fe(this->get_mesh_z_var(), dim)->get_fe_type().family
1473  == LAGRANGE &&
1474  this->get_element_fe(this->get_mesh_z_var(), dim)->get_fe_type().order.get_order()
1475  == this->get_elem().default_order()));
1476 #endif
1477 
1478  // Get degree of freedom coefficients from point coordinates
1479  if (this->get_mesh_x_var() != libMesh::invalid_uint)
1480  for (unsigned int i=0; i != n_nodes; ++i)
1481  (this->get_elem_solution(this->get_mesh_x_var()))(i) = this->get_elem().point(i)(0);
1482 
1483  if (this->get_mesh_y_var() != libMesh::invalid_uint)
1484  for (unsigned int i=0; i != n_nodes; ++i)
1485  (this->get_elem_solution(this->get_mesh_y_var()))(i) = this->get_elem().point(i)(1);
1486 
1487  if (this->get_mesh_z_var() != libMesh::invalid_uint)
1488  for (unsigned int i=0; i != n_nodes; ++i)
1489  (this->get_elem_solution(this->get_mesh_z_var()))(i) = this->get_elem().point(i)(2);
1490  // }
1491  // FIXME - If the coordinate data is not in our own system, someone
1492  // had better get around to implementing that... - RHS
1493  // else
1494  // {
1495  // libmesh_not_implemented();
1496  // }
1497 }
unsigned int n_threads()
Definition: libmesh_base.h:125
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:110
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value.
Definition: libmesh.h:184
unsigned int get_mesh_x_var() const
Accessor for x-variable of moving mesh System.
Definition: fem_context.h:823
unsigned int dim
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:262
const Elem & get_elem() const
Accessor for current Elem object.
Definition: fem_context.h:871
libmesh_assert(j)
virtual unsigned int n_nodes() const =0
const dof_id_type n_nodes
Definition: tecplot_io.C:67
System * _mesh_sys
System from which to acquire moving mesh information.
Definition: fem_context.h:967
virtual Order default_order() const =0
const Point & point(const unsigned int i) const
Definition: elem.h:1809
unsigned int get_mesh_z_var() const
Accessor for z-variable of moving mesh System.
Definition: fem_context.h:851
unsigned char get_elem_dim() const
Definition: fem_context.h:906
unsigned int get_mesh_y_var() const
Accessor for y-variable of moving mesh System.
Definition: fem_context.h:837
void libMesh::FEMContext::elem_position_set ( Real  theta)
inherited

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

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

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

1196 {
1197  if (_mesh_sys)
1198  this->_do_elem_position_set(theta);
1199 }
System * _mesh_sys
System from which to acquire moving mesh information.
Definition: fem_context.h:967
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:1506
void libMesh::FEMContext::elem_reinit ( Real  theta)
virtualinherited

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 1318 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().

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

1319 {
1320  // Update the "time" variable of this context object
1321  this->_update_time_from_system(theta);
1322 
1323  // Handle a moving element if necessary.
1324  if (_mesh_sys)
1325  {
1326  // We assume that the ``default'' state
1327  // of the mesh is its final, theta=1.0
1328  // position, so we don't bother with
1329  // mesh motion in that case.
1330  if (theta != 1.0)
1331  {
1332  // FIXME - ALE is not threadsafe yet!
1333  libmesh_assert_equal_to (libMesh::n_threads(), 1);
1334 
1335  elem_position_set(theta);
1336  }
1337  elem_fe_reinit();
1338  }
1339 }
unsigned int n_threads()
Definition: libmesh_base.h:125
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:1195
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:1796
System * _mesh_sys
System from which to acquire moving mesh information.
Definition: fem_context.h:967
virtual void elem_fe_reinit(const std::vector< Point > *const pts=libmesh_nullptr)
Reinitializes interior FE objects on the current geometric element.
Definition: fem_context.C:1382
void libMesh::FEMContext::elem_side_reinit ( Real  theta)
virtualinherited

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 1342 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().

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

1343 {
1344  // Update the "time" variable of this context object
1345  this->_update_time_from_system(theta);
1346 
1347  // Handle a moving element if necessary
1348  if (_mesh_sys)
1349  {
1350  // FIXME - not threadsafe yet!
1351  elem_position_set(theta);
1352  side_fe_reinit();
1353  }
1354 }
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:1195
virtual void side_fe_reinit()
Reinitializes side FE objects on the current geometric element.
Definition: fem_context.C:1405
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:1796
System * _mesh_sys
System from which to acquire moving mesh information.
Definition: fem_context.h:967
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 996 of file fem_context.C.

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

997 {
998  Gradient du;
999 
1000  this->fixed_interior_gradient( var, qp, du );
1001 
1002  return du;
1003 }
NumberVectorValue Gradient
Gradient fixed_interior_gradient(unsigned int var, unsigned int qp) const
Definition: fem_context.C:996
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 1007 of file fem_context.C.

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

1009 {
1010  this->some_gradient
1011  <OutputType,
1013  <typename TensorTools::MakeReal
1014  <typename TensorTools::DecrementRank
1015  <OutputType>::type>::type>,
1017  (var, qp, du);
1018 }
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:214
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:262
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:263
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 1023 of file fem_context.C.

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

1024 {
1025  Tensor d2u;
1026 
1027  this->fixed_interior_hessian( var, qp, d2u );
1028 
1029  return d2u;
1030 }
NumberTensorValue Tensor
Tensor fixed_interior_hessian(unsigned int var, unsigned int qp) const
Definition: fem_context.C:1023
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 1034 of file fem_context.C.

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

1036 {
1037  this->some_hessian<OutputType,
1039  <typename TensorTools::MakeReal
1040  <typename TensorTools::DecrementRank
1041  <typename TensorTools::DecrementRank
1042  <OutputType>::type>::type>::type>,
1043  &DiffContext::get_elem_fixed_solution>(var, qp, d2u);
1044 }
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:214
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:262
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:296
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 973 of file fem_context.C.

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

974 {
975  Number u = 0.;
976 
977  this->fixed_interior_value( var, qp, u );
978 
979  return u;
980 }
Number fixed_interior_value(unsigned int var, unsigned int qp) const
Definition: fem_context.C:973
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 985 of file fem_context.C.

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

987 {
988  this->some_value<OutputType,
992 }
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:234
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:214
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:262
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 1169 of file fem_context.C.

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

1170 {
1171  Gradient grad_u;
1172 
1173  this->fixed_point_gradient( var, p, grad_u );
1174 
1175  return grad_u;
1176 }
Gradient fixed_point_gradient(unsigned int var, const Point &p) const
Definition: fem_context.C:1169
NumberVectorValue Gradient
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 1181 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(), libMesh::DiffContext::get_elem_fixed_solution(), and libmesh_nullptr.

1185 {
1186  typedef typename TensorTools::MakeReal
1188  OutputShape;
1189 
1190  // Get local-to-global dof index lookup
1191  const unsigned int n_dofs = cast_int<unsigned int>
1192  (this->get_dof_indices(var).size());
1193 
1194  // Get current local coefficients
1195  libmesh_assert_greater (_elem_fixed_subsolutions.size(), var);
1196  const DenseSubVector<Number> & coef = this->get_elem_fixed_solution(var);
1197 
1198  // Get finite element object
1199  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
1200  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
1201 
1202  // Build a FE for calculating u(p)
1203  FEGenericBase<OutputShape> * fe_new =
1204  this->build_new_fe( fe, p, tolerance );
1205 
1206  // Get the values of the shape function derivatives
1207  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient>> & dphi = fe_new->get_dphi();
1208 
1209  grad_u = 0.0;
1210 
1211  for (unsigned int l=0; l != n_dofs; l++)
1212  grad_u.add_scaled(dphi[l][0], coef(l));
1213 
1214  return;
1215 }
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:366
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:214
const class libmesh_nullptr_t libmesh_nullptr
std::vector< DenseSubVector< Number > * > _elem_fixed_subsolutions
Definition: diff_context.h:587
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
Helper function to reduce some code duplication in the *_point_* methods.
Definition: fem_context.C:1884
unsigned char get_elem_dim() const
Definition: fem_context.h:906
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 1220 of file fem_context.C.

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

1221 {
1222  Tensor hess_u;
1223 
1224  this->fixed_point_hessian( var, p, hess_u );
1225 
1226  return hess_u;
1227 }
Tensor fixed_point_hessian(unsigned int var, const Point &p) const
Definition: fem_context.C:1220
NumberTensorValue Tensor
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 1232 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(), libMesh::DiffContext::get_elem_fixed_solution(), and libmesh_nullptr.

1236 {
1237  typedef typename TensorTools::DecrementRank<OutputType>::type Rank1Decrement;
1238  typedef typename TensorTools::DecrementRank<Rank1Decrement>::type Rank2Decrement;
1239  typedef typename TensorTools::MakeReal<Rank2Decrement>::type OutputShape;
1240 
1241  // Get local-to-global dof index lookup
1242  const unsigned int n_dofs = cast_int<unsigned int>
1243  (this->get_dof_indices(var).size());
1244 
1245  // Get current local coefficients
1246  libmesh_assert_greater (_elem_fixed_subsolutions.size(), var);
1247  const DenseSubVector<Number> & coef = this->get_elem_fixed_solution(var);
1248 
1249  // Get finite element object
1250  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
1251  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
1252 
1253  // Build a FE for calculating u(p)
1254  FEGenericBase<OutputShape> * fe_new =
1255  this->build_new_fe( fe, p, tolerance );
1256 
1257  // Get the values of the shape function derivatives
1258  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor>> & d2phi = fe_new->get_d2phi();
1259 
1260  hess_u = 0.0;
1261 
1262  for (unsigned int l=0; l != n_dofs; l++)
1263  hess_u.add_scaled(d2phi[l][0], coef(l));
1264 
1265  return;
1266 }
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:366
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:214
const class libmesh_nullptr_t libmesh_nullptr
std::vector< DenseSubVector< Number > * > _elem_fixed_subsolutions
Definition: diff_context.h:587
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
Helper function to reduce some code duplication in the *_point_* methods.
Definition: fem_context.C:1884
unsigned char get_elem_dim() const
Definition: fem_context.h:906
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 1123 of file fem_context.C.

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

1124 {
1125  Number u = 0.;
1126 
1127  this->fixed_point_value( var, p, u );
1128 
1129  return u;
1130 }
Number fixed_point_value(unsigned int var, const Point &p) const
Definition: fem_context.C:1123
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 1133 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(), libMesh::DiffContext::get_elem_fixed_solution(), and libmesh_nullptr.

1137 {
1138  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
1139 
1140  // Get local-to-global dof index lookup
1141  const unsigned int n_dofs = cast_int<unsigned int>
1142  (this->get_dof_indices(var).size());
1143 
1144  // Get current local coefficients
1145  libmesh_assert_greater (_elem_fixed_subsolutions.size(), var);
1146  const DenseSubVector<Number> & coef = this->get_elem_fixed_solution(var);
1147 
1148  // Get finite element object
1149  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
1150  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
1151 
1152  // Build a FE for calculating u(p)
1153  FEGenericBase<OutputShape> * fe_new =
1154  this->build_new_fe( fe, p, tolerance );
1155 
1156  // Get the values of the shape function derivatives
1157  const std::vector<std::vector<OutputShape>> & phi = fe_new->get_phi();
1158 
1159  u = 0.;
1160 
1161  for (unsigned int l=0; l != n_dofs; l++)
1162  u += phi[l][0] * coef(l);
1163 
1164  return;
1165 }
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:366
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:214
const class libmesh_nullptr_t libmesh_nullptr
std::vector< DenseSubVector< Number > * > _elem_fixed_subsolutions
Definition: diff_context.h:587
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
Helper function to reduce some code duplication in the *_point_* methods.
Definition: fem_context.C:1884
unsigned char get_elem_dim() const
Definition: fem_context.h:906
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 1073 of file fem_context.C.

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

1074 {
1075  Gradient du;
1076 
1077  this->fixed_side_gradient( var, qp, du );
1078 
1079  return du;
1080 }
NumberVectorValue Gradient
Gradient fixed_side_gradient(unsigned int var, unsigned int qp) const
Definition: fem_context.C:1073
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 1084 of file fem_context.C.

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

1086 {
1087  this->some_gradient<OutputType,
1089  <typename TensorTools::MakeReal
1090  <typename TensorTools::DecrementRank
1091  <OutputType>::type>::type>,
1092  &DiffContext::get_elem_fixed_solution>(var, qp, du);
1093 }
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:214
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:263
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:299
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 1098 of file fem_context.C.

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

1099 {
1100  Tensor d2u;
1101 
1102  this->fixed_side_hessian( var, qp, d2u );
1103 
1104  return d2u;
1105 }
Tensor fixed_side_hessian(unsigned int var, unsigned int qp) const
Definition: fem_context.C:1098
NumberTensorValue Tensor
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 1108 of file fem_context.C.

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

1110 {
1111  this->some_hessian<OutputType,
1113  <typename TensorTools::MakeReal
1114  <typename TensorTools::DecrementRank
1115  <typename TensorTools::DecrementRank
1116  <OutputType>::type>::type>::type>,
1117  &DiffContext::get_elem_fixed_solution>(var, qp, d2u);
1118 }
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:214
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:296
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:299
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 1049 of file fem_context.C.

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

1050 {
1051  Number u = 0.;
1052 
1053  this->fixed_side_value( var, qp, u );
1054 
1055  return u;
1056 }
Number fixed_side_value(unsigned int var, unsigned int qp) const
Definition: fem_context.C:1049
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 1060 of file fem_context.C.

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

1062 {
1063  this->some_value
1064  <OutputType,
1068  (var, qp, u);
1069 }
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:234
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:214
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:299
Real libMesh::DiffContext::get_deltat_value ( )
inherited
Returns
The value currently pointed to by this class's _deltat member

Definition at line 146 of file diff_context.C.

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

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

147 {
149 
150  return *_deltat;
151 }
Real * _deltat
Default NULL, can optionally be used to point to a timestep value in the System-derived class respons...
Definition: diff_context.h:636
libmesh_assert(j)
unsigned char libMesh::FEMContext::get_dim ( ) const
inherited

Accessor for cached mesh dimension.

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

Definition at line 899 of file fem_context.h.

References libMesh::FEMContext::_dim.

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

900  { return this->_dim; }
unsigned char _dim
Cached dimension of largest dimension element in this mesh.
Definition: fem_context.h:1122
const std::vector<dof_id_type>& libMesh::DiffContext::get_dof_indices ( ) const
inherited

Accessor for element dof indices.

Definition at line 366 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(), AssemblyA0::boundary_assembly(), AssemblyF0::boundary_assembly(), AssemblyA1::boundary_assembly(), AssemblyF1::boundary_assembly(), AssemblyF2::boundary_assembly(), A2::boundary_assembly(), AssemblyA2::boundary_assembly(), A3::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(), LaplaceQoI::element_qoi_derivative(), LaplaceSystem::element_qoi_derivative(), HeatSystem::element_qoi_derivative(), NavierSystem::element_time_derivative(), SolidSystem::element_time_derivative(), L2System::element_time_derivative(), PoissonSystem::element_time_derivative(), LaplaceSystem::element_time_derivative(), CurlCurlSystem::element_time_derivative(), ElasticitySystem::element_time_derivative(), CoupledSystem::element_time_derivative(), FirstOrderScalarSystemBase::element_time_derivative(), SecondOrderScalarSystemFirstOrderTimeSolverBase::element_time_derivative(), libMesh::FEMContext::fixed_point_gradient(), libMesh::FEMContext::fixed_point_hessian(), libMesh::FEMContext::fixed_point_value(), LaplaceSystem::init_dirichlet_bcs(), libMesh::VectorSetAction< Val >::insert(), A0::interior_assembly(), B::interior_assembly(), M0::interior_assembly(), A1::interior_assembly(), AssemblyA0::interior_assembly(), EIM_IP_assembly::interior_assembly(), AcousticsInnerProduct::interior_assembly(), AssemblyA1::interior_assembly(), A2::interior_assembly(), AssemblyA2::interior_assembly(), EIM_F::interior_assembly(), F0::interior_assembly(), OutputAssembly::interior_assembly(), InnerProductAssembly::interior_assembly(), AssemblyEIM::interior_assembly(), AssemblyF0::interior_assembly(), AssemblyF1::interior_assembly(), Ex6InnerProduct::interior_assembly(), Ex6EIMInnerProduct::interior_assembly(), libMesh::FEMContext::interior_curl(), libMesh::FEMContext::interior_div(), libMesh::FEMContext::interior_gradients(), libMesh::FEMContext::interior_hessians(), libMesh::FEMContext::interior_values(), NavierSystem::mass_residual(), ElasticitySystem::mass_residual(), 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::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()(), libMesh::FEMContext::point_curl(), libMesh::FEMContext::point_gradient(), libMesh::FEMContext::point_hessian(), libMesh::FEMContext::point_value(), libMesh::FEMContext::pre_fe_reinit(), NavierSystem::side_constraint(), LaplaceSystem::side_constraint(), libMesh::FEMContext::side_gradient(), libMesh::FEMContext::side_gradients(), libMesh::FEMContext::side_hessians(), CoupledSystemQoI::side_qoi_derivative(), LaplaceSystem::side_qoi_derivative(), SolidSystem::side_time_derivative(), CurlCurlSystem::side_time_derivative(), ElasticitySystem::side_time_derivative(), libMesh::FEMContext::side_values(), libMesh::FEMContext::some_gradient(), libMesh::FEMContext::some_hessian(), libMesh::FEMContext::some_value(), and libMesh::RBEIMConstruction::truth_solve().

367  { return _dof_indices; }
std::vector< dof_id_type > _dof_indices
Global Degree of freedom index lists.
Definition: diff_context.h:620
std::vector<dof_id_type>& libMesh::DiffContext::get_dof_indices ( )
inherited

Non-const accessor for element dof indices.

Definition at line 372 of file diff_context.h.

References libMesh::DiffContext::_dof_indices.

373  { return _dof_indices; }
std::vector< dof_id_type > _dof_indices
Global Degree of freedom index lists.
Definition: diff_context.h:620
const std::vector<dof_id_type>& libMesh::DiffContext::get_dof_indices ( unsigned int  var) const
inherited

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

Definition at line 379 of file diff_context.h.

References libMesh::DiffContext::_dof_indices_var.

380  {
381  libmesh_assert_greater(_dof_indices_var.size(), var);
382  return _dof_indices_var[var];
383  }
std::vector< std::vector< dof_id_type > > _dof_indices_var
Definition: diff_context.h:621
std::vector<dof_id_type>& libMesh::DiffContext::get_dof_indices ( unsigned int  var)
inherited

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

Definition at line 389 of file diff_context.h.

References libMesh::DiffContext::_dof_indices_var.

390  {
391  libmesh_assert_greater(_dof_indices_var.size(), var);
392  return _dof_indices_var[var];
393  }
std::vector< std::vector< dof_id_type > > _dof_indices_var
Definition: diff_context.h:621
unsigned char libMesh::FEMContext::get_edge ( ) const
inherited

Accessor for current edge of Elem object.

Definition at line 891 of file fem_context.h.

References libMesh::FEMContext::edge.

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

892  { return edge; }
unsigned char edge
Current edge for edge_* to examine.
Definition: fem_context.h:982
template<typename OutputShape >
void libMesh::FEMContext::get_edge_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe 
) const
inherited

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

Definition at line 1239 of file fem_context.h.

References libMesh::FEMContext::_edge_fe_var.

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

1240 {
1241  libmesh_assert_less ( var, _edge_fe_var.size() );
1242  fe = cast_ptr<FEGenericBase<OutputShape> *>( _edge_fe_var[var] );
1243 }
std::vector< FEAbstract * > _edge_fe_var
Definition: fem_context.h:1106
FEBase * libMesh::FEMContext::get_edge_fe ( unsigned int  var) const
inherited

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

Definition at line 1246 of file fem_context.h.

References libMesh::FEMContext::_edge_fe_var.

1247 {
1248  libmesh_assert_less ( var, _edge_fe_var.size() );
1249  return cast_ptr<FEBase *>( _edge_fe_var[var] );
1250 }
std::vector< FEAbstract * > _edge_fe_var
Definition: fem_context.h:1106
const QBase& libMesh::FEMContext::get_edge_qrule ( ) const
inherited

Accessor for element edge quadrature rule.

Definition at line 794 of file fem_context.h.

References libMesh::FEMContext::_edge_qrule.

795  { return *(this->_edge_qrule); }
UniquePtr< QBase > _edge_qrule
Quadrature rules for element edges.
Definition: fem_context.h:1158
const Elem& libMesh::FEMContext::get_elem ( ) const
inherited

Accessor for current Elem object.

Definition at line 871 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(), AssemblyF0::boundary_assembly(), AssemblyA1::boundary_assembly(), AssemblyF1::boundary_assembly(), AssemblyF2::boundary_assembly(), AssemblyA2::boundary_assembly(), libMesh::FEMContext::build_new_fe(), libMesh::FEMContext::cached_fe(), libMesh::OldSolutionValue< 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(), L2System::element_time_derivative(), libMesh::FEMContext::has_side_boundary_id(), A0::interior_assembly(), A1::interior_assembly(), EIM_F::interior_assembly(), OutputAssembly::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().

872  { libmesh_assert(this->_elem);
873  return *(this->_elem); }
libmesh_assert(j)
const Elem * _elem
Current element for element_* to examine.
Definition: fem_context.h:1117
Elem& libMesh::FEMContext::get_elem ( )
inherited

Accessor for current Elem object.

Definition at line 878 of file fem_context.h.

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

879  { libmesh_assert(this->_elem);
880  return *(const_cast<Elem *>(this->_elem)); }
libmesh_assert(j)
const Elem * _elem
Current element for element_* to examine.
Definition: fem_context.h:1117
unsigned char libMesh::FEMContext::get_elem_dim ( ) const
inherited
const DenseMatrix<Number>& libMesh::DGFEMContext::get_elem_elem_jacobian ( ) const

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

111  { return _elem_elem_jacobian; }
DenseMatrix< Number > _elem_elem_jacobian
The DG Jacobian terms.
DenseMatrix<Number>& libMesh::DGFEMContext::get_elem_elem_jacobian ( )

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.
const DenseSubMatrix<Number>& libMesh::DGFEMContext::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.

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< DenseSubMatrix< Number > * > > _elem_elem_subjacobians
DenseSubMatrix<Number>& libMesh::DGFEMContext::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.

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< DenseSubMatrix< Number > * > > _elem_elem_subjacobians
const DenseVector<Number>& libMesh::DiffContext::get_elem_fixed_solution ( ) const
inherited
DenseVector<Number>& libMesh::DiffContext::get_elem_fixed_solution ( )
inherited

Non-const accessor for element fixed solution.

Definition at line 220 of file diff_context.h.

References libMesh::DiffContext::_elem_fixed_solution.

221  { 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:586
const DenseSubVector<Number>& libMesh::DiffContext::get_elem_fixed_solution ( unsigned int  var) const
inherited

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

Definition at line 227 of file diff_context.h.

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

228  {
229  libmesh_assert_greater(_elem_fixed_subsolutions.size(), var);
231  return *(_elem_fixed_subsolutions[var]);
232  }
libmesh_assert(j)
std::vector< DenseSubVector< Number > * > _elem_fixed_subsolutions
Definition: diff_context.h:587
DenseSubVector<Number>& libMesh::DiffContext::get_elem_fixed_solution ( unsigned int  var)
inherited

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

Definition at line 238 of file diff_context.h.

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

239  {
240  libmesh_assert_greater(_elem_fixed_subsolutions.size(), var);
242  return *(_elem_fixed_subsolutions[var]);
243  }
libmesh_assert(j)
std::vector< DenseSubVector< Number > * > _elem_fixed_subsolutions
Definition: diff_context.h:587
const DenseMatrix<Number>& libMesh::DiffContext::get_elem_jacobian ( ) const
inherited

Const accessor for element Jacobian.

Definition at line 282 of file diff_context.h.

References libMesh::DiffContext::_elem_jacobian.

Referenced by libMesh::EulerSolver::_general_residual(), libMesh::Euler2Solver::_general_residual(), libMesh::NewmarkSolver::_general_residual(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::FEMSystem::assembly(), AssemblyA0::boundary_assembly(), AssemblyA1::boundary_assembly(), A2::boundary_assembly(), AssemblyA2::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(), L2System::element_time_derivative(), PoissonSystem::element_time_derivative(), LaplaceSystem::element_time_derivative(), CurlCurlSystem::element_time_derivative(), ElasticitySystem::element_time_derivative(), CoupledSystem::element_time_derivative(), LaplaceSystem::init_dirichlet_bcs(), B::interior_assembly(), A0::interior_assembly(), M0::interior_assembly(), A1::interior_assembly(), AssemblyA0::interior_assembly(), EIM_IP_assembly::interior_assembly(), AcousticsInnerProduct::interior_assembly(), AssemblyA1::interior_assembly(), A2::interior_assembly(), AssemblyA2::interior_assembly(), InnerProductAssembly::interior_assembly(), AssemblyEIM::interior_assembly(), Ex6InnerProduct::interior_assembly(), Ex6EIMInnerProduct::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(), NavierSystem::side_constraint(), LaplaceSystem::side_constraint(), libMesh::EigenTimeSolver::side_residual(), SolidSystem::side_time_derivative(), and CurlCurlSystem::side_time_derivative().

283  { return _elem_jacobian; }
DenseMatrix< Number > _elem_jacobian
Element jacobian: derivatives of elem_residual with respect to elem_solution.
Definition: diff_context.h:598
DenseMatrix<Number>& libMesh::DiffContext::get_elem_jacobian ( )
inherited

Non-const accessor for element Jacobian.

Definition at line 288 of file diff_context.h.

References libMesh::DiffContext::_elem_jacobian.

289  { return _elem_jacobian; }
DenseMatrix< Number > _elem_jacobian
Element jacobian: derivatives of elem_residual with respect to elem_solution.
Definition: diff_context.h:598
const DenseSubMatrix<Number>& libMesh::DiffContext::get_elem_jacobian ( unsigned int  var1,
unsigned int  var2 
) const
inherited

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

Definition at line 295 of file diff_context.h.

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

296  {
297  libmesh_assert_greater(_elem_subjacobians.size(), var1);
298  libmesh_assert_greater(_elem_subjacobians[var1].size(), var2);
299  libmesh_assert(_elem_subjacobians[var1][var2]);
300  return *(_elem_subjacobians[var1][var2]);
301  }
std::vector< std::vector< DenseSubMatrix< Number > * > > _elem_subjacobians
Definition: diff_context.h:615
libmesh_assert(j)
DenseSubMatrix<Number>& libMesh::DiffContext::get_elem_jacobian ( unsigned int  var1,
unsigned int  var2 
)
inherited

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

Definition at line 307 of file diff_context.h.

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

308  {
309  libmesh_assert_greater(_elem_subjacobians.size(), var1);
310  libmesh_assert_greater(_elem_subjacobians[var1].size(), var2);
311  libmesh_assert(_elem_subjacobians[var1][var2]);
312  return *(_elem_subjacobians[var1][var2]);
313  }
std::vector< std::vector< DenseSubMatrix< Number > * > > _elem_subjacobians
Definition: diff_context.h:615
libmesh_assert(j)
const DenseMatrix<Number>& libMesh::DGFEMContext::get_elem_neighbor_jacobian ( ) const

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

137  { return _elem_neighbor_jacobian; }
DenseMatrix< Number > _elem_neighbor_jacobian
DenseMatrix<Number>& libMesh::DGFEMContext::get_elem_neighbor_jacobian ( )

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
const DenseSubMatrix<Number>& libMesh::DGFEMContext::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.

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< DenseSubMatrix< Number > * > > _elem_neighbor_subjacobians
DenseSubMatrix<Number>& libMesh::DGFEMContext::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.

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< DenseSubMatrix< Number > * > > _elem_neighbor_subjacobians
const DenseVector<Number>& libMesh::DiffContext::get_elem_residual ( ) const
inherited

Const accessor for element residual.

Definition at line 248 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(), 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(), L2System::element_time_derivative(), LaplaceSystem::element_time_derivative(), PoissonSystem::element_time_derivative(), CurlCurlSystem::element_time_derivative(), ElasticitySystem::element_time_derivative(), CoupledSystem::element_time_derivative(), FirstOrderScalarSystemBase::element_time_derivative(), SecondOrderScalarSystemFirstOrderTimeSolverBase::element_time_derivative(), LaplaceSystem::init_dirichlet_bcs(), EIM_F::interior_assembly(), F0::interior_assembly(), OutputAssembly::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(), ElasticitySystem::side_time_derivative(), and libMesh::RBEIMConstruction::truth_solve().

249  { return _elem_residual; }
DenseVector< Number > _elem_residual
Element residual vector.
Definition: diff_context.h:592
DenseVector<Number>& libMesh::DiffContext::get_elem_residual ( )
inherited

Non-const accessor for element residual.

Definition at line 254 of file diff_context.h.

References libMesh::DiffContext::_elem_residual.

255  { return _elem_residual; }
DenseVector< Number > _elem_residual
Element residual vector.
Definition: diff_context.h:592
const DenseSubVector<Number>& libMesh::DiffContext::get_elem_residual ( unsigned int  var) const
inherited

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

Definition at line 261 of file diff_context.h.

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

262  {
263  libmesh_assert_greater(_elem_subresiduals.size(), var);
265  return *(_elem_subresiduals[var]);
266  }
std::vector< DenseSubVector< Number > * > _elem_subresiduals
Element residual subvectors and Jacobian submatrices.
Definition: diff_context.h:614
libmesh_assert(j)
DenseSubVector<Number>& libMesh::DiffContext::get_elem_residual ( unsigned int  var)
inherited

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

Definition at line 272 of file diff_context.h.

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

273  {
274  libmesh_assert_greater(_elem_subresiduals.size(), var);
276  return *(_elem_subresiduals[var]);
277  }
std::vector< DenseSubVector< Number > * > _elem_subresiduals
Element residual subvectors and Jacobian submatrices.
Definition: diff_context.h:614
libmesh_assert(j)
const DenseVector<Number>& libMesh::DiffContext::get_elem_solution ( ) const
inherited
DenseVector<Number>& libMesh::DiffContext::get_elem_solution ( )
inherited

Non-const accessor for element solution.

Definition at line 116 of file diff_context.h.

References libMesh::DiffContext::_elem_solution.

117  { return _elem_solution; }
DenseVector< Number > _elem_solution
Element by element components of nonlinear_solution as adjusted by a time_solver. ...
Definition: diff_context.h:564
const DenseSubVector<Number>& libMesh::DiffContext::get_elem_solution ( unsigned int  var) const
inherited

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

Definition at line 123 of file diff_context.h.

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

124  {
125  libmesh_assert_greater(_elem_subsolutions.size(), var);
127  return *(_elem_subsolutions[var]);
128  }
libmesh_assert(j)
std::vector< DenseSubVector< Number > * > _elem_subsolutions
Definition: diff_context.h:565
DenseSubVector<Number>& libMesh::DiffContext::get_elem_solution ( unsigned int  var)
inherited

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

Definition at line 134 of file diff_context.h.

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

135  {
136  libmesh_assert_greater(_elem_subsolutions.size(), var);
138  return *(_elem_subsolutions[var]);
139  }
libmesh_assert(j)
std::vector< DenseSubVector< Number > * > _elem_subsolutions
Definition: diff_context.h:565
const DenseVector<Number>& libMesh::DiffContext::get_elem_solution_accel ( ) const
inherited

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

time.

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

180  { 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:578
DenseVector<Number>& libMesh::DiffContext::get_elem_solution_accel ( )
inherited

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

time.

Definition at line 186 of file diff_context.h.

References libMesh::DiffContext::_elem_solution_accel.

187  { 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:578
const DenseSubVector<Number>& libMesh::DiffContext::get_elem_solution_accel ( unsigned int  var) const
inherited

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

Definition at line 193 of file diff_context.h.

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

194  {
195  libmesh_assert_greater(_elem_subsolution_accels.size(), var);
197  return *(_elem_subsolution_accels[var]);
198  }
std::vector< DenseSubVector< Number > * > _elem_subsolution_accels
Definition: diff_context.h:579
libmesh_assert(j)
DenseSubVector<Number>& libMesh::DiffContext::get_elem_solution_accel ( unsigned int  var)
inherited

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

Definition at line 204 of file diff_context.h.

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

205  {
206  libmesh_assert_greater(_elem_subsolution_accels.size(), var);
208  return *(_elem_subsolution_accels[var]);
209  }
std::vector< DenseSubVector< Number > * > _elem_subsolution_accels
Definition: diff_context.h:579
libmesh_assert(j)
Real libMesh::DiffContext::get_elem_solution_accel_derivative ( ) const
inherited

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

References libMesh::DiffContext::elem_solution_accel_derivative.

Referenced by ElasticitySystem::mass_residual(), and SecondOrderScalarSystemSecondOrderTimeSolverBase::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:497
Real libMesh::DiffContext::get_elem_solution_derivative ( ) const
inherited

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

References libMesh::DiffContext::elem_solution_derivative.

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

420  { return elem_solution_derivative; }
Real elem_solution_derivative
The derivative of elem_solution with respect to the current nonlinear solution.
Definition: diff_context.h:483
const DenseVector<Number>& libMesh::DiffContext::get_elem_solution_rate ( ) const
inherited
DenseVector<Number>& libMesh::DiffContext::get_elem_solution_rate ( )
inherited

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:571
const DenseSubVector<Number>& libMesh::DiffContext::get_elem_solution_rate ( unsigned int  var) const
inherited

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, and libMesh::libmesh_assert().

159  {
160  libmesh_assert_greater(_elem_subsolution_rates.size(), var);
162  return *(_elem_subsolution_rates[var]);
163  }
std::vector< DenseSubVector< Number > * > _elem_subsolution_rates
Definition: diff_context.h:572
libmesh_assert(j)
DenseSubVector<Number>& libMesh::DiffContext::get_elem_solution_rate ( unsigned int  var)
inherited

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

Definition at line 169 of file diff_context.h.

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

170  {
171  libmesh_assert_greater(_elem_subsolution_rates.size(), var);
173  return *(_elem_subsolution_rates[var]);
174  }
std::vector< DenseSubVector< Number > * > _elem_subsolution_rates
Definition: diff_context.h:572
libmesh_assert(j)
Real libMesh::DiffContext::get_elem_solution_rate_derivative ( ) const
inherited

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

References libMesh::DiffContext::elem_solution_rate_derivative.

Referenced by libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns(), SecondOrderScalarSystemSecondOrderTimeSolverBase::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:490
template<typename OutputShape >
void libMesh::FEMContext::get_element_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe 
) const
inherited

Accessor for interior finite element object for variable var for the largest dimension in the mesh.

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

Definition at line 262 of file fem_context.h.

References libMesh::FEMContext::get_dim().

Referenced by libMesh::FEMContext::_do_elem_position_set(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), 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(), LaplaceQoI::element_qoi_derivative(), LaplaceSystem::element_qoi_derivative(), HeatSystem::element_qoi_derivative(), NavierSystem::element_time_derivative(), SolidSystem::element_time_derivative(), L2System::element_time_derivative(), LaplaceSystem::element_time_derivative(), PoissonSystem::element_time_derivative(), CurlCurlSystem::element_time_derivative(), ElasticitySystem::element_time_derivative(), CoupledSystem::element_time_derivative(), libMesh::RBEIMConstruction::enrich_RB_space(), libMesh::FEMContext::fixed_interior_gradient(), libMesh::FEMContext::fixed_interior_hessian(), libMesh::FEMContext::fixed_interior_value(), libMesh::FEMContext::get_element_fe(), LaplaceQoI::init_context(), NavierSystem::init_context(), SolidSystem::init_context(), L2System::init_context(), LaplaceSystem::init_context(), PoissonSystem::init_context(), CurlCurlSystem::init_context(), ElasticitySystem::init_context(), CoupledSystem::init_context(), libMesh::ParsedFEMFunction< Output >::init_context(), ElasticityRBConstruction::init_context(), libMesh::FEMSystem::init_context(), SimpleRBConstruction::init_context(), libMesh::RBEIMConstruction::init_context_with_sys(), LaplaceSystem::init_dirichlet_bcs(), libMesh::FEMContext::interior_accel(), B::interior_assembly(), A0::interior_assembly(), M0::interior_assembly(), A1::interior_assembly(), AssemblyA0::interior_assembly(), EIM_IP_assembly::interior_assembly(), AcousticsInnerProduct::interior_assembly(), AssemblyA1::interior_assembly(), A2::interior_assembly(), AssemblyA2::interior_assembly(), EIM_F::interior_assembly(), F0::interior_assembly(), OutputAssembly::interior_assembly(), InnerProductAssembly::interior_assembly(), AssemblyEIM::interior_assembly(), AssemblyF0::interior_assembly(), AssemblyF1::interior_assembly(), Ex6InnerProduct::interior_assembly(), Ex6EIMInnerProduct::interior_assembly(), libMesh::FEMContext::interior_gradient(), libMesh::FEMContext::interior_hessian(), libMesh::FEMContext::interior_rate(), NavierSystem::mass_residual(), ElasticitySystem::mass_residual(), libMesh::FEMPhysics::mass_residual(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()(), NavierSystem::side_constraint(), and libMesh::RBEIMConstruction::truth_solve().

263  { this->get_element_fe<OutputShape>(var,fe,this->get_dim()); }
unsigned char get_dim() const
Accessor for cached mesh dimension.
Definition: fem_context.h:899
FEBase* libMesh::FEMContext::get_element_fe ( unsigned int  var) const
inherited

Accessor for interior finite element object for scalar-valued variable var for the largest dimension in the mesh.

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

Definition at line 273 of file fem_context.h.

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

274  { return this->get_element_fe(var,this->get_dim()); }
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:262
unsigned char get_dim() const
Accessor for cached mesh dimension.
Definition: fem_context.h:899
template<typename OutputShape >
void libMesh::FEMContext::get_element_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe,
unsigned char  dim 
) const
inherited

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

Definition at line 1203 of file fem_context.h.

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

1205 {
1206  libmesh_assert( !_element_fe_var[dim].empty() );
1207  libmesh_assert_less ( var, (_element_fe_var[dim].size() ) );
1208  fe = cast_ptr<FEGenericBase<OutputShape> *>( (_element_fe_var[dim][var] ) );
1209 }
unsigned int dim
libmesh_assert(j)
std::vector< std::vector< FEAbstract * > > _element_fe_var
Pointers to the same finite element objects, but indexed by variable number.
Definition: fem_context.h:1104
FEBase * libMesh::FEMContext::get_element_fe ( unsigned int  var,
unsigned char  dim 
) const
inherited

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

Definition at line 1212 of file fem_context.h.

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

1213 {
1214  libmesh_assert( !_element_fe_var[dim].empty() );
1215  libmesh_assert_less ( var, (_element_fe_var[dim].size() ) );
1216  return cast_ptr<FEBase *>( (_element_fe_var[dim][var] ) );
1217 }
unsigned int dim
libmesh_assert(j)
std::vector< std::vector< FEAbstract * > > _element_fe_var
Pointers to the same finite element objects, but indexed by variable number.
Definition: fem_context.h:1104
const QBase& libMesh::FEMContext::get_element_qrule ( ) const
inherited

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

Definition at line 765 of file fem_context.h.

References libMesh::FEMContext::get_elem_dim().

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

766  { return this->get_element_qrule(this->get_elem_dim()); }
const QBase & get_element_qrule() const
Accessor for element interior quadrature rule for the dimension of the current _elem.
Definition: fem_context.h:765
unsigned char get_elem_dim() const
Definition: fem_context.h:906
const QBase& libMesh::FEMContext::get_element_qrule ( unsigned char  dim) const
inherited

Accessor for element interior quadrature rule.

Definition at line 778 of file fem_context.h.

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

780  return *(this->_element_qrule[dim]); }
unsigned int dim
libmesh_assert(j)
std::vector< QBase * > _element_qrule
Quadrature rule for element interior.
Definition: fem_context.h:1141
Real libMesh::DiffContext::get_fixed_solution_derivative ( ) const
inherited

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

References libMesh::DiffContext::fixed_solution_derivative.

447  { 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:504
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 184 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().

185 {
186  return *_localized_vectors[&localized_vector].second[var];
187 }
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:558
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 190 of file diff_context.C.

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

191 {
192  std::map<const NumericVector<Number> *, std::pair<DenseVector<Number>, std::vector<DenseSubVector<Number> *>>>::const_iterator
193  localized_vectors_it = _localized_vectors.find(&localized_vector);
194  libmesh_assert(localized_vectors_it != _localized_vectors.end());
195  return *localized_vectors_it->second.second[var];
196 }
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:558
libmesh_assert(j)
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 169 of file diff_context.C.

References libMesh::DiffContext::_localized_vectors.

170 {
171  return _localized_vectors[&localized_vector].first;
172 }
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:558
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 175 of file diff_context.C.

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

176 {
177  std::map<const NumericVector<Number> *, std::pair<DenseVector<Number>, std::vector<DenseSubVector<Number> *>>>::const_iterator
178  localized_vectors_it = _localized_vectors.find(&localized_vector);
179  libmesh_assert(localized_vectors_it != _localized_vectors.end());
180  return localized_vectors_it->second.first;
181 }
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:558
libmesh_assert(j)
const System* libMesh::FEMContext::get_mesh_system ( ) const
inherited

Accessor for moving mesh System.

Definition at line 811 of file fem_context.h.

References libMesh::FEMContext::_mesh_sys.

812  { return this->_mesh_sys; }
System * _mesh_sys
System from which to acquire moving mesh information.
Definition: fem_context.h:967
System* libMesh::FEMContext::get_mesh_system ( )
inherited

Accessor for moving mesh System.

Definition at line 817 of file fem_context.h.

References libMesh::FEMContext::_mesh_sys.

818  { return this->_mesh_sys; }
System * _mesh_sys
System from which to acquire moving mesh information.
Definition: fem_context.h:967
unsigned int libMesh::FEMContext::get_mesh_x_var ( ) const
inherited

Accessor for x-variable of moving mesh System.

Definition at line 823 of file fem_context.h.

References libMesh::FEMContext::_mesh_x_var.

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

824  { return _mesh_x_var; }
unsigned int _mesh_x_var
Variables from which to acquire moving mesh information.
Definition: fem_context.h:972
unsigned int libMesh::FEMContext::get_mesh_y_var ( ) const
inherited

Accessor for y-variable of moving mesh System.

Definition at line 837 of file fem_context.h.

References libMesh::FEMContext::_mesh_y_var.

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

838  { return _mesh_y_var; }
unsigned int _mesh_y_var
Definition: fem_context.h:972
unsigned int libMesh::FEMContext::get_mesh_z_var ( ) const
inherited

Accessor for z-variable of moving mesh System.

Definition at line 851 of file fem_context.h.

References libMesh::FEMContext::_mesh_z_var.

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

852  { return _mesh_z_var; }
unsigned int _mesh_z_var
Definition: fem_context.h:972
const Elem& libMesh::DGFEMContext::get_neighbor ( ) const

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.
const std::vector<dof_id_type>& libMesh::DGFEMContext::get_neighbor_dof_indices ( ) const

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

72  { return _neighbor_dof_indices; }
std::vector< dof_id_type > _neighbor_dof_indices
Global Degree of freedom index lists for the neighbor element.
const std::vector<dof_id_type>& libMesh::DGFEMContext::get_neighbor_dof_indices ( unsigned int  var) const

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
const DenseMatrix<Number>& libMesh::DGFEMContext::get_neighbor_elem_jacobian ( ) const

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

163  { return _neighbor_elem_jacobian; }
DenseMatrix< Number > _neighbor_elem_jacobian
DenseMatrix<Number>& libMesh::DGFEMContext::get_neighbor_elem_jacobian ( )

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
const DenseSubMatrix<Number>& libMesh::DGFEMContext::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.

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< DenseSubMatrix< Number > * > > _neighbor_elem_subjacobians
DenseSubMatrix<Number>& libMesh::DGFEMContext::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.

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< DenseSubMatrix< Number > * > > _neighbor_elem_subjacobians
const DenseMatrix<Number>& libMesh::DGFEMContext::get_neighbor_neighbor_jacobian ( ) const

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

189  { return _neighbor_neighbor_jacobian; }
DenseMatrix< Number > _neighbor_neighbor_jacobian
DenseMatrix<Number>& libMesh::DGFEMContext::get_neighbor_neighbor_jacobian ( )

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
const DenseSubMatrix<Number>& libMesh::DGFEMContext::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.

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< DenseSubMatrix< Number > * > > _neighbor_neighbor_subjacobians
DenseSubMatrix<Number>& libMesh::DGFEMContext::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.

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< DenseSubMatrix< Number > * > > _neighbor_neighbor_subjacobians
const DenseVector<Number>& libMesh::DGFEMContext::get_neighbor_residual ( ) const

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.
DenseVector<Number>& libMesh::DGFEMContext::get_neighbor_residual ( )

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.
const DenseSubVector<Number>& libMesh::DGFEMContext::get_neighbor_residual ( unsigned int  var) const

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< DenseSubVector< Number > * > _neighbor_subresiduals
Element residual subvectors and Jacobian submatrices.
DenseSubVector<Number>& libMesh::DGFEMContext::get_neighbor_residual ( unsigned int  var)

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< DenseSubVector< Number > * > _neighbor_subresiduals
Element residual subvectors and Jacobian submatrices.
template<typename OutputShape >
void libMesh::DGFEMContext::get_neighbor_side_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe 
) const

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 dg_terms_are_active().

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...
const std::vector<DenseVector<Number> >& libMesh::DiffContext::get_qoi_derivatives ( ) const
inherited

Const accessor for QoI derivatives.

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

331  { return _elem_qoi_derivative; }
std::vector< DenseVector< Number > > _elem_qoi_derivative
Element quantity of interest derivative contributions.
Definition: diff_context.h:608
std::vector<DenseVector<Number> >& libMesh::DiffContext::get_qoi_derivatives ( )
inherited

Non-const accessor for QoI derivatives.

Definition at line 336 of file diff_context.h.

References libMesh::DiffContext::_elem_qoi_derivative.

337  { return _elem_qoi_derivative; }
std::vector< DenseVector< Number > > _elem_qoi_derivative
Element quantity of interest derivative contributions.
Definition: diff_context.h:608
const DenseSubVector<Number>& libMesh::DiffContext::get_qoi_derivatives ( unsigned int  qoi,
unsigned int  var 
) const
inherited

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

Definition at line 343 of file diff_context.h.

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

344  {
345  libmesh_assert_greater(_elem_qoi_subderivatives.size(), qoi);
346  libmesh_assert_greater(_elem_qoi_subderivatives[qoi].size(), var);
348  return *(_elem_qoi_subderivatives[qoi][var]);
349  }
std::vector< std::vector< DenseSubVector< Number > * > > _elem_qoi_subderivatives
Definition: diff_context.h:609
libmesh_assert(j)
DenseSubVector<Number>& libMesh::DiffContext::get_qoi_derivatives ( unsigned int  qoi,
unsigned int  var 
)
inherited

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

Definition at line 355 of file diff_context.h.

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

356  {
357  libmesh_assert_greater(_elem_qoi_subderivatives.size(), qoi);
358  libmesh_assert_greater(_elem_qoi_subderivatives[qoi].size(), var);
360  return *(_elem_qoi_subderivatives[qoi][var]);
361  }
std::vector< std::vector< DenseSubVector< Number > * > > _elem_qoi_subderivatives
Definition: diff_context.h:609
libmesh_assert(j)
const std::vector<Number>& libMesh::DiffContext::get_qois ( ) const
inherited

Const accessor for QoI vector.

Definition at line 318 of file diff_context.h.

References libMesh::DiffContext::_elem_qoi.

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

319  { return _elem_qoi; }
std::vector< Number > _elem_qoi
Element quantity of interest contributions.
Definition: diff_context.h:603
std::vector<Number>& libMesh::DiffContext::get_qois ( )
inherited

Non-const accessor for QoI vector.

Definition at line 324 of file diff_context.h.

References libMesh::DiffContext::_elem_qoi.

325  { return _elem_qoi; }
std::vector< Number > _elem_qoi
Element quantity of interest contributions.
Definition: diff_context.h:603
unsigned char libMesh::FEMContext::get_side ( ) const
inherited

Accessor for current side of Elem object.

Definition at line 885 of file fem_context.h.

References libMesh::FEMContext::side.

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

886  { return side; }
unsigned char side
Current side for side_* to examine.
Definition: fem_context.h:977
template<typename OutputShape >
void libMesh::FEMContext::get_side_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe 
) const
inherited

Accessor for edge/face (2D/3D) finite element object for variable var for the largest dimension in the mesh.

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

Definition at line 299 of file fem_context.h.

References libMesh::FEMContext::get_dim().

Referenced by AssemblyA0::boundary_assembly(), AssemblyF0::boundary_assembly(), AssemblyA1::boundary_assembly(), AssemblyF1::boundary_assembly(), AssemblyF2::boundary_assembly(), A2::boundary_assembly(), AssemblyA2::boundary_assembly(), A3::boundary_assembly(), F0::boundary_assembly(), Output0::boundary_assembly(), libMesh::ParsedFEMFunction< Output >::eval_args(), libMesh::FEMContext::fixed_side_gradient(), libMesh::FEMContext::fixed_side_hessian(), libMesh::FEMContext::fixed_side_value(), libMesh::FEMContext::get_side_fe(), NavierSystem::init_context(), SolidSystem::init_context(), LaplaceSystem::init_context(), PoissonSystem::init_context(), CurlCurlSystem::init_context(), ElasticitySystem::init_context(), CoupledSystem::init_context(), libMesh::ParsedFEMFunction< Output >::init_context(), SimpleRBConstruction::init_context(), LaplaceSystem::init_dirichlet_bcs(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()(), 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().

300  { this->get_side_fe<OutputShape>(var,fe,this->get_dim()); }
unsigned char get_dim() const
Accessor for cached mesh dimension.
Definition: fem_context.h:899
FEBase* libMesh::FEMContext::get_side_fe ( unsigned int  var) const
inherited

Accessor for side finite element object for scalar-valued variable var for the largest dimension in the mesh.

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

Definition at line 310 of file fem_context.h.

References libMesh::FEMContext::edge_fe_reinit(), libMesh::FEMContext::elem_edge_reinit(), libMesh::FEMContext::elem_fe_reinit(), libMesh::FEMContext::elem_reinit(), libMesh::FEMContext::elem_side_reinit(), libMesh::FEMContext::fixed_interior_gradient(), libMesh::FEMContext::fixed_interior_hessian(), libMesh::FEMContext::fixed_interior_value(), libMesh::FEMContext::fixed_point_gradient(), libMesh::FEMContext::fixed_point_hessian(), libMesh::FEMContext::fixed_point_value(), libMesh::FEMContext::fixed_side_gradient(), libMesh::FEMContext::fixed_side_hessian(), libMesh::FEMContext::fixed_side_value(), libMesh::FEMContext::get_dim(), libMesh::FEMContext::get_edge_fe(), libMesh::FEMContext::get_side_fe(), libMesh::FEMContext::interior_accel(), libMesh::FEMContext::interior_curl(), libMesh::FEMContext::interior_div(), libMesh::FEMContext::interior_gradient(), libMesh::FEMContext::interior_gradients(), libMesh::FEMContext::interior_hessian(), libMesh::FEMContext::interior_hessians(), libMesh::FEMContext::interior_rate(), libMesh::FEMContext::interior_value(), libMesh::FEMContext::interior_values(), libmesh_nullptr, libMesh::FEMContext::nonlocal_reinit(), libMesh::FEMContext::point_accel(), libMesh::FEMContext::point_curl(), libMesh::FEMContext::point_gradient(), libMesh::FEMContext::point_hessian(), libMesh::FEMContext::point_rate(), libMesh::FEMContext::point_value(), libMesh::FEMContext::pre_fe_reinit(), libMesh::Real, libMesh::FEMContext::side_accel(), libMesh::FEMContext::side_fe_reinit(), libMesh::FEMContext::side_gradient(), libMesh::FEMContext::side_gradients(), libMesh::FEMContext::side_hessian(), libMesh::FEMContext::side_hessians(), libMesh::FEMContext::side_rate(), libMesh::FEMContext::side_value(), libMesh::FEMContext::side_values(), and libMesh::TOLERANCE.

311  { return this->get_side_fe(var,this->get_dim()); }
unsigned char get_dim() const
Accessor for cached mesh dimension.
Definition: fem_context.h:899
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:299
template<typename OutputShape >
void libMesh::FEMContext::get_side_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe,
unsigned char  dim 
) const
inherited

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

Definition at line 1221 of file fem_context.h.

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

1223 {
1224  libmesh_assert( !_side_fe_var[dim].empty() );
1225  libmesh_assert_less ( var, (_side_fe_var[dim].size() ) );
1226  fe = cast_ptr<FEGenericBase<OutputShape> *>( (_side_fe_var[dim][var] ) );
1227 }
unsigned int dim
libmesh_assert(j)
std::vector< std::vector< FEAbstract * > > _side_fe_var
Definition: fem_context.h:1105
FEBase * libMesh::FEMContext::get_side_fe ( unsigned int  var,
unsigned char  dim 
) const
inherited

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

Definition at line 1230 of file fem_context.h.

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

1231 {
1232  libmesh_assert( !_side_fe_var[dim].empty() );
1233  libmesh_assert_less ( var, (_side_fe_var[dim].size() ) );
1234  return cast_ptr<FEBase *>( (_side_fe_var[dim][var] ) );
1235 }
unsigned int dim
libmesh_assert(j)
std::vector< std::vector< FEAbstract * > > _side_fe_var
Definition: fem_context.h:1105
const QBase& libMesh::FEMContext::get_side_qrule ( ) const
inherited
const QBase& libMesh::FEMContext::get_side_qrule ( unsigned char  dim) const
inherited

Accessor for element side quadrature rule.

Definition at line 785 of file fem_context.h.

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

786  {
788  return *(this->_side_qrule[dim]);
789  }
unsigned int dim
std::vector< QBase * > _side_qrule
Quadrature rules for element sides The FEM context will try to find a quadrature rule that correctly ...
Definition: fem_context.h:1149
libmesh_assert(j)
const System& libMesh::DiffContext::get_system ( ) const
inherited

Accessor for associated system.

Definition at line 104 of file diff_context.h.

References libMesh::DiffContext::_system.

Referenced by libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns(), HeatSystem::element_qoi_derivative(), neighbor_side_fe_reinit(), and libMesh::DifferentiablePhysics::nonlocal_mass_residual().

105  { return _system; }
const System & _system
A reference to the system this context is constructed with.
Definition: diff_context.h:641
Real libMesh::DiffContext::get_system_time ( ) const
inherited

Accessor for the time variable stored in the system class.

Definition at line 398 of file diff_context.h.

References libMesh::DiffContext::system_time.

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

399  { 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:477
Real libMesh::DiffContext::get_time ( ) const
inherited

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

Definition at line 404 of file diff_context.h.

References libMesh::DiffContext::time.

405  { 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:468
bool libMesh::FEMContext::has_elem ( ) const
inherited

Test for current Elem object.

Definition at line 865 of file fem_context.h.

References libMesh::FEMContext::_elem, and libmesh_nullptr.

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

866  { return (this->_elem != libmesh_nullptr); }
const class libmesh_nullptr_t libmesh_nullptr
const Elem * _elem
Current element for element_* to examine.
Definition: fem_context.h:1117
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 209 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().

210 {
211  return _boundary_info.has_boundary_id(&(this->get_elem()), side, id);
212 }
const Elem & get_elem() const
Accessor for current Elem object.
Definition: fem_context.h:871
const BoundaryInfo & _boundary_info
Saved reference to BoundaryInfo on the mesh for this System.
Definition: fem_context.h:1112
unsigned char side
Current side for side_* to examine.
Definition: fem_context.h:977
bool has_boundary_id(const Node *const node, const boundary_id_type id) const
template<typename OutputType >
template void libMesh::FEMContext::interior_accel< Gradient > ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
inherited
Returns
The second time derivative (acceleration) of the solution variable var at the quadrature point qp on the current element interior.

Definition at line 1295 of file fem_context.C.

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

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

1297 {
1298  this->some_value<OutputType,
1302 }
const DenseVector< Number > & get_elem_solution_accel() const
Accessor for element solution accel of change w.r.t.
Definition: diff_context.h:179
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:234
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:262
template<typename OutputType >
template void libMesh::FEMContext::interior_curl< Gradient > ( unsigned int  var,
unsigned int  qp,
OutputType &  curl_u 
) const
inherited
Returns
The curl of the solution variable var at the physical point p on the current element.

Definition at line 512 of file fem_context.C.

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

Referenced by CurlCurlSystem::element_time_derivative(), and libMesh::FEMContext::get_side_fe().

514 {
515  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
516 
517  // Get local-to-global dof index lookup
518  const unsigned int n_dofs = cast_int<unsigned int>
519  (this->get_dof_indices(var).size());
520 
521  // Get current local coefficients
522  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
523  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
524 
525  // Get finite element object
526  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
527  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
528 
529  // Get shape function values at quadrature point
530  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputShape>> & curl_phi = fe->get_curl_phi();
531 
532  // Accumulate solution curl
533  curl_u = 0.;
534 
535  for (unsigned int l=0; l != n_dofs; l++)
536  curl_u.add_scaled(curl_phi[l][qp], coef(l));
537 
538  return;
539 }
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:110
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:366
const class libmesh_nullptr_t libmesh_nullptr
std::vector< DenseSubVector< Number > * > _elem_subsolutions
Definition: diff_context.h:565
unsigned char get_elem_dim() const
Definition: fem_context.h:906
template<typename OutputType >
template void libMesh::FEMContext::interior_div< Number > ( unsigned int  var,
unsigned int  qp,
OutputType &  div_u 
) const
inherited
Returns
The divergence of the solution variable var at the physical point p on the current element.

Definition at line 543 of file fem_context.C.

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

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

545 {
546  typedef typename
547  TensorTools::IncrementRank
548  <typename TensorTools::MakeReal<OutputType>::type>::type OutputShape;
549 
550  // Get local-to-global dof index lookup
551  const unsigned int n_dofs = cast_int<unsigned int>
552  (this->get_dof_indices(var).size());
553 
554  // Get current local coefficients
555  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
556  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
557 
558  // Get finite element object
559  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
560  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
561 
562  // Get shape function values at quadrature point
563  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputDivergence>> & div_phi = fe->get_div_phi();
564 
565  // Accumulate solution curl
566  div_u = 0.;
567 
568  for (unsigned int l=0; l != n_dofs; l++)
569  div_u += div_phi[l][qp] * coef(l);
570 
571  return;
572 }
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:110
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:366
const class libmesh_nullptr_t libmesh_nullptr
std::vector< DenseSubVector< Number > * > _elem_subsolutions
Definition: diff_context.h:565
unsigned char get_elem_dim() const
Definition: fem_context.h:906
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 381 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(), libMesh::FEMPhysics::eulerian_residual(), libMesh::FEMContext::get_side_fe(), and LaplaceSystem::init_dirichlet_bcs().

383 {
384  Gradient du;
385 
386  this->interior_gradient( var, qp, du );
387 
388  return du;
389 }
NumberVectorValue Gradient
Gradient interior_gradient(unsigned int var, unsigned int qp) const
Definition: fem_context.C:381
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 394 of file fem_context.C.

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

397 {
398  this->some_gradient<OutputType,
399  &FEMContext::get_element_fe<typename TensorTools::MakeReal
400  <typename TensorTools::DecrementRank
401  <OutputType>::type>::type>,
402  &DiffContext::get_elem_solution>(var, qp, du);
403 }
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:110
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:262
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:263
template<typename OutputType >
template void libMesh::FEMContext::interior_gradients< Tensor > ( unsigned int  var,
const NumericVector< Number > &  _system_vector,
std::vector< OutputType > &  interior_gradients_vector 
) const
inherited

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

Note
This is the preferred API.

Definition at line 408 of file fem_context.C.

References libMesh::DiffContext::get_dof_indices(), libMesh::FEMContext::get_elem_dim(), libMesh::DiffContext::get_localized_subvector(), and libmesh_nullptr.

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

411 {
412  typedef typename TensorTools::MakeReal
414  OutputShape;
415 
416  // Get local-to-global dof index lookup
417  const unsigned int n_dofs = cast_int<unsigned int>
418  (this->get_dof_indices(var).size());
419 
420  // Get current local coefficients
421  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
422 
423  // Get finite element object
424  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
425  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
426 
427  // Get shape function values at quadrature point
428  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient>> & dphi = fe->get_dphi();
429 
430  // Loop over all the q_points in this finite element
431  for (std::size_t qp=0; qp != du_vals.size(); qp++)
432  {
433  OutputType & du = du_vals[qp];
434 
435  // Compute the gradient at this q_point
436  du = 0;
437 
438  for (unsigned int l=0; l != n_dofs; l++)
439  du.add_scaled(dphi[l][qp], coef(l));
440  }
441 
442  return;
443 }
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:366
const class libmesh_nullptr_t libmesh_nullptr
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:184
unsigned char get_elem_dim() const
Definition: fem_context.h:906
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 446 of file fem_context.C.

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

447 {
448  Tensor d2u;
449 
450  this->interior_hessian( var, qp, d2u );
451 
452  return d2u;
453 }
Tensor interior_hessian(unsigned int var, unsigned int qp) const
Definition: fem_context.C:446
NumberTensorValue Tensor
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 456 of file fem_context.C.

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

458 {
459  this->some_hessian<OutputType,
461  <typename TensorTools::MakeReal
462  <typename TensorTools::DecrementRank
463  <typename TensorTools::DecrementRank
464  <OutputType>::type>::type>::type>,
465  &DiffContext::get_elem_solution>(var, qp, d2u);
466 }
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:110
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:262
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:296
template<typename OutputType >
template void libMesh::FEMContext::interior_hessians< Tensor > ( unsigned int  var,
const NumericVector< Number > &  _system_vector,
std::vector< OutputType > &  d2u_vals 
) const
inherited

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

This is the preferred API.

Definition at line 470 of file fem_context.C.

References libMesh::DiffContext::get_dof_indices(), libMesh::FEMContext::get_elem_dim(), libMesh::DiffContext::get_localized_subvector(), and libmesh_nullptr.

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

473 {
474  typedef typename TensorTools::DecrementRank<OutputType>::type Rank1Decrement;
475  typedef typename TensorTools::DecrementRank<Rank1Decrement>::type Rank2Decrement;
476  typedef typename TensorTools::MakeReal<Rank2Decrement>::type OutputShape;
477 
478  // Get local-to-global dof index lookup
479  const unsigned int n_dofs = cast_int<unsigned int>
480  (this->get_dof_indices(var).size());
481 
482  // Get current local coefficients
483  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
484 
485  // Get finite element object
486  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
487  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
488 
489  // Get shape function values at quadrature point
490  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor>> & d2phi = fe->get_d2phi();
491 
492  // Loop over all the q_points in this finite element
493  for (std::size_t qp=0; qp != d2u_vals.size(); qp++)
494  {
495  OutputType & d2u = d2u_vals[qp];
496 
497  // Compute the gradient at this q_point
498  d2u = 0;
499 
500  for (unsigned int l=0; l != n_dofs; l++)
501  d2u.add_scaled(d2phi[l][qp], coef(l));
502  }
503 
504  return;
505 }
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:366
const class libmesh_nullptr_t libmesh_nullptr
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:184
unsigned char get_elem_dim() const
Definition: fem_context.h:906
template<typename OutputType >
template void libMesh::FEMContext::interior_rate< Gradient > ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
inherited
Returns
The time derivative (rate) of the solution variable var at the quadrature point qp on the current element interior.

Definition at line 1273 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(), libMesh::FEMContext::get_side_fe(), NavierSystem::mass_residual(), libMesh::FEMPhysics::mass_residual(), and FirstOrderScalarSystemBase::mass_residual().

1275 {
1276  this->some_value<OutputType,
1280 }
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:234
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:262
const DenseVector< Number > & get_elem_solution_rate() const
Accessor for element solution rate of change w.r.t.
Definition: diff_context.h:144
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 326 of file fem_context.C.

Referenced by libMesh::FirstOrderUnsteadySolver::compute_second_order_eqns(), LaplaceSystem::element_postprocess(), LaplaceQoI::element_qoi(), NavierSystem::element_time_derivative(), L2System::element_time_derivative(), CurlCurlSystem::element_time_derivative(), CoupledSystem::element_time_derivative(), libMesh::RBEIMConstruction::enrich_RB_space(), and libMesh::FEMContext::get_side_fe().

327 {
328  Number u;
329 
330  this->interior_value( var, qp, u );
331 
332  return u;
333 }
Number interior_value(unsigned int var, unsigned int qp) const
Definition: fem_context.C:326
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 336 of file fem_context.C.

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

338 {
339  this->some_value<OutputType,
340  &FEMContext::get_element_fe<typename TensorTools::MakeReal<OutputType>::type>,
341  &DiffContext::get_elem_solution>(var, qp, u);
342 }
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:110
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:234
template<typename OutputType >
template void libMesh::FEMContext::interior_values< Gradient > ( unsigned int  var,
const NumericVector< Number > &  _system_vector,
std::vector< OutputType > &  interior_values_vector 
) const
inherited

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

Definition at line 346 of file fem_context.C.

References libMesh::DiffContext::get_dof_indices(), libMesh::FEMContext::get_elem_dim(), libMesh::DiffContext::get_localized_subvector(), and libmesh_nullptr.

Referenced by HeatSystem::element_qoi_derivative(), and libMesh::FEMContext::get_side_fe().

349 {
350  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
351 
352  // Get local-to-global dof index lookup
353  const unsigned int n_dofs = cast_int<unsigned int>
354  (this->get_dof_indices(var).size());
355 
356  // Get current local coefficients
357  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
358 
359  // Get the finite element object
360  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
361  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
362 
363  // Get shape function values at quadrature point
364  const std::vector<std::vector<OutputShape>> & phi = fe->get_phi();
365 
366  // Loop over all the q_points on this element
367  for (std::size_t qp=0; qp != u_vals.size(); qp++)
368  {
369  OutputType & u = u_vals[qp];
370 
371  // Compute the value at this q_point
372  u = 0.;
373 
374  for (unsigned int l=0; l != n_dofs; l++)
375  u += phi[l][qp] * coef(l);
376  }
377 
378  return;
379 }
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:366
const class libmesh_nullptr_t libmesh_nullptr
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:184
unsigned char get_elem_dim() const
Definition: fem_context.h:906
bool libMesh::DiffContext::is_adjoint ( ) const
inherited

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

Definition at line 453 of file diff_context.h.

References libMesh::DiffContext::_is_adjoint.

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

454  { return _is_adjoint; }
bool _is_adjoint
Is this context to be used for a primal or adjoint solve?
Definition: diff_context.h:646
bool& libMesh::DiffContext::is_adjoint ( )
inherited

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

Definition at line 460 of file diff_context.h.

References libMesh::DiffContext::_is_adjoint.

461  { return _is_adjoint; }
bool _is_adjoint
Is this context to be used for a primal or adjoint solve?
Definition: diff_context.h:646
unsigned int libMesh::DiffContext::n_vars ( ) const
inherited
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 111 of file dg_fem_context.C.

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

112 {
113  // Call this *after* side_fe_reinit
114 
115  // Initialize all the neighbor side FE objects based on inverse mapping
116  // the quadrature points on the current side
117  std::vector<Point> qface_side_points;
118  std::vector<Point> qface_neighbor_points;
119  std::map<FEType, FEAbstract *>::iterator local_fe_end = _neighbor_side_fe.end();
120  for (std::map<FEType, FEAbstract *>::iterator i = _neighbor_side_fe.begin();
121  i != local_fe_end; ++i)
122  {
123  FEType neighbor_side_fe_type = i->first;
124  FEAbstract * side_fe = _side_fe[this->get_dim()][neighbor_side_fe_type];
125  qface_side_points = side_fe->get_xyz();
126 
128  neighbor_side_fe_type,
129  &get_neighbor(),
130  qface_side_points,
131  qface_neighbor_points);
132 
133  i->second->reinit(&get_neighbor(), &qface_neighbor_points);
134  }
135 
136  // Set boolean flag to indicate that the DG terms are active on this element
137  _dg_terms_active = true;
138 
139  // Also, initialize data required for DG assembly on the current side,
140  // analogously to FEMContext::pre_fe_reinit
141 
142  // Initialize the per-element data for elem.
144 
145  const unsigned int n_dofs = cast_int<unsigned int>
146  (this->get_dof_indices().size());
147  const unsigned int n_neighbor_dofs = cast_int<unsigned int>
148  (_neighbor_dof_indices.size());
149 
150  // These resize calls also zero out the residual and jacobian
151  _neighbor_residual.resize(n_neighbor_dofs);
152  _elem_elem_jacobian.resize(n_dofs, n_dofs);
153  _elem_neighbor_jacobian.resize(n_dofs, n_neighbor_dofs);
154  _neighbor_elem_jacobian.resize(n_neighbor_dofs, n_dofs);
155  _neighbor_neighbor_jacobian.resize(n_neighbor_dofs, n_neighbor_dofs);
156 
157  // Initialize the per-variable data for elem.
158  {
159  unsigned int sub_dofs = 0;
160  for (unsigned int i=0; i != get_system().n_vars(); ++i)
161  {
163 
164  const unsigned int n_dofs_var = cast_int<unsigned int>
165  (_neighbor_dof_indices_var[i].size());
166 
167  _neighbor_subresiduals[i]->reposition
168  (sub_dofs, n_dofs_var);
169 
170  for (unsigned int j=0; j != i; ++j)
171  {
172  const unsigned int n_dofs_var_j =
173  cast_int<unsigned int>
174  (this->get_dof_indices(j).size());
175 
176  _elem_elem_subjacobians[i][j]->reposition
177  (sub_dofs, _neighbor_subresiduals[j]->i_off(),
178  n_dofs_var, n_dofs_var_j);
179  _elem_elem_subjacobians[j][i]->reposition
180  (_neighbor_subresiduals[j]->i_off(), sub_dofs,
181  n_dofs_var_j, n_dofs_var);
182 
183  _elem_neighbor_subjacobians[i][j]->reposition
184  (sub_dofs, _neighbor_subresiduals[j]->i_off(),
185  n_dofs_var, n_dofs_var_j);
186  _elem_neighbor_subjacobians[j][i]->reposition
187  (_neighbor_subresiduals[j]->i_off(), sub_dofs,
188  n_dofs_var_j, n_dofs_var);
189 
190  _neighbor_elem_subjacobians[i][j]->reposition
191  (sub_dofs, _neighbor_subresiduals[j]->i_off(),
192  n_dofs_var, n_dofs_var_j);
193  _neighbor_elem_subjacobians[j][i]->reposition
194  (_neighbor_subresiduals[j]->i_off(), sub_dofs,
195  n_dofs_var_j, n_dofs_var);
196 
197  _neighbor_neighbor_subjacobians[i][j]->reposition
198  (sub_dofs, _neighbor_subresiduals[j]->i_off(),
199  n_dofs_var, n_dofs_var_j);
200  _neighbor_neighbor_subjacobians[j][i]->reposition
201  (_neighbor_subresiduals[j]->i_off(), sub_dofs,
202  n_dofs_var_j, n_dofs_var);
203  }
204  _elem_elem_subjacobians[i][i]->reposition
205  (sub_dofs, sub_dofs,
206  n_dofs_var,
207  n_dofs_var);
208  _elem_neighbor_subjacobians[i][i]->reposition
209  (sub_dofs, sub_dofs,
210  n_dofs_var,
211  n_dofs_var);
212  _neighbor_elem_subjacobians[i][i]->reposition
213  (sub_dofs, sub_dofs,
214  n_dofs_var,
215  n_dofs_var);
216  _neighbor_neighbor_subjacobians[i][i]->reposition
217  (sub_dofs, sub_dofs,
218  n_dofs_var,
219  n_dofs_var);
220  sub_dofs += n_dofs_var;
221  }
222  libmesh_assert_equal_to (sub_dofs, n_dofs);
223  }
224 
225 }
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 resize(const unsigned int n)
Resize the vector.
Definition: dense_vector.h:350
std::vector< std::vector< dof_id_type > > _neighbor_dof_indices_var
std::map< FEType, FEAbstract * > _neighbor_side_fe
Finite element objects for each variable&#39;s sides on the neighbor element.
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:366
const Elem & get_neighbor() const
Accessor for current neighbor Elem object for assembling DG terms.
unsigned char get_dim() const
Accessor for cached mesh dimension.
Definition: fem_context.h:899
const DofMap & get_dof_map() const
Definition: system.h:2030
std::vector< std::vector< DenseSubMatrix< Number > * > > _elem_elem_subjacobians
std::vector< std::vector< DenseSubMatrix< Number > * > > _neighbor_neighbor_subjacobians
std::vector< std::vector< DenseSubMatrix< Number > * > > _elem_neighbor_subjacobians
DenseMatrix< Number > _neighbor_elem_jacobian
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_interface.C:569
DenseMatrix< Number > _elem_neighbor_jacobian
const System & get_system() const
Accessor for associated system.
Definition: diff_context.h:104
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, FEAbstract * > > _side_fe
Definition: fem_context.h:1094
std::vector< std::vector< DenseSubMatrix< Number > * > > _neighbor_elem_subjacobians
DenseMatrix< Number > _neighbor_neighbor_jacobian
void resize(const unsigned int new_m, const unsigned int new_n)
Resize the matrix.
Definition: dense_matrix.h:776
std::vector< DenseSubVector< Number > * > _neighbor_subresiduals
Element residual subvectors and Jacobian submatrices.
unsigned int n_vars() const
Definition: system.h:2086
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Fills the vector di with the global degree of freedom indices for the element.
Definition: dof_map.C:1917
void libMesh::FEMContext::nonlocal_reinit ( Real  theta)
virtualinherited

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

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

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

1373 {
1374  // Update the "time" variable of this context object
1375  this->_update_time_from_system(theta);
1376 
1377  // We can reuse the Elem FE safely here.
1378  elem_fe_reinit();
1379 }
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:1796
virtual void elem_fe_reinit(const std::vector< Point > *const pts=libmesh_nullptr)
Reinitializes interior FE objects on the current geometric element.
Definition: fem_context.C:1382
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.

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

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

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

Definition at line 937 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(), libMesh::DiffContext::get_elem_solution(), and libmesh_nullptr.

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

941 {
942  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
943 
944  // Get local-to-global dof index lookup
945  const unsigned int n_dofs = cast_int<unsigned int>
946  (this->get_dof_indices(var).size());
947 
948  // Get current local coefficients
949  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
950  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
951 
952  // Get finite element object
953  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
954  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
955 
956  // Build a FE for calculating u(p)
957  FEGenericBase<OutputShape> * fe_new =
958  this->build_new_fe( fe, p, tolerance );
959 
960  // Get the values of the shape function derivatives
961  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputShape>> & curl_phi = fe_new->get_curl_phi();
962 
963  curl_u = 0.0;
964 
965  for (unsigned int l=0; l != n_dofs; l++)
966  curl_u.add_scaled(curl_phi[l][0], coef(l));
967 
968  return;
969 }
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:110
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:366
const class libmesh_nullptr_t libmesh_nullptr
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
Helper function to reduce some code duplication in the *_point_* methods.
Definition: fem_context.C:1884
std::vector< DenseSubVector< Number > * > _elem_subsolutions
Definition: diff_context.h:565
unsigned char get_elem_dim() const
Definition: fem_context.h:906
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 834 of file fem_context.C.

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

835 {
836  Gradient grad_u;
837 
838  this->point_gradient( var, p, grad_u );
839 
840  return grad_u;
841 }
NumberVectorValue Gradient
Gradient point_gradient(unsigned int var, const Point &p) const
Definition: fem_context.C:834
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 846 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(), libMesh::DiffContext::get_elem_solution(), and libmesh_nullptr.

850 {
851  typedef typename TensorTools::MakeReal
853  OutputShape;
854 
855  // Get local-to-global dof index lookup
856  const unsigned int n_dofs = cast_int<unsigned int>
857  (this->get_dof_indices(var).size());
858 
859  // Get current local coefficients
860  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
861  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
862 
863  // Get finite element object
864  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
865  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
866 
867  // Build a FE for calculating u(p)
868  FEGenericBase<OutputShape> * fe_new =
869  this->build_new_fe( fe, p, tolerance );
870 
871  // Get the values of the shape function derivatives
872  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient>> & dphi = fe_new->get_dphi();
873 
874  grad_u = 0.0;
875 
876  for (unsigned int l=0; l != n_dofs; l++)
877  grad_u.add_scaled(dphi[l][0], coef(l));
878 
879  return;
880 }
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:110
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:366
const class libmesh_nullptr_t libmesh_nullptr
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
Helper function to reduce some code duplication in the *_point_* methods.
Definition: fem_context.C:1884
std::vector< DenseSubVector< Number > * > _elem_subsolutions
Definition: diff_context.h:565
unsigned char get_elem_dim() const
Definition: fem_context.h:906
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 886 of file fem_context.C.

Referenced by libMesh::ParsedFEMFunction< Output >::eval_args(), and libMesh::FEMContext::get_side_fe().

887 {
888  Tensor hess_u;
889 
890  this->point_hessian( var, p, hess_u );
891 
892  return hess_u;
893 }
Tensor point_hessian(unsigned int var, const Point &p) const
Definition: fem_context.C:886
NumberTensorValue Tensor
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 897 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(), libMesh::DiffContext::get_elem_solution(), and libmesh_nullptr.

901 {
902  typedef typename TensorTools::DecrementRank<OutputType>::type Rank1Decrement;
903  typedef typename TensorTools::DecrementRank<Rank1Decrement>::type Rank2Decrement;
904  typedef typename TensorTools::MakeReal<Rank2Decrement>::type OutputShape;
905 
906  // Get local-to-global dof index lookup
907  const unsigned int n_dofs = cast_int<unsigned int>
908  (this->get_dof_indices(var).size());
909 
910  // Get current local coefficients
911  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
912  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
913 
914  // Get finite element object
915  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
916  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
917 
918  // Build a FE for calculating u(p)
919  FEGenericBase<OutputShape> * fe_new =
920  this->build_new_fe( fe, p, tolerance );
921 
922  // Get the values of the shape function derivatives
923  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor>> & d2phi = fe_new->get_d2phi();
924 
925  hess_u = 0.0;
926 
927  for (unsigned int l=0; l != n_dofs; l++)
928  hess_u.add_scaled(d2phi[l][0], coef(l));
929 
930  return;
931 }
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:110
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:366
const class libmesh_nullptr_t libmesh_nullptr
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
Helper function to reduce some code duplication in the *_point_* methods.
Definition: fem_context.C:1884
std::vector< DenseSubVector< Number > * > _elem_subsolutions
Definition: diff_context.h:565
unsigned char get_elem_dim() const
Definition: fem_context.h:906
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.

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

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

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

789 {
790  Number u = 0.;
791 
792  this->point_value( var, p, u );
793 
794  return u;
795 }
Number point_value(unsigned int var, const Point &p) const
Definition: fem_context.C:788
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 798 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(), libMesh::DiffContext::get_elem_solution(), and libmesh_nullptr.

802 {
803  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
804 
805  // Get local-to-global dof index lookup
806  const unsigned int n_dofs = cast_int<unsigned int>
807  (this->get_dof_indices(var).size());
808 
809  // Get current local coefficients
810  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
811  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
812 
813  // Get finite element object
814  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
815  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
816 
817  // Build a FE for calculating u(p)
818  FEGenericBase<OutputShape> * fe_new =
819  this->build_new_fe( fe, p, tolerance );
820 
821  // Get the values of the shape function derivatives
822  const std::vector<std::vector<OutputShape>> & phi = fe_new->get_phi();
823 
824  u = 0.;
825 
826  for (unsigned int l=0; l != n_dofs; l++)
827  u += phi[l][0] * coef(l);
828 
829  return;
830 }
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:110
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:366
const class libmesh_nullptr_t libmesh_nullptr
FEGenericBase< OutputShape > * build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
Helper function to reduce some code duplication in the *_point_* methods.
Definition: fem_context.C:1884
std::vector< DenseSubVector< Number > * > _elem_subsolutions
Definition: diff_context.h:565
unsigned char get_elem_dim() const
Definition: fem_context.h:906
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 1582 of file fem_context.C.

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

Referenced by libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::FEMSystem::assembly(), L2System::element_time_derivative(), libMesh::RBEIMConstruction::enrich_RB_space(), libMesh::FEMContext::get_side_fe(), libMesh::FEMSystem::mesh_position_get(), libMesh::FEMSystem::mesh_position_set(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::System::project_vector(), and libMesh::RBEIMConstruction::truth_solve().

1583 {
1584  this->set_elem(e);
1585 
1586  if (algebraic_type() == CURRENT ||
1588  {
1589  // Initialize the per-element data for elem.
1590  if (this->has_elem())
1591  sys.get_dof_map().dof_indices (&(this->get_elem()), this->get_dof_indices());
1592  else
1593  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1595  (static_cast<Elem*>(libmesh_nullptr), this->get_dof_indices());
1596  }
1597 #ifdef LIBMESH_ENABLE_AMR
1598  else if (algebraic_type() == OLD)
1599  {
1600  // Initialize the per-element data for elem.
1601  if (this->has_elem())
1602  sys.get_dof_map().old_dof_indices (&(this->get_elem()), this->get_dof_indices());
1603  else
1604  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1606  (static_cast<Elem*>(libmesh_nullptr), this->get_dof_indices());
1607  }
1608 #endif // LIBMESH_ENABLE_AMR
1609 
1610  const unsigned int n_dofs = cast_int<unsigned int>
1611  (this->get_dof_indices().size());
1612  const std::size_t n_qoi = sys.qoi.size();
1613 
1614  if (this->algebraic_type() != NONE &&
1615  this->algebraic_type() != DOFS_ONLY)
1616  {
1617  // This also resizes elem_solution
1619  sys.current_local_solution->get(this->get_dof_indices(), this->get_elem_solution().get_values());
1620  else
1621  _custom_solution->get(this->get_dof_indices(), this->get_elem_solution().get_values());
1622 
1623  if (sys.use_fixed_solution)
1624  this->get_elem_fixed_solution().resize(n_dofs);
1625 
1626  // Only make space for these if we're using DiffSystem
1627  // This is assuming *only* DiffSystem is using elem_solution_rate/accel
1628  const DifferentiableSystem * diff_system = dynamic_cast<const DifferentiableSystem *>(&sys);
1629  if (diff_system)
1630  {
1631  // Now, we only need these if the solver is unsteady
1632  if (!diff_system->get_time_solver().is_steady())
1633  {
1634  this->get_elem_solution_rate().resize(n_dofs);
1635 
1636  // We only need accel space if the TimeSolver is second order
1637  const UnsteadySolver & time_solver = cast_ref<const UnsteadySolver &>(diff_system->get_time_solver());
1638 
1639  if (time_solver.time_order() >= 2 || !diff_system->get_second_order_vars().empty())
1640  this->get_elem_solution_accel().resize(n_dofs);
1641  }
1642  }
1643 
1644  if (algebraic_type() != OLD)
1645  {
1646  // These resize calls also zero out the residual and jacobian
1647  this->get_elem_residual().resize(n_dofs);
1648  this->get_elem_jacobian().resize(n_dofs, n_dofs);
1649 
1650  this->get_qoi_derivatives().resize(n_qoi);
1651  this->_elem_qoi_subderivatives.resize(n_qoi);
1652  for (std::size_t q=0; q != n_qoi; ++q)
1653  (this->get_qoi_derivatives())[q].resize(n_dofs);
1654  }
1655  }
1656 
1657  // Initialize the per-variable data for elem.
1658  {
1659  unsigned int sub_dofs = 0;
1660  for (unsigned int i=0; i != sys.n_vars(); ++i)
1661  {
1662  if (algebraic_type() == CURRENT ||
1664  {
1665  if (this->has_elem())
1666  sys.get_dof_map().dof_indices (&(this->get_elem()), this->get_dof_indices(i), i);
1667  else
1668  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1670  (static_cast<Elem*>(libmesh_nullptr), this->get_dof_indices(i), i);
1671  }
1672 #ifdef LIBMESH_ENABLE_AMR
1673  else if (algebraic_type() == OLD)
1674  {
1675  if (this->has_elem())
1676  sys.get_dof_map().old_dof_indices (&(this->get_elem()), this->get_dof_indices(i), i);
1677  else
1678  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1680  (static_cast<Elem*>(libmesh_nullptr), this->get_dof_indices(i), i);
1681  }
1682 #endif // LIBMESH_ENABLE_AMR
1683 
1684  if (this->algebraic_type() != NONE &&
1685  this->algebraic_type() != DOFS_ONLY)
1686  {
1687  const unsigned int n_dofs_var = cast_int<unsigned int>
1688  (this->get_dof_indices(i).size());
1689 
1690  this->get_elem_solution(i).reposition
1691  (sub_dofs, n_dofs_var);
1692 
1693  // Only make space for these if we're using DiffSystem
1694  // This is assuming *only* DiffSystem is using elem_solution_rate/accel
1695  const DifferentiableSystem * diff_system = dynamic_cast<const DifferentiableSystem *>(&sys);
1696  if (diff_system)
1697  {
1698  // Now, we only need these if the solver is unsteady
1699  if (!diff_system->get_time_solver().is_steady())
1700  {
1701  this->get_elem_solution_rate(i).reposition
1702  (sub_dofs, n_dofs_var);
1703 
1704  // We only need accel space if the TimeSolver is second order
1705  const UnsteadySolver & time_solver = cast_ref<const UnsteadySolver &>(diff_system->get_time_solver());
1706 
1707  if (time_solver.time_order() >= 2 || !diff_system->get_second_order_vars().empty())
1708  this->get_elem_solution_accel(i).reposition
1709  (sub_dofs, n_dofs_var);
1710  }
1711  }
1712 
1713  if (sys.use_fixed_solution)
1714  this->get_elem_fixed_solution(i).reposition
1715  (sub_dofs, n_dofs_var);
1716 
1717  if (algebraic_type() != OLD)
1718  {
1719  this->get_elem_residual(i).reposition
1720  (sub_dofs, n_dofs_var);
1721 
1722  for (std::size_t q=0; q != n_qoi; ++q)
1723  this->get_qoi_derivatives(q,i).reposition
1724  (sub_dofs, n_dofs_var);
1725 
1726  for (unsigned int j=0; j != i; ++j)
1727  {
1728  const unsigned int n_dofs_var_j =
1729  cast_int<unsigned int>
1730  (this->get_dof_indices(j).size());
1731 
1732  this->get_elem_jacobian(i,j).reposition
1733  (sub_dofs, this->get_elem_residual(j).i_off(),
1734  n_dofs_var, n_dofs_var_j);
1735  this->get_elem_jacobian(j,i).reposition
1736  (this->get_elem_residual(j).i_off(), sub_dofs,
1737  n_dofs_var_j, n_dofs_var);
1738  }
1739  this->get_elem_jacobian(i,i).reposition
1740  (sub_dofs, sub_dofs,
1741  n_dofs_var,
1742  n_dofs_var);
1743  }
1744 
1745  sub_dofs += n_dofs_var;
1746  }
1747  }
1748 
1749  if (this->algebraic_type() != NONE &&
1750  this->algebraic_type() != DOFS_ONLY &&
1751  this->algebraic_type() != OLD)
1752  libmesh_assert_equal_to (sub_dofs, n_dofs);
1753  }
1754 
1755  // Now do the localization for the user requested vectors
1756  if (this->algebraic_type() != NONE)
1757  {
1758  DiffContext::localized_vectors_iterator localized_vec_it = this->_localized_vectors.begin();
1759  const DiffContext::localized_vectors_iterator localized_vec_end = this->_localized_vectors.end();
1760 
1761  for (; localized_vec_it != localized_vec_end; ++localized_vec_it)
1762  {
1763  const NumericVector<Number> & current_localized_vector = *localized_vec_it->first;
1764  DenseVector<Number> & target_vector = localized_vec_it->second.first;
1765 
1766  current_localized_vector.get(this->get_dof_indices(), target_vector.get_values());
1767 
1768  // Initialize the per-variable data for elem.
1769  unsigned int sub_dofs = 0;
1770  for (unsigned int i=0; i != sys.n_vars(); ++i)
1771  {
1772  const unsigned int n_dofs_var = cast_int<unsigned int>
1773  (this->get_dof_indices(i).size());
1774 
1775  // This is redundant with earlier initialization, isn't it? - RHS
1776  // sys.get_dof_map().dof_indices (&(this->get_elem()), this->get_dof_indices(i), i);
1777 
1778  localized_vec_it->second.second[i]->reposition
1779  (sub_dofs, n_dofs_var);
1780 
1781  sub_dofs += n_dofs_var;
1782  }
1783  libmesh_assert_equal_to (sub_dofs, n_dofs);
1784  }
1785  }
1786 }
const DenseVector< Number > & get_elem_solution() const
Accessor for element solution.
Definition: diff_context.h:110
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:558
const NumericVector< Number > * _custom_solution
Data with which to do algebra reinitialization.
Definition: fem_context.h:994
void set_elem(const Elem *e)
Helper function to promote accessor usage.
Definition: fem_context.C:1788
ImplicitSystem & sys
bool has_elem() const
Test for current Elem object.
Definition: fem_context.h:865
std::vector< std::vector< DenseSubVector< Number > * > > _elem_qoi_subderivatives
Definition: diff_context.h:609
const DenseVector< Number > & get_elem_solution_accel() const
Accessor for element solution accel of change w.r.t.
Definition: diff_context.h:179
void resize(const unsigned int n)
Resize the vector.
Definition: dense_vector.h:350
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
Definition: diff_context.h:366
const DenseVector< Number > & get_elem_fixed_solution() const
Accessor for element fixed solution.
Definition: diff_context.h:214
UniquePtr< NumericVector< Number > > current_local_solution
All the values I need to compute my contribution to the simulation at hand.
Definition: system.h:1535
const class libmesh_nullptr_t libmesh_nullptr
void old_dof_indices(const Elem *const elem, std::vector< dof_id_type > &di, const unsigned int vn=libMesh::invalid_uint) const
After a mesh is refined and repartitioned it is possible that the _send_list will need to be augmente...
Definition: dof_map.C:2378
const DenseVector< Number > & get_elem_residual() const
Const accessor for element residual.
Definition: diff_context.h:248
const Elem & get_elem() const
Accessor for current Elem object.
Definition: fem_context.h:871
const DenseMatrix< Number > & get_elem_jacobian() const
Const accessor for element Jacobian.
Definition: diff_context.h:282
const std::vector< DenseVector< Number > > & get_qoi_derivatives() const
Const accessor for QoI derivatives.
Definition: diff_context.h:330
const DofMap & get_dof_map() const
Definition: system.h:2030
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:527
std::vector< Number > qoi
Values of the quantities of interest.
Definition: system.h:1553
bool use_fixed_solution
A boolean to be set to true by systems using elem_fixed_solution, for optional use by e...
Definition: system.h:1493
const DenseVector< Number > & get_elem_solution_rate() const
Accessor for element solution rate of change w.r.t.
Definition: diff_context.h:144
AlgebraicType algebraic_type() const
Definition: fem_context.h:952
virtual void get(const std::vector< numeric_index_type > &index, T *values) const
Access multiple components at once.
void resize(const unsigned int new_m, const unsigned int new_n)
Resize the matrix.
Definition: dense_matrix.h:776
unsigned int n_vars() const
Definition: system.h:2086
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Fills the vector di with the global degree of freedom indices for the element.
Definition: dof_map.C:1917
void libMesh::FEMContext::set_algebraic_type ( const AlgebraicType  atype)
inherited

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

References libMesh::FEMContext::_atype.

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

947  { _atype = atype; }
AlgebraicType _atype
Keep track of what type of algebra reinitialization is to be done.
Definition: fem_context.h:989
void libMesh::FEMContext::set_custom_solution ( const NumericVector< Number > *  custom_sol)
inherited

Set a NumericVector to be used in place of current_local_solution for calculating elem_solution.

Set to NULL to restore the current_local_solution behavior. Advanced DifferentiableSystem specific capabilities will only be enabled in the current_local_solution case.

Definition at line 961 of file fem_context.h.

References libMesh::FEMContext::_custom_solution.

962  { _custom_solution = custom_sol; }
const NumericVector< Number > * _custom_solution
Data with which to do algebra reinitialization.
Definition: fem_context.h:994
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 138 of file diff_context.C.

References libMesh::DiffContext::_deltat.

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

139 {
140  // We may actually want to be able to set this pointer to NULL, so
141  // don't report an error for that.
142  _deltat = dt;
143 }
Real * _deltat
Default NULL, can optionally be used to point to a timestep value in the System-derived class respons...
Definition: diff_context.h:636
void libMesh::FEMContext::set_elem ( const Elem e)
protectedinherited

Helper function to promote accessor usage.

Definition at line 1788 of file fem_context.C.

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

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

1789 {
1790  this->_elem = e;
1791 
1792  // If e is NULL, we assume it's SCALAR and set _elem_dim to 0.
1793  this->_elem_dim = this->_elem ? this->_elem->dim() : 0;
1794 }
unsigned char _elem_dim
Cached dimension of this->_elem.
Definition: fem_context.h:1127
virtual unsigned int dim() const =0
const Elem * _elem
Current element for element_* to examine.
Definition: fem_context.h:1117
virtual void libMesh::FEMContext::set_mesh_system ( System sys)
virtualinherited

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

This should be set automatically if the FEMPhysics requires it.

Definition at line 805 of file fem_context.h.

References libMesh::FEMContext::_mesh_sys, and libMesh::sys.

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

806  { this->_mesh_sys = sys; }
ImplicitSystem & sys
System * _mesh_sys
System from which to acquire moving mesh information.
Definition: fem_context.h:967
void libMesh::FEMContext::set_mesh_x_var ( unsigned int  x_var)
inherited

Accessor for x-variable of moving mesh System.

This should be set automatically if the FEMPhysics requires it.

Definition at line 831 of file fem_context.h.

References libMesh::FEMContext::_mesh_x_var.

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

832  { _mesh_x_var = x_var; }
unsigned int _mesh_x_var
Variables from which to acquire moving mesh information.
Definition: fem_context.h:972
void libMesh::FEMContext::set_mesh_y_var ( unsigned int  y_var)
inherited

Accessor for y-variable of moving mesh System.

This should be set automatically if the FEMPhysics requires it.

Definition at line 845 of file fem_context.h.

References libMesh::FEMContext::_mesh_y_var.

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

846  { _mesh_y_var = y_var; }
unsigned int _mesh_y_var
Definition: fem_context.h:972
void libMesh::FEMContext::set_mesh_z_var ( unsigned int  z_var)
inherited

Accessor for z-variable of moving mesh System.

This should be set automatically if the FEMPhysics requires it.

Definition at line 859 of file fem_context.h.

References libMesh::FEMContext::_mesh_z_var.

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

860  { _mesh_z_var = z_var; }
unsigned int _mesh_z_var
Definition: fem_context.h:972
void libMesh::DGFEMContext::set_neighbor ( const Elem neighbor)

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

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

Definition at line 220 of file dg_fem_context.h.

References _neighbor.

221  { _neighbor = &neighbor; }
const Elem * _neighbor
Current neighbor element for assembling DG terms.
void libMesh::DiffContext::set_time ( Real  time_in)
inherited

Set the time for which the current nonlinear_solution is defined.

Definition at line 410 of file diff_context.h.

References libMesh::DiffContext::time.

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

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

Definition at line 1307 of file fem_context.C.

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

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

1309 {
1310  this->some_value<OutputType,
1314 }
const DenseVector< Number > & get_elem_solution_accel() const
Accessor for element solution accel of change w.r.t.
Definition: diff_context.h:179
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Helper function to reduce some code duplication in the *interior_value methods.