libMesh::FEMContext Class Reference

#include <fem_context.h>

Inheritance diagram for libMesh::FEMContext:

Classes

struct  FENeeded
 

Public Types

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

Public Member Functions

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

Public Attributes

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

Protected Member Functions

template<typename OutputShape >
UniquePtr< FEGenericBase< OutputShape > > build_new_fe (const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
 
void set_elem (const Elem *e)
 
template<typename OutputType , typename FENeeded< OutputType >::value_getter fe_getter, diff_subsolution_getter subsolution_getter>
void some_value (unsigned int var, unsigned int qp, OutputType &u) const
 
template<typename OutputType , typename FENeeded< OutputType >::grad_getter fe_getter, diff_subsolution_getter subsolution_getter>
void some_gradient (unsigned int var, unsigned int qp, OutputType &u) const
 
template<typename OutputType , typename FENeeded< OutputType >::hess_getter fe_getter, diff_subsolution_getter subsolution_getter>
void some_hessian (unsigned int var, unsigned int qp, OutputType &u) const
 

Protected Attributes

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

Private Member Functions

void _do_elem_position_set (Real theta)
 
void _update_time_from_system (Real theta)
 

Detailed Description

This class provides all data required for a physics package (e.g. an FEMSystem subclass) to perform local element residual and jacobian integrations.

This class is part of the new DifferentiableSystem framework, which is still experimental. Users of this framework should beware of bugs and future API changes.

Author
Roy H. Stogner
Date
2009

Definition at line 61 of file fem_context.h.

Member Typedef Documentation

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

Helper typedef to simplify refactoring

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

866  { NONE = 0, // Do not reinitialize dof_indices
867  DOFS_ONLY, // Reinitialize dof_indices, not
868  // algebraic structures
869  CURRENT, // Use dof_indices, current solution
870  OLD }; // Use old_dof_indices, custom solution

Constructor & Destructor Documentation

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

Constructor. Allocates some but fills no data structures.

Definition at line 37 of file fem_context.C.

References _edge_fe, _edge_fe_var, _edge_qrule, _elem_dims, _element_fe, _element_fe_var, _element_qrule, _side_fe, _side_fe_var, _side_qrule, libMesh::FEAbstract::build(), libMesh::FEType::default_quadrature_rule(), libMesh::System::extra_quadrature_order, libMesh::FEType::family, libMesh::libmesh_assert(), libmesh_nullptr, libMesh::System::n_vars(), libMesh::FEType::order, libMesh::SCALAR, and libMesh::System::variable_type().

38  : DiffContext(sys),
40  _mesh_x_var(0),
41  _mesh_y_var(0),
42  _mesh_z_var(0),
43  side(0), edge(0),
44  _atype(CURRENT),
49  _elem_dim(0), /* This will be reset in set_elem(). */
53 {
54  // Reserve space for the FEAbstract and QBase objects for each
55  // element dimension possiblity (0,1,2,3)
56  _element_fe.resize(4);
57  _side_fe.resize(4);
58  _element_fe_var.resize(4);
59  _side_fe_var.resize(4);
60 
61  // We need to know which of our variables has the hardest
62  // shape functions to numerically integrate.
63 
64  unsigned int nv = sys.n_vars();
65 
66  libmesh_assert (nv);
67  FEType hardest_fe_type = sys.variable_type(0);
68 
69  bool have_scalar = false;
70 
71  for (unsigned int i=0; i != nv; ++i)
72  {
73  FEType fe_type = sys.variable_type(i);
74 
75  // Make sure we find a non-SCALAR FE family, even in the case
76  // where the first variable(s) weren't
77  if (hardest_fe_type.family == SCALAR)
78  {
79  hardest_fe_type.family = fe_type.family;
80  hardest_fe_type.order = fe_type.order;
81  }
82 
83  // FIXME - we don't yet handle mixed finite elements from
84  // different families which require different quadrature rules
85  // libmesh_assert_equal_to (fe_type.family, hardest_fe_type.family);
86 
87  // We need to detect SCALAR's so we can prepare FE objects for
88  // them, and so we don't mistake high order scalars as a reason
89  // to crank up the quadrature order on other types.
90  if( fe_type.family == SCALAR )
91  have_scalar = true;
92  else if (fe_type.order > hardest_fe_type.order)
93  hardest_fe_type = fe_type;
94  }
95 
96  if(have_scalar)
97  // SCALAR FEs have dimension 0 by assumption
98  _elem_dims.insert(0);
99 
100  for( std::set<unsigned char>::const_iterator dim_it = _elem_dims.begin();
101  dim_it != _elem_dims.end(); ++dim_it )
102  {
103  const unsigned char dim = *dim_it;
104 
105  // Create an adequate quadrature rule
106  _element_qrule[dim] = hardest_fe_type.default_quadrature_rule
107  (dim, sys.extra_quadrature_order).release();
108  _side_qrule[dim] = hardest_fe_type.default_quadrature_rule
109  (dim-1, sys.extra_quadrature_order).release();
110  if (dim == 3)
111  _edge_qrule.reset(hardest_fe_type.default_quadrature_rule
112  (1, sys.extra_quadrature_order).release());
113 
114  // Next, create finite element objects
115  _element_fe_var[dim].resize(nv);
116  _side_fe_var[dim].resize(nv);
117  if (dim == 3)
118  _edge_fe_var.resize(nv);
119 
120 
121  for (unsigned int i=0; i != nv; ++i)
122  {
123  FEType fe_type = sys.variable_type(i);
124 
125  if ( _element_fe[dim][fe_type] == libmesh_nullptr )
126  {
127  _element_fe[dim][fe_type] = FEAbstract::build(dim, fe_type).release();
128  _element_fe[dim][fe_type]->attach_quadrature_rule(_element_qrule[dim]);
129  _side_fe[dim][fe_type] = FEAbstract::build(dim, fe_type).release();
130  _side_fe[dim][fe_type]->attach_quadrature_rule(_side_qrule[dim]);
131 
132  if (dim == 3)
133  {
134  _edge_fe[fe_type] = FEAbstract::build(dim, fe_type).release();
135  _edge_fe[fe_type]->attach_quadrature_rule(_edge_qrule.get());
136  }
137  }
138 
139  _element_fe_var[dim][i] = _element_fe[dim][fe_type];
140  _side_fe_var[dim][i] = _side_fe[dim][fe_type];
141  if ((dim) == 3)
142  _edge_fe_var[i] = _edge_fe[fe_type];
143 
144  }
145  }
146 }
FEFamily family
Definition: fe_type.h:206
const BoundaryInfo & get_boundary_info() const
Definition: mesh_base.h:111
const NumericVector< Number > * _custom_solution
Definition: fem_context.h:927
unsigned int _mesh_z_var
Definition: fem_context.h:905
ImplicitSystem & sys
int extra_quadrature_order
Definition: system.h:1497
const class libmesh_nullptr_t libmesh_nullptr
std::vector< QBase * > _side_qrule
Definition: fem_context.h:1070
const FEType & variable_type(const unsigned int i) const
Definition: system.h:2153
DiffContext(const System &)
Definition: diff_context.C:29
libmesh_assert(j)
unsigned char edge
Definition: fem_context.h:915
std::set< unsigned char > _elem_dims
Definition: fem_context.h:1054
const MeshBase & get_mesh() const
Definition: system.h:2003
unsigned char _elem_dim
Definition: fem_context.h:1048
unsigned int _mesh_x_var
Definition: fem_context.h:905
AlgebraicType _atype
Definition: fem_context.h:922
std::map< FEType, FEAbstract * > _edge_fe
Definition: fem_context.h:1016
const BoundaryInfo & _boundary_info
Definition: fem_context.h:1033
std::vector< std::vector< FEAbstract * > > _element_fe_var
Definition: fem_context.h:1025
const std::set< unsigned char > & elem_dimensions() const
Definition: mesh_base.h:184
unsigned char _dim
Definition: fem_context.h:1043
std::vector< std::map< FEType, FEAbstract * > > _side_fe
Definition: fem_context.h:1015
std::vector< FEAbstract * > _edge_fe_var
Definition: fem_context.h:1027
std::vector< std::map< FEType, FEAbstract * > > _element_fe
Definition: fem_context.h:1014
std::vector< QBase * > _element_qrule
Definition: fem_context.h:1062
unsigned char side
Definition: fem_context.h:910
unsigned int mesh_dimension() const
Definition: mesh_base.C:148
unsigned int _mesh_y_var
Definition: fem_context.h:905
unsigned int n_vars() const
Definition: system.h:2075
static UniquePtr< FEAbstract > build(const unsigned int dim, const FEType &type)
Definition: fe_abstract.C:44
std::vector< std::vector< FEAbstract * > > _side_fe_var
Definition: fem_context.h:1026
const Elem * _elem
Definition: fem_context.h:1038
UniquePtr< QBase > _edge_qrule
Definition: fem_context.h:1079
libMesh::FEMContext::~FEMContext ( )
virtual

Destructor.

Definition at line 148 of file fem_context.C.

References _edge_fe, _element_fe, _element_qrule, _side_fe, and _side_qrule.

149 {
150  // We don't want to store UniquePtrs in STL containers, but we don't
151  // want to leak memory either
152  for (std::vector<std::map<FEType, FEAbstract *> >::iterator d = _element_fe.begin();
153  d != _element_fe.end(); ++d)
154  for (std::map<FEType, FEAbstract *>::iterator i = d->begin();
155  i != d->end(); ++i)
156  delete i->second;
157 
158  for (std::vector<std::map<FEType, FEAbstract *> >::iterator d = _side_fe.begin();
159  d != _side_fe.end(); ++d)
160  for (std::map<FEType, FEAbstract *>::iterator i = d->begin();
161  i != d->end(); ++i)
162  delete i->second;
163 
164  for (std::map<FEType, FEAbstract *>::iterator i = _edge_fe.begin();
165  i != _edge_fe.end(); ++i)
166  delete i->second;
167  _edge_fe.clear();
168 
169  for (std::vector<QBase *>::iterator i = _element_qrule.begin();
170  i != _element_qrule.end(); ++i)
171  delete *i;
172  _element_qrule.clear();
173 
174  for (std::vector<QBase *>::iterator i = _side_qrule.begin();
175  i != _side_qrule.end(); ++i)
176  delete *i;
177  _side_qrule.clear();
178 }
std::vector< QBase * > _side_qrule
Definition: fem_context.h:1070
std::map< FEType, FEAbstract * > _edge_fe
Definition: fem_context.h:1016
std::vector< std::map< FEType, FEAbstract * > > _side_fe
Definition: fem_context.h:1015
std::vector< std::map< FEType, FEAbstract * > > _element_fe
Definition: fem_context.h:1014
std::vector< QBase * > _element_qrule
Definition: fem_context.h:1062

Member Function Documentation

void libMesh::FEMContext::_do_elem_position_set ( Real  theta)
private

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.

This does the work of elem_position_set, but isn't safe to call without _mesh_sys/etc. defined first.

Definition at line 1485 of file fem_context.C.

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

Referenced by elem_position_set().

1486 {
1487  // This is too expensive to call unless we've been asked to move the mesh
1489 
1490  // This will probably break with threading when two contexts are
1491  // operating on elements which share a node
1492  libmesh_assert_equal_to (libMesh::n_threads(), 1);
1493 
1494  // If the coordinate data is in our own system, it's already
1495  // been set up for us, and we can ignore our input parameter theta
1496  // if (_mesh_sys == this->number())
1497  // {
1498  unsigned int n_nodes = this->get_elem().n_nodes();
1499 
1500 #ifndef NDEBUG
1501  const unsigned char dim = this->get_elem_dim();
1502 
1503  // For simplicity we demand that mesh coordinates be stored
1504  // in a format that allows a direct copy
1506  (this->get_element_fe(this->get_mesh_x_var(), dim)->get_fe_type().family
1507  == LAGRANGE &&
1508  this->get_elem_solution(this->get_mesh_x_var()).size() == n_nodes));
1510  (this->get_element_fe(this->get_mesh_y_var(), dim)->get_fe_type().family
1511  == LAGRANGE &&
1512  this->get_elem_solution(this->get_mesh_y_var()).size() == n_nodes));
1514  (this->get_element_fe(this->get_mesh_z_var(), dim)->get_fe_type().family
1515  == LAGRANGE &&
1516  this->get_elem_solution(this->get_mesh_z_var()).size() == n_nodes));
1517 #endif
1518 
1519  // Set the new point coordinates
1520  if (this->get_mesh_x_var() != libMesh::invalid_uint)
1521  for (unsigned int i=0; i != n_nodes; ++i)
1522  const_cast<Elem &>(this->get_elem()).point(i)(0) =
1523  libmesh_real(this->get_elem_solution(this->get_mesh_x_var())(i));
1524 
1525  if (this->get_mesh_y_var() != libMesh::invalid_uint)
1526  for (unsigned int i=0; i != n_nodes; ++i)
1527  const_cast<Elem &>(this->get_elem()).point(i)(1) =
1528  libmesh_real(this->get_elem_solution(this->get_mesh_y_var())(i));
1529 
1530  if (this->get_mesh_z_var() != libMesh::invalid_uint)
1531  for (unsigned int i=0; i != n_nodes; ++i)
1532  const_cast<Elem &>(this->get_elem()).point(i)(2) =
1533  libmesh_real(this->get_elem_solution(this->get_mesh_z_var())(i));
1534  // }
1535  // FIXME - If the coordinate data is not in our own system, someone
1536  // had better get around to implementing that... - RHS
1537  // else
1538  // {
1539  // libmesh_not_implemented();
1540  // }
1541 }
T libmesh_real(T a)
unsigned int n_threads()
Definition: libmesh_base.h:125
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:110
const unsigned int invalid_uint
Definition: libmesh.h:184
unsigned int get_mesh_x_var() const
Definition: fem_context.h:756
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:235
const Elem & get_elem() const
Definition: fem_context.h:804
libmesh_assert(j)
virtual unsigned int n_nodes() const =0
const dof_id_type n_nodes
Definition: tecplot_io.C:67
unsigned int get_mesh_z_var() const
Definition: fem_context.h:784
unsigned char get_elem_dim() const
Definition: fem_context.h:839
unsigned int get_mesh_y_var() const
Definition: fem_context.h:770
void libMesh::FEMContext::_update_time_from_system ( Real  theta)
private

Update the time in the context object for the given value of theta, based on the values of "time" and "deltat" stored in the system which created this context.

Definition at line 1775 of file fem_context.C.

References libMesh::DiffContext::get_deltat_value(), libMesh::DiffContext::get_system_time(), libMesh::Real, and libMesh::DiffContext::set_time().

Referenced by elem_edge_reinit(), elem_reinit(), elem_side_reinit(), and nonlocal_reinit().

1776 {
1777  // Update the "time" variable based on the value of theta. For this
1778  // to work, we need to know the value of deltat, a pointer to which is now
1779  // stored by our parent DiffContext class. Note: get_deltat_value() will
1780  // assert in debug mode if the requested pointer is NULL.
1781  const Real deltat = this->get_deltat_value();
1782 
1783  this->set_time(theta*(this->get_system_time() + deltat) + (1.-theta)*this->get_system_time());
1784 }
void set_time(Real time_in)
Definition: diff_context.h:410
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real get_system_time() const
Definition: diff_context.h:398
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
Definition: diff_context.h:558
ImplicitSystem & sys
unsigned int n_vars() const
Definition: system.h:2075
AlgebraicType libMesh::FEMContext::algebraic_type ( ) const
inline

Definition at line 885 of file fem_context.h.

References _atype.

Referenced by build_new_fe(), and pre_fe_reinit().

885 { return _atype; }
AlgebraicType _atype
Definition: fem_context.h:922
template<typename OutputShape >
template UniquePtr< FEGenericBase< RealGradient > > libMesh::FEMContext::build_new_fe ( const FEGenericBase< OutputShape > *  fe,
const Point p,
const Real  tolerance = TOLERANCE 
) const
protected

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

Definition at line 1790 of file fem_context.C.

References algebraic_type(), libMesh::FEGenericBase< OutputType >::build(), libMesh::Elem::dim(), libMesh::FEType::family, get_elem(), libMesh::FEAbstract::get_fe_type(), has_elem(), libMesh::Elem::infinite(), libMesh::FEInterface::inverse_map(), libMesh::Elem::JUST_COARSENED, libMesh::Elem::JUST_REFINED, libMesh::libmesh_assert(), libmesh_nullptr, OLD, libMesh::FEType::order, libMesh::Elem::p_refinement_flag(), libMesh::Real, libMesh::FEAbstract::reinit(), and libMesh::SCALAR.

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

1793 {
1794  FEType fe_type = fe->get_fe_type();
1795 
1796  // If we don't have an Elem to evaluate on, then the only functions
1797  // we can sensibly evaluate are the scalar dofs which are the same
1798  // everywhere.
1799  libmesh_assert(this->has_elem() || fe_type.family == SCALAR);
1800 
1801 #ifdef LIBMESH_ENABLE_AMR
1802  if ((algebraic_type() == OLD) &&
1803  this->has_elem())
1804  {
1805  if (this->get_elem().p_refinement_flag() == Elem::JUST_REFINED)
1806  fe_type.order = static_cast<Order>(fe_type.order - 1);
1807  else if (this->get_elem().p_refinement_flag() == Elem::JUST_COARSENED)
1808  fe_type.order = static_cast<Order>(fe_type.order + 1);
1809  }
1810 #endif // LIBMESH_ENABLE_AMR
1811 
1812  const unsigned int elem_dim = this->has_elem() ? this->get_elem().dim() : 0;
1813 
1814  FEGenericBase<OutputShape>* fe_new =
1815 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1816  (this->has_elem() && this->get_elem().infinite()) ?
1817  FEGenericBase<OutputShape>::build_InfFE(elem_dim, fe_type).release() :
1818 #endif
1819  FEGenericBase<OutputShape>::build(elem_dim, fe_type).release();
1820 
1821  // Map the physical co-ordinates to the master co-ordinates using the inverse_map from fe_interface.h
1822  // Build a vector of point co-ordinates to send to reinit
1823  Point master_point = this->has_elem() ?
1824  FEInterface::inverse_map (elem_dim,
1825  fe_type,
1826  &this->get_elem(),
1827  p,
1828  tolerance) : Point(0);
1829 
1830  std::vector<Point> coor(1, master_point);
1831 
1832  // Reinitialize the element and compute the shape function values at coor
1833  if(this->has_elem())
1834  fe_new->reinit (&this->get_elem(), &coor);
1835  else
1836  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1837  fe_new->reinit (libmesh_nullptr, &coor);
1838 
1839  return UniquePtr<FEGenericBase<OutputShape> >(fe_new);
1840 }
bool has_elem() const
Definition: fem_context.h:798
const class libmesh_nullptr_t libmesh_nullptr
const Elem & get_elem() const
Definition: fem_context.h:804
libmesh_assert(j)
virtual bool infinite() const =0
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:556
RefinementState p_refinement_flag() const
Definition: elem.h:2236
static UniquePtr< FEGenericBase > build_InfFE(const unsigned int dim, const FEType &type)
AlgebraicType algebraic_type() const
Definition: fem_context.h:885
virtual unsigned int dim() const =0
static UniquePtr< FEGenericBase > build(const unsigned int dim, const FEType &type)
void libMesh::FEMContext::edge_fe_reinit ( )
virtual

Reinitializes edge FE objects on the current geometric element

Definition at line 1404 of file fem_context.C.

References _edge_fe, get_edge(), get_elem(), and get_elem_dim().

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

1405 {
1406  libmesh_assert_equal_to (this->get_elem_dim(), 3);
1407 
1408  // Initialize all the interior FE objects on elem/edge.
1409  // Logging of FE::reinit is done in the FE functions
1410  std::map<FEType, FEAbstract *>::iterator local_fe_end = _edge_fe.end();
1411  for (std::map<FEType, FEAbstract *>::iterator i = _edge_fe.begin();
1412  i != local_fe_end; ++i)
1413  {
1414  i->second->edge_reinit(&(this->get_elem()), this->get_edge());
1415  }
1416 }
const Elem & get_elem() const
Definition: fem_context.h:804
std::map< FEType, FEAbstract * > _edge_fe
Definition: fem_context.h:1016
unsigned char get_edge() const
Definition: fem_context.h:824
unsigned char get_elem_dim() const
Definition: fem_context.h:839
const std::set<unsigned char>& libMesh::FEMContext::elem_dimensions ( ) const
inline
void libMesh::FEMContext::elem_edge_reinit ( Real  theta)
virtual

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

References _mesh_sys, _update_time_from_system(), edge_fe_reinit(), and elem_position_set().

Referenced by get_side_fe().

1337 {
1338  // Update the "time" variable of this context object
1339  this->_update_time_from_system(theta);
1340 
1341  // Handle a moving element if necessary
1342  if (_mesh_sys)
1343  {
1344  // FIXME - not threadsafe yet!
1345  elem_position_set(theta);
1346  edge_fe_reinit();
1347  }
1348 }
void elem_position_set(Real theta)
Definition: fem_context.h:1106
void _update_time_from_system(Real theta)
Definition: fem_context.C:1775
virtual void edge_fe_reinit()
Definition: fem_context.C:1404
void libMesh::FEMContext::elem_fe_reinit ( const std::vector< Point > *const  pts = libmesh_nullptr)
virtual

Reinitializes interior FE objects on the current geometric element

Definition at line 1361 of file fem_context.C.

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

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

1362 {
1363  // Initialize all the interior FE objects on elem.
1364  // Logging of FE::reinit is done in the FE functions
1365  // We only reinit the FE objects for the current element
1366  // dimension
1367  const unsigned char dim = this->get_elem_dim();
1368 
1369  libmesh_assert( !_element_fe[dim].empty() );
1370 
1371  std::map<FEType, FEAbstract *>::iterator local_fe_end = _element_fe[dim].end();
1372  for (std::map<FEType, FEAbstract *>::iterator i = _element_fe[dim].begin();
1373  i != local_fe_end; ++i)
1374  {
1375  if(this->has_elem())
1376  i->second->reinit(&(this->get_elem()), pts);
1377  else
1378  // If !this->has_elem(), then we assume we are dealing with a SCALAR variable
1379  i->second->reinit(libmesh_nullptr);
1380  }
1381 }
bool has_elem() const
Definition: fem_context.h:798
const class libmesh_nullptr_t libmesh_nullptr
const Elem & get_elem() const
Definition: fem_context.h:804
libmesh_assert(j)
std::vector< std::map< FEType, FEAbstract * > > _element_fe
Definition: fem_context.h:1014
unsigned char get_elem_dim() const
Definition: fem_context.h:839
void libMesh::FEMContext::elem_position_get ( )

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

Definition at line 1420 of file fem_context.C.

References _mesh_sys, libMesh::Elem::default_order(), get_elem(), get_elem_dim(), libMesh::DiffContext::get_elem_solution(), get_element_fe(), get_mesh_x_var(), get_mesh_y_var(), 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 elem_dimensions(), and libMesh::FEMSystem::mesh_position_get().

1421 {
1422  // This is too expensive to call unless we've been asked to move the mesh
1424 
1425  // This will probably break with threading when two contexts are
1426  // operating on elements which share a node
1427  libmesh_assert_equal_to (libMesh::n_threads(), 1);
1428 
1429  // If the coordinate data is in our own system, it's already
1430  // been set up for us
1431  // if (_mesh_sys == this->number())
1432  // {
1433  unsigned int n_nodes = this->get_elem().n_nodes();
1434 
1435 #ifndef NDEBUG
1436  const unsigned char dim = this->get_elem_dim();
1437 
1438  // For simplicity we demand that mesh coordinates be stored
1439  // in a format that allows a direct copy
1441  (this->get_element_fe(this->get_mesh_x_var(), dim)->get_fe_type().family
1442  == LAGRANGE &&
1443  this->get_element_fe(this->get_mesh_x_var(), dim)->get_fe_type().order.get_order()
1444  == this->get_elem().default_order()));
1446  (this->get_element_fe(this->get_mesh_y_var(), dim)->get_fe_type().family
1447  == LAGRANGE &&
1448  this->get_element_fe(this->get_mesh_y_var(), dim)->get_fe_type().order.get_order()
1449  == this->get_elem().default_order()));
1451  (this->get_element_fe(this->get_mesh_z_var(), dim)->get_fe_type().family
1452  == LAGRANGE &&
1453  this->get_element_fe(this->get_mesh_z_var(), dim)->get_fe_type().order.get_order()
1454  == this->get_elem().default_order()));
1455 #endif
1456 
1457  // Get degree of freedom coefficients from point coordinates
1458  if (this->get_mesh_x_var() != libMesh::invalid_uint)
1459  for (unsigned int i=0; i != n_nodes; ++i)
1460  (this->get_elem_solution(this->get_mesh_x_var()))(i) = this->get_elem().point(i)(0);
1461 
1462  if (this->get_mesh_y_var() != libMesh::invalid_uint)
1463  for (unsigned int i=0; i != n_nodes; ++i)
1464  (this->get_elem_solution(this->get_mesh_y_var()))(i) = this->get_elem().point(i)(1);
1465 
1466  if (this->get_mesh_z_var() != libMesh::invalid_uint)
1467  for (unsigned int i=0; i != n_nodes; ++i)
1468  (this->get_elem_solution(this->get_mesh_z_var()))(i) = this->get_elem().point(i)(2);
1469  // }
1470  // FIXME - If the coordinate data is not in our own system, someone
1471  // had better get around to implementing that... - RHS
1472  // else
1473  // {
1474  // libmesh_not_implemented();
1475  // }
1476 }
unsigned int n_threads()
Definition: libmesh_base.h:125
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:110
const unsigned int invalid_uint
Definition: libmesh.h:184
unsigned int get_mesh_x_var() const
Definition: fem_context.h:756
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:235
const Elem & get_elem() const
Definition: fem_context.h:804
libmesh_assert(j)
virtual unsigned int n_nodes() const =0
const dof_id_type n_nodes
Definition: tecplot_io.C:67
virtual Order default_order() const =0
const Point & point(const unsigned int i) const
Definition: elem.h:1595
unsigned int get_mesh_z_var() const
Definition: fem_context.h:784
unsigned char get_elem_dim() const
Definition: fem_context.h:839
unsigned int get_mesh_y_var() const
Definition: fem_context.h:770
void libMesh::FEMContext::elem_position_set ( Real  theta)
inline

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

References _do_elem_position_set(), and _mesh_sys.

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

1107 {
1108  if (_mesh_sys)
1109  this->_do_elem_position_set(theta);
1110 }
void _do_elem_position_set(Real theta)
Definition: fem_context.C:1485
void libMesh::FEMContext::elem_reinit ( Real  theta)
virtual

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

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

Referenced by get_side_fe().

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

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

References _mesh_sys, _update_time_from_system(), elem_position_set(), and side_fe_reinit().

Referenced by get_side_fe().

1322 {
1323  // Update the "time" variable of this context object
1324  this->_update_time_from_system(theta);
1325 
1326  // Handle a moving element if necessary
1327  if (_mesh_sys)
1328  {
1329  // FIXME - not threadsafe yet!
1330  elem_position_set(theta);
1331  side_fe_reinit();
1332  }
1333 }
void elem_position_set(Real theta)
Definition: fem_context.h:1106
virtual void side_fe_reinit()
Definition: fem_context.C:1384
void _update_time_from_system(Real theta)
Definition: fem_context.C:1775
Gradient libMesh::FEMContext::fixed_interior_gradient ( unsigned int  var,
unsigned int  qp 
) const

Returns the gradient of the fixed_solution variable var at the quadrature point qp on the current element interior. This API currently present for backward compatibility.

Definition at line 973 of file fem_context.C.

Referenced by get_side_fe().

974 {
975  Gradient du;
976 
977  this->fixed_interior_gradient( var, qp, du );
978 
979  return du;
980 }
NumberVectorValue Gradient
Gradient fixed_interior_gradient(unsigned int var, unsigned int qp) const
Definition: fem_context.C:973
template<typename OutputType >
void libMesh::FEMContext::fixed_interior_gradient ( unsigned int  var,
unsigned int  qp,
OutputType &  grad_u 
) const

Returns the gradient of the fixed_solution variable var at the quadrature point qp on the current element interior. This is the preferred API.

Definition at line 984 of file fem_context.C.

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

986 {
987  this->some_gradient
988  <OutputType,
990  <typename TensorTools::MakeReal
991  <typename TensorTools::DecrementRank
992  <OutputType>::type>::type>,
994  (var, qp, du);
995 }
const DenseVector< Number > & get_elem_fixed_solution() const
Definition: diff_context.h:214
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:235
void some_gradient(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:234
Tensor libMesh::FEMContext::fixed_interior_hessian ( unsigned int  var,
unsigned int  qp 
) const

Returns the hessian of the fixed_solution variable var at the quadrature point qp on the current element interior. This API currently present for backward compatibility.

Definition at line 1000 of file fem_context.C.

Referenced by get_side_fe().

1001 {
1002  Tensor d2u;
1003 
1004  this->fixed_interior_hessian( var, qp, d2u );
1005 
1006  return d2u;
1007 }
NumberTensorValue Tensor
Tensor fixed_interior_hessian(unsigned int var, unsigned int qp) const
Definition: fem_context.C:1000
template<typename OutputType >
void libMesh::FEMContext::fixed_interior_hessian ( unsigned int  var,
unsigned int  qp,
OutputType &  hess_u 
) const

Returns the hessian of the fixed_solution variable var at the quadrature point qp on the current element interior. This is the preferred API.

Definition at line 1011 of file fem_context.C.

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

1013 {
1014  this->some_hessian<OutputType,
1016  <typename TensorTools::MakeReal
1017  <typename TensorTools::DecrementRank
1018  <typename TensorTools::DecrementRank
1019  <OutputType>::type>::type>::type>,
1020  &DiffContext::get_elem_fixed_solution>(var, qp, d2u);
1021 }
const DenseVector< Number > & get_elem_fixed_solution() const
Definition: diff_context.h:214
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:235
void some_hessian(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:267
Number libMesh::FEMContext::fixed_interior_value ( unsigned int  var,
unsigned int  qp 
) const

Returns the value of the fixed_solution variable var at the quadrature point qp on the current element interior. This API currently present for backward compatibility.

Definition at line 950 of file fem_context.C.

Referenced by get_side_fe().

951 {
952  Number u = 0.;
953 
954  this->fixed_interior_value( var, qp, u );
955 
956  return u;
957 }
Number fixed_interior_value(unsigned int var, unsigned int qp) const
Definition: fem_context.C:950
template<typename OutputType >
void libMesh::FEMContext::fixed_interior_value ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const

Returns the value of the fixed_solution variable var at the quadrature point qp on the current element interior. This is the preferred API.

Definition at line 962 of file fem_context.C.

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

964 {
965  this->some_value<OutputType,
969 }
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:205
const DenseVector< Number > & get_elem_fixed_solution() const
Definition: diff_context.h:214
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:235
Gradient libMesh::FEMContext::fixed_point_gradient ( unsigned int  var,
const Point p 
) const

Returns the gradient of the fixed_solution variable var at the physical point p on the current element. This API currently present for backward compatibility.

Definition at line 1146 of file fem_context.C.

Referenced by get_side_fe().

1147 {
1148  Gradient grad_u;
1149 
1150  this->fixed_point_gradient( var, p, grad_u );
1151 
1152  return grad_u;
1153 }
Gradient fixed_point_gradient(unsigned int var, const Point &p) const
Definition: fem_context.C:1146
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

Returns the gradient of the fixed_solution variable var at the physical point p on the current element. This is the preferred API.

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

Definition at line 1158 of file fem_context.C.

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

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

Returns the hessian of the fixed_solution variable var at the physical point p on the current element. This API currently present for backward compatibility.

Definition at line 1197 of file fem_context.C.

Referenced by get_side_fe().

1198 {
1199  Tensor hess_u;
1200 
1201  this->fixed_point_hessian( var, p, hess_u );
1202 
1203  return hess_u;
1204 }
Tensor fixed_point_hessian(unsigned int var, const Point &p) const
Definition: fem_context.C:1197
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

Returns the hessian of the fixed_solution variable var at the physical point p on the current element. This is the preferred API.

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

Definition at line 1209 of file fem_context.C.

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

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

Returns the value of the fixed_solution variable var at the physical point p on the current element. This API currently present for backward compatibility.

Definition at line 1100 of file fem_context.C.

Referenced by get_side_fe().

1101 {
1102  Number u = 0.;
1103 
1104  this->fixed_point_value( var, p, u );
1105 
1106  return u;
1107 }
Number fixed_point_value(unsigned int var, const Point &p) const
Definition: fem_context.C:1100
template<typename OutputType >
void libMesh::FEMContext::fixed_point_value ( unsigned int  var,
const Point p,
OutputType &  u,
const Real  tolerance = TOLERANCE 
) const

Returns the value of the fixed_solution variable var at the physical point p on the current element. This is the preferred API.

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

Definition at line 1110 of file fem_context.C.

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

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

Returns the gradient of the fixed_solution variable var at the quadrature point qp on the current element side. This API currently present for backward compatibility.

Definition at line 1050 of file fem_context.C.

Referenced by get_side_fe().

1051 {
1052  Gradient du;
1053 
1054  this->fixed_side_gradient( var, qp, du );
1055 
1056  return du;
1057 }
NumberVectorValue Gradient
Gradient fixed_side_gradient(unsigned int var, unsigned int qp) const
Definition: fem_context.C:1050
template<typename OutputType >
void libMesh::FEMContext::fixed_side_gradient ( unsigned int  var,
unsigned int  qp,
OutputType &  grad_u 
) const

Returns the gradient of the fixed_solution variable var at the quadrature point qp on the current element side. This is the preferred API.

Definition at line 1061 of file fem_context.C.

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

1063 {
1064  this->some_gradient<OutputType,
1066  <typename TensorTools::MakeReal
1067  <typename TensorTools::DecrementRank
1068  <OutputType>::type>::type>,
1069  &DiffContext::get_elem_fixed_solution>(var, qp, du);
1070 }
const DenseVector< Number > & get_elem_fixed_solution() const
Definition: diff_context.h:214
void some_gradient(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:234
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:272
Tensor libMesh::FEMContext::fixed_side_hessian ( unsigned int  var,
unsigned int  qp 
) const

Returns the hessian of the fixed_solution variable var at the quadrature point qp on the current element side. This API currently present for backward compatibility.

Definition at line 1075 of file fem_context.C.

Referenced by get_side_fe().

1076 {
1077  Tensor d2u;
1078 
1079  this->fixed_side_hessian( var, qp, d2u );
1080 
1081  return d2u;
1082 }
Tensor fixed_side_hessian(unsigned int var, unsigned int qp) const
Definition: fem_context.C:1075
NumberTensorValue Tensor
template<typename OutputType >
void libMesh::FEMContext::fixed_side_hessian ( unsigned int  var,
unsigned int  qp,
OutputType &  hess_u 
) const

Returns the hessian of the fixed_solution variable var at the quadrature point qp on the current element side. This is the preferred API.

Definition at line 1085 of file fem_context.C.

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

1087 {
1088  this->some_hessian<OutputType,
1090  <typename TensorTools::MakeReal
1091  <typename TensorTools::DecrementRank
1092  <typename TensorTools::DecrementRank
1093  <OutputType>::type>::type>::type>,
1094  &DiffContext::get_elem_fixed_solution>(var, qp, d2u);
1095 }
const DenseVector< Number > & get_elem_fixed_solution() const
Definition: diff_context.h:214
void some_hessian(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:267
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:272
Number libMesh::FEMContext::fixed_side_value ( unsigned int  var,
unsigned int  qp 
) const

Returns the value of the fixed_solution variable var at the quadrature point qp on the current element side. This API currently present for backward compatibility.

Definition at line 1026 of file fem_context.C.

Referenced by get_side_fe().

1027 {
1028  Number u = 0.;
1029 
1030  this->fixed_side_value( var, qp, u );
1031 
1032  return u;
1033 }
Number fixed_side_value(unsigned int var, unsigned int qp) const
Definition: fem_context.C:1026
template<typename OutputType >
void libMesh::FEMContext::fixed_side_value ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const

Returns the value of the fixed_solution variable var at the quadrature point qp on the current element side. This is the preferred API.

Definition at line 1037 of file fem_context.C.

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

1039 {
1040  this->some_value
1041  <OutputType,
1045  (var, qp, u);
1046 }
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:205
const DenseVector< Number > & get_elem_fixed_solution() const
Definition: diff_context.h:214
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:272
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 _update_time_from_system().

147 {
149 
150  return *_deltat;
151 }
libmesh_assert(j)
unsigned char libMesh::FEMContext::get_dim ( ) const
inline

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

References _dim.

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

833  { return this->_dim; }
unsigned char _dim
Definition: fem_context.h:1043
std::vector<dof_id_type>& libMesh::DiffContext::get_dof_indices ( )
inlineinherited

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
Definition: diff_context.h:620
const std::vector<dof_id_type>& libMesh::DiffContext::get_dof_indices ( unsigned int  var) const
inlineinherited

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

Definition at line 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)
inlineinherited

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
inline

Accessor for current edge of Elem object

Definition at line 824 of file fem_context.h.

References edge.

Referenced by edge_fe_reinit().

825  { return edge; }
unsigned char edge
Definition: fem_context.h:915
template<typename OutputShape >
void libMesh::FEMContext::get_edge_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe 
) const
inline

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

Definition at line 1150 of file fem_context.h.

References _edge_fe_var.

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

1151 {
1152  libmesh_assert_less ( var, _edge_fe_var.size() );
1153  fe = cast_ptr<FEGenericBase<OutputShape> *>( _edge_fe_var[var] );
1154 }
std::vector< FEAbstract * > _edge_fe_var
Definition: fem_context.h:1027
FEBase * libMesh::FEMContext::get_edge_fe ( unsigned int  var) const
inline

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

Definition at line 1157 of file fem_context.h.

References _edge_fe_var.

1158 {
1159  libmesh_assert_less ( var, _edge_fe_var.size() );
1160  return cast_ptr<FEBase *>( _edge_fe_var[var] );
1161 }
std::vector< FEAbstract * > _edge_fe_var
Definition: fem_context.h:1027
const QBase& libMesh::FEMContext::get_edge_qrule ( ) const
inline

Accessor for element edge quadrature rule.

Definition at line 727 of file fem_context.h.

References _edge_qrule.

728  { return *(this->_edge_qrule); }
UniquePtr< QBase > _edge_qrule
Definition: fem_context.h:1079
Elem& libMesh::FEMContext::get_elem ( )
inline

Accessor for current Elem object

Definition at line 811 of file fem_context.h.

References _elem, and libMesh::libmesh_assert().

812  { libmesh_assert(this->_elem);
813  return *(const_cast<Elem *>(this->_elem)); }
libmesh_assert(j)
const Elem * _elem
Definition: fem_context.h:1038
DenseVector<Number>& libMesh::DiffContext::get_elem_fixed_solution ( )
inlineinherited

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
Definition: diff_context.h:586
const DenseSubVector<Number>& libMesh::DiffContext::get_elem_fixed_solution ( unsigned int  var) const
inlineinherited

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

Definition at line 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)
inlineinherited

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
DenseMatrix<Number>& libMesh::DiffContext::get_elem_jacobian ( )
inlineinherited

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
Definition: diff_context.h:598
const DenseSubMatrix<Number>& libMesh::DiffContext::get_elem_jacobian ( unsigned int  var1,
unsigned int  var2 
) const
inlineinherited

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

Definition at line 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 
)
inlineinherited

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 DenseVector<Number>& libMesh::DiffContext::get_elem_residual ( ) const
inlineinherited
DenseVector<Number>& libMesh::DiffContext::get_elem_residual ( )
inlineinherited

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
Definition: diff_context.h:592
const DenseSubVector<Number>& libMesh::DiffContext::get_elem_residual ( unsigned int  var) const
inlineinherited

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

Definition at line 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
Definition: diff_context.h:614
libmesh_assert(j)
DenseSubVector<Number>& libMesh::DiffContext::get_elem_residual ( unsigned int  var)
inlineinherited

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

Definition at line 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
Definition: diff_context.h:614
libmesh_assert(j)
DenseVector<Number>& libMesh::DiffContext::get_elem_solution ( )
inlineinherited

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
Definition: diff_context.h:564
const DenseSubVector<Number>& libMesh::DiffContext::get_elem_solution ( unsigned int  var) const
inlineinherited

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

Definition at line 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)
inlineinherited

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
inlineinherited

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(), interior_accel(), pre_fe_reinit(), libMesh::FirstOrderUnsteadySolver::prepare_accel(), and side_accel().

180  { return _elem_solution_accel; }
DenseVector< Number > _elem_solution_accel
Definition: diff_context.h:578
DenseVector<Number>& libMesh::DiffContext::get_elem_solution_accel ( )
inlineinherited

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

Definition at line 186 of file diff_context.h.

References libMesh::DiffContext::_elem_solution_accel.

187  { return _elem_solution_accel; }
DenseVector< Number > _elem_solution_accel
Definition: diff_context.h:578
const DenseSubVector<Number>& libMesh::DiffContext::get_elem_solution_accel ( unsigned int  var) const
inlineinherited

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

Definition at line 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)
inlineinherited

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
inlineinherited

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

Definition at line 437 of file diff_context.h.

References libMesh::DiffContext::elem_solution_accel_derivative.

Real elem_solution_accel_derivative
Definition: diff_context.h:497
Real libMesh::DiffContext::get_elem_solution_derivative ( ) const
inlineinherited

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

Definition at line 419 of file diff_context.h.

References libMesh::DiffContext::elem_solution_derivative.

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

420  { return elem_solution_derivative; }
const DenseVector<Number>& libMesh::DiffContext::get_elem_solution_rate ( ) const
inlineinherited
DenseVector<Number>& libMesh::DiffContext::get_elem_solution_rate ( )
inlineinherited

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

Definition at line 151 of file diff_context.h.

References libMesh::DiffContext::_elem_solution_rate.

152  { return _elem_solution_rate; }
DenseVector< Number > _elem_solution_rate
Definition: diff_context.h:571
const DenseSubVector<Number>& libMesh::DiffContext::get_elem_solution_rate ( unsigned int  var) const
inlineinherited

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

Definition at line 158 of file diff_context.h.

References libMesh::DiffContext::_elem_subsolution_rates, 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)
inlineinherited

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
inlineinherited

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

Definition at line 428 of file diff_context.h.

References libMesh::DiffContext::elem_solution_rate_derivative.

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

Real elem_solution_rate_derivative
Definition: diff_context.h:490
template<typename OutputShape >
void libMesh::FEMContext::get_element_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe 
) const
inline

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

References get_dim().

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

236  { this->get_element_fe<OutputShape>(var,fe,this->get_dim()); }
unsigned char get_dim() const
Definition: fem_context.h:832
FEBase* libMesh::FEMContext::get_element_fe ( unsigned int  var) const
inline

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

References get_dim(), and get_element_fe().

247  { return this->get_element_fe(var,this->get_dim()); }
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:235
unsigned char get_dim() const
Definition: fem_context.h:832
template<typename OutputShape >
void libMesh::FEMContext::get_element_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe,
unsigned char  dim 
) const
inline

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

Definition at line 1114 of file fem_context.h.

References _element_fe_var, and libMesh::libmesh_assert().

1116 {
1117  libmesh_assert( !_element_fe_var[dim].empty() );
1118  libmesh_assert_less ( var, (_element_fe_var[dim].size() ) );
1119  fe = cast_ptr<FEGenericBase<OutputShape> *>( (_element_fe_var[dim][var] ) );
1120 }
libmesh_assert(j)
std::vector< std::vector< FEAbstract * > > _element_fe_var
Definition: fem_context.h:1025
FEBase * libMesh::FEMContext::get_element_fe ( unsigned int  var,
unsigned char  dim 
) const
inline

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

Definition at line 1123 of file fem_context.h.

References _element_fe_var, and libMesh::libmesh_assert().

1124 {
1125  libmesh_assert( !_element_fe_var[dim].empty() );
1126  libmesh_assert_less ( var, (_element_fe_var[dim].size() ) );
1127  return cast_ptr<FEBase *>( (_element_fe_var[dim][var] ) );
1128 }
libmesh_assert(j)
std::vector< std::vector< FEAbstract * > > _element_fe_var
Definition: fem_context.h:1025
const QBase& libMesh::FEMContext::get_element_qrule ( ) const
inline

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

Definition at line 698 of file fem_context.h.

References get_elem_dim().

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

699  { return this->get_element_qrule(this->get_elem_dim()); }
const QBase & get_element_qrule() const
Definition: fem_context.h:698
unsigned char get_elem_dim() const
Definition: fem_context.h:839
const QBase& libMesh::FEMContext::get_element_qrule ( unsigned char  dim) const
inline

Accessor for element interior quadrature rule.

Definition at line 711 of file fem_context.h.

References _element_qrule, and libMesh::libmesh_assert().

713  return *(this->_element_qrule[dim]); }
libmesh_assert(j)
std::vector< QBase * > _element_qrule
Definition: fem_context.h:1062
Real libMesh::DiffContext::get_fixed_solution_derivative ( ) const
inlineinherited

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

Definition at line 446 of file diff_context.h.

References libMesh::DiffContext::fixed_solution_derivative.

447  { return fixed_solution_derivative; }
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 interior_gradients(), interior_hessians(), interior_values(), side_gradients(), side_hessians(), and 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
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
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
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
Definition: diff_context.h:558
libmesh_assert(j)
const System* libMesh::FEMContext::get_mesh_system ( ) const
inline

Accessor for moving mesh System

Definition at line 744 of file fem_context.h.

References _mesh_sys.

745  { return this->_mesh_sys; }
System* libMesh::FEMContext::get_mesh_system ( )
inline

Accessor for moving mesh System

Definition at line 750 of file fem_context.h.

References _mesh_sys.

751  { return this->_mesh_sys; }
unsigned int libMesh::FEMContext::get_mesh_x_var ( ) const
inline

Accessor for x-variable of moving mesh System

Definition at line 756 of file fem_context.h.

References _mesh_x_var.

Referenced by _do_elem_position_set(), and elem_position_get().

757  { return _mesh_x_var; }
unsigned int _mesh_x_var
Definition: fem_context.h:905
unsigned int libMesh::FEMContext::get_mesh_y_var ( ) const
inline

Accessor for y-variable of moving mesh System

Definition at line 770 of file fem_context.h.

References _mesh_y_var.

Referenced by _do_elem_position_set(), and elem_position_get().

771  { return _mesh_y_var; }
unsigned int _mesh_y_var
Definition: fem_context.h:905
unsigned int libMesh::FEMContext::get_mesh_z_var ( ) const
inline

Accessor for z-variable of moving mesh System

Definition at line 784 of file fem_context.h.

References _mesh_z_var.

Referenced by _do_elem_position_set(), and elem_position_get().

785  { return _mesh_z_var; }
unsigned int _mesh_z_var
Definition: fem_context.h:905
const std::vector<DenseVector<Number> >& libMesh::DiffContext::get_qoi_derivatives ( ) const
inlineinherited

Const accessor for QoI derivatives.

Definition at line 330 of file diff_context.h.

References libMesh::DiffContext::_elem_qoi_derivative.

Referenced by pre_fe_reinit().

331  { return _elem_qoi_derivative; }
std::vector< DenseVector< Number > > _elem_qoi_derivative
Definition: diff_context.h:608
std::vector<DenseVector<Number> >& libMesh::DiffContext::get_qoi_derivatives ( )
inlineinherited

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
Definition: diff_context.h:608
const DenseSubVector<Number>& libMesh::DiffContext::get_qoi_derivatives ( unsigned int  qoi,
unsigned int  var 
) const
inlineinherited

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

Definition at line 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 
)
inlineinherited

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
inlineinherited

Const accessor for QoI vector.

Definition at line 318 of file diff_context.h.

References libMesh::DiffContext::_elem_qoi.

319  { return _elem_qoi; }
std::vector< Number > _elem_qoi
Definition: diff_context.h:603
std::vector<Number>& libMesh::DiffContext::get_qois ( )
inlineinherited

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
Definition: diff_context.h:603
unsigned char libMesh::FEMContext::get_side ( ) const
inline

Accessor for current side of Elem object

Definition at line 818 of file fem_context.h.

References side.

Referenced by side_fe_reinit().

819  { return side; }
unsigned char side
Definition: fem_context.h:910
template<typename OutputShape >
void libMesh::FEMContext::get_side_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe 
) const
inline

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

References get_dim().

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

273  { this->get_side_fe<OutputShape>(var,fe,this->get_dim()); }
unsigned char get_dim() const
Definition: fem_context.h:832
FEBase* libMesh::FEMContext::get_side_fe ( unsigned int  var) const
inline

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

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

284  { return this->get_side_fe(var,this->get_dim()); }
unsigned char get_dim() const
Definition: fem_context.h:832
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:272
template<typename OutputShape >
void libMesh::FEMContext::get_side_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe,
unsigned char  dim 
) const
inline

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

Definition at line 1132 of file fem_context.h.

References _side_fe_var, and libMesh::libmesh_assert().

1134 {
1135  libmesh_assert( !_side_fe_var[dim].empty() );
1136  libmesh_assert_less ( var, (_side_fe_var[dim].size() ) );
1137  fe = cast_ptr<FEGenericBase<OutputShape> *>( (_side_fe_var[dim][var] ) );
1138 }
libmesh_assert(j)
std::vector< std::vector< FEAbstract * > > _side_fe_var
Definition: fem_context.h:1026
FEBase * libMesh::FEMContext::get_side_fe ( unsigned int  var,
unsigned char  dim 
) const
inline

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

Definition at line 1141 of file fem_context.h.

References _side_fe_var, and libMesh::libmesh_assert().

1142 {
1143  libmesh_assert( !_side_fe_var[dim].empty() );
1144  libmesh_assert_less ( var, (_side_fe_var[dim].size() ) );
1145  return cast_ptr<FEBase *>( (_side_fe_var[dim][var] ) );
1146 }
libmesh_assert(j)
std::vector< std::vector< FEAbstract * > > _side_fe_var
Definition: fem_context.h:1026
const QBase& libMesh::FEMContext::get_side_qrule ( ) const
inline

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

Definition at line 705 of file fem_context.h.

References get_elem_dim().

706  { return this->get_side_qrule(this->get_elem_dim()); }
const QBase & get_side_qrule() const
Definition: fem_context.h:705
unsigned char get_elem_dim() const
Definition: fem_context.h:839
const QBase& libMesh::FEMContext::get_side_qrule ( unsigned char  dim) const
inline

Accessor for element side quadrature rule.

Definition at line 718 of file fem_context.h.

References _side_qrule, and libMesh::libmesh_assert().

719  {
721  return *(this->_side_qrule[dim]);
722  }
std::vector< QBase * > _side_qrule
Definition: fem_context.h:1070
libmesh_assert(j)
const System& libMesh::DiffContext::get_system ( ) const
inlineinherited

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

105  { return _system; }
const System & _system
Definition: diff_context.h:641
Real libMesh::DiffContext::get_system_time ( ) const
inlineinherited

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

399  { return system_time; }
const Real system_time
Definition: diff_context.h:477
Real libMesh::DiffContext::get_time ( ) const
inlineinherited

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; }
bool libMesh::FEMContext::has_elem ( ) const
inline

Test for current Elem object

Definition at line 798 of file fem_context.h.

References _elem, and libmesh_nullptr.

Referenced by build_new_fe(), elem_fe_reinit(), and pre_fe_reinit().

799  { return (this->_elem != libmesh_nullptr); }
const class libmesh_nullptr_t libmesh_nullptr
const Elem * _elem
Definition: fem_context.h:1038
bool libMesh::FEMContext::has_side_boundary_id ( boundary_id_type  id) const

Reports if the boundary id is found on the current side

Definition at line 182 of file fem_context.C.

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

183 {
184  return _boundary_info.has_boundary_id(&(this->get_elem()), side, id);
185 }
const Elem & get_elem() const
Definition: fem_context.h:804
const BoundaryInfo & _boundary_info
Definition: fem_context.h:1033
unsigned char side
Definition: fem_context.h:910
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

Returns the second time derivative (acceleration) of the solution variable var at the quadrature point qp on the current element interior.

Definition at line 1274 of file fem_context.C.

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

Referenced by get_side_fe().

1276 {
1277  this->some_value<OutputType,
1281 }
const DenseVector< Number > & get_elem_solution_accel() const
Definition: diff_context.h:179
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:205
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:235
template<typename OutputType >
template void libMesh::FEMContext::interior_curl< Gradient > ( unsigned int  var,
unsigned int  qp,
OutputType &  curl_u 
) const

Returns the curl of the solution variable var at the physical point p on the current element.

Definition at line 485 of file fem_context.C.

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

Referenced by get_side_fe().

487 {
488  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
489 
490  // Get local-to-global dof index lookup
491  const unsigned int n_dofs = cast_int<unsigned int>
492  (this->get_dof_indices(var).size());
493 
494  // Get current local coefficients
495  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
496  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
497 
498  // Get finite element object
499  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
500  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
501 
502  // Get shape function values at quadrature point
503  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputShape> > & curl_phi = fe->get_curl_phi();
504 
505  // Accumulate solution curl
506  curl_u = 0.;
507 
508  for (unsigned int l=0; l != n_dofs; l++)
509  curl_u.add_scaled(curl_phi[l][qp], coef(l));
510 
511  return;
512 }
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:110
const std::vector< dof_id_type > & get_dof_indices() const
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:839
template<typename OutputType >
template void libMesh::FEMContext::interior_div< Number > ( unsigned int  var,
unsigned int  qp,
OutputType &  div_u 
) const

Returns the divergence of the solution variable var at the physical point p on the current element.

Definition at line 516 of file fem_context.C.

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

Referenced by get_side_fe().

518 {
519  typedef typename
520  TensorTools::IncrementRank
521  <typename TensorTools::MakeReal<OutputType>::type>::type OutputShape;
522 
523  // Get local-to-global dof index lookup
524  const unsigned int n_dofs = cast_int<unsigned int>
525  (this->get_dof_indices(var).size());
526 
527  // Get current local coefficients
528  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
529  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
530 
531  // Get finite element object
532  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
533  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
534 
535  // Get shape function values at quadrature point
536  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputDivergence> > & div_phi = fe->get_div_phi();
537 
538  // Accumulate solution curl
539  div_u = 0.;
540 
541  for (unsigned int l=0; l != n_dofs; l++)
542  div_u += div_phi[l][qp] * coef(l);
543 
544  return;
545 }
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:110
const std::vector< dof_id_type > & get_dof_indices() const
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:839
Gradient libMesh::FEMContext::interior_gradient ( unsigned int  var,
unsigned int  qp 
) const

Returns the gradient of the solution variable var at the quadrature point qp on the current element interior. This API currently present for backward compatibility.

Definition at line 352 of file fem_context.C.

Referenced by get_side_fe().

354 {
355  Gradient du;
356 
357  this->interior_gradient( var, qp, du );
358 
359  return du;
360 }
NumberVectorValue Gradient
Gradient interior_gradient(unsigned int var, unsigned int qp) const
Definition: fem_context.C:352
template<typename OutputType >
void libMesh::FEMContext::interior_gradient ( unsigned int  var,
unsigned int  qp,
OutputType &  du 
) const

Returns the gradient of the solution variable var at the quadrature point qp on the current element interior. This is the preferred API.

Definition at line 365 of file fem_context.C.

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

368 {
369  this->some_gradient<OutputType,
370  &FEMContext::get_element_fe<typename TensorTools::MakeReal
371  <typename TensorTools::DecrementRank
372  <OutputType>::type>::type>,
373  &DiffContext::get_elem_solution>(var, qp, du);
374 }
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:110
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:235
void some_gradient(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:234
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

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

Definition at line 379 of file fem_context.C.

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

Referenced by get_side_fe().

382 {
383  typedef typename TensorTools::MakeReal
385  OutputShape;
386 
387  // Get local-to-global dof index lookup
388  const unsigned int n_dofs = cast_int<unsigned int>
389  (this->get_dof_indices(var).size());
390 
391  // Get current local coefficients
392  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
393 
394  // Get finite element object
395  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
396  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
397 
398  // Get shape function values at quadrature point
399  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient> > & dphi = fe->get_dphi();
400 
401  // Loop over all the q_points in this finite element
402  for (std::size_t qp=0; qp != du_vals.size(); qp++)
403  {
404  OutputType & du = du_vals[qp];
405 
406  // Compute the gradient at this q_point
407  du = 0;
408 
409  for (unsigned int l=0; l != n_dofs; l++)
410  du.add_scaled(dphi[l][qp], coef(l));
411  }
412 
413  return;
414 }
const std::vector< dof_id_type > & get_dof_indices() const
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)
Definition: diff_context.C:184
unsigned char get_elem_dim() const
Definition: fem_context.h:839
Tensor libMesh::FEMContext::interior_hessian ( unsigned int  var,
unsigned int  qp 
) const

Returns the hessian of the solution variable var at the quadrature point qp on the current element interior. This API currently present for backward compatibility.

Definition at line 417 of file fem_context.C.

Referenced by get_side_fe().

418 {
419  Tensor d2u;
420 
421  this->interior_hessian( var, qp, d2u );
422 
423  return d2u;
424 }
Tensor interior_hessian(unsigned int var, unsigned int qp) const
Definition: fem_context.C:417
NumberTensorValue Tensor
template<typename OutputType >
void libMesh::FEMContext::interior_hessian ( unsigned int  var,
unsigned int  qp,
OutputType &  d2u 
) const

Returns the hessian of the solution variable var at the quadrature point qp on the current element interior. This is the preferred API.

Definition at line 427 of file fem_context.C.

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

429 {
430  this->some_hessian<OutputType,
432  <typename TensorTools::MakeReal
433  <typename TensorTools::DecrementRank
434  <typename TensorTools::DecrementRank
435  <OutputType>::type>::type>::type>,
436  &DiffContext::get_elem_solution>(var, qp, d2u);
437 }
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:110
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:235
void some_hessian(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:267
template<typename OutputType >
template void libMesh::FEMContext::interior_hessians< Tensor > ( 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. This is the preferred API.

Definition at line 441 of file fem_context.C.

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

Referenced by get_side_fe().

444 {
445  typedef typename TensorTools::MakeReal<
446  typename TensorTools::DecrementRank<
447  typename TensorTools::DecrementRank<
448  OutputType>::type>::type>::type
449  OutputShape;
450 
451  // Get local-to-global dof index lookup
452  const unsigned int n_dofs = cast_int<unsigned int>
453  (this->get_dof_indices(var).size());
454 
455  // Get current local coefficients
456  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
457 
458  // Get finite element object
459  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
460  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
461 
462  // Get shape function values at quadrature point
463  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor> > & d2phi = fe->get_d2phi();
464 
465  // Loop over all the q_points in this finite element
466  for (std::size_t qp=0; qp != d2u_vals.size(); qp++)
467  {
468  OutputType & d2u = d2u_vals[qp];
469 
470  // Compute the gradient at this q_point
471  d2u = 0;
472 
473  for (unsigned int l=0; l != n_dofs; l++)
474  d2u.add_scaled(d2phi[l][qp], coef(l));
475  }
476 
477  return;
478 }
const std::vector< dof_id_type > & get_dof_indices() const
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)
Definition: diff_context.C:184
unsigned char get_elem_dim() const
Definition: fem_context.h:839
template<typename OutputType >
template void libMesh::FEMContext::interior_rate< Gradient > ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const

Returns the time derivative (rate) of the solution variable var at the quadrature point qp on the current element interior.

Definition at line 1252 of file fem_context.C.

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

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

1254 {
1255  this->some_value<OutputType,
1259 }
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:205
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:235
const DenseVector< Number > & get_elem_solution_rate() const
Definition: diff_context.h:144
Number libMesh::FEMContext::interior_value ( unsigned int  var,
unsigned int  qp 
) const

Returns the value of the solution variable var at the quadrature point qp on the current element interior. This API currently present for backward compatibility.

Definition at line 297 of file fem_context.C.

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

298 {
299  Number u;
300 
301  this->interior_value( var, qp, u );
302 
303  return u;
304 }
Number interior_value(unsigned int var, unsigned int qp) const
Definition: fem_context.C:297
template<typename OutputType >
void libMesh::FEMContext::interior_value ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const

Returns the value of the solution variable var at the quadrature point qp on the current element interior. This is the preferred API.

Definition at line 307 of file fem_context.C.

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

309 {
310  this->some_value<OutputType,
311  &FEMContext::get_element_fe<typename TensorTools::MakeReal<OutputType>::type>,
312  &DiffContext::get_elem_solution>(var, qp, u);
313 }
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:110
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:205
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

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

Definition at line 317 of file fem_context.C.

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

Referenced by get_side_fe().

320 {
321  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
322 
323  // Get local-to-global dof index lookup
324  const unsigned int n_dofs = cast_int<unsigned int>
325  (this->get_dof_indices(var).size());
326 
327  // Get current local coefficients
328  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
329 
330  // Get the finite element object
331  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
332  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
333 
334  // Get shape function values at quadrature point
335  const std::vector<std::vector<OutputShape> > & phi = fe->get_phi();
336 
337  // Loop over all the q_points on this element
338  for (std::size_t qp=0; qp != u_vals.size(); qp++)
339  {
340  OutputType & u = u_vals[qp];
341 
342  // Compute the value at this q_point
343  u = 0.;
344 
345  for (unsigned int l=0; l != n_dofs; l++)
346  u += phi[l][qp] * coef(l);
347  }
348 
349  return;
350 }
const std::vector< dof_id_type > & get_dof_indices() const
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)
Definition: diff_context.C:184
unsigned char get_elem_dim() const
Definition: fem_context.h:839
bool libMesh::DiffContext::is_adjoint ( ) const
inlineinherited

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& libMesh::DiffContext::is_adjoint ( )
inlineinherited

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; }
unsigned int libMesh::DiffContext::n_vars ( ) const
inlineinherited
void libMesh::FEMContext::nonlocal_reinit ( Real  theta)
virtual

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

References _update_time_from_system(), and elem_fe_reinit().

Referenced by get_side_fe().

1352 {
1353  // Update the "time" variable of this context object
1354  this->_update_time_from_system(theta);
1355 
1356  // We can reuse the Elem FE safely here.
1357  elem_fe_reinit();
1358 }
void _update_time_from_system(Real theta)
Definition: fem_context.C:1775
virtual void elem_fe_reinit(const std::vector< Point > *const pts=libmesh_nullptr)
Definition: fem_context.C:1361
template<typename OutputType >
void libMesh::FEMContext::point_accel ( unsigned int  var,
const Point p,
OutputType &  u 
) const

Returns the second time derivative (acceleration) of the solution variable var at the physical point p on the current element.

Referenced by 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

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

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

Referenced by get_side_fe().

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

Returns the gradient of the solution variable var at the physical point p on the current element. This API currently present for backward compatibility.

Definition at line 809 of file fem_context.C.

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

810 {
811  Gradient grad_u;
812 
813  this->point_gradient( var, p, grad_u );
814 
815  return grad_u;
816 }
NumberVectorValue Gradient
Gradient point_gradient(unsigned int var, const Point &p) const
Definition: fem_context.C:809
template<typename OutputType >
void libMesh::FEMContext::point_gradient ( unsigned int  var,
const Point p,
OutputType &  grad_u,
const Real  tolerance = TOLERANCE 
) const

Returns the gradient of the solution variable var at the physical point p on the current element. This is the preferred API.

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

Definition at line 821 of file fem_context.C.

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

825 {
826  typedef typename TensorTools::MakeReal
828  OutputShape;
829 
830  // Get local-to-global dof index lookup
831  const unsigned int n_dofs = cast_int<unsigned int>
832  (this->get_dof_indices(var).size());
833 
834  // Get current local coefficients
835  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
836  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
837 
838  // Get finite element object
839  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
840  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
841 
842  // Build a FE for calculating u(p)
843  UniquePtr<FEGenericBase<OutputShape> > fe_new =
844  this->build_new_fe( fe, p, tolerance );
845 
846  // Get the values of the shape function derivatives
847  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient> > & dphi = fe_new->get_dphi();
848 
849  grad_u = 0.0;
850 
851  for (unsigned int l=0; l != n_dofs; l++)
852  grad_u.add_scaled(dphi[l][0], coef(l));
853 
854  return;
855 }
UniquePtr< FEGenericBase< OutputShape > > build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
Definition: fem_context.C:1790
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:110
const std::vector< dof_id_type > & get_dof_indices() const
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:839
Tensor libMesh::FEMContext::point_hessian ( unsigned int  var,
const Point p 
) const

Returns the hessian of the solution variable var at the physical point p on the current element. This API currently present for backward compatibility.

Definition at line 861 of file fem_context.C.

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

862 {
863  Tensor hess_u;
864 
865  this->point_hessian( var, p, hess_u );
866 
867  return hess_u;
868 }
Tensor point_hessian(unsigned int var, const Point &p) const
Definition: fem_context.C:861
NumberTensorValue Tensor
template<typename OutputType >
void libMesh::FEMContext::point_hessian ( unsigned int  var,
const Point p,
OutputType &  hess_u,
const Real  tolerance = TOLERANCE 
) const

Returns the hessian of the solution variable var at the physical point p on the current element. This is the preferred API.

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

Definition at line 872 of file fem_context.C.

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

876 {
877  typedef typename TensorTools::MakeReal<
878  typename TensorTools::DecrementRank<
879  typename TensorTools::DecrementRank<
880  OutputType>::type>::type>::type
881  OutputShape;
882 
883  // Get local-to-global dof index lookup
884  const unsigned int n_dofs = cast_int<unsigned int>
885  (this->get_dof_indices(var).size());
886 
887  // Get current local coefficients
888  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
889  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
890 
891  // Get finite element object
892  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
893  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
894 
895  // Build a FE for calculating u(p)
896  UniquePtr<FEGenericBase<OutputShape> > fe_new =
897  this->build_new_fe( fe, p, tolerance );
898 
899  // Get the values of the shape function derivatives
900  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor> > & d2phi = fe_new->get_d2phi();
901 
902  hess_u = 0.0;
903 
904  for (unsigned int l=0; l != n_dofs; l++)
905  hess_u.add_scaled(d2phi[l][0], coef(l));
906 
907  return;
908 }
UniquePtr< FEGenericBase< OutputShape > > build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
Definition: fem_context.C:1790
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:110
const std::vector< dof_id_type > & get_dof_indices() const
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:839
template<typename OutputType >
void libMesh::FEMContext::point_rate ( unsigned int  var,
const Point p,
OutputType &  u 
) const

Returns the time derivative (rate) of the solution variable var at the physical point p on the current element.

Referenced by get_side_fe().

Number libMesh::FEMContext::point_value ( unsigned int  var,
const Point p 
) const

Returns the value of the solution variable var at the physical point p on the current element. This API currently present for backward compatibility.

Definition at line 763 of file fem_context.C.

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

764 {
765  Number u = 0.;
766 
767  this->point_value( var, p, u );
768 
769  return u;
770 }
Number point_value(unsigned int var, const Point &p) const
Definition: fem_context.C:763
template<typename OutputType >
void libMesh::FEMContext::point_value ( unsigned int  var,
const Point p,
OutputType &  u,
const Real  tolerance = TOLERANCE 
) const

Returns the value of the solution variable var at the physical point p on the current element. This is the preferred API.

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

Definition at line 773 of file fem_context.C.

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

777 {
778  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
779 
780  // Get local-to-global dof index lookup
781  const unsigned int n_dofs = cast_int<unsigned int>
782  (this->get_dof_indices(var).size());
783 
784  // Get current local coefficients
785  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
786  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
787 
788  // Get finite element object
789  FEGenericBase<OutputShape> * fe = libmesh_nullptr;
790  this->get_element_fe<OutputShape>( var, fe, this->get_elem_dim() );
791 
792  // Build a FE for calculating u(p)
793  UniquePtr<FEGenericBase<OutputShape> > fe_new =
794  this->build_new_fe( fe, p, tolerance );
795 
796  // Get the values of the shape function derivatives
797  const std::vector<std::vector<OutputShape> > & phi = fe_new->get_phi();
798 
799  u = 0.;
800 
801  for (unsigned int l=0; l != n_dofs; l++)
802  u += phi[l][0] * coef(l);
803 
804  return;
805 }
UniquePtr< FEGenericBase< OutputShape > > build_new_fe(const FEGenericBase< OutputShape > *fe, const Point &p, const Real tolerance=TOLERANCE) const
Definition: fem_context.C:1790
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:110
const std::vector< dof_id_type > & get_dof_indices() const
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:839
void libMesh::FEMContext::pre_fe_reinit ( const System sys,
const Elem e 
)
virtual

Reinitializes local data vectors/matrices on the current geometric element

Definition at line 1561 of file fem_context.C.

References _custom_solution, libMesh::DiffContext::_elem_qoi_subderivatives, libMesh::DiffContext::_localized_vectors, algebraic_type(), CURRENT, libMesh::System::current_local_solution, libMesh::DofMap::dof_indices(), DOFS_ONLY, libMesh::NumericVector< T >::get(), libMesh::DiffContext::get_dof_indices(), libMesh::System::get_dof_map(), 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(), has_elem(), libMesh::TimeSolver::is_steady(), libmesh_nullptr, libMesh::System::n_vars(), NONE, OLD, libMesh::DofMap::old_dof_indices(), libMesh::System::qoi, libMesh::DenseVector< T >::resize(), libMesh::DenseMatrix< T >::resize(), set_elem(), libMesh::sys, libMesh::UnsteadySolver::time_order(), and libMesh::System::use_fixed_solution.

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

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

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

References _atype.

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

880  { _atype = atype; }
AlgebraicType _atype
Definition: fem_context.h:922
void libMesh::FEMContext::set_custom_solution ( const NumericVector< Number > *  custom_sol)
inline

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

References _custom_solution.

895  { _custom_solution = custom_sol; }
const NumericVector< Number > * _custom_solution
Definition: fem_context.h:927
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 }
void libMesh::FEMContext::set_elem ( const Elem e)
protected

Helper function to promote accessor usage

Definition at line 1767 of file fem_context.C.

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

Referenced by pre_fe_reinit().

1768 {
1769  this->_elem = e;
1770 
1771  // If e is NULL, we assume it's SCALAR and set _elem_dim to 0.
1772  this->_elem_dim = this->_elem ? this->_elem->dim() : 0;
1773 }
unsigned char _elem_dim
Definition: fem_context.h:1048
virtual unsigned int dim() const =0
const Elem * _elem
Definition: fem_context.h:1038
virtual void libMesh::FEMContext::set_mesh_system ( System sys)
inlinevirtual

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

References _mesh_sys, and libMesh::sys.

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

739  { this->_mesh_sys = sys; }
ImplicitSystem & sys
void libMesh::FEMContext::set_mesh_x_var ( unsigned int  x_var)
inline

Accessor for x-variable of moving mesh System

This should be set automatically if the FEMPhysics requires it.

Definition at line 764 of file fem_context.h.

References _mesh_x_var.

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

765  { _mesh_x_var = x_var; }
unsigned int _mesh_x_var
Definition: fem_context.h:905
void libMesh::FEMContext::set_mesh_y_var ( unsigned int  y_var)
inline

Accessor for y-variable of moving mesh System

This should be set automatically if the FEMPhysics requires it.

Definition at line 778 of file fem_context.h.

References _mesh_y_var.

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

779  { _mesh_y_var = y_var; }
unsigned int _mesh_y_var
Definition: fem_context.h:905
void libMesh::FEMContext::set_mesh_z_var ( unsigned int  z_var)
inline

Accessor for z-variable of moving mesh System

This should be set automatically if the FEMPhysics requires it.

Definition at line 792 of file fem_context.h.

References _mesh_z_var.

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

793  { _mesh_z_var = z_var; }
unsigned int _mesh_z_var
Definition: fem_context.h:905
void libMesh::DiffContext::set_time ( Real  time_in)
inlineinherited

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

411  { time = time_in; }
template<typename OutputType >
template void libMesh::FEMContext::side_accel< Gradient > ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const

Returns the second time derivative (acceleration) of the solution variable var at the quadrature point qp on the current element side.

Definition at line 1286 of file fem_context.C.

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

Referenced by get_side_fe().

1288 {
1289  this->some_value<OutputType,
1293 }
const DenseVector< Number > & get_elem_solution_accel() const
Definition: diff_context.h:179
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:205
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:272
std::vector< boundary_id_type > libMesh::FEMContext::side_boundary_ids ( ) const

Lists the boundary ids found on the current side

This function is now deprecated. Instead, use the version that takes a reference to a std::set.

Definition at line 188 of file fem_context.C.

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

189 {
190  libmesh_deprecated();
191  return _boundary_info.boundary_ids(&(this->get_elem()), side);
192 }
const Elem & get_elem() const
Definition: fem_context.h:804
std::vector< boundary_id_type > boundary_ids(const Node *node) const
const BoundaryInfo & _boundary_info
Definition: fem_context.h:1033
unsigned char side
Definition: fem_context.h:910
void libMesh::FEMContext::side_boundary_ids ( std::vector< boundary_id_type > &  vec_to_fill) const

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

Definition at line 195 of file fem_context.C.

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

196 {
197  _boundary_info.boundary_ids(&(this->get_elem()), side, vec_to_fill);
198 }
const Elem & get_elem() const
Definition: fem_context.h:804
std::vector< boundary_id_type > boundary_ids(const Node *node) const
const BoundaryInfo & _boundary_info
Definition: fem_context.h:1033
unsigned char side
Definition: fem_context.h:910
void libMesh::FEMContext::side_fe_reinit ( )
virtual

Reinitializes side FE objects on the current geometric element

Reimplemented in libMesh::DGFEMContext.

Definition at line 1384 of file fem_context.C.

References _side_fe, get_elem(), get_elem_dim(), get_side(), and libMesh::libmesh_assert().

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

1385 {
1386  // Initialize all the side FE objects on elem/side.
1387  // Logging of FE::reinit is done in the FE functions
1388  // We only reinit the FE objects for the current element
1389  // dimension
1390  const unsigned char dim = this->get_elem_dim();
1391 
1392  libmesh_assert( !_side_fe[dim].empty() );
1393 
1394  std::map<FEType, FEAbstract *>::iterator local_fe_end = _side_fe[dim].end();
1395  for (std::map<FEType, FEAbstract *>::iterator i = _side_fe[dim].begin();
1396  i != local_fe_end; ++i)
1397  {
1398  i->second->reinit(&(this->get_elem()), this->get_side());
1399  }
1400 }
unsigned char get_side() const
Definition: fem_context.h:818
const Elem & get_elem() const
Definition: fem_context.h:804
libmesh_assert(j)
std::vector< std::map< FEType, FEAbstract * > > _side_fe
Definition: fem_context.h:1015
unsigned char get_elem_dim() const
Definition: fem_context.h:839
Gradient libMesh::FEMContext::side_gradient ( unsigned int  var,
unsigned int  qp 
) const

Returns the gradient of the solution variable var at the quadrature point qp on the current element side. This API currently present for backward compatibility.

Definition at line 606 of file fem_context.C.

Referenced by get_side_fe().

607 {
608  Gradient du;
609 
610  this->side_gradient( var, qp, du );
611 
612  return du;
613 }
NumberVectorValue Gradient
Gradient side_gradient(unsigned int var, unsigned int qp) const
Definition: fem_context.C:606
template<typename OutputType >
void libMesh::FEMContext::side_gradient ( unsigned int  var,
unsigned int  qp,
OutputType &  du 
) const

Returns the gradient of the solution variable var at the quadrature point qp on the current element side. This is the preferred API.

Definition at line 617 of file fem_context.C.

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

619 {
620  typedef typename TensorTools::MakeReal
622  OutputShape;
623 
624  // Get local-to-global dof index lookup
625  const unsigned int n_dofs = cast_int<unsigned int>
626  (this->get_dof_indices(var).size());
627 
628  // Get current local coefficients
629  libmesh_assert_greater (this->_elem_subsolutions.size(), var);
630  const DenseSubVector<Number> & coef = this->get_elem_solution(var);
631 
632  // Get finite element object
633  FEGenericBase<OutputShape> * the_side_fe = libmesh_nullptr;
634  this->get_side_fe<OutputShape>( var, the_side_fe, this->get_elem_dim() );
635 
636  // Get shape function values at quadrature point
637  const std::vector<std::vector< typename FEGenericBase<OutputShape>::OutputGradient> > & dphi = the_side_fe->get_dphi();
638 
639  // Accumulate solution derivatives
640  du = 0.;
641 
642  for (unsigned int l=0; l != n_dofs; l++)
643  du.add_scaled(dphi[l][qp], coef(l));
644 
645  return;
646 }
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:110
const std::vector< dof_id_type > & get_dof_indices() const
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:839
template<typename OutputType >
template void libMesh::FEMContext::side_gradients< Tensor > ( unsigned int  var,
const NumericVector< Number > &  _system_vector,
std::vector< OutputType > &  side_gradients_vector 
) const

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

Definition at line 651 of file fem_context.C.

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

Referenced by get_side_fe().

654 {
655  typedef typename TensorTools::MakeReal
657  OutputShape;
658 
659  // Get local-to-global dof index lookup
660  const unsigned int n_dofs = cast_int<unsigned int>
661  (this->get_dof_indices(var).size());
662 
663  // Get current local coefficients
664  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
665 
666  // Get finite element object
667  FEGenericBase<OutputShape> * the_side_fe = libmesh_nullptr;
668  this->get_side_fe<OutputShape>( var, the_side_fe, this->get_elem_dim() );
669 
670  // Get shape function values at quadrature point
671  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient> > & dphi = the_side_fe->get_dphi();
672 
673  // Loop over all the q_points in this finite element
674  for (std::size_t qp=0; qp != du_vals.size(); qp++)
675  {
676  OutputType & du = du_vals[qp];
677 
678  du = 0;
679 
680  // Compute the gradient at this q_point
681  for (unsigned int l=0; l != n_dofs; l++)
682  du.add_scaled(dphi[l][qp], coef(l));
683  }
684 
685  return;
686 }
const std::vector< dof_id_type > & get_dof_indices() const
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)
Definition: diff_context.C:184
unsigned char get_elem_dim() const
Definition: fem_context.h:839
Tensor libMesh::FEMContext::side_hessian ( unsigned int  var,
unsigned int  qp 
) const

Returns the hessian of the solution variable var at the quadrature point qp on the current element side. This API currently present for backward compatibility.

Definition at line 689 of file fem_context.C.

Referenced by get_side_fe().

691 {
692  Tensor d2u;
693 
694  this->side_hessian( var, qp, d2u );
695 
696  return d2u;
697 }
NumberTensorValue Tensor
Tensor side_hessian(unsigned int var, unsigned int qp) const
Definition: fem_context.C:689
template<typename OutputType >
void libMesh::FEMContext::side_hessian ( unsigned int  var,
unsigned int  qp,
OutputType &  d2u 
) const

Returns the hessian of the solution variable var at the quadrature point qp on the current element side. This is the preferred API.

Definition at line 702 of file fem_context.C.

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

705 {
706  this->some_hessian<OutputType,
708  <typename TensorTools::MakeReal
709  <typename TensorTools::DecrementRank
710  <typename TensorTools::DecrementRank
711  <OutputType>::type>::type>::type>,
712  &DiffContext::get_elem_solution>(var, qp, d2u);
713 }
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:110
void some_hessian(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:267
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:272
template<typename OutputType >
template void libMesh::FEMContext::side_hessians< Tensor > ( 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. This is the preferred API.

Definition at line 718 of file fem_context.C.

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

Referenced by get_side_fe().

721 {
722  typedef typename TensorTools::MakeReal<
723  typename TensorTools::DecrementRank<
724  typename TensorTools::DecrementRank<
725  OutputType>::type>::type>::type
726  OutputShape;
727 
728  // Get local-to-global dof index lookup
729  const unsigned int n_dofs = cast_int<unsigned int>
730  (this->get_dof_indices(var).size());
731 
732  // Get current local coefficients
733  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
734 
735  // Get finite element object
736  FEGenericBase<OutputShape> * the_side_fe = libmesh_nullptr;
737  this->get_side_fe<OutputShape>( var, the_side_fe, this->get_elem_dim() );
738 
739  // Get shape function values at quadrature point
740  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor> > & d2phi = the_side_fe->get_d2phi();
741 
742  // Loop over all the q_points in this finite element
743  for (std::size_t qp=0; qp != d2u_vals.size(); qp++)
744  {
745  OutputType & d2u = d2u_vals[qp];
746 
747  // Compute the gradient at this q_point
748  d2u = 0;
749 
750  for (unsigned int l=0; l != n_dofs; l++)
751  d2u.add_scaled(d2phi[l][qp], coef(l));
752  }
753 
754  return;
755 }
const std::vector< dof_id_type > & get_dof_indices() const
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)
Definition: diff_context.C:184
unsigned char get_elem_dim() const
Definition: fem_context.h:839
template<typename OutputType >
template void libMesh::FEMContext::side_rate< Gradient > ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const

Returns the time derivative (rate) of the solution variable var at the quadrature point qp on the current element side.

Definition at line 1264 of file fem_context.C.

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

Referenced by get_side_fe().

1266 {
1267  this->some_value<OutputType,
1271 }
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:205
const DenseVector< Number > & get_elem_solution_rate() const
Definition: diff_context.h:144
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Definition: fem_context.h:272
Number libMesh::FEMContext::side_value ( unsigned int  var,
unsigned int  qp 
) const

Returns the value of the solution variable var at the quadrature point qp on the current element side. This API currently present for backward compatibility.

Definition at line 548 of file fem_context.C.

Referenced by get_side_fe().

550 {
551  Number u = 0.;
552 
553  this->side_value( var, qp, u );
554 
555  return u;
556 }
Number side_value(unsigned int var, unsigned int qp) const
Definition: fem_context.C:548
template<typename OutputType >
void libMesh::FEMContext::side_value ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const

Returns the value of the solution variable var at the quadrature point qp on the current element side. This is the preferred API.

Definition at line 560 of file fem_context.C.

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

563 {
564  this->some_value<OutputType,
565  &FEMContext::get_side_fe<typename TensorTools::MakeReal<OutputType>::type>,
566  &DiffContext::get_elem_solution>(var, qp, u);
567 }
const DenseVector< Number > & get_elem_solution() const
Definition: diff_context.h:110
void some_value(unsigned int var, unsigned int qp, OutputType &u) const
Definition: fem_context.C:205
template<typename OutputType >
template void libMesh::FEMContext::side_values< Gradient > ( unsigned int  var,
const NumericVector< Number > &  _system_vector,
std::vector< OutputType > &  side_values_vector 
) const

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

Definition at line 571 of file fem_context.C.

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

Referenced by get_side_fe().

574 {
575  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
576 
577  // Get local-to-global dof index lookup
578  const unsigned int n_dofs = cast_int<unsigned int>
579  (this->get_dof_indices(var).size());
580 
581  // Get current local coefficients
582  const DenseSubVector<Number> & coef = get_localized_subvector(_system_vector, var);
583 
584  // Get the finite element object
585  FEGenericBase<OutputShape> * the_side_fe = libmesh_nullptr;
586  this->get_side_fe<OutputShape>( var, the_side_fe, this->get_elem_dim() );
587 
588  // Get shape function values at quadrature point
589  const std::vector<std::vector<OutputShape> > & phi = the_side_fe->get_phi();
590 
591  // Loop over all the q_points on this element
592  for (std::size_t qp=0; qp != u_vals.size(); qp++)
593  {
594  OutputType & u = u_vals[qp];
595 
596  // Compute the value at this q_point
597  u = 0.;
598 
599  for (unsigned int l=0; l != n_dofs; l++)
600  u += phi[l][qp] * coef(l);
601  }
602 
603  return;
604 }
const std::vector< dof_id_type > & get_dof_indices() const
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)
Definition: diff_context.C:184
unsigned char get_elem_dim() const
Definition: fem_context.h:839
template<typename OutputType , typename FEMContext::FENeeded< OutputType >::grad_getter fe_getter, FEMContext::diff_subsolution_getter subsolution_getter>
void libMesh::FEMContext::some_gradient ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
protected

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

Definition at line 234 of file fem_context.C.

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

Referenced by fixed_interior_gradient(), fixed_side_gradient(), and interior_gradient().

235 {
236  // Get local-to-global dof index lookup
237  const unsigned int n_dofs = cast_int<unsigned int>
238  (this->get_dof_indices(var).size());
239 
240  // Get current local coefficients
241  const DenseSubVector<Number> & coef = (this->*subsolution_getter)(var);
242 
243  // Get finite element object
245  (this->*fe_getter)( var, fe, this->get_elem_dim() );
246 
247  // Get shape function values at quadrature point
248  const std::vector<std::vector
250  & dphi = fe->get_dphi();
251 
252  // Accumulate solution derivatives
253  du = 0;
254 
255  for (unsigned int l=0; l != n_dofs; l++)
256  du.add_scaled(dphi[l][qp], coef(l));
257 
258  return;
259 }
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:366
const class libmesh_nullptr_t libmesh_nullptr
TensorTools::IncrementRank< OutputShape >::type OutputGradient
Definition: fe_base.h:133
FEGenericBase< grad_shape > grad_base
Definition: fem_context.h:969
unsigned char get_elem_dim() const
Definition: fem_context.h:839
template<typename OutputType , typename FEMContext::FENeeded< OutputType >::hess_getter fe_getter, FEMContext::diff_subsolution_getter subsolution_getter>
void libMesh::FEMContext::some_hessian ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
protected

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

Definition at line 267 of file fem_context.C.

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

Referenced by fixed_interior_hessian(), fixed_side_hessian(), interior_hessian(), and side_hessian().

268 {
269  // Get local-to-global dof index lookup
270  const unsigned int n_dofs = cast_int<unsigned int>
271  (this->get_dof_indices(var).size());
272 
273  // Get current local coefficients
274  const DenseSubVector<Number> & coef = (this->*subsolution_getter)(var);
275 
276  // Get finite element object
278  (this->*fe_getter)( var, fe, this->get_elem_dim() );
279 
280  // Get shape function values at quadrature point
281  const std::vector<std::vector
283  & d2phi = fe->get_d2phi();
284 
285  // Accumulate solution second derivatives
286  d2u = 0.0;
287 
288  for (unsigned int l=0; l != n_dofs; l++)
289  d2u.add_scaled(d2phi[l][qp], coef(l));
290 
291  return;
292 }
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:366
const class libmesh_nullptr_t libmesh_nullptr
FEGenericBase< hess_shape > hess_base
Definition: fem_context.h:974
TensorTools::IncrementRank< OutputGradient >::type OutputTensor
Definition: fe_base.h:134
unsigned char get_elem_dim() const
Definition: fem_context.h:839
template<typename OutputType , typename FEMContext::FENeeded< OutputType >::value_getter fe_getter, FEMContext::diff_subsolution_getter subsolution_getter>
void libMesh::FEMContext::some_value ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
protected

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

Definition at line 205 of file fem_context.C.

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

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

206 {
207  // Get local-to-global dof index lookup
208  const unsigned int n_dofs = cast_int<unsigned int>
209  (this->get_dof_indices(var).size());
210 
211  // Get current local coefficients
212  const DenseSubVector<Number> & coef = (this->*subsolution_getter)(var);
213 
214  // Get finite element object
216  (this->*fe_getter)( var, fe, this->get_elem_dim() );
217 
218  // Get shape function values at quadrature point
219  const std::vector<std::vector
220  <typename FENeeded<OutputType>::value_shape> > & phi = fe->get_phi();
221 
222  // Accumulate solution value
223  u = 0.;
224 
225  for (unsigned int l=0; l != n_dofs; l++)
226  u += phi[l][qp] * coef(l);
227 }
TensorTools::MakeReal< OutputType >::type value_shape
Definition: fem_context.h:963
FEGenericBase< value_shape > value_base
Definition: fem_context.h:964
const std::vector< dof_id_type > & get_dof_indices() const
Definition: diff_context.h:366
const class libmesh_nullptr_t libmesh_nullptr
unsigned char get_elem_dim() const
Definition: fem_context.h:839

Member Data Documentation

AlgebraicType libMesh::FEMContext::_atype
protected

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

Definition at line 922 of file fem_context.h.

Referenced by algebraic_type(), and set_algebraic_type().

const BoundaryInfo& libMesh::FEMContext::_boundary_info
protected

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

Definition at line 1033 of file fem_context.h.

Referenced by has_side_boundary_id(), and side_boundary_ids().

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

Data with which to do algebra reinitialization

Definition at line 927 of file fem_context.h.

Referenced by pre_fe_reinit(), and set_custom_solution().

unsigned char libMesh::FEMContext::_dim
protected

Cached dimension of largest dimension element in this mesh

Definition at line 1043 of file fem_context.h.

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

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

Global Degree of freedom index lists

Definition at line 620 of file diff_context.h.

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

std::vector<std::vector<dof_id_type> > libMesh::DiffContext::_dof_indices_var
protectedinherited
std::map<FEType, FEAbstract *> libMesh::FEMContext::_edge_fe
protected

Definition at line 1016 of file fem_context.h.

Referenced by edge_fe_reinit(), FEMContext(), and ~FEMContext().

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

Definition at line 1027 of file fem_context.h.

Referenced by FEMContext(), and get_edge_fe().

UniquePtr<QBase> libMesh::FEMContext::_edge_qrule
protected

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

Definition at line 1079 of file fem_context.h.

Referenced by FEMContext(), and get_edge_qrule().

const Elem* libMesh::FEMContext::_elem
protected

Current element for element_* to examine

Definition at line 1038 of file fem_context.h.

Referenced by get_elem(), has_elem(), and set_elem().

unsigned char libMesh::FEMContext::_elem_dim
protected

Cached dimension of this->_elem.

Definition at line 1048 of file fem_context.h.

Referenced by get_elem_dim(), and set_elem().

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

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

Definition at line 1054 of file fem_context.h.

Referenced by elem_dimensions(), and FEMContext().

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

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

Definition at line 586 of file diff_context.h.

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

std::vector<DenseSubVector<Number> *> libMesh::DiffContext::_elem_fixed_subsolutions
protectedinherited
DenseMatrix<Number> libMesh::DiffContext::_elem_jacobian
protectedinherited

Element jacobian: derivatives of elem_residual with respect to elem_solution

Definition at line 598 of file diff_context.h.

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

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

Element quantity of interest contributions

Definition at line 603 of file diff_context.h.

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

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

Element quantity of interest derivative contributions

Definition at line 608 of file diff_context.h.

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

std::vector<std::vector<DenseSubVector<Number> *> > libMesh::DiffContext::_elem_qoi_subderivatives
protectedinherited
DenseVector<Number> libMesh::DiffContext::_elem_residual
protectedinherited

Element residual vector

Definition at line 592 of file diff_context.h.

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

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

Element by element components of nonlinear_solution as adjusted by a time_solver

Definition at line 564 of file diff_context.h.

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

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

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

Definition at line 578 of file diff_context.h.

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

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

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

Definition at line 571 of file diff_context.h.

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

std::vector<std::vector<DenseSubMatrix<Number> *> > libMesh::DiffContext::_elem_subjacobians
protectedinherited
std::vector<DenseSubVector<Number> *> libMesh::DiffContext::_elem_subresiduals
protectedinherited

Element residual subvectors and Jacobian submatrices

Definition at line 614 of file diff_context.h.

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

std::vector<DenseSubVector<Number> *> libMesh::DiffContext::_elem_subsolution_accels
protectedinherited
std::vector<DenseSubVector<Number> *> libMesh::DiffContext::_elem_subsolution_rates
protectedinherited
std::vector<std::map<FEType, FEAbstract *> > libMesh::FEMContext::_element_fe
protected

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

Definition at line 1014 of file fem_context.h.

Referenced by elem_fe_reinit(), FEMContext(), and ~FEMContext().

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

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

Definition at line 1025 of file fem_context.h.

Referenced by FEMContext(), and get_element_fe().

std::vector<QBase *> libMesh::FEMContext::_element_qrule
protected

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

Definition at line 1062 of file fem_context.h.

Referenced by FEMContext(), get_element_qrule(), and ~FEMContext().

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

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

Definition at line 558 of file diff_context.h.

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

System* libMesh::FEMContext::_mesh_sys

System from which to acquire moving mesh information

Definition at line 900 of file fem_context.h.

Referenced by _do_elem_position_set(), elem_edge_reinit(), elem_position_get(), elem_position_set(), elem_reinit(), elem_side_reinit(), get_mesh_system(), and set_mesh_system().

unsigned int libMesh::FEMContext::_mesh_x_var

Variables from which to acquire moving mesh information

Definition at line 905 of file fem_context.h.

Referenced by get_mesh_x_var(), and set_mesh_x_var().

unsigned int libMesh::FEMContext::_mesh_y_var

Definition at line 905 of file fem_context.h.

Referenced by get_mesh_y_var(), and set_mesh_y_var().

unsigned int libMesh::FEMContext::_mesh_z_var

Definition at line 905 of file fem_context.h.

Referenced by get_mesh_z_var(), and set_mesh_z_var().

std::vector<std::map<FEType, FEAbstract *> > libMesh::FEMContext::_side_fe
protected
std::vector<std::vector<FEAbstract *> > libMesh::FEMContext::_side_fe_var
protected

Definition at line 1026 of file fem_context.h.

Referenced by FEMContext(), and get_side_fe().

std::vector<QBase *> libMesh::FEMContext::_side_qrule
protected

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

Definition at line 1070 of file fem_context.h.

Referenced by FEMContext(), get_side_qrule(), and ~FEMContext().

unsigned char libMesh::FEMContext::edge

Current edge for edge_* to examine

Definition at line 915 of file fem_context.h.

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

Real libMesh::DiffContext::elem_solution_accel_derivative
inherited

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

Definition at line 497 of file diff_context.h.

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

Real libMesh::DiffContext::elem_solution_derivative
inherited
Real libMesh::DiffContext::elem_solution_rate_derivative
inherited

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

Definition at line 490 of file diff_context.h.

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

Real libMesh::DiffContext::fixed_solution_derivative
inherited

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

Definition at line 504 of file diff_context.h.

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

unsigned char libMesh::FEMContext::side
const Real libMesh::DiffContext::system_time
inherited

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

Definition at line 477 of file diff_context.h.

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

Real libMesh::DiffContext::time
inherited

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

Definition at line 468 of file diff_context.h.

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


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