[P]arallel [Hi]gh-order [Li]brary for [P]DEs  Latest
Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
parameters_mesh_adaptation.cpp
1 #include "parameters/parameters_mesh_adaptation.h"
2 
3 namespace PHiLiP {
4 namespace Parameters {
5 
6 void MeshAdaptationParam::declare_parameters (dealii::ParameterHandler &prm)
7 {
8  prm.enter_subsection("mesh adaptation");
9  {
10  prm.declare_entry("total_mesh_adaptation_cycles","0",
11  dealii::Patterns::Integer(),
12  "Maximum adaptation steps for a problem.");
13 
14  prm.declare_entry("mesh_adaptation_type", "h_adaptation",
15  dealii::Patterns::Selection(
16  " h_adaptation | "
17  " p_adaptation | "
18  " hp_adaptation | "
19  " anisotropic_adaptation "
20  ),
21  "Mesh adaptation type that we want to use. "
22  "Choices are "
23  " <h_adaptation | "
24  " p_adaptation | "
25  " hp_adaptation "
26  " anisotropic_adaptation>.");
27 
28  prm.declare_entry("use_goal_oriented_mesh_adaptation","false",
29  dealii::Patterns::Bool(),
30  "Flag to use goal oriented mesh adaptation. False by default.");
31 
32 
33  prm.enter_subsection("fixed-fraction");
34  {
35  prm.declare_entry("refine_fraction","0.0",
36  dealii::Patterns::Double(0.0,1.0),
37  "Fraction of cells to be h-refined.");
38 
39  prm.declare_entry("h_coarsen_fraction","0.0",
40  dealii::Patterns::Double(0.0,1.0),
41  "Fraction of cells to be h-coarsened.");
42 
43  prm.declare_entry("hp_smoothness_tolerance","1.0e-6",
44  dealii::Patterns::Double(0.0,1.0e5),
45  "Tolerance to decide between h- or p-refinement.");
46  }
47  prm.leave_subsection();// "fixed-fraction"
48 
49  prm.enter_subsection("anisotropic");
50  {
51  prm.declare_entry("mesh_complexity_anisotropic_adaptation","50.0",
52  dealii::Patterns::Double(0.0,1.0e5),
53  "Continuous equivalent of number of vertices/elements.");
54 
55  prm.declare_entry("norm_Lp_anisotropic_adaptation","2.0",
56  dealii::Patterns::Double(0.0,1.0e5),
57  "Lp norm w.r.t. which the optimization is performed in the continuous mesh framework.");
58  }
59  prm.leave_subsection(); // "anisotropic"
60  }
61  prm.leave_subsection(); // "mesh adaptation"
62 
63 }
64 
65 void MeshAdaptationParam::parse_parameters (dealii::ParameterHandler &prm)
66 {
67  prm.enter_subsection("mesh adaptation");
68  {
69  total_mesh_adaptation_cycles = prm.get_integer("total_mesh_adaptation_cycles");
70  const std::string mesh_adaptation_string = prm.get("mesh_adaptation_type");
71  if(mesh_adaptation_string == "h_adaptation") {mesh_adaptation_type = MeshAdaptationType::h_adaptation;}
72  else if(mesh_adaptation_string == "p_adaptation") {mesh_adaptation_type = MeshAdaptationType::p_adaptation;}
73  else if(mesh_adaptation_string == "hp_adaptation") {mesh_adaptation_type = MeshAdaptationType::hp_adaptation;}
74  else if(mesh_adaptation_string == "anisotropic_adaptation") {mesh_adaptation_type = MeshAdaptationType::anisotropic_adaptation;}
75 
76  use_goal_oriented_mesh_adaptation = prm.get_bool("use_goal_oriented_mesh_adaptation");
77 
78  prm.enter_subsection("fixed-fraction");
79  {
80  refine_fraction = prm.get_double("refine_fraction");
81  h_coarsen_fraction = prm.get_double("h_coarsen_fraction");
82  hp_smoothness_tolerance = prm.get_double("hp_smoothness_tolerance");
83  }
84  prm.leave_subsection();// "fixed-fraction"
85 
86  prm.enter_subsection("anisotropic");
87  {
88  mesh_complexity_anisotropic_adaptation = prm.get_double("mesh_complexity_anisotropic_adaptation");
89  norm_Lp_anisotropic_adaptation = prm.get_double("norm_Lp_anisotropic_adaptation");
90  }
91  prm.leave_subsection(); // "anisotropic"
92  }
93  prm.leave_subsection(); // "mesh adaptation"
94 }
95 
96 } // namespace Parameters
97 } // namespace PHiLiP
98 
int total_mesh_adaptation_cycles
Total/maximum number of mesh adaptation cycles while solving a problem.
Files for the baseline physics.
Definition: ADTypes.hpp:10
double hp_smoothness_tolerance
Tolerance to decide between h- or p-refinement.
void parse_parameters(dealii::ParameterHandler &prm)
Parse parameters.
MeshAdaptationType mesh_adaptation_type
Selection of mesh adaptation type.
double norm_Lp_anisotropic_adaptation
Lp norm w.r.t. which the optimization is performed in the continuous mesh framework.
double h_coarsen_fraction
Fraction of cells to be h-coarsened.
bool use_goal_oriented_mesh_adaptation
Flag to use goal oriented mesh adaptation.
double mesh_complexity_anisotropic_adaptation
Continuous equivalent of number of vertices/elements. Used in anisotropic mesh adaptation.
double refine_fraction
Fraction of cells to be h or p-refined.
static void declare_parameters(dealii::ParameterHandler &prm)
Declare parameters.