libMesh::DGFEMContext Class Reference

#include <dg_fem_context.h>

Inheritance diagram for libMesh::DGFEMContext:

Public Types

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

Public Member Functions

 DGFEMContext (const System &sys)
 
virtual ~DGFEMContext ()
 
virtual void side_fe_reinit ()
 
void neighbor_side_fe_reinit ()
 
const std::vector< dof_id_type > & get_neighbor_dof_indices () const
 
const std::vector< dof_id_type > & get_neighbor_dof_indices (unsigned int var) const
 
const DenseVector< Number > & get_neighbor_residual () const
 
DenseVector< Number > & get_neighbor_residual ()
 
const DenseSubVector< Number > & get_neighbor_residual (unsigned int var) const
 
DenseSubVector< Number > & get_neighbor_residual (unsigned int var)
 
const DenseMatrix< Number > & get_elem_elem_jacobian () const
 
DenseMatrix< Number > & get_elem_elem_jacobian ()
 
const DenseSubMatrix< Number > & get_elem_elem_jacobian (unsigned int var1, unsigned int var2) const
 
DenseSubMatrix< Number > & get_elem_elem_jacobian (unsigned int var1, unsigned int var2)
 
const DenseMatrix< Number > & get_elem_neighbor_jacobian () const
 
DenseMatrix< Number > & get_elem_neighbor_jacobian ()
 
const DenseSubMatrix< Number > & get_elem_neighbor_jacobian (unsigned int var1, unsigned int var2) const
 
DenseSubMatrix< Number > & get_elem_neighbor_jacobian (unsigned int var1, unsigned int var2)
 
const DenseMatrix< Number > & get_neighbor_elem_jacobian () const
 
DenseMatrix< Number > & get_neighbor_elem_jacobian ()
 
const DenseSubMatrix< Number > & get_neighbor_elem_jacobian (unsigned int var1, unsigned int var2) const
 
DenseSubMatrix< Number > & get_neighbor_elem_jacobian (unsigned int var1, unsigned int var2)
 
const DenseMatrix< Number > & get_neighbor_neighbor_jacobian () const
 
DenseMatrix< Number > & get_neighbor_neighbor_jacobian ()
 
const DenseSubMatrix< Number > & get_neighbor_neighbor_jacobian (unsigned int var1, unsigned int var2) const
 
DenseSubMatrix< Number > & get_neighbor_neighbor_jacobian (unsigned int var1, unsigned int var2)
 
void set_neighbor (const Elem &neighbor)
 
const Elemget_neighbor () const
 
bool dg_terms_are_active () const
 
template<typename OutputShape >
void get_neighbor_side_fe (unsigned int var, FEGenericBase< OutputShape > *&fe) const
 
bool has_side_boundary_id (boundary_id_type id) const
 
std::vector< boundary_id_typeside_boundary_ids () const
 
Number interior_value (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void interior_value (unsigned int var, unsigned int qp, OutputType &u) const
 
Number side_value (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void side_value (unsigned int var, unsigned int qp, OutputType &u) const
 
Number point_value (unsigned int var, const Point &p) const
 
template<typename OutputType >
void point_value (unsigned int var, const Point &p, OutputType &u) const
 
Gradient interior_gradient (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void interior_gradient (unsigned int var, unsigned int qp, OutputType &du) const
 
Gradient side_gradient (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void side_gradient (unsigned int var, unsigned int qp, OutputType &du) const
 
Gradient point_gradient (unsigned int var, const Point &p) const
 
template<typename OutputType >
void point_gradient (unsigned int var, const Point &p, OutputType &grad_u) const
 
Tensor interior_hessian (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void interior_hessian (unsigned int var, unsigned int qp, OutputType &d2u) const
 
Tensor side_hessian (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void side_hessian (unsigned int var, unsigned int qp, OutputType &d2u) const
 
Tensor point_hessian (unsigned int var, const Point &p) const
 
template<typename OutputType >
void point_hessian (unsigned int var, const Point &p, OutputType &hess_u) const
 
Number fixed_interior_value (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void fixed_interior_value (unsigned int var, unsigned int qp, OutputType &u) const
 
Number fixed_side_value (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void fixed_side_value (unsigned int var, unsigned int qp, OutputType &u) const
 
Number fixed_point_value (unsigned int var, const Point &p) const
 
template<typename OutputType >
void fixed_point_value (unsigned int var, const Point &p, OutputType &u) const
 
Gradient fixed_interior_gradient (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void fixed_interior_gradient (unsigned int var, unsigned int qp, OutputType &grad_u) const
 
Gradient fixed_side_gradient (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void fixed_side_gradient (unsigned int var, unsigned int qp, OutputType &grad_u) const
 
Gradient fixed_point_gradient (unsigned int var, const Point &p) const
 
template<typename OutputType >
void fixed_point_gradient (unsigned int var, const Point &p, OutputType &grad_u) const
 
Tensor fixed_interior_hessian (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void fixed_interior_hessian (unsigned int var, unsigned int qp, OutputType &hess_u) const
 
Tensor fixed_side_hessian (unsigned int var, unsigned int qp) const
 
template<typename OutputType >
void fixed_side_hessian (unsigned int var, unsigned int qp, OutputType &hess_u) const
 
Tensor fixed_point_hessian (unsigned int var, const Point &p) const
 
template<typename OutputType >
void fixed_point_hessian (unsigned int var, const Point &p, OutputType &hess_u) const
 
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_side_fe (unsigned int var, FEGenericBase< OutputShape > *&fe) const
 
FEBaseget_side_fe (unsigned int var) const
 
template<typename OutputShape >
void get_edge_fe (unsigned int var, FEGenericBase< OutputShape > *&fe) const
 
FEBaseget_edge_fe (unsigned int var) const
 
template<typename OutputType >
void interior_values (unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &interior_values_vector) const
 
template<typename OutputType >
void side_values (unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &side_values_vector) const
 
template<typename OutputType >
void interior_gradients (unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &interior_gradients_vector) const
 
template<typename OutputType >
void side_gradients (unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &side_gradients_vector) const
 
template<typename OutputType >
void interior_hessians (unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &d2u_vals) const
 
template<typename OutputType >
void side_hessians (unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &d2u_vals) const
 
template<typename OutputType >
void interior_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
 
template<typename OutputType >
void interior_div (unsigned int var, unsigned int qp, OutputType &div_u) const
 
virtual void elem_reinit (Real theta)
 
virtual void elem_side_reinit (Real theta)
 
virtual void elem_edge_reinit (Real theta)
 
virtual void pre_fe_reinit (const System &, const Elem *e)
 
void elem_fe_reinit ()
 
void edge_fe_reinit ()
 
const QBaseget_element_qrule () const
 
const QBaseget_side_qrule () 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)
 
const Elemget_elem () const
 
Elemget_elem ()
 
unsigned char get_side () const
 
unsigned char get_edge () const
 
unsigned char get_dim () const
 
void elem_position_set (Real theta)
 
void elem_position_get ()
 
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
 
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
 
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
 
Real get_system_time () const
 
Real get_time () const
 
void set_time (Real time_in)
 
Real get_elem_solution_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 fixed_solution_derivative
 

Protected Member Functions

template<typename OutputShape >
AutoPtr< FEGenericBase
< OutputShape > > 
build_new_fe (const FEGenericBase< OutputShape > *fe, const Point &p) const
 

Protected Attributes

std::map< FEType, FEAbstract * > _element_fe
 
std::map< FEType, FEAbstract * > _side_fe
 
std::map< FEType, FEAbstract * > _edge_fe
 
std::vector< FEAbstract * > _element_fe_var
 
std::vector< FEAbstract * > _side_fe_var
 
std::vector< FEAbstract * > _edge_fe_var
 
BoundaryInfo_boundary_info
 
const Elemelem
 
unsigned char dim
 
QBaseelement_qrule
 
QBaseside_qrule
 
QBaseedge_qrule
 
std::map< const NumericVector
< Number > *, std::pair
< DenseVector< Number >
, std::vector< DenseSubVector
< Number > * > > > 
localized_vectors
 
DenseVector< Numberelem_solution
 
std::vector< DenseSubVector
< Number > * > 
elem_subsolutions
 
DenseVector< Numberelem_fixed_solution
 
std::vector< DenseSubVector
< Number > * > 
elem_fixed_subsolutions
 
DenseVector< Numberelem_residual
 
DenseMatrix< Numberelem_jacobian
 
std::vector< Numberelem_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_typedof_indices
 
std::vector< std::vector
< dof_id_type > > 
dof_indices_var
 

Private Attributes

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

Detailed Description

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

Definition at line 39 of file dg_fem_context.h.

Member Typedef Documentation

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

Constructor & Destructor Documentation

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

Constructor. Allocates some but fills no data structures.

Definition at line 29 of file dg_fem_context.C.

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

30  : FEMContext(sys),
31  _neighbor(NULL),
32  _neighbor_dof_indices_var(sys.n_vars()),
33  _dg_terms_active(false)
34 {
35  libmesh_experimental();
36 
37  unsigned int nv = sys.n_vars();
38  libmesh_assert (nv);
39 
40  _neighbor_subresiduals.reserve(nv);
41  _elem_elem_subjacobians.resize(nv);
42  _elem_neighbor_subjacobians.resize(nv);
43  _neighbor_elem_subjacobians.resize(nv);
45 
46  for (unsigned int i=0; i != nv; ++i)
47  {
48  _neighbor_subresiduals.push_back(new DenseSubVector<Number>(_neighbor_residual));
49  _elem_elem_subjacobians[i].reserve(nv);
50  _elem_neighbor_subjacobians[i].reserve(nv);
51  _neighbor_elem_subjacobians[i].reserve(nv);
52  _neighbor_neighbor_subjacobians[i].reserve(nv);
53 
54  for (unsigned int j=0; j != nv; ++j)
55  {
56  _elem_elem_subjacobians[i].push_back
57  (new DenseSubMatrix<Number>(_elem_elem_jacobian));
58  _elem_neighbor_subjacobians[i].push_back
59  (new DenseSubMatrix<Number>(_elem_neighbor_jacobian));
60  _neighbor_elem_subjacobians[i].push_back
61  (new DenseSubMatrix<Number>(_neighbor_elem_jacobian));
63  (new DenseSubMatrix<Number>(_neighbor_neighbor_jacobian));
64  }
65  }
66 
67  _neighbor_side_fe_var.resize(nv);
68  for (unsigned int i=0; i != nv; ++i)
69  {
70  FEType fe_type = sys.variable_type(i);
71 
72  if ( _neighbor_side_fe[fe_type] == NULL )
73  {
74  _neighbor_side_fe[fe_type] = FEAbstract::build(dim, fe_type).release();
75  }
77  }
78 }
libMesh::DGFEMContext::~DGFEMContext ( )
virtual

Destructor.

Definition at line 80 of file dg_fem_context.C.

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

81 {
82 
83  for (std::size_t i=0; i != _neighbor_subresiduals.size(); ++i)
84  {
85  delete _neighbor_subresiduals[i];
86 
87  for (std::size_t j=0; j != _elem_elem_subjacobians[i].size(); ++j)
88  {
89  delete _elem_elem_subjacobians[i][j];
90  delete _elem_neighbor_subjacobians[i][j];
91  delete _neighbor_elem_subjacobians[i][j];
93  }
94  }
95 
96  // Delete the FE objects
97  for (std::map<FEType, FEAbstract *>::iterator i = _neighbor_side_fe.begin();
98  i != _neighbor_side_fe.end(); ++i)
99  delete i->second;
100  _neighbor_side_fe.clear();
101 }

Member Function Documentation

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

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

Definition at line 125 of file diff_context.C.

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

126 {
127  // Make an empty pair keyed with a reference to this _localized_vector
128  localized_vectors[&_localized_vector] = std::make_pair(DenseVector<Number>(), std::vector<DenseSubVector<Number>*>());
129 
130  unsigned int nv = _sys.n_vars();
131 
132  localized_vectors[&_localized_vector].second.reserve(nv);
133 
134  // Fill the DenseSubVector with nv copies of DenseVector
135  for(unsigned int i=0; i != nv; ++i)
136  localized_vectors[&_localized_vector].second.push_back(new DenseSubVector<Number>(localized_vectors[&_localized_vector].first));
137 }
template<typename OutputShape >
template AutoPtr< FEGenericBase< RealGradient > > libMesh::FEMContext::build_new_fe ( const FEGenericBase< OutputShape > *  fe,
const Point p 
) const
protectedinherited

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

Definition at line 1699 of file fem_context.C.

References libMesh::Elem::dim(), libMesh::FEMContext::dim, libMesh::FEMContext::elem, libMesh::FEAbstract::get_fe_type(), and libMesh::FEInterface::inverse_map().

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

1701 {
1702  FEType fe_type = fe->get_fe_type();
1703  AutoPtr<FEGenericBase<OutputShape> > fe_new(FEGenericBase<OutputShape>::build(elem->dim(), fe_type));
1704 
1705  // Map the physical co-ordinates to the master co-ordinates using the inverse_map from fe_interface.h
1706  // Build a vector of point co-ordinates to send to reinit
1707  std::vector<Point> coor(1, FEInterface::inverse_map(dim, fe_type, elem, p));
1708 
1709  // Reinitialize the element and compute the shape function values at coor
1710  fe_new->reinit (elem, &coor);
1711 
1712  return fe_new;
1713 }
bool libMesh::DGFEMContext::dg_terms_are_active ( ) const
inline

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

Definition at line 231 of file dg_fem_context.h.

References _dg_terms_active.

232  { return _dg_terms_active; }
void libMesh::FEMContext::edge_fe_reinit ( )
inherited

Reinitializes edge FE objects on the current geometric element

Definition at line 1438 of file fem_context.C.

References libMesh::FEMContext::_edge_fe, libMesh::FEMContext::dim, libMesh::FEMContext::edge, and libMesh::FEMContext::elem.

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

1439 {
1440  libmesh_assert_equal_to (dim, 3);
1441 
1442  // Initialize all the interior FE objects on elem/edge.
1443  // Logging of FE::reinit is done in the FE functions
1444  std::map<FEType, FEAbstract *>::iterator local_fe_end = _edge_fe.end();
1445  for (std::map<FEType, FEAbstract *>::iterator i = _edge_fe.begin();
1446  i != local_fe_end; ++i)
1447  {
1448  i->second->edge_reinit(elem, edge);
1449  }
1450 }
void libMesh::FEMContext::elem_edge_reinit ( Real  theta)
virtualinherited

Reinitialize Elem and edge FE objects if necessary for integration at a new point in time: specifically, handle moving elements in moving mesh schemes.

Reimplemented from libMesh::DiffContext.

Definition at line 1396 of file fem_context.C.

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

1397 {
1398  // Update the "time" variable of this context object
1399  this->_update_time_from_system(theta);
1400 
1401  // Handle a moving element if necessary
1402  if (_mesh_sys)
1403  {
1404  // FIXME - not threadsafe yet!
1405  elem_position_set(theta);
1406  edge_fe_reinit();
1407  }
1408 }
void libMesh::FEMContext::elem_fe_reinit ( )
inherited

Reinitializes interior FE objects on the current geometric element

Definition at line 1411 of file fem_context.C.

References libMesh::FEMContext::_element_fe, and libMesh::FEMContext::elem.

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

1412 {
1413  // Initialize all the interior FE objects on elem.
1414  // Logging of FE::reinit is done in the FE functions
1415  std::map<FEType, FEAbstract *>::iterator local_fe_end = _element_fe.end();
1416  for (std::map<FEType, FEAbstract *>::iterator i = _element_fe.begin();
1417  i != local_fe_end; ++i)
1418  {
1419  i->second->reinit(elem);
1420  }
1421 }
void libMesh::FEMContext::elem_position_get ( )
inherited

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

Definition at line 1454 of file fem_context.C.

References libMesh::FEMContext::_element_fe_var, libMesh::FEMContext::_mesh_sys, libMesh::FEMContext::_mesh_x_var, libMesh::FEMContext::_mesh_y_var, libMesh::FEMContext::_mesh_z_var, libMesh::Elem::default_order(), libMesh::FEMContext::elem, libMesh::DiffContext::elem_subsolutions, libMesh::invalid_uint, libMeshEnums::LAGRANGE, libMesh::libmesh_assert(), n_nodes, libMesh::Elem::n_nodes(), libMesh::n_threads, and libMesh::Elem::point().

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

1455 {
1456  // This is too expensive to call unless we've been asked to move the mesh
1458 
1459  // This will probably break with threading when two contexts are
1460  // operating on elements which share a node
1461  libmesh_assert_equal_to (libMesh::n_threads(), 1);
1462 
1463  // If the coordinate data is in our own system, it's already
1464  // been set up for us
1465 // if (_mesh_sys == this->number())
1466 // {
1467  unsigned int n_nodes = elem->n_nodes();
1468  // For simplicity we demand that mesh coordinates be stored
1469  // in a format that allows a direct copy
1471  (_element_fe_var[_mesh_x_var]->get_fe_type().family
1472  == LAGRANGE &&
1473  _element_fe_var[_mesh_x_var]->get_fe_type().order
1474  == elem->default_order()));
1476  (_element_fe_var[_mesh_y_var]->get_fe_type().family
1477  == LAGRANGE &&
1478  _element_fe_var[_mesh_y_var]->get_fe_type().order
1479  == elem->default_order()));
1481  (_element_fe_var[_mesh_z_var]->get_fe_type().family
1482  == LAGRANGE &&
1483  _element_fe_var[_mesh_z_var]->get_fe_type().order
1484  == elem->default_order()));
1485 
1486  // Get degree of freedom coefficients from point coordinates
1488  for (unsigned int i=0; i != n_nodes; ++i)
1489  (*elem_subsolutions[_mesh_x_var])(i) = elem->point(i)(0);
1490 
1492  for (unsigned int i=0; i != n_nodes; ++i)
1493  (*elem_subsolutions[_mesh_y_var])(i) = elem->point(i)(1);
1494 
1496  for (unsigned int i=0; i != n_nodes; ++i)
1497  (*elem_subsolutions[_mesh_z_var])(i) = elem->point(i)(2);
1498 // }
1499  // FIXME - If the coordinate data is not in our own system, someone
1500  // had better get around to implementing that... - RHS
1501 // else
1502 // {
1503 // libmesh_not_implemented();
1504 // }
1505 }
void libMesh::FEMContext::elem_position_set ( Real  theta)
inlineinherited

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

Definition at line 758 of file fem_context.h.

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

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

759 {
760  if (_mesh_sys)
761  this->_do_elem_position_set(theta);
762 }
void libMesh::FEMContext::elem_reinit ( Real  theta)
virtualinherited

Reinitialize all my FEM context data on a given element for the given system Reinitialize Elem and FE objects if necessary for integration at a new point in time: specifically, handle moving elements in moving mesh schemes.

Reimplemented from libMesh::DiffContext.

Definition at line 1359 of file fem_context.C.

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

1360 {
1361  // Update the "time" variable of this context object
1362  this->_update_time_from_system(theta);
1363 
1364  // Handle a moving element if necessary.
1365  if (_mesh_sys)
1366  // We assume that the ``default'' state
1367  // of the mesh is its final, theta=1.0
1368  // position, so we don't bother with
1369  // mesh motion in that case.
1370  if (theta != 1.0)
1371  {
1372  // FIXME - ALE is not threadsafe yet!
1373  libmesh_assert_equal_to (libMesh::n_threads(), 1);
1374 
1375  elem_position_set(theta);
1376  }
1377  elem_fe_reinit();
1378 }
void libMesh::FEMContext::elem_side_reinit ( Real  theta)
virtualinherited

Reinitialize Elem and side FE objects if necessary for integration at a new point in time: specifically, handle moving elements in moving mesh schemes.

Reimplemented from libMesh::DiffContext.

Definition at line 1381 of file fem_context.C.

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

1382 {
1383  // Update the "time" variable of this context object
1384  this->_update_time_from_system(theta);
1385 
1386  // Handle a moving element if necessary
1387  if (_mesh_sys)
1388  {
1389  // FIXME - not threadsafe yet!
1390  elem_position_set(theta);
1391  side_fe_reinit();
1392  }
1393 }
Gradient libMesh::FEMContext::fixed_interior_gradient ( unsigned int  var,
unsigned int  qp 
) const
inherited

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

Definition at line 974 of file fem_context.C.

975 {
976  Gradient du;
977 
978  this->fixed_interior_gradient( var, qp, du );
979 
980  return du;
981 }
template<typename OutputType >
void libMesh::FEMContext::fixed_interior_gradient ( unsigned int  var,
unsigned int  qp,
OutputType &  grad_u 
) const
inherited

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

Tensor libMesh::FEMContext::fixed_interior_hessian ( unsigned int  var,
unsigned int  qp 
) const
inherited

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

Definition at line 1021 of file fem_context.C.

1022 {
1023  Tensor d2u;
1024 
1025  this->fixed_interior_hessian( var, qp, d2u );
1026 
1027  return d2u;
1028 }
template<typename OutputType >
void libMesh::FEMContext::fixed_interior_hessian ( unsigned int  var,
unsigned int  qp,
OutputType &  hess_u 
) const
inherited

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

Definition at line 1032 of file fem_context.C.

References libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_fixed_subsolutions, libMesh::FEGenericBase< T >::get_d2phi(), libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

1034 {
1035  typedef typename TensorTools::MakeReal<
1036  typename TensorTools::DecrementRank<
1037  typename TensorTools::DecrementRank<
1038  OutputType>::type>::type>::type
1039  OutputShape;
1040 
1041  // Get local-to-global dof index lookup
1042  libmesh_assert_greater (dof_indices.size(), var);
1043  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
1044  (dof_indices_var[var].size());
1045 
1046  // Get current local coefficients
1049  DenseSubVector<Number> &coef = *elem_fixed_subsolutions[var];
1050 
1051  // Get finite element object
1052  FEGenericBase<OutputShape>* fe = NULL;
1053  this->get_element_fe<OutputShape>( var, fe );
1054 
1055  // Get shape function values at quadrature point
1056  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor> > &d2phi = fe->get_d2phi();
1057 
1058  // Accumulate solution second derivatives
1059  d2u = 0.0;
1060 
1061  for (unsigned int l=0; l != n_dofs; l++)
1062  d2u.add_scaled(d2phi[l][qp], coef(l));
1063 
1064  return;
1065 }
Number libMesh::FEMContext::fixed_interior_value ( unsigned int  var,
unsigned int  qp 
) const
inherited

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

Definition at line 929 of file fem_context.C.

930 {
931  Number u = 0.;
932 
933  this->fixed_interior_value( var, qp, u );
934 
935  return u;
936 }
template<typename OutputType >
void libMesh::FEMContext::fixed_interior_value ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
inherited

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

Definition at line 941 of file fem_context.C.

References libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_fixed_subsolutions, libMesh::FEGenericBase< T >::get_phi(), libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

943 {
944  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
945 
946  // Get local-to-global dof index lookup
947  libmesh_assert_greater (dof_indices.size(), var);
948  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
949  (dof_indices_var[var].size());
950 
951  // Get current local coefficients
954  DenseSubVector<Number> &coef = *elem_fixed_subsolutions[var];
955 
956  // Get finite element object
957  FEGenericBase<OutputShape>* fe = NULL;
958  this->get_element_fe<OutputShape>( var, fe );
959 
960  // Get shape function values at quadrature point
961  const std::vector<std::vector<OutputShape> > &phi = fe->get_phi();
962 
963  // Accumulate solution value
964  u = 0.0;
965 
966  for (unsigned int l=0; l != n_dofs; l++)
967  u += phi[l][qp] * coef(l);
968 
969  return;
970 }
Gradient libMesh::FEMContext::fixed_point_gradient ( unsigned int  var,
const Point p 
) const
inherited

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

Definition at line 1254 of file fem_context.C.

1255 {
1256  Gradient grad_u;
1257 
1258  this->fixed_point_gradient( var, p, grad_u );
1259 
1260  return grad_u;
1261 }
template<typename OutputType >
void libMesh::FEMContext::fixed_point_gradient ( unsigned int  var,
const Point p,
OutputType &  grad_u 
) const
inherited

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

Definition at line 1266 of file fem_context.C.

References libMesh::FEMContext::build_new_fe(), libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_fixed_subsolutions, libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

1268 {
1269  typedef typename TensorTools::MakeReal
1270  <typename TensorTools::DecrementRank<OutputType>::type>::type
1271  OutputShape;
1272 
1273  // Get local-to-global dof index lookup
1274  libmesh_assert_greater (dof_indices.size(), var);
1275  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
1276  (dof_indices_var[var].size());
1277 
1278  // Get current local coefficients
1281  DenseSubVector<Number> &coef = *elem_fixed_subsolutions[var];
1282 
1283  // Get finite element object
1284  FEGenericBase<OutputShape>* fe = NULL;
1285  this->get_element_fe<OutputShape>( var, fe );
1286 
1287  // Build a FE for calculating u(p)
1288  AutoPtr<FEGenericBase<OutputShape> > fe_new = this->build_new_fe( fe, p );
1289 
1290  // Get the values of the shape function derivatives
1291  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient> >& dphi = fe_new->get_dphi();
1292 
1293  grad_u = 0.0;
1294 
1295  for (unsigned int l=0; l != n_dofs; l++)
1296  grad_u.add_scaled(dphi[l][0], coef(l));
1297 
1298  return;
1299 }
Tensor libMesh::FEMContext::fixed_point_hessian ( unsigned int  var,
const Point p 
) const
inherited

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

Definition at line 1304 of file fem_context.C.

1305 {
1306  Tensor hess_u;
1307 
1308  this->fixed_point_hessian( var, p, hess_u );
1309 
1310  return hess_u;
1311 }
template<typename OutputType >
void libMesh::FEMContext::fixed_point_hessian ( unsigned int  var,
const Point p,
OutputType &  hess_u 
) const
inherited

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

Definition at line 1316 of file fem_context.C.

References libMesh::FEMContext::build_new_fe(), libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_fixed_subsolutions, libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

1318 {
1319  typedef typename TensorTools::MakeReal<
1320  typename TensorTools::DecrementRank<
1321  typename TensorTools::DecrementRank<
1322  OutputType>::type>::type>::type
1323  OutputShape;
1324 
1325  // Get local-to-global dof index lookup
1326  libmesh_assert_greater (dof_indices.size(), var);
1327  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
1328  (dof_indices_var[var].size());
1329 
1330  // Get current local coefficients
1333  DenseSubVector<Number> &coef = *elem_fixed_subsolutions[var];
1334 
1335  // Get finite element object
1336  FEGenericBase<OutputShape>* fe = NULL;
1337  this->get_element_fe<OutputShape>( var, fe );
1338 
1339  // Build a FE for calculating u(p)
1340  AutoPtr<FEGenericBase<OutputShape> > fe_new = this->build_new_fe( fe, p );
1341 
1342  // Get the values of the shape function derivatives
1343  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor> >& d2phi = fe_new->get_d2phi();
1344 
1345  hess_u = 0.0;
1346 
1347  for (unsigned int l=0; l != n_dofs; l++)
1348  hess_u.add_scaled(d2phi[l][0], coef(l));
1349 
1350  return;
1351 }
Number libMesh::FEMContext::fixed_point_value ( unsigned int  var,
const Point p 
) const
inherited

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

Definition at line 1209 of file fem_context.C.

1210 {
1211  Number u = 0.;
1212 
1213  this->fixed_point_value( var, p, u );
1214 
1215  return u;
1216 }
template<typename OutputType >
void libMesh::FEMContext::fixed_point_value ( unsigned int  var,
const Point p,
OutputType &  u 
) const
inherited

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

Definition at line 1219 of file fem_context.C.

References libMesh::FEMContext::build_new_fe(), libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_fixed_subsolutions, libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

1221 {
1222  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
1223 
1224  // Get local-to-global dof index lookup
1225  libmesh_assert_greater (dof_indices.size(), var);
1226  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
1227  (dof_indices_var[var].size());
1228 
1229  // Get current local coefficients
1232  DenseSubVector<Number> &coef = *elem_fixed_subsolutions[var];
1233 
1234  // Get finite element object
1235  FEGenericBase<OutputShape>* fe = NULL;
1236  this->get_element_fe<OutputShape>( var, fe );
1237 
1238  // Build a FE for calculating u(p)
1239  AutoPtr<FEGenericBase<OutputShape> > fe_new = this->build_new_fe( fe, p );
1240 
1241  // Get the values of the shape function derivatives
1242  const std::vector<std::vector<OutputShape> >& phi = fe_new->get_phi();
1243 
1244  u = 0.;
1245 
1246  for (unsigned int l=0; l != n_dofs; l++)
1247  u += phi[l][0] * coef(l);
1248 
1249  return;
1250 }
Gradient libMesh::FEMContext::fixed_side_gradient ( unsigned int  var,
unsigned int  qp 
) const
inherited

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

Definition at line 1114 of file fem_context.C.

1115 {
1116  Gradient du;
1117 
1118  this->fixed_side_gradient( var, qp, du );
1119 
1120  return du;
1121 }
template<typename OutputType >
void libMesh::FEMContext::fixed_side_gradient ( unsigned int  var,
unsigned int  qp,
OutputType &  grad_u 
) const
inherited

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

Definition at line 1125 of file fem_context.C.

References libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_fixed_subsolutions, libMesh::FEGenericBase< T >::get_dphi(), libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

1127 {
1128  typedef typename TensorTools::MakeReal
1129  <typename TensorTools::DecrementRank<OutputType>::type>::type
1130  OutputShape;
1131 
1132  // Get local-to-global dof index lookup
1133  libmesh_assert_greater (dof_indices.size(), var);
1134  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
1135  (dof_indices_var[var].size());
1136 
1137  // Get current local coefficients
1140  DenseSubVector<Number> &coef = *elem_fixed_subsolutions[var];
1141 
1142  // Get finite element object
1143  FEGenericBase<OutputShape>* the_side_fe = NULL;
1144  this->get_side_fe<OutputShape>( var, the_side_fe );
1145 
1146  // Get shape function values at quadrature point
1147  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient> > &dphi = the_side_fe->get_dphi();
1148 
1149  // Accumulate solution derivatives
1150  du = 0.0;
1151 
1152  for (unsigned int l=0; l != n_dofs; l++)
1153  du.add_scaled(dphi[l][qp], coef(l));
1154 
1155  return;
1156 }
Tensor libMesh::FEMContext::fixed_side_hessian ( unsigned int  var,
unsigned int  qp 
) const
inherited

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

Definition at line 1161 of file fem_context.C.

1162 {
1163  Tensor d2u;
1164 
1165  this->fixed_side_hessian( var, qp, d2u );
1166 
1167  return d2u;
1168 }
template<typename OutputType >
void libMesh::FEMContext::fixed_side_hessian ( unsigned int  var,
unsigned int  qp,
OutputType &  hess_u 
) const
inherited

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

Definition at line 1171 of file fem_context.C.

References libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_fixed_subsolutions, libMesh::FEGenericBase< T >::get_d2phi(), libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

1173 {
1174  typedef typename TensorTools::MakeReal<
1175  typename TensorTools::DecrementRank<
1176  typename TensorTools::DecrementRank<
1177  OutputType>::type>::type>::type
1178  OutputShape;
1179 
1180  // Get local-to-global dof index lookup
1181  libmesh_assert_greater (dof_indices.size(), var);
1182  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
1183  (dof_indices_var[var].size());
1184 
1185  // Get current local coefficients
1188  DenseSubVector<Number> &coef = *elem_fixed_subsolutions[var];
1189 
1190  // Get finite element object
1191  FEGenericBase<OutputShape>* the_side_fe = NULL;
1192  this->get_side_fe<OutputShape>( var, the_side_fe );
1193 
1194  // Get shape function values at quadrature point
1195  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor> > &d2phi = the_side_fe->get_d2phi();
1196 
1197  // Accumulate solution second derivatives
1198  d2u = 0.0;
1199 
1200  for (unsigned int l=0; l != n_dofs; l++)
1201  d2u.add_scaled(d2phi[l][qp], coef(l));
1202 
1203  return;
1204 }
Number libMesh::FEMContext::fixed_side_value ( unsigned int  var,
unsigned int  qp 
) const
inherited

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

Definition at line 1070 of file fem_context.C.

1071 {
1072  Number u = 0.;
1073 
1074  this->fixed_side_value( var, qp, u );
1075 
1076  return u;
1077 }
template<typename OutputType >
void libMesh::FEMContext::fixed_side_value ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
inherited

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

Definition at line 1081 of file fem_context.C.

References libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_fixed_subsolutions, libMesh::FEGenericBase< T >::get_phi(), libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

1083 {
1084  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
1085 
1086  // Get local-to-global dof index lookup
1087  libmesh_assert_greater (dof_indices.size(), var);
1088  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
1089  (dof_indices_var[var].size());
1090 
1091  // Get current local coefficients
1094  DenseSubVector<Number> &coef = *elem_fixed_subsolutions[var];
1095 
1096  // Get finite element object
1097  FEGenericBase<OutputShape>* the_side_fe = NULL;
1098  this->get_side_fe<OutputShape>( var, the_side_fe );
1099 
1100  // Get shape function values at quadrature point
1101  const std::vector<std::vector<OutputShape> > &phi = the_side_fe->get_phi();
1102 
1103  // Accumulate solution value
1104  u = 0.0;
1105 
1106  for (unsigned int l=0; l != n_dofs; l++)
1107  u += phi[l][qp] * coef(l);
1108 
1109  return;
1110 }
Real libMesh::DiffContext::get_deltat_value ( )
inherited

Returns the value currently pointed to by this class's _deltat member

Definition at line 117 of file diff_context.C.

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

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

118 {
120 
121  return *_deltat;
122 }
unsigned char libMesh::FEMContext::get_dim ( ) const
inlineinherited

Accessor for cached element dimension

Definition at line 636 of file fem_context.h.

References libMesh::FEMContext::dim.

637  { return dim; }
const std::vector<dof_id_type>& libMesh::DiffContext::get_dof_indices ( ) const
inlineinherited
std::vector<dof_id_type>& libMesh::DiffContext::get_dof_indices ( )
inlineinherited

Non-const accessor for element dof indices

Definition at line 241 of file diff_context.h.

References libMesh::DiffContext::dof_indices.

242  { return dof_indices; }
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 248 of file diff_context.h.

References libMesh::DiffContext::dof_indices_var.

249  { return dof_indices_var[var]; }
unsigned char libMesh::FEMContext::get_edge ( ) const
inlineinherited

Accessor for current edge of Elem object

Definition at line 630 of file fem_context.h.

References libMesh::FEMContext::edge.

631  { return edge; }
template<typename OutputShape >
void libMesh::FEMContext::get_edge_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe 
) const
inlineinherited

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

Definition at line 796 of file fem_context.h.

References libMesh::FEMContext::_edge_fe_var.

797 {
798  libmesh_assert_less ( var, _edge_fe_var.size() );
799  fe = libmesh_cast_ptr<FEGenericBase<OutputShape>*>( _edge_fe_var[var] );
800 }
FEBase * libMesh::FEMContext::get_edge_fe ( unsigned int  var) const
inlineinherited

Accessor for edge finite element object for scalar-valued variable var.

Definition at line 803 of file fem_context.h.

References libMesh::FEMContext::_edge_fe_var.

804 {
805  libmesh_assert_less ( var, _edge_fe_var.size() );
806  return libmesh_cast_ptr<FEBase*>( _edge_fe_var[var] );
807 }
const QBase& libMesh::FEMContext::get_edge_qrule ( ) const
inlineinherited

Accessor for element edge quadrature rule.

Definition at line 541 of file fem_context.h.

References libMesh::FEMContext::edge_qrule.

542  { return *(this->edge_qrule); }
const Elem& libMesh::FEMContext::get_elem ( ) const
inlineinherited

Accessor for current Elem object

Definition at line 612 of file fem_context.h.

References libMesh::FEMContext::elem.

Referenced by libMesh::FEMSystem::mesh_position_set(), and libMesh::FEMSystem::numerical_jacobian().

613  { return *elem; }
Elem& libMesh::FEMContext::get_elem ( )
inlineinherited

Accessor for current Elem object

Definition at line 618 of file fem_context.h.

References libMesh::FEMContext::elem.

619  { return *(const_cast<Elem*>(elem)); }
const DenseMatrix<Number>& libMesh::DGFEMContext::get_elem_elem_jacobian ( ) const
inline

Const accessor for element-element Jacobian.

Definition at line 110 of file dg_fem_context.h.

References _elem_elem_jacobian.

111  { return _elem_elem_jacobian; }
DenseMatrix<Number>& libMesh::DGFEMContext::get_elem_elem_jacobian ( )
inline

Non-const accessor for element-element Jacobian.

Definition at line 116 of file dg_fem_context.h.

References _elem_elem_jacobian.

117  { return _elem_elem_jacobian; }
const DenseSubMatrix<Number>& libMesh::DGFEMContext::get_elem_elem_jacobian ( unsigned int  var1,
unsigned int  var2 
) const
inline

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

Definition at line 123 of file dg_fem_context.h.

References _elem_elem_subjacobians.

124  { return *(_elem_elem_subjacobians[var1][var2]); }
DenseSubMatrix<Number>& libMesh::DGFEMContext::get_elem_elem_jacobian ( unsigned int  var1,
unsigned int  var2 
)
inline

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

Definition at line 130 of file dg_fem_context.h.

References _elem_elem_subjacobians.

131  { return *(_elem_elem_subjacobians[var1][var2]); }
DenseVector<Number>& libMesh::DiffContext::get_elem_fixed_solution ( )
inlineinherited

Non-const accessor for element fixed solution.

Definition at line 132 of file diff_context.h.

References libMesh::DiffContext::elem_fixed_solution.

133  { return elem_fixed_solution; }
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 139 of file diff_context.h.

References libMesh::DiffContext::elem_fixed_subsolutions.

140  { return *(elem_fixed_subsolutions[var]); }
const DenseMatrix<Number>& libMesh::DiffContext::get_elem_jacobian ( ) const
inlineinherited
DenseMatrix<Number>& libMesh::DiffContext::get_elem_jacobian ( )
inlineinherited

Non-const accessor for element Jacobian.

Definition at line 177 of file diff_context.h.

References libMesh::DiffContext::elem_jacobian.

178  { return elem_jacobian; }
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 184 of file diff_context.h.

References libMesh::DiffContext::elem_subjacobians.

185  { return *(elem_subjacobians[var1][var2]); }
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 191 of file diff_context.h.

References libMesh::DiffContext::elem_subjacobians.

192  { return *(elem_subjacobians[var1][var2]); }
const DenseMatrix<Number>& libMesh::DGFEMContext::get_elem_neighbor_jacobian ( ) const
inline

Const accessor for element-neighbor Jacobian.

Definition at line 136 of file dg_fem_context.h.

References _elem_neighbor_jacobian.

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

Non-const accessor for element -neighborJacobian.

Definition at line 142 of file dg_fem_context.h.

References _elem_neighbor_jacobian.

143  { return _elem_neighbor_jacobian; }
const DenseSubMatrix<Number>& libMesh::DGFEMContext::get_elem_neighbor_jacobian ( unsigned int  var1,
unsigned int  var2 
) const
inline

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

Definition at line 149 of file dg_fem_context.h.

References _elem_neighbor_subjacobians.

150  { return *(_elem_neighbor_subjacobians[var1][var2]); }
DenseSubMatrix<Number>& libMesh::DGFEMContext::get_elem_neighbor_jacobian ( unsigned int  var1,
unsigned int  var2 
)
inline

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

Definition at line 156 of file dg_fem_context.h.

References _elem_neighbor_subjacobians.

157  { return *(_elem_neighbor_subjacobians[var1][var2]); }
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 151 of file diff_context.h.

References libMesh::DiffContext::elem_residual.

152  { return elem_residual; }
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 158 of file diff_context.h.

References libMesh::DiffContext::elem_subresiduals.

159  { return *(elem_subresiduals[var]); }
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 165 of file diff_context.h.

References libMesh::DiffContext::elem_subresiduals.

166  { return *(elem_subresiduals[var]); }
DenseVector<Number>& libMesh::DiffContext::get_elem_solution ( )
inlineinherited

Non-const accessor for element solution.

Definition at line 113 of file diff_context.h.

References libMesh::DiffContext::elem_solution.

114  { return elem_solution; }
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 120 of file diff_context.h.

References libMesh::DiffContext::elem_subsolutions.

121  { return *(elem_subsolutions[var]); }
Real libMesh::DiffContext::get_elem_solution_derivative ( ) const
inlineinherited

Definition at line 269 of file diff_context.h.

References libMesh::DiffContext::elem_solution_derivative.

270  { return elem_solution_derivative; }
template<typename OutputShape >
void libMesh::FEMContext::get_element_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe 
) const
inlineinherited

Accessor for interior finite element object for variable var.

Definition at line 766 of file fem_context.h.

References libMesh::FEMContext::_element_fe_var.

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

767 {
768  libmesh_assert_less ( var, _element_fe_var.size() );
769  fe = libmesh_cast_ptr<FEGenericBase<OutputShape>*>( _element_fe_var[var] );
770 }
FEBase * libMesh::FEMContext::get_element_fe ( unsigned int  var) const
inlineinherited

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

Definition at line 773 of file fem_context.h.

References libMesh::FEMContext::_element_fe_var.

774 {
775  libmesh_assert_less ( var, _element_fe_var.size() );
776  return libmesh_cast_ptr<FEBase*>( _element_fe_var[var] );
777 }
const QBase& libMesh::FEMContext::get_element_qrule ( ) const
inlineinherited

Accessor for element interior quadrature rule.

Definition at line 529 of file fem_context.h.

References libMesh::FEMContext::element_qrule.

530  { return *(this->element_qrule); }
Real libMesh::DiffContext::get_fixed_solution_derivative ( ) const
inlineinherited

Definition at line 272 of file diff_context.h.

References libMesh::DiffContext::fixed_solution_derivative.

273  { 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 155 of file diff_context.C.

References libMesh::DiffContext::localized_vectors.

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

156 {
157  return *localized_vectors[&_localized_vector].second[_var];
158 }
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 161 of file diff_context.C.

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

162 {
163  std::map<const NumericVector<Number>*, std::pair<DenseVector<Number>, std::vector<DenseSubVector<Number>*> > >::const_iterator
164  localized_vectors_it = localized_vectors.find(&_localized_vector);
165  libmesh_assert(localized_vectors_it != localized_vectors.end());
166  return *localized_vectors_it->second.second[_var];
167 }
DenseVector< Number > & libMesh::DiffContext::get_localized_vector ( const NumericVector< Number > &  _localized_vector)
inherited

Return a reference to DenseVector localization of _localized_vector contained in the localized_vectors map

Definition at line 140 of file diff_context.C.

References libMesh::DiffContext::localized_vectors.

141 {
142  return localized_vectors[&_localized_vector].first;
143 }
const DenseVector< Number > & libMesh::DiffContext::get_localized_vector ( const NumericVector< Number > &  _localized_vector) const
inherited

const accessible version of get_localized_vector function

Definition at line 146 of file diff_context.C.

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

147 {
148  std::map<const NumericVector<Number>*, std::pair<DenseVector<Number>, std::vector<DenseSubVector<Number>*> > >::const_iterator
149  localized_vectors_it = localized_vectors.find(&_localized_vector);
150  libmesh_assert(localized_vectors_it != localized_vectors.end());
151  return localized_vectors_it->second.first;
152 }
const System* libMesh::FEMContext::get_mesh_system ( ) const
inlineinherited

Accessor for moving mesh System

Definition at line 558 of file fem_context.h.

References libMesh::FEMContext::_mesh_sys.

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

Accessor for moving mesh System

Definition at line 564 of file fem_context.h.

References libMesh::FEMContext::_mesh_sys.

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

Accessor for x-variable of moving mesh System

Definition at line 570 of file fem_context.h.

References libMesh::FEMContext::_mesh_x_var.

571  { return _mesh_x_var; }
unsigned int libMesh::FEMContext::get_mesh_y_var ( ) const
inlineinherited

Accessor for y-variable of moving mesh System

Definition at line 584 of file fem_context.h.

References libMesh::FEMContext::_mesh_y_var.

585  { return _mesh_y_var; }
unsigned int libMesh::FEMContext::get_mesh_z_var ( ) const
inlineinherited

Accessor for z-variable of moving mesh System

Definition at line 598 of file fem_context.h.

References libMesh::FEMContext::_mesh_z_var.

599  { return _mesh_z_var; }
const Elem& libMesh::DGFEMContext::get_neighbor ( ) const
inline

Accessor for current neighbor Elem object for assembling DG terms.

Definition at line 225 of file dg_fem_context.h.

References _neighbor.

Referenced by neighbor_side_fe_reinit().

226  { return *_neighbor; }
const std::vector<dof_id_type>& libMesh::DGFEMContext::get_neighbor_dof_indices ( ) const
inline

Accessor for neighbor dof indices

Definition at line 71 of file dg_fem_context.h.

References _neighbor_dof_indices.

72  { return _neighbor_dof_indices; }
const std::vector<dof_id_type>& libMesh::DGFEMContext::get_neighbor_dof_indices ( unsigned int  var) const
inline

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

Definition at line 78 of file dg_fem_context.h.

References _neighbor_dof_indices_var.

79  { return _neighbor_dof_indices_var[var]; }
const DenseMatrix<Number>& libMesh::DGFEMContext::get_neighbor_elem_jacobian ( ) const
inline

Const accessor for element-neighbor Jacobian.

Definition at line 162 of file dg_fem_context.h.

References _neighbor_elem_jacobian.

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

Non-const accessor for element Jacobian.

Definition at line 168 of file dg_fem_context.h.

References _neighbor_elem_jacobian.

169  { return _neighbor_elem_jacobian; }
const DenseSubMatrix<Number>& libMesh::DGFEMContext::get_neighbor_elem_jacobian ( unsigned int  var1,
unsigned int  var2 
) const
inline

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

Definition at line 175 of file dg_fem_context.h.

References _neighbor_elem_subjacobians.

176  { return *(_neighbor_elem_subjacobians[var1][var2]); }
DenseSubMatrix<Number>& libMesh::DGFEMContext::get_neighbor_elem_jacobian ( unsigned int  var1,
unsigned int  var2 
)
inline

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

Definition at line 182 of file dg_fem_context.h.

References _neighbor_elem_subjacobians.

183  { return *(_neighbor_elem_subjacobians[var1][var2]); }
const DenseMatrix<Number>& libMesh::DGFEMContext::get_neighbor_neighbor_jacobian ( ) const
inline

Const accessor for element-neighbor Jacobian.

Definition at line 188 of file dg_fem_context.h.

References _neighbor_neighbor_jacobian.

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

Non-const accessor for element Jacobian.

Definition at line 194 of file dg_fem_context.h.

References _neighbor_neighbor_jacobian.

195  { return _neighbor_neighbor_jacobian; }
const DenseSubMatrix<Number>& libMesh::DGFEMContext::get_neighbor_neighbor_jacobian ( unsigned int  var1,
unsigned int  var2 
) const
inline

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

Definition at line 201 of file dg_fem_context.h.

References _neighbor_neighbor_subjacobians.

202  { return *(_neighbor_neighbor_subjacobians[var1][var2]); }
DenseSubMatrix<Number>& libMesh::DGFEMContext::get_neighbor_neighbor_jacobian ( unsigned int  var1,
unsigned int  var2 
)
inline

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

Definition at line 208 of file dg_fem_context.h.

References _neighbor_neighbor_subjacobians.

209  { return *(_neighbor_neighbor_subjacobians[var1][var2]); }
const DenseVector<Number>& libMesh::DGFEMContext::get_neighbor_residual ( ) const
inline

Const accessor for neighbor residual.

Definition at line 84 of file dg_fem_context.h.

References _neighbor_residual.

85  { return _neighbor_residual; }
DenseVector<Number>& libMesh::DGFEMContext::get_neighbor_residual ( )
inline

Non-const accessor for neighbor residual.

Definition at line 90 of file dg_fem_context.h.

References _neighbor_residual.

91  { return _neighbor_residual; }
const DenseSubVector<Number>& libMesh::DGFEMContext::get_neighbor_residual ( unsigned int  var) const
inline

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

Definition at line 97 of file dg_fem_context.h.

References _neighbor_subresiduals.

98  { return *(_neighbor_subresiduals[var]); }
DenseSubVector<Number>& libMesh::DGFEMContext::get_neighbor_residual ( unsigned int  var)
inline

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

Definition at line 104 of file dg_fem_context.h.

References _neighbor_subresiduals.

105  { return *(_neighbor_subresiduals[var]); }
template<typename OutputShape >
void libMesh::DGFEMContext::get_neighbor_side_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe 
) const
inline

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

Definition at line 300 of file dg_fem_context.h.

References _neighbor_side_fe_var.

301 {
302  libmesh_assert_less ( var, _neighbor_side_fe_var.size() );
303  fe = libmesh_cast_ptr<FEGenericBase<OutputShape>*>( _neighbor_side_fe_var[var] );
304 }
const std::vector<DenseVector<Number> >& libMesh::DiffContext::get_qoi_derivatives ( ) const
inlineinherited

Const accessor for QoI derivatives.

Definition at line 209 of file diff_context.h.

References libMesh::DiffContext::elem_qoi_derivative.

210  { return elem_qoi_derivative; }
std::vector<DenseVector<Number> >& libMesh::DiffContext::get_qoi_derivatives ( )
inlineinherited

Non-const accessor for QoI derivatives.

Definition at line 215 of file diff_context.h.

References libMesh::DiffContext::elem_qoi_derivative.

216  { return elem_qoi_derivative; }
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 222 of file diff_context.h.

References libMesh::DiffContext::elem_qoi_subderivatives.

223  { return *(elem_qoi_subderivatives[qoi][var]); }
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 229 of file diff_context.h.

References libMesh::DiffContext::elem_qoi_subderivatives.

230  { return *(elem_qoi_subderivatives[qoi][var]); }
const std::vector<Number>& libMesh::DiffContext::get_qois ( ) const
inlineinherited

Const accessor for QoI vector.

Definition at line 197 of file diff_context.h.

References libMesh::DiffContext::elem_qoi.

198  { return elem_qoi; }
std::vector<Number>& libMesh::DiffContext::get_qois ( )
inlineinherited

Non-const accessor for QoI vector.

Definition at line 203 of file diff_context.h.

References libMesh::DiffContext::elem_qoi.

204  { return elem_qoi; }
unsigned char libMesh::FEMContext::get_side ( ) const
inlineinherited

Accessor for current side of Elem object

Definition at line 624 of file fem_context.h.

References libMesh::FEMContext::side.

625  { return side; }
template<typename OutputShape >
void libMesh::FEMContext::get_side_fe ( unsigned int  var,
FEGenericBase< OutputShape > *&  fe 
) const
inlineinherited

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

Definition at line 781 of file fem_context.h.

References libMesh::FEMContext::_side_fe_var.

782 {
783  libmesh_assert_less ( var, _side_fe_var.size() );
784  fe = libmesh_cast_ptr<FEGenericBase<OutputShape>*>( _side_fe_var[var] );
785 }
FEBase * libMesh::FEMContext::get_side_fe ( unsigned int  var) const
inlineinherited

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

Definition at line 788 of file fem_context.h.

References libMesh::FEMContext::_side_fe_var.

789 {
790  libmesh_assert_less ( var, _side_fe_var.size() );
791  return libmesh_cast_ptr<FEBase*>( _side_fe_var[var] );
792 }
const QBase& libMesh::FEMContext::get_side_qrule ( ) const
inlineinherited

Accessor for element side quadrature rule.

Definition at line 535 of file fem_context.h.

References libMesh::FEMContext::side_qrule.

536  { return *(this->side_qrule); }
const System& libMesh::DiffContext::get_system ( ) const
inlineinherited

Accessor for associated system.

Definition at line 101 of file diff_context.h.

References libMesh::DiffContext::_system.

Referenced by neighbor_side_fe_reinit().

102  { return _system; }
Real libMesh::DiffContext::get_system_time ( ) const
inlineinherited

Accessor for the time variable stored in the system class.

Definition at line 254 of file diff_context.h.

References libMesh::DiffContext::system_time.

255  { return system_time; }
Real libMesh::DiffContext::get_time ( ) const
inlineinherited

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

Definition at line 260 of file diff_context.h.

References libMesh::DiffContext::time.

261  { return time; }
bool libMesh::FEMContext::has_side_boundary_id ( boundary_id_type  id) const
inherited

Reports if the boundary id is found on the current side

Definition at line 144 of file fem_context.C.

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

145 {
146  return _boundary_info->has_boundary_id(elem, side, id);
147 }
template<typename OutputType >
template void libMesh::FEMContext::interior_curl< Gradient > ( unsigned int  var,
unsigned int  qp,
OutputType &  curl_u 
) const
inherited

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

Definition at line 417 of file fem_context.C.

References libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_subsolutions, libMesh::FEGenericBase< T >::get_curl_phi(), libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

419 {
420  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
421 
422  // Get local-to-global dof index lookup
423  libmesh_assert_greater (dof_indices.size(), var);
424  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
425  (dof_indices_var[var].size());
426 
427  // Get current local coefficients
430  DenseSubVector<Number> &coef = *elem_subsolutions[var];
431 
432  // Get finite element object
433  FEGenericBase<OutputShape>* fe = NULL;
434  this->get_element_fe<OutputShape>( var, fe );
435 
436  // Get shape function values at quadrature point
437  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputShape> > &curl_phi = fe->get_curl_phi();
438 
439  // Accumulate solution curl
440  curl_u = 0.;
441 
442  for (unsigned int l=0; l != n_dofs; l++)
443  curl_u.add_scaled(curl_phi[l][qp], coef(l));
444 
445  return;
446 }
template<typename OutputType >
template void libMesh::FEMContext::interior_div< Number > ( unsigned int  var,
unsigned int  qp,
OutputType &  div_u 
) const
inherited

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

Definition at line 450 of file fem_context.C.

References libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_subsolutions, libMesh::FEGenericBase< T >::get_div_phi(), libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

452 {
453  typedef typename
454  TensorTools::IncrementRank
455  <typename TensorTools::MakeReal<OutputType>::type>::type OutputShape;
456 
457  // Get local-to-global dof index lookup
458  libmesh_assert_greater (dof_indices.size(), var);
459  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
460  (dof_indices_var[var].size());
461 
462  // Get current local coefficients
465  DenseSubVector<Number> &coef = *elem_subsolutions[var];
466 
467  // Get finite element object
468  FEGenericBase<OutputShape>* fe = NULL;
469  this->get_element_fe<OutputShape>( var, fe );
470 
471  // Get shape function values at quadrature point
472  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputDivergence> > &div_phi = fe->get_div_phi();
473 
474  // Accumulate solution curl
475  div_u = 0.;
476 
477  for (unsigned int l=0; l != n_dofs; l++)
478  div_u += div_phi[l][qp] * coef(l);
479 
480  return;
481 }
Gradient libMesh::FEMContext::interior_gradient ( unsigned int  var,
unsigned int  qp 
) const
inherited

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

Definition at line 236 of file fem_context.C.

237 {
238  Gradient du;
239 
240  this->interior_gradient( var, qp, du );
241 
242  return du;
243 }
template<typename OutputType >
void libMesh::FEMContext::interior_gradient ( unsigned int  var,
unsigned int  qp,
OutputType &  du 
) const
inherited

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

Definition at line 248 of file fem_context.C.

References libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_subsolutions, libMesh::FEGenericBase< T >::get_dphi(), libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

250 {
251  typedef typename TensorTools::MakeReal
252  <typename TensorTools::DecrementRank<OutputType>::type>::type
253  OutputShape;
254 
255  // Get local-to-global dof index lookup
256  libmesh_assert_greater (dof_indices.size(), var);
257  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
258  (dof_indices_var[var].size());
259 
260  // Get current local coefficients
263  DenseSubVector<Number> &coef = *elem_subsolutions[var];
264 
265  // Get finite element object
266  FEGenericBase<OutputShape>* fe = NULL;
267  this->get_element_fe<OutputShape>( var, fe );
268 
269  // Get shape function values at quadrature point
270  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient> > &dphi = fe->get_dphi();
271 
272  // Accumulate solution derivatives
273  du = 0;
274 
275  for (unsigned int l=0; l != n_dofs; l++)
276  du.add_scaled(dphi[l][qp], coef(l));
277 
278  return;
279 }
template<typename OutputType >
template void libMesh::FEMContext::interior_gradients< Tensor > ( unsigned int  var,
const NumericVector< Number > &  _system_vector,
std::vector< OutputType > &  interior_gradients_vector 
) const
inherited

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

Definition at line 285 of file fem_context.C.

References libMesh::FEGenericBase< T >::get_dphi(), and libMesh::libmesh_assert_greater().

288 {
289  typedef typename TensorTools::MakeReal
290  <typename TensorTools::DecrementRank<OutputType>::type>::type
291  OutputShape;
292 
293  // Get local-to-global dof index lookup
294  libmesh_assert_greater (dof_indices.size(), var);
295  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
296  (dof_indices_var[var].size());
297 
298  // Get current local coefficients
299  const DenseSubVector<Number> &coef = get_localized_subvector(_system_vector, var);
300 
301  // Get finite element object
302  FEGenericBase<OutputShape>* fe = NULL;
303  this->get_element_fe<OutputShape>( var, fe );
304 
305  // Get shape function values at quadrature point
306  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient> > &dphi = fe->get_dphi();
307 
308  // Loop over all the q_points in this finite element
309  for (unsigned int qp=0; qp != du_vals.size(); qp++)
310  {
311  OutputType &du = du_vals[qp];
312 
313  // Compute the gradient at this q_point
314  du = 0;
315 
316  for (unsigned int l=0; l != n_dofs; l++)
317  du.add_scaled(dphi[l][qp], coef(l));
318  }
319 
320  return;
321 }
Tensor libMesh::FEMContext::interior_hessian ( unsigned int  var,
unsigned int  qp 
) const
inherited

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

Definition at line 324 of file fem_context.C.

325 {
326  Tensor d2u;
327 
328  this->interior_hessian( var, qp, d2u );
329 
330  return d2u;
331 }
template<typename OutputType >
void libMesh::FEMContext::interior_hessian ( unsigned int  var,
unsigned int  qp,
OutputType &  d2u 
) const
inherited

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

Definition at line 334 of file fem_context.C.

References libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_subsolutions, libMesh::FEGenericBase< T >::get_d2phi(), libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

336 {
337  typedef typename TensorTools::MakeReal<
338  typename TensorTools::DecrementRank<
339  typename TensorTools::DecrementRank<
340  OutputType>::type>::type>::type
341  OutputShape;
342 
343  // Get local-to-global dof index lookup
344  libmesh_assert_greater (dof_indices.size(), var);
345  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
346  (dof_indices_var[var].size());
347 
348  // Get current local coefficients
351  DenseSubVector<Number> &coef = *elem_subsolutions[var];
352 
353  // Get finite element object
354  FEGenericBase<OutputShape>* fe = NULL;
355  this->get_element_fe<OutputShape>( var, fe );
356 
357  // Get shape function values at quadrature point
358  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor> > &d2phi = fe->get_d2phi();
359 
360  // Accumulate solution second derivatives
361  d2u = 0.0;
362 
363  for (unsigned int l=0; l != n_dofs; l++)
364  d2u.add_scaled(d2phi[l][qp], coef(l));
365 
366  return;
367 }
template<typename OutputType >
template void libMesh::FEMContext::interior_hessians< Tensor > ( unsigned int  var,
const NumericVector< Number > &  _system_vector,
std::vector< OutputType > &  d2u_vals 
) const
inherited

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

Definition at line 372 of file fem_context.C.

References libMesh::FEGenericBase< T >::get_d2phi(), and libMesh::libmesh_assert_greater().

375 {
376  typedef typename TensorTools::MakeReal<
377  typename TensorTools::DecrementRank<
378  typename TensorTools::DecrementRank<
379  OutputType>::type>::type>::type
380  OutputShape;
381 
382  // Get local-to-global dof index lookup
383  libmesh_assert_greater (dof_indices.size(), var);
384  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
385  (dof_indices_var[var].size());
386 
387  // Get current local coefficients
388  const DenseSubVector<Number> &coef = get_localized_subvector(_system_vector, var);
389 
390  // Get finite element object
391  FEGenericBase<OutputShape>* fe = NULL;
392  this->get_element_fe<OutputShape>( var, fe );
393 
394  // Get shape function values at quadrature point
395  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor> > &d2phi = fe->get_d2phi();
396 
397  // Loop over all the q_points in this finite element
398  for (unsigned int qp=0; qp != d2u_vals.size(); qp++)
399  {
400  OutputType &d2u = d2u_vals[qp];
401 
402  // Compute the gradient at this q_point
403  d2u = 0;
404 
405  for (unsigned int l=0; l != n_dofs; l++)
406  d2u.add_scaled(d2phi[l][qp], coef(l));
407  }
408 
409  return;
410 }
Number libMesh::FEMContext::interior_value ( unsigned int  var,
unsigned int  qp 
) const
inherited

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

Definition at line 157 of file fem_context.C.

158 {
159  Number u = 0.;
160 
161  this->interior_value( var, qp, u );
162 
163  return u;
164 }
template<typename OutputType >
void libMesh::FEMContext::interior_value ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
inherited

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

Definition at line 167 of file fem_context.C.

References libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_subsolutions, libMesh::FEGenericBase< T >::get_phi(), libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

169 {
170  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
171 
172  // Get local-to-global dof index lookup
173  libmesh_assert_greater (dof_indices.size(), var);
174  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
175  (dof_indices_var[var].size());
176 
177  // Get current local coefficients
180  DenseSubVector<Number> &coef = *elem_subsolutions[var];
181 
182  // Get finite element object
183  FEGenericBase<OutputShape>* fe = NULL;
184  this->get_element_fe<OutputShape>( var, fe );
185 
186  // Get shape function values at quadrature point
187  const std::vector<std::vector<OutputShape> > &phi = fe->get_phi();
188 
189  // Accumulate solution value
190  u = 0.;
191 
192  for (unsigned int l=0; l != n_dofs; l++)
193  u += phi[l][qp] * coef(l);
194 
195  return;
196 }
template<typename OutputType >
template void libMesh::FEMContext::interior_values< Gradient > ( unsigned int  var,
const NumericVector< Number > &  _system_vector,
std::vector< OutputType > &  interior_values_vector 
) const
inherited

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

Definition at line 200 of file fem_context.C.

References libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::get_localized_subvector(), libMesh::FEGenericBase< T >::get_phi(), and libMesh::libmesh_assert_greater().

203 {
204  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
205 
206  // Get local-to-global dof index lookup
207  libmesh_assert_greater (dof_indices.size(), var);
208  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
209  (dof_indices_var[var].size());
210 
211  // Get current local coefficients
212  const DenseSubVector<Number> &coef = get_localized_subvector(_system_vector, var);
213 
214  // Get the finite element object
215  FEGenericBase<OutputShape>* fe = NULL;
216  this->get_element_fe<OutputShape>( var, fe );
217 
218  // Get shape function values at quadrature point
219  const std::vector<std::vector<OutputShape> > &phi = fe->get_phi();
220 
221  // Loop over all the q_points on this element
222  for (unsigned int qp=0; qp != u_vals.size(); qp++)
223  {
224  OutputType &u = u_vals[qp];
225 
226  // Compute the value at this q_point
227  u = 0.;
228 
229  for (unsigned int l=0; l != n_dofs; l++)
230  u += phi[l][qp] * coef(l);
231  }
232 
233  return;
234 }
bool libMesh::DiffContext::is_adjoint ( ) const
inlineinherited

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

Definition at line 279 of file diff_context.h.

References libMesh::DiffContext::_is_adjoint.

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

280  { 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 286 of file diff_context.h.

References libMesh::DiffContext::_is_adjoint.

287  { return _is_adjoint; }
unsigned int libMesh::DiffContext::n_vars ( ) const
inlineinherited

Number of variables in solution.

Definition at line 95 of file diff_context.h.

References libMesh::DiffContext::dof_indices_var.

96  { return libmesh_cast_int<unsigned int>(dof_indices_var.size()); }
void libMesh::DGFEMContext::neighbor_side_fe_reinit ( )

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

Definition at line 112 of file dg_fem_context.C.

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

113 {
114  // Call this *after* side_fe_reinit
115 
116  // Initialize all the neighbor side FE objects based on inverse mapping
117  // the quadrature points on the current side
118  std::vector<Point> qface_side_points;
119  std::vector<Point> qface_neighbor_points;
120  std::map<FEType, FEAbstract *>::iterator local_fe_end = _neighbor_side_fe.end();
121  for (std::map<FEType, FEAbstract *>::iterator i = _neighbor_side_fe.begin();
122  i != local_fe_end; ++i)
123  {
124  FEType neighbor_side_fe_type = i->first;
125  FEAbstract* side_fe = _side_fe[neighbor_side_fe_type];
126  qface_side_points = side_fe->get_xyz();
127 
129  neighbor_side_fe_type,
130  &get_neighbor(),
131  qface_side_points,
132  qface_neighbor_points);
133 
134  i->second->reinit(&get_neighbor(), &qface_neighbor_points);
135  }
136 
137  // Set boolean flag to indicate that the DG terms are active on this element
138  _dg_terms_active = true;
139 
140  // Also, initialize data required for DG assembly on the current side,
141  // analogously to FEMContext::pre_fe_reinit
142 
143  // Initialize the per-element data for elem.
145 
146  const unsigned int n_dofs = dof_indices.size();
147  const unsigned int n_neighbor_dofs = libmesh_cast_int<unsigned int>
148  (_neighbor_dof_indices.size());
149 
150  // These resize calls also zero out the residual and jacobian
151  _neighbor_residual.resize(n_neighbor_dofs);
152  _elem_elem_jacobian.resize(n_dofs, n_dofs);
153  _elem_neighbor_jacobian.resize(n_dofs, n_neighbor_dofs);
154  _neighbor_elem_jacobian.resize(n_neighbor_dofs, n_dofs);
155  _neighbor_neighbor_jacobian.resize(n_neighbor_dofs, n_neighbor_dofs);
156 
157  // Initialize the per-variable data for elem.
158  {
159  unsigned int sub_dofs = 0;
160  for (unsigned int i=0; i != get_system().n_vars(); ++i)
161  {
163 
164  const unsigned int n_dofs_var = libmesh_cast_int<unsigned int>
165  (_neighbor_dof_indices_var[i].size());
166 
167  _neighbor_subresiduals[i]->reposition
168  (sub_dofs, n_dofs_var);
169 
170  for (unsigned int j=0; j != i; ++j)
171  {
172  const unsigned int n_dofs_var_j =
173  libmesh_cast_int<unsigned int>
174  (dof_indices_var[j].size());
175 
176  _elem_elem_subjacobians[i][j]->reposition
177  (sub_dofs, _neighbor_subresiduals[j]->i_off(),
178  n_dofs_var, n_dofs_var_j);
179  _elem_elem_subjacobians[j][i]->reposition
180  (_neighbor_subresiduals[j]->i_off(), sub_dofs,
181  n_dofs_var_j, n_dofs_var);
182 
183  _elem_neighbor_subjacobians[i][j]->reposition
184  (sub_dofs, _neighbor_subresiduals[j]->i_off(),
185  n_dofs_var, n_dofs_var_j);
186  _elem_neighbor_subjacobians[j][i]->reposition
187  (_neighbor_subresiduals[j]->i_off(), sub_dofs,
188  n_dofs_var_j, n_dofs_var);
189 
190  _neighbor_elem_subjacobians[i][j]->reposition
191  (sub_dofs, _neighbor_subresiduals[j]->i_off(),
192  n_dofs_var, n_dofs_var_j);
193  _neighbor_elem_subjacobians[j][i]->reposition
194  (_neighbor_subresiduals[j]->i_off(), sub_dofs,
195  n_dofs_var_j, n_dofs_var);
196 
197  _neighbor_neighbor_subjacobians[i][j]->reposition
198  (sub_dofs, _neighbor_subresiduals[j]->i_off(),
199  n_dofs_var, n_dofs_var_j);
200  _neighbor_neighbor_subjacobians[j][i]->reposition
201  (_neighbor_subresiduals[j]->i_off(), sub_dofs,
202  n_dofs_var_j, n_dofs_var);
203  }
204  _elem_elem_subjacobians[i][i]->reposition
205  (sub_dofs, sub_dofs,
206  n_dofs_var,
207  n_dofs_var);
208  _elem_neighbor_subjacobians[i][i]->reposition
209  (sub_dofs, sub_dofs,
210  n_dofs_var,
211  n_dofs_var);
212  _neighbor_elem_subjacobians[i][i]->reposition
213  (sub_dofs, sub_dofs,
214  n_dofs_var,
215  n_dofs_var);
216  _neighbor_neighbor_subjacobians[i][i]->reposition
217  (sub_dofs, sub_dofs,
218  n_dofs_var,
219  n_dofs_var);
220  sub_dofs += n_dofs_var;
221  }
222  libmesh_assert_equal_to (sub_dofs, n_dofs);
223  }
224 
225 }
template<typename OutputType >
template void libMesh::FEMContext::point_curl< Gradient > ( unsigned int  var,
const Point p,
OutputType &  curl_u 
) const
inherited

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

Definition at line 894 of file fem_context.C.

References libMesh::FEMContext::build_new_fe(), libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_subsolutions, libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

896 {
897  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
898 
899  // Get local-to-global dof index lookup
900  libmesh_assert_greater (dof_indices.size(), var);
901  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
902  (dof_indices_var[var].size());
903 
904  // Get current local coefficients
907  DenseSubVector<Number> &coef = *elem_subsolutions[var];
908 
909  // Get finite element object
910  FEGenericBase<OutputShape>* fe = NULL;
911  this->get_element_fe<OutputShape>( var, fe );
912 
913  // Build a FE for calculating u(p)
914  AutoPtr<FEGenericBase<OutputShape> > fe_new = this->build_new_fe( fe, p );
915 
916  // Get the values of the shape function derivatives
917  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputShape> >& curl_phi = fe_new->get_curl_phi();
918 
919  curl_u = 0.0;
920 
921  for (unsigned int l=0; l != n_dofs; l++)
922  curl_u.add_scaled(curl_phi[l][0], coef(l));
923 
924  return;
925 }
Gradient libMesh::FEMContext::point_gradient ( unsigned int  var,
const Point p 
) const
inherited

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

Definition at line 791 of file fem_context.C.

792 {
793  Gradient grad_u;
794 
795  this->point_gradient( var, p, grad_u );
796 
797  return grad_u;
798 }
template<typename OutputType >
void libMesh::FEMContext::point_gradient ( unsigned int  var,
const Point p,
OutputType &  grad_u 
) const
inherited

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

Definition at line 803 of file fem_context.C.

References libMesh::FEMContext::build_new_fe(), libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_subsolutions, libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

805 {
806  typedef typename TensorTools::MakeReal
807  <typename TensorTools::DecrementRank<OutputType>::type>::type
808  OutputShape;
809 
810  // Get local-to-global dof index lookup
811  libmesh_assert_greater (dof_indices.size(), var);
812  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
813  (dof_indices_var[var].size());
814 
815  // Get current local coefficients
818  DenseSubVector<Number> &coef = *elem_subsolutions[var];
819 
820  // Get finite element object
821  FEGenericBase<OutputShape>* fe = NULL;
822  this->get_element_fe<OutputShape>( var, fe );
823 
824  // Build a FE for calculating u(p)
825  AutoPtr<FEGenericBase<OutputShape> > fe_new = this->build_new_fe( fe, p );
826 
827  // Get the values of the shape function derivatives
828  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient> >& dphi = fe_new->get_dphi();
829 
830  grad_u = 0.0;
831 
832  for (unsigned int l=0; l != n_dofs; l++)
833  grad_u.add_scaled(dphi[l][0], coef(l));
834 
835  return;
836 }
Tensor libMesh::FEMContext::point_hessian ( unsigned int  var,
const Point p 
) const
inherited

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

Definition at line 842 of file fem_context.C.

843 {
844  Tensor hess_u;
845 
846  this->point_hessian( var, p, hess_u );
847 
848  return hess_u;
849 }
template<typename OutputType >
void libMesh::FEMContext::point_hessian ( unsigned int  var,
const Point p,
OutputType &  hess_u 
) const
inherited

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

Definition at line 853 of file fem_context.C.

References libMesh::FEMContext::build_new_fe(), libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_subsolutions, libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

855 {
856  typedef typename TensorTools::MakeReal<
857  typename TensorTools::DecrementRank<
858  typename TensorTools::DecrementRank<
859  OutputType>::type>::type>::type
860  OutputShape;
861 
862  // Get local-to-global dof index lookup
863  libmesh_assert_greater (dof_indices.size(), var);
864  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
865  (dof_indices_var[var].size());
866 
867  // Get current local coefficients
870  DenseSubVector<Number> &coef = *elem_subsolutions[var];
871 
872  // Get finite element object
873  FEGenericBase<OutputShape>* fe = NULL;
874  this->get_element_fe<OutputShape>( var, fe );
875 
876  // Build a FE for calculating u(p)
877  AutoPtr<FEGenericBase<OutputShape> > fe_new = this->build_new_fe( fe, p );
878 
879  // Get the values of the shape function derivatives
880  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor> >& d2phi = fe_new->get_d2phi();
881 
882  hess_u = 0.0;
883 
884  for (unsigned int l=0; l != n_dofs; l++)
885  hess_u.add_scaled(d2phi[l][0], coef(l));
886 
887  return;
888 }
Number libMesh::FEMContext::point_value ( unsigned int  var,
const Point p 
) const
inherited

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

Definition at line 746 of file fem_context.C.

747 {
748  Number u = 0.;
749 
750  this->point_value( var, p, u );
751 
752  return u;
753 }
template<typename OutputType >
void libMesh::FEMContext::point_value ( unsigned int  var,
const Point p,
OutputType &  u 
) const
inherited

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

Definition at line 756 of file fem_context.C.

References libMesh::FEMContext::build_new_fe(), libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_subsolutions, libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

758 {
759  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
760 
761  // Get local-to-global dof index lookup
762  libmesh_assert_greater (dof_indices.size(), var);
763  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
764  (dof_indices_var[var].size());
765 
766  // Get current local coefficients
769  DenseSubVector<Number> &coef = *elem_subsolutions[var];
770 
771  // Get finite element object
772  FEGenericBase<OutputShape>* fe = NULL;
773  this->get_element_fe<OutputShape>( var, fe );
774 
775  // Build a FE for calculating u(p)
776  AutoPtr<FEGenericBase<OutputShape> > fe_new = this->build_new_fe( fe, p );
777 
778  // Get the values of the shape function derivatives
779  const std::vector<std::vector<OutputShape> >& phi = fe_new->get_phi();
780 
781  u = 0.;
782 
783  for (unsigned int l=0; l != n_dofs; l++)
784  u += phi[l][0] * coef(l);
785 
786  return;
787 }
void libMesh::FEMContext::pre_fe_reinit ( const System sys,
const Elem e 
)
virtualinherited

Reinitializes local data vectors/matrices on the current geometric element

Definition at line 1585 of file fem_context.C.

References libMesh::System::current_local_solution, libMesh::DiffContext::dof_indices, libMesh::DofMap::dof_indices(), libMesh::DiffContext::dof_indices_var, libMesh::FEMContext::elem, libMesh::DiffContext::elem_fixed_solution, libMesh::DiffContext::elem_fixed_subsolutions, libMesh::DiffContext::elem_jacobian, libMesh::DiffContext::elem_qoi_derivative, libMesh::DiffContext::elem_qoi_subderivatives, libMesh::DiffContext::elem_residual, libMesh::DiffContext::elem_solution, libMesh::DiffContext::elem_subjacobians, libMesh::DiffContext::elem_subresiduals, libMesh::DiffContext::elem_subsolutions, libMesh::NumericVector< T >::get(), libMesh::System::get_dof_map(), libMesh::DenseVector< T >::get_values(), libMesh::DiffContext::localized_vectors, libMesh::System::n_vars(), libMesh::System::qoi, libMesh::DenseVector< T >::resize(), libMesh::DenseMatrix< T >::resize(), libMesh::resize(), and libMesh::System::use_fixed_solution.

Referenced by libMesh::FEMSystem::mesh_position_get(), libMesh::FEMSystem::mesh_position_set(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), and libMesh::System::project_vector().

1586 {
1587  elem = e;
1588 
1589  // Initialize the per-element data for elem.
1590  sys.get_dof_map().dof_indices (elem, dof_indices);
1591  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
1592  (dof_indices.size());
1593  const std::size_t n_qoi = sys.qoi.size();
1594 
1595  if (sys.use_fixed_solution)
1596  elem_fixed_solution.resize(n_dofs);
1597 
1598  sys.current_local_solution->get(dof_indices, elem_solution.get_values());
1599 
1600  // These resize calls also zero out the residual and jacobian
1601  elem_residual.resize(n_dofs);
1602  elem_jacobian.resize(n_dofs, n_dofs);
1603 
1604  elem_qoi_derivative.resize(n_qoi);
1605  elem_qoi_subderivatives.resize(n_qoi);
1606  for (std::size_t q=0; q != n_qoi; ++q)
1607  elem_qoi_derivative[q].resize(n_dofs);
1608 
1609  // Initialize the per-variable data for elem.
1610  {
1611  unsigned int sub_dofs = 0;
1612  for (unsigned int i=0; i != sys.n_vars(); ++i)
1613  {
1614  sys.get_dof_map().dof_indices (elem, dof_indices_var[i], i);
1615 
1616  const unsigned int n_dofs_var = libmesh_cast_int<unsigned int>
1617  (dof_indices_var[i].size());
1618 
1619  elem_subsolutions[i]->reposition
1620  (sub_dofs, n_dofs_var);
1621 
1622  if (sys.use_fixed_solution)
1623  elem_fixed_subsolutions[i]->reposition
1624  (sub_dofs, n_dofs_var);
1625 
1626  elem_subresiduals[i]->reposition
1627  (sub_dofs, n_dofs_var);
1628 
1629  for (std::size_t q=0; q != n_qoi; ++q)
1630  elem_qoi_subderivatives[q][i]->reposition
1631  (sub_dofs, n_dofs_var);
1632 
1633  for (unsigned int j=0; j != i; ++j)
1634  {
1635  const unsigned int n_dofs_var_j =
1636  libmesh_cast_int<unsigned int>
1637  (dof_indices_var[j].size());
1638 
1639  elem_subjacobians[i][j]->reposition
1640  (sub_dofs, elem_subresiduals[j]->i_off(),
1641  n_dofs_var, n_dofs_var_j);
1642  elem_subjacobians[j][i]->reposition
1643  (elem_subresiduals[j]->i_off(), sub_dofs,
1644  n_dofs_var_j, n_dofs_var);
1645  }
1646  elem_subjacobians[i][i]->reposition
1647  (sub_dofs, sub_dofs,
1648  n_dofs_var,
1649  n_dofs_var);
1650  sub_dofs += n_dofs_var;
1651  }
1652  libmesh_assert_equal_to (sub_dofs, n_dofs);
1653  }
1654 
1655  // Now do the localization for the user requested vectors
1657  const DiffContext::localized_vectors_iterator localized_vec_end = localized_vectors.end();
1658 
1659  for(; localized_vec_it != localized_vec_end; ++localized_vec_it)
1660  {
1661  const NumericVector<Number>& current_localized_vector = *localized_vec_it->first;
1662  DenseVector<Number>& target_vector = localized_vec_it->second.first;
1663 
1664  current_localized_vector.get(dof_indices, target_vector.get_values());
1665 
1666  // Initialize the per-variable data for elem.
1667  unsigned int sub_dofs = 0;
1668  for (unsigned int i=0; i != sys.n_vars(); ++i)
1669  {
1670  const unsigned int n_dofs_var = libmesh_cast_int<unsigned int>
1671  (dof_indices_var[i].size());
1672  sys.get_dof_map().dof_indices (elem, dof_indices_var[i], i);
1673 
1674  localized_vec_it->second.second[i]->reposition
1675  (sub_dofs, n_dofs_var);
1676 
1677  sub_dofs += n_dofs_var;
1678  }
1679  libmesh_assert_equal_to (sub_dofs, n_dofs);
1680  }
1681 }
void libMesh::DiffContext::set_deltat_pointer ( Real dt)
inherited

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

Definition at line 109 of file diff_context.C.

References libMesh::DiffContext::_deltat.

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

110 {
111  // We may actually want to be able to set this pointer to NULL, so
112  // don't report an error for that.
113  _deltat = dt;
114 }
virtual void libMesh::FEMContext::set_mesh_system ( System sys)
inlinevirtualinherited

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

This should be set automatically if the FEMPhysics requires it.

Definition at line 552 of file fem_context.h.

References libMesh::FEMContext::_mesh_sys.

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

553  { this->_mesh_sys = sys; }
void libMesh::FEMContext::set_mesh_x_var ( unsigned int  x_var)
inlineinherited

Accessor for x-variable of moving mesh System

This should be set automatically if the FEMPhysics requires it.

Definition at line 578 of file fem_context.h.

References libMesh::FEMContext::_mesh_x_var.

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

579  { _mesh_x_var = x_var; }
void libMesh::FEMContext::set_mesh_y_var ( unsigned int  y_var)
inlineinherited

Accessor for y-variable of moving mesh System

This should be set automatically if the FEMPhysics requires it.

Definition at line 592 of file fem_context.h.

References libMesh::FEMContext::_mesh_y_var.

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

593  { _mesh_y_var = y_var; }
void libMesh::FEMContext::set_mesh_z_var ( unsigned int  z_var)
inlineinherited

Accessor for z-variable of moving mesh System

This should be set automatically if the FEMPhysics requires it.

Definition at line 606 of file fem_context.h.

References libMesh::FEMContext::_mesh_z_var.

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

607  { _mesh_z_var = z_var; }
void libMesh::DGFEMContext::set_neighbor ( const Elem neighbor)
inline

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

Definition at line 219 of file dg_fem_context.h.

References _neighbor.

220  { _neighbor = &neighbor; }
void libMesh::DiffContext::set_time ( Real  time_in)
inlineinherited

Set the time for which the current nonlinear_solution is defined.

Definition at line 266 of file diff_context.h.

References libMesh::DiffContext::time.

267  { time = time_in; }
std::vector< boundary_id_type > libMesh::FEMContext::side_boundary_ids ( ) const
inherited

Lists the boundary ids found on the current side

Definition at line 150 of file fem_context.C.

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

151 {
153 }
void libMesh::DGFEMContext::side_fe_reinit ( )
virtual

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

Reimplemented from libMesh::FEMContext.

Definition at line 103 of file dg_fem_context.C.

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

104 {
106 
107  // By default we assume that the DG terms are inactive
108  // They are only active if neighbor_side_fe_reinit is called
109  _dg_terms_active = false;
110 }
Gradient libMesh::FEMContext::side_gradient ( unsigned int  var,
unsigned int  qp 
) const
inherited

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

Definition at line 565 of file fem_context.C.

566 {
567  Gradient du;
568 
569  this->side_gradient( var, qp, du );
570 
571  return du;
572 }
template<typename OutputType >
void libMesh::FEMContext::side_gradient ( unsigned int  var,
unsigned int  qp,
OutputType &  du 
) const
inherited

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

Definition at line 576 of file fem_context.C.

References libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_subsolutions, libMesh::FEGenericBase< T >::get_dphi(), libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

578 {
579  typedef typename TensorTools::MakeReal
580  <typename TensorTools::DecrementRank<OutputType>::type>::type
581  OutputShape;
582 
583  // Get local-to-global dof index lookup
584  libmesh_assert_greater (dof_indices.size(), var);
585  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
586  (dof_indices_var[var].size());
587 
588  // Get current local coefficients
591  DenseSubVector<Number> &coef = *elem_subsolutions[var];
592 
593  // Get finite element object
594  FEGenericBase<OutputShape>* the_side_fe = NULL;
595  this->get_side_fe<OutputShape>( var, the_side_fe );
596 
597  // Get shape function values at quadrature point
598  const std::vector<std::vector< typename FEGenericBase<OutputShape>::OutputGradient> > &dphi = the_side_fe->get_dphi();
599 
600  // Accumulate solution derivatives
601  du = 0.;
602 
603  for (unsigned int l=0; l != n_dofs; l++)
604  du.add_scaled(dphi[l][qp], coef(l));
605 
606  return;
607 }
template<typename OutputType >
template void libMesh::FEMContext::side_gradients< Tensor > ( unsigned int  var,
const NumericVector< Number > &  _system_vector,
std::vector< OutputType > &  side_gradients_vector 
) const
inherited

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

Definition at line 613 of file fem_context.C.

References libMesh::FEGenericBase< T >::get_dphi(), and libMesh::libmesh_assert_greater().

616 {
617  typedef typename TensorTools::MakeReal
618  <typename TensorTools::DecrementRank<OutputType>::type>::type
619  OutputShape;
620 
621  // Get local-to-global dof index lookup
622  libmesh_assert_greater (dof_indices.size(), var);
623  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
624  (dof_indices_var[var].size());
625 
626  // Get current local coefficients
627  const DenseSubVector<Number> &coef = get_localized_subvector(_system_vector, var);
628 
629  // Get finite element object
630  FEGenericBase<OutputShape>* the_side_fe = NULL;
631  this->get_side_fe<OutputShape>( var, the_side_fe );
632 
633  // Get shape function values at quadrature point
634  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputGradient> > &dphi = the_side_fe->get_dphi();
635 
636  // Loop over all the q_points in this finite element
637  for (unsigned int qp=0; qp != du_vals.size(); qp++)
638  {
639  OutputType &du = du_vals[qp];
640 
641  du = 0;
642 
643  // Compute the gradient at this q_point
644  for (unsigned int l=0; l != n_dofs; l++)
645  du.add_scaled(dphi[l][qp], coef(l));
646  }
647 
648  return;
649 }
Tensor libMesh::FEMContext::side_hessian ( unsigned int  var,
unsigned int  qp 
) const
inherited

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

Definition at line 652 of file fem_context.C.

653 {
654  Tensor d2u;
655 
656  this->side_hessian( var, qp, d2u );
657 
658  return d2u;
659 }
template<typename OutputType >
void libMesh::FEMContext::side_hessian ( unsigned int  var,
unsigned int  qp,
OutputType &  d2u 
) const
inherited

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

Definition at line 662 of file fem_context.C.

References libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_subsolutions, libMesh::FEGenericBase< T >::get_d2phi(), libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

664 {
665  typedef typename TensorTools::MakeReal<
666  typename TensorTools::DecrementRank<
667  typename TensorTools::DecrementRank<
668  OutputType>::type>::type>::type
669  OutputShape;
670 
671  // Get local-to-global dof index lookup
672  libmesh_assert_greater (dof_indices.size(), var);
673  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
674  (dof_indices_var[var].size());
675 
676  // Get current local coefficients
679  DenseSubVector<Number> &coef = *elem_subsolutions[var];
680 
681  // Get finite element object
682  FEGenericBase<OutputShape>* the_side_fe = NULL;
683  this->get_side_fe<OutputShape>( var, the_side_fe );
684 
685  // Get shape function values at quadrature point
686  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor> > &d2phi = the_side_fe->get_d2phi();
687 
688  // Accumulate solution second derivatives
689  d2u = 0.0;
690 
691  for (unsigned int l=0; l != n_dofs; l++)
692  d2u.add_scaled(d2phi[l][qp], coef(l));
693 
694  return;
695 }
template<typename OutputType >
template void libMesh::FEMContext::side_hessians< Tensor > ( unsigned int  var,
const NumericVector< Number > &  _system_vector,
std::vector< OutputType > &  d2u_vals 
) const
inherited

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

Definition at line 700 of file fem_context.C.

References libMesh::FEGenericBase< T >::get_d2phi(), and libMesh::libmesh_assert_greater().

703 {
704  typedef typename TensorTools::MakeReal<
705  typename TensorTools::DecrementRank<
706  typename TensorTools::DecrementRank<
707  OutputType>::type>::type>::type
708  OutputShape;
709 
710  // Get local-to-global dof index lookup
711  libmesh_assert_greater (dof_indices.size(), var);
712  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
713  (dof_indices_var[var].size());
714 
715  // Get current local coefficients
716  const DenseSubVector<Number> &coef = get_localized_subvector(_system_vector, var);
717 
718  // Get finite element object
719  FEGenericBase<OutputShape>* the_side_fe = NULL;
720  this->get_side_fe<OutputShape>( var, the_side_fe );
721 
722  // Get shape function values at quadrature point
723  const std::vector<std::vector<typename FEGenericBase<OutputShape>::OutputTensor> > &d2phi = the_side_fe->get_d2phi();
724 
725  // Loop over all the q_points in this finite element
726  for (unsigned int qp=0; qp != d2u_vals.size(); qp++)
727  {
728  OutputType &d2u = d2u_vals[qp];
729 
730  // Compute the gradient at this q_point
731  d2u = 0;
732 
733  for (unsigned int l=0; l != n_dofs; l++)
734  d2u.add_scaled(d2phi[l][qp], coef(l));
735  }
736 
737  return;
738 }
Number libMesh::FEMContext::side_value ( unsigned int  var,
unsigned int  qp 
) const
inherited

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

Definition at line 484 of file fem_context.C.

485 {
486  Number u = 0.;
487 
488  this->side_value( var, qp, u );
489 
490  return u;
491 }
template<typename OutputType >
void libMesh::FEMContext::side_value ( unsigned int  var,
unsigned int  qp,
OutputType &  u 
) const
inherited

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

Definition at line 495 of file fem_context.C.

References libMesh::DiffContext::dof_indices, libMesh::DiffContext::dof_indices_var, libMesh::DiffContext::elem_subsolutions, libMesh::FEGenericBase< T >::get_phi(), libMesh::libmesh_assert(), and libMesh::libmesh_assert_greater().

497 {
498  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
499 
500  // Get local-to-global dof index lookup
501  libmesh_assert_greater (dof_indices.size(), var);
502  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
503  (dof_indices_var[var].size());
504 
505  // Get current local coefficients
508  DenseSubVector<Number> &coef = *elem_subsolutions[var];
509 
510  // Get finite element object
511  FEGenericBase<OutputShape>* the_side_fe = NULL;
512  this->get_side_fe<OutputShape>( var, the_side_fe );
513 
514  // Get shape function values at quadrature point
515  const std::vector<std::vector<OutputShape> > &phi = the_side_fe->get_phi();
516 
517  // Accumulate solution value
518  u = 0.;
519 
520  for (unsigned int l=0; l != n_dofs; l++)
521  u += phi[l][qp] * coef(l);
522 
523  return;
524 }
template<typename OutputType >
template void libMesh::FEMContext::side_values< Gradient > ( unsigned int  var,
const NumericVector< Number > &  _system_vector,
std::vector< OutputType > &  side_values_vector 
) const
inherited

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

Definition at line 529 of file fem_context.C.

References libMesh::FEGenericBase< T >::get_phi(), and libMesh::libmesh_assert_greater().

532 {
533  typedef typename TensorTools::MakeReal<OutputType>::type OutputShape;
534 
535  // Get local-to-global dof index lookup
536  libmesh_assert_greater (dof_indices.size(), var);
537  const unsigned int n_dofs = libmesh_cast_int<unsigned int>
538  (dof_indices_var[var].size());
539 
540  // Get current local coefficients
541  const DenseSubVector<Number> &coef = get_localized_subvector(_system_vector, var);
542 
543  // Get the finite element object
544  FEGenericBase<OutputShape>* the_side_fe = NULL;
545  this->get_side_fe<OutputShape>( var, the_side_fe );
546 
547  // Get shape function values at quadrature point
548  const std::vector<std::vector<OutputShape> > &phi = the_side_fe->get_phi();
549 
550  // Loop over all the q_points on this element
551  for (unsigned int qp=0; qp != u_vals.size(); qp++)
552  {
553  OutputType &u = u_vals[qp];
554 
555  // Compute the value at this q_point
556  u = 0.;
557 
558  for (unsigned int l=0; l != n_dofs; l++)
559  u += phi[l][qp] * coef(l);
560  }
561 
562  return;
563 }

Member Data Documentation

BoundaryInfo* libMesh::FEMContext::_boundary_info
protectedinherited

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

Definition at line 700 of file fem_context.h.

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

bool libMesh::DGFEMContext::_dg_terms_active
private

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

Definition at line 295 of file dg_fem_context.h.

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

std::map<FEType, FEAbstract*> libMesh::FEMContext::_edge_fe
protectedinherited
std::vector<FEAbstract*> libMesh::FEMContext::_edge_fe_var
protectedinherited
DenseMatrix<Number> libMesh::DGFEMContext::_elem_elem_jacobian
private

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

Definition at line 256 of file dg_fem_context.h.

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

std::vector<std::vector<DenseSubMatrix<Number> *> > libMesh::DGFEMContext::_elem_elem_subjacobians
private
DenseMatrix<Number> libMesh::DGFEMContext::_elem_neighbor_jacobian
private
std::vector<std::vector<DenseSubMatrix<Number> *> > libMesh::DGFEMContext::_elem_neighbor_subjacobians
private
std::map<FEType, FEAbstract*> libMesh::FEMContext::_element_fe
protectedinherited

Finite element objects for each variable's interior, sides and edges.

Definition at line 683 of file fem_context.h.

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

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

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

Definition at line 692 of file fem_context.h.

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

unsigned int libMesh::FEMContext::_mesh_x_var
inherited
const Elem* libMesh::DGFEMContext::_neighbor
private

Current neighbor element for assembling DG terms.

Definition at line 245 of file dg_fem_context.h.

Referenced by get_neighbor(), and set_neighbor().

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

Global Degree of freedom index lists for the neighbor element

Definition at line 273 of file dg_fem_context.h.

Referenced by get_neighbor_dof_indices(), and neighbor_side_fe_reinit().

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

Definition at line 274 of file dg_fem_context.h.

Referenced by get_neighbor_dof_indices(), and neighbor_side_fe_reinit().

DenseMatrix<Number> libMesh::DGFEMContext::_neighbor_elem_jacobian
private
std::vector<std::vector<DenseSubMatrix<Number> *> > libMesh::DGFEMContext::_neighbor_elem_subjacobians
private
DenseMatrix<Number> libMesh::DGFEMContext::_neighbor_neighbor_jacobian
private
std::vector<std::vector<DenseSubMatrix<Number> *> > libMesh::DGFEMContext::_neighbor_neighbor_subjacobians
private
DenseVector<Number> libMesh::DGFEMContext::_neighbor_residual
private

Residual vector of the neighbor component.

Definition at line 250 of file dg_fem_context.h.

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

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

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

Definition at line 283 of file dg_fem_context.h.

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

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

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

Definition at line 289 of file dg_fem_context.h.

Referenced by DGFEMContext(), and get_neighbor_side_fe().

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

Element residual subvectors and Jacobian submatrices

Definition at line 264 of file dg_fem_context.h.

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

std::map<FEType, FEAbstract*> libMesh::FEMContext::_side_fe
protectedinherited
std::vector<FEAbstract*> libMesh::FEMContext::_side_fe_var
protectedinherited
unsigned char libMesh::FEMContext::dim
protectedinherited
unsigned char libMesh::FEMContext::edge
inherited

Current edge for edge_* to examine

Definition at line 670 of file fem_context.h.

Referenced by libMesh::FEMContext::edge_fe_reinit(), and libMesh::FEMContext::get_edge().

QBase* libMesh::FEMContext::edge_qrule
protectedinherited

Quadrature rules for element edges. If the FEM context is told to prepare for edge integration on 3D elements, it will try to find a quadrature rule that correctly integrates all variables

Definition at line 731 of file fem_context.h.

Referenced by libMesh::FEMContext::FEMContext(), libMesh::FEMContext::get_edge_qrule(), and libMesh::FEMContext::~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 385 of file diff_context.h.

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

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

Element jacobian: derivatives of elem_residual with respect to elem_solution

Definition at line 397 of file diff_context.h.

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

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

Element quantity of interest contributions

Definition at line 402 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 407 of file diff_context.h.

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

std::vector<std::vector<DenseSubVector<Number> *> > libMesh::DiffContext::elem_qoi_subderivatives
protectedinherited
DenseVector<Number> libMesh::DiffContext::elem_residual
protectedinherited
DenseVector<Number> libMesh::DiffContext::elem_solution
protectedinherited

Element by element components of nonlinear_solution as adjusted by a time_solver

Definition at line 377 of file diff_context.h.

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

Real libMesh::DiffContext::elem_solution_derivative
inherited

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

Definition at line 310 of file diff_context.h.

Referenced by libMesh::EulerSolver::element_residual(), libMesh::Euler2Solver::element_residual(), libMesh::DiffContext::get_elem_solution_derivative(), libMesh::EulerSolver::side_residual(), and libMesh::Euler2Solver::side_residual().

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

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

QBase* libMesh::FEMContext::element_qrule
protectedinherited

Quadrature rule for element interior. The FEM context will try to find a quadrature rule that correctly integrates all variables

Definition at line 717 of file fem_context.h.

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

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

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

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

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

unsigned char libMesh::FEMContext::side
inherited
QBase* libMesh::FEMContext::side_qrule
protectedinherited

Quadrature rules for element sides The FEM context will try to find a quadrature rule that correctly integrates all variables

Definition at line 724 of file fem_context.h.

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

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

Referenced by libMesh::FEMContext::_update_time_from_system(), and 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 294 of file diff_context.h.

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


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

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:59 UTC

Hosted By:
SourceForge.net Logo