27 #ifndef VOLUME_HANDLER_DG_HPP_
28 #define VOLUME_HANDLER_DG_HPP_
30 #include <deal.II/base/quadrature_lib.h>
31 #include <deal.II/base/tensor.h>
33 #include <deal.II/dofs/dof_handler.h>
35 #include <deal.II/fe/fe.h>
36 #include <deal.II/fe/fe_simplex_p.h>
37 #include <deal.II/fe/fe_values.h>
38 #include <deal.II/fe/mapping_fe.h>
49 template <
unsigned int dim>
64 const std::unique_ptr<dealii::FE_SimplexDGP<dim>>
fe_dg;
68 const std::unique_ptr<dealii::MappingFE<dim>>
mapping;
86 ,
fe_dg(std::make_unique<dealii::FE_SimplexDGP<dim>>(1))
87 ,
mapping(std::make_unique<dealii::MappingFE<dim>>(*
fe_dg))
89 ,
fe_values(std::make_unique<dealii::FEValues<dim>>(
93 dealii::update_inverse_jacobians | dealii::update_quadrature_points |
94 dealii::update_values))
113 virtual dealii::Point<dim>
118 virtual dealii::Point<dim>
127 dealii::Tensor<2, dim>
138 template <
unsigned int dim>
144 fe_values->reinit(new_cell);
148 template <
unsigned int dim>
152 AssertThrow(initialized, dealii::StandardExceptions::ExcNotInitialized());
154 AssertThrow(q < pow(n_quad_points_1D, dim),
155 dealii::StandardExceptions::ExcMessage(
156 "Index of quadrature point outside the limit."));
158 return fe_values->quadrature_point(q);
161 template <
unsigned int dim>
165 AssertThrow(initialized, dealii::StandardExceptions::ExcNotInitialized());
167 AssertThrow(q < pow(n_quad_points_1D, dim),
168 dealii::StandardExceptions::ExcMessage(
169 "Index of quadrature point outside the limit."));
171 return mapping->transform_real_to_unit_cell(cell, quadrature_real(q));
174 template <
unsigned int dim>
178 AssertThrow(initialized, dealii::StandardExceptions::ExcNotInitialized());
180 AssertThrow(q < pow(n_quad_points_1D, dim),
181 dealii::StandardExceptions::ExcMessage(
182 "Index of quadrature point outside the limit."));
184 return QGLpoints.weight(q);
187 template <
unsigned int dim>
188 dealii::Tensor<2, dim>
191 AssertThrow(initialized, dealii::StandardExceptions::ExcNotInitialized());
193 dealii::Tensor<2, dim> BJinv;
195 const dealii::DerivativeForm<1, dim, dim> jac_inv =
196 fe_values->inverse_jacobian(0);
199 for (
unsigned int i = 0; i < dim; ++i)
201 for (
unsigned int j = 0; j < dim; ++j)
203 BJinv[i][j] = jac_inv[i][j];
210 template <
unsigned int dim>
214 AssertThrow(initialized, dealii::StandardExceptions::ExcNotInitialized());
216 return fe_values.get_n_quad_points.size();
Class representing the Gauss-Legendre quadrature formula on simplex elements.
Class for the main operations on a discontinuous Galerkin volume element.
const std::unique_ptr< dealii::MappingFE< dim > > mapping
Mapping of the discretized space, needed for geometrical reference-to-actual operations.
const unsigned int n_quad_points_1D
Number of quadrature points in one dimensional elements.
const QGaussLegendreSimplex< dim > QGLpoints
Quadrature formula for volume elements.
const std::unique_ptr< dealii::FE_SimplexDGP< dim > > fe_dg
Internal Lagrangian basis class.
virtual double quadrature_weight(const unsigned int q) const
Return the quadrature weight associated to the -th quadrature point.
std::unique_ptr< dealii::FEValues< dim > > fe_values
Internal FEM basis class.
dealii::DoFHandler< dim >::active_cell_iterator cell
Actual DG cell.
void reinit(const typename dealii::DoFHandler< dim >::active_cell_iterator &new_cell)
Reinit objects on the current new_cell.
virtual dealii::Point< dim > quadrature_ref(const unsigned int q) const
Return the -th spatial quadrature point position on the reference element.
virtual dealii::Point< dim > quadrature_real(const unsigned int q) const
Return the -th spatial quadrature point position on the actual element.
bool initialized
A condition to inform if the class is initialized on an element or not.
unsigned int get_n_quad_points() const
Get the number of quadrature points on the current element.
dealii::Tensor< 2, dim > get_jacobian_inverse() const
Inverse of the Jacobian of the reference-to-actual transformation.
virtual ~VolumeHandlerDG()=default
Destructor.
typename ActiveSelector::active_cell_iterator active_cell_iterator