27 #ifndef FACE_HANDLER_DG_HPP_
28 #define FACE_HANDLER_DG_HPP_
30 #include <deal.II/base/quadrature_lib.h>
31 #include <deal.II/base/tensor.h>
33 #include <deal.II/fe/fe.h>
34 #include <deal.II/fe/fe_q.h>
47 template <
unsigned int dim>
55 const double tol = 1e-10;
75 dealii::update_quadrature_points | dealii::update_normal_vectors |
76 dealii::update_JxW_values | dealii::update_jacobians))
91 const unsigned int new_edge);
112 const unsigned int q,
116 dealii::Tensor<1, dim>
127 template <
unsigned int dim>
131 const unsigned int new_edge)
133 this->cell = new_cell;
135 fe_face_values->reinit(new_cell, new_edge);
136 this->fe_values->reinit(new_cell);
137 this->initialized =
true;
140 template <
unsigned int dim>
144 AssertThrow(this->initialized,
145 dealii::StandardExceptions::ExcNotInitialized());
147 AssertThrow(q < pow(this->n_quad_points_1D, dim - 1),
148 dealii::StandardExceptions::ExcMessage(
149 "Index of quadrature point outside the limit."));
151 return fe_face_values->quadrature_point(q);
154 template <
unsigned int dim>
158 AssertThrow(this->initialized,
159 dealii::StandardExceptions::ExcNotInitialized());
161 AssertThrow(q < pow(this->n_quad_points_1D, dim - 1),
162 dealii::StandardExceptions::ExcMessage(
163 "Index of quadrature point outside the limit."));
165 return this->mapping->transform_real_to_unit_cell(this->cell,
169 template <
unsigned int dim>
173 AssertThrow(this->initialized,
174 dealii::StandardExceptions::ExcNotInitialized());
176 AssertThrow(q < pow(this->n_quad_points_1D, dim - 1),
177 dealii::StandardExceptions::ExcMessage(
178 "Index of quadrature point outside the limit."));
180 return QGLpoints_face.weight(q);
183 template <
unsigned int dim>
186 const unsigned int q,
189 AssertThrow(this->initialized,
190 dealii::StandardExceptions::ExcNotInitialized());
192 AssertThrow(q < pow(this->n_quad_points_1D, dim - 1),
193 dealii::StandardExceptions::ExcMessage(
194 "Index of quadrature point outside the limit."));
196 const unsigned int n_quad_points_face =
197 static_cast<int>(std::pow(this->n_quad_points_1D, dim - 1));
198 const dealii::Point<dim> P_q = quadrature_real(q);
201 for (
unsigned int nq = 0; nq < n_quad_points_face; ++nq)
203 const dealii::Point<dim> P_nq = FaceHandlerDG_neigh.
quadrature_real(nq);
207 if ((P_nq - P_q).norm() < tol)
216 template <
unsigned int dim>
217 dealii::Tensor<1, dim>
220 AssertThrow(this->initialized,
221 dealii::StandardExceptions::ExcNotInitialized());
223 return fe_face_values->normal_vector(0);
232 AssertThrow(this->initialized,
233 dealii::StandardExceptions::ExcNotInitialized());
235 return this->cell->face(edge)->measure();
245 AssertThrow(this->initialized,
246 dealii::StandardExceptions::ExcNotInitialized());
248 const auto face = this->cell->face(edge);
251 const double semi_per = (face->line(0)->measure() + face->line(1)->measure() +
252 face->line(2)->measure()) /
256 return std::sqrt(semi_per * (semi_per - face->line(0)->measure()) *
257 (semi_per - face->line(1)->measure()) *
258 (semi_per - face->line(2)->measure()));
Class for the main operations on the faces of a discontinuous Galerkin element.
virtual ~FaceHandlerDG()=default
Destructor.
dealii::Point< dim > quadrature_ref(const unsigned int q) const override
Return the -th spatial quadrature point position on the reference element.
const double tol
Default tolerance.
dealii::Tensor< 1, dim > get_normal() const
Outward normal vector on the current element and face.
unsigned int edge
Index of the actual face.
double quadrature_weight(const unsigned int q) const override
Return the quadrature weight associated to the -th quadrature point.
double get_measure() const
Measure of face.
dealii::Point< dim > quadrature_real(const unsigned int q) const override
Return the -th spatial quadrature point position on the actual element.
std::unique_ptr< dealii::FEFaceValues< dim > > fe_face_values
Internal FEM basis class for face elements.
const QGaussLegendreSimplex< dim - 1 > QGLpoints_face
Quadrature formula for face elements.
int corresponding_neigh_index(const unsigned int q, const FaceHandlerDG< dim > &FaceHandlerDG_neigh) const
To manually obtain the associated quadrature point index in the neighbor element on the shared face.
void reinit(const typename dealii::DoFHandler< dim >::active_cell_iterator &new_cell, const unsigned int new_edge)
Reinit objects on the current new_cell and new_edge.
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 std::unique_ptr< dealii::FE_SimplexDGP< dim > > fe_dg
Internal Lagrangian basis class.
typename ActiveSelector::active_cell_iterator active_cell_iterator