[P]arallel [Hi]gh-order [Li]brary for [P]DEs  Latest
Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
reconstruct_poly.h
1 
2 #ifndef __RECONSTRUCT_POLY_H__
3 #define __RECONSTRUCT_POLY_H__
4 
5 #include <deal.II/lac/la_parallel_vector.h>
6 
7 #include <deal.II/hp/mapping_collection.h>
8 #include <deal.II/hp/q_collection.h>
9 
10 #include <deal.II/base/polynomial_space.h>
11 
12 #include <deal.II/grid/tria.h>
13 
14 #include <deal.II/fe/fe.h>
15 #include <deal.II/fe/mapping.h>
16 
17 #include "physics/manufactured_solution.h"
18 
19 namespace PHiLiP {
20 
21 namespace GridRefinement {
22 
24 enum class NormType{
25  H1,
26  L2,
27  };
28 
30 
34 template <int dim>
35 std::array<unsigned int, dim> compute_index(
36  const unsigned int i,
37  const unsigned int size);
38 
40 
51 template <int dim, int nstate, typename real>
53 {
54 
55 public:
58  const dealii::DoFHandler<dim>& dof_handler,
59  const dealii::hp::MappingCollection<dim>& mapping_collection,
60  const dealii::hp::FECollection<dim>& fe_collection,
61  const dealii::hp::QCollection<dim>& quadrature_collection,
62  const dealii::UpdateFlags& update_flags
63  );
64 
66 
69  void reinit(const unsigned int n);
70 
72 
74  void set_norm_type(const NormType norm_type);
75 
77 
106  void reconstruct_chord_derivative(
107  const dealii::LinearAlgebra::distributed::Vector<real>&solution,
108  const unsigned int rel_order
109  );
110 
112 
139  void reconstruct_directional_derivative(
140  const dealii::LinearAlgebra::distributed::Vector<real>&solution,
141  const unsigned int rel_order
142  );
143 
145 
161  void reconstruct_manufactured_derivative(
162  const std::shared_ptr<ManufacturedSolutionFunction<dim,real>>& manufactured_solution,
163  const unsigned int rel_order
164  );
165 
166 private:
168 
202  template <typename DoFCellAccessorType>
203  dealii::Vector<real> reconstruct_norm(
204  const NormType norm_type,
205  const DoFCellAccessorType & curr_cell,
206  const dealii::PolynomialSpace<dim> ps,
207  const dealii::LinearAlgebra::distributed::Vector<real> &solution);
208 
210 
225  template <typename DoFCellAccessorType>
226  dealii::Vector<real> reconstruct_H1_norm(
227  const DoFCellAccessorType & curr_cell,
228  const dealii::PolynomialSpace<dim> ps,
229  const dealii::LinearAlgebra::distributed::Vector<real> &solution);
230 
232 
246  template <typename DoFCellAccessorType>
247  dealii::Vector<real> reconstruct_L2_norm(
248  const DoFCellAccessorType & curr_cell,
249  const dealii::PolynomialSpace<dim> ps,
250  const dealii::LinearAlgebra::distributed::Vector<real> &solution);
251 
253 
257  template <typename DoFCellAccessorType>
258  std::vector<DoFCellAccessorType> get_patch_around_dof_cell(
259  const DoFCellAccessorType &cell);
260 
261  // member attributes
262  const dealii::DoFHandler<dim>& dof_handler;
263  const dealii::hp::MappingCollection<dim> & mapping_collection;
264  const dealii::hp::FECollection<dim> & fe_collection;
265  const dealii::hp::QCollection<dim> & quadrature_collection;
266  const dealii::UpdateFlags & update_flags;
267 
269  NormType norm_type;
270 
271 public:
273 
278  std::vector<std::array<real,dim>> derivative_value;
279 
281 
286  std::vector<std::array<dealii::Tensor<1,dim,real>,dim>> derivative_direction;
287 
289  dealii::Vector<real> get_derivative_value_vector_dealii(
290  const unsigned int index);
291 };
292 
293 } // namespace GridRefinement
294 
295 } //namespace PHiLiP
296 
297 #endif // __RECONSTRUCT_POLY_H__
std::vector< std::array< dealii::Tensor< 1, dim, real >, dim > > derivative_direction
Derivative directions.
Polynomial Reconstruction Class.
Manufactured solution used for grid studies to check convergence orders.
const dealii::UpdateFlags & update_flags
Update flags used in obtaining local cell representation.
const dealii::hp::MappingCollection< dim > & mapping_collection
Collection of mapping rules for reference element conversion.
Files for the baseline physics.
Definition: ADTypes.hpp:10
std::vector< std::array< real, dim > > derivative_value
Derivative values.
const dealii::hp::FECollection< dim > & fe_collection
Collection of Finite elements to represent discontinuous solution space.
NormType norm_type
Setting controls the choice of norm used in reconstruction. Set via set_norm_type.
const dealii::DoFHandler< dim > & dof_handler
Degree of freedom handler for iteration over mesh elements and their nodes.
const dealii::hp::QCollection< dim > & quadrature_collection
Collection of quadrature rules used to evaluate volume integrals.