18#include "libmesh/dg_fem_context.h"
19#include "libmesh/dof_map.h"
20#include "libmesh/elem.h"
21#include "libmesh/fe_base.h"
22#include "libmesh/fe_interface.h"
23#include "libmesh/quadrature.h"
24#include "libmesh/system.h"
32 _neighbor_dof_indices_var(sys.
n_vars()),
33 _dg_terms_active(false)
35 unsigned int nv = sys.
n_vars();
44 for (
unsigned int i=0; i != nv; ++i)
52 for (
unsigned int j=0; j != nv; ++j)
62 for (
unsigned int i=0; i != nv; ++i)
90 std::vector<Point> qface_side_points;
91 std::vector<Point> qface_neighbor_points;
95 qface_side_points = side_fe->
get_xyz();
98 qface_side_points, qface_neighbor_points);
112 const unsigned int n_dofs = cast_int<unsigned int>
114 const unsigned int n_neighbor_dofs = cast_int<unsigned int>
126 unsigned int sub_dofs = 0;
131 const unsigned int n_dofs_var = cast_int<unsigned int>
135 (sub_dofs, n_dofs_var);
137 for (
unsigned int j=0; j != i; ++j)
139 const unsigned int n_dofs_var_j =
140 cast_int<unsigned int>
145 n_dofs_var, n_dofs_var_j);
148 n_dofs_var_j, n_dofs_var);
152 n_dofs_var, n_dofs_var_j);
155 n_dofs_var_j, n_dofs_var);
159 n_dofs_var, n_dofs_var_j);
162 n_dofs_var_j, n_dofs_var);
166 n_dofs_var, n_dofs_var_j);
169 n_dofs_var_j, n_dofs_var);
187 sub_dofs += n_dofs_var;
189 libmesh_assert_equal_to (sub_dofs, n_dofs);
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_elem_subjacobians
DenseMatrix< Number > _elem_elem_jacobian
The DG Jacobian terms.
std::vector< std::vector< dof_id_type > > _neighbor_dof_indices_var
bool _dg_terms_active
Boolean flag to indicate whether or not the DG terms have been assembled and should be used in the gl...
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_neighbor_subjacobians
DenseMatrix< Number > _neighbor_neighbor_jacobian
virtual void side_fe_reinit() override
Override side_fe_reinit to set a boolean flag so that by default DG terms are assumed to be inactive.
virtual ~DGFEMContext()
Destructor.
DenseVector< Number > _neighbor_residual
Residual vector of the neighbor component.
std::map< FEType, std::unique_ptr< FEAbstract > > _neighbor_side_fe
Finite element objects for each variable's sides on the neighbor element.
std::vector< dof_id_type > _neighbor_dof_indices
Global Degree of freedom index lists for the neighbor element.
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _neighbor_neighbor_subjacobians
DGFEMContext(const System &sys)
Constructor.
std::vector< std::unique_ptr< DenseSubVector< Number > > > _neighbor_subresiduals
Element residual subvectors and Jacobian submatrices.
DenseMatrix< Number > _neighbor_elem_jacobian
void neighbor_side_fe_reinit()
Initialize neighbor side data needed to assemble DG terms.
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _neighbor_elem_subjacobians
DenseMatrix< Number > _elem_neighbor_jacobian
const Elem & get_neighbor() const
Accessor for current neighbor Elem object for assembling DG terms.
std::vector< FEAbstract * > _neighbor_side_fe_var
Pointers to the same finite element objects on the neighbor element, but indexed by variable number.
void resize(const unsigned int new_m, const unsigned int new_n)
Resizes the matrix to the specified size and calls zero().
Defines a dense submatrix for use in Finite Element-type computations.
Defines a dense subvector for use in finite element computations.
void resize(const unsigned int n)
Resize the vector.
unsigned int n_vars() const
Number of variables in solution.
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
const System & get_system() const
Accessor for associated system.
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
This class forms the foundation from which generic finite elements may be derived.
virtual_for_inffe const std::vector< Point > & get_xyz() const
static std::unique_ptr< FEAbstract > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
This class provides all data required for a physics package (e.g.
virtual void side_fe_reinit()
Reinitializes side FE objects on the current geometric element.
unsigned char get_dim() const
Accessor for cached mesh dimension.
std::vector< std::map< FEType, std::unique_ptr< FEAbstract > > > _side_fe
unsigned char _dim
Cached dimension of largest dimension element in this mesh.
static Point inverse_map(const unsigned int dim, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true, const bool extra_checks=true)
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
Manages consistently variables, degrees of freedom, and coefficient vectors.
const FEType & variable_type(const unsigned int i) const
unsigned int n_vars() const
const DofMap & get_dof_map() const
The libMesh namespace provides an interface to certain functionality in the library.
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...