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);
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
std::vector< dof_id_type > _neighbor_dof_indices
Global Degree of freedom index lists for the neighbor element.
DenseVector< Number > _neighbor_residual
Residual vector of the neighbor component.
DenseMatrix< Number > _elem_elem_jacobian
The DG Jacobian terms.
void neighbor_side_fe_reinit()
Initialize neighbor side data needed to assemble DG terms.
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Fills the vector di with the global degree of freedom indices for the element.
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_elem_subjacobians
static Point inverse_map(const unsigned int dim, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true, const bool extra_checks=true)
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...
void resize(const unsigned int n)
Resize the vector.
std::vector< std::vector< dof_id_type > > _neighbor_dof_indices_var
std::vector< FEAbstract * > _neighbor_side_fe_var
Pointers to the same finite element objects on the neighbor element, but indexed by variable number...
The libMesh namespace provides an interface to certain functionality in the library.
unsigned char get_dim() const
Accessor for cached mesh dimension.
Defines a dense subvector for use in finite element computations.
virtual void side_fe_reinit()
Reinitializes side FE objects on the current geometric element.
const System & get_system() const
Accessor for associated system.
Manages consistently variables, degrees of freedom, and coefficient vectors.
Defines a dense submatrix for use in Finite Element-type computations.
DenseMatrix< Number > _neighbor_elem_jacobian
This class provides all data required for a physics package (e.g.
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
DenseMatrix< Number > _elem_neighbor_jacobian
virtual_for_inffe const std::vector< Point > & get_xyz() const
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _elem_neighbor_subjacobians
bool _dg_terms_active
Boolean flag to indicate whether or not the DG terms have been assembled and should be used in the gl...
unsigned char _dim
Cached dimension of largest dimension element in this mesh.
std::vector< std::map< FEType, std::unique_ptr< FEAbstract > > > _side_fe
const FEType & variable_type(const unsigned int i) const
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _neighbor_elem_subjacobians
DGFEMContext(const System &sys)
Constructor.
static std::unique_ptr< FEAbstract > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
DenseMatrix< Number > _neighbor_neighbor_jacobian
void resize(const unsigned int new_m, const unsigned int new_n)
Resizes the matrix to the specified size and calls zero().
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...
std::vector< std::unique_ptr< DenseSubVector< Number > > > _neighbor_subresiduals
Element residual subvectors and Jacobian submatrices.
virtual ~DGFEMContext()
Destructor.
unsigned int n_vars() const
This class forms the foundation from which generic finite elements may be derived.
unsigned int n_vars() const
Number of variables in solution.
std::map< FEType, std::unique_ptr< FEAbstract > > _neighbor_side_fe
Finite element objects for each variable's sides on the neighbor element.
const DofMap & get_dof_map() const
const Elem & get_neighbor() const
Accessor for current neighbor Elem object for assembling DG terms.
std::vector< std::vector< std::unique_ptr< DenseSubMatrix< Number > > > > _neighbor_neighbor_subjacobians