Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
analytical_solutions.cc
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2019, 2021-2023, 2026 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4#include <core/utilities.h>
5
7
9{
10 template <int dim>
11 void
13 {
14 prm.enter_subsection("analytical solution");
15 prm.declare_entry(
16 "enable",
17 Patterns::Tools::Convert<bool>::to_string(enable),
18 Patterns::Bool(),
19 "Enable the calculation of the analytical solution and L2 error");
21 prm,
22 "verbosity",
24 "State whether from the post-processing values should be printed.",
27
28 prm.declare_entry(
29 "filename",
31 Patterns::FileName(),
32 "File name for the output for the L2Error table with respect to time or mesh ");
33
34
35 {
36 prm.enter_subsection("uvwp");
37 uvwp.declare_parameters(prm, dim + 1);
38 prm.leave_subsection();
39 }
40 {
41 prm.enter_subsection("temperature");
42 temperature.declare_parameters(prm);
43 prm.leave_subsection();
44 }
45
46 {
47 prm.enter_subsection("tracer");
48 tracer.declare_parameters(prm);
49 prm.leave_subsection();
50 }
51 {
52 prm.enter_subsection("QMOM");
54 prm.leave_subsection();
55 }
56 {
57 prm.enter_subsection("CLS");
58 phase.declare_parameters(prm);
59 prm.leave_subsection();
60 }
61
62 {
63 prm.enter_subsection("cahn hilliard");
64 cahn_hilliard.declare_parameters(prm, 2);
65 prm.leave_subsection();
66 }
67
68 {
69 prm.enter_subsection("electromagnetics");
70 electromagnetics.declare_parameters(prm, 4 * dim);
71 prm.leave_subsection();
72 }
73
74 prm.leave_subsection();
75 }
76
77 template <int dim>
78 void
80 {
81 prm.enter_subsection("analytical solution");
82 enable = prm.get_bool("enable");
83 filename = prm.get("filename");
85 prm.get("verbosity"),
87 "verbosity");
88
89 {
90 prm.enter_subsection("uvwp");
91 uvwp.parse_parameters(prm);
92 prm.leave_subsection();
93 }
94
95 {
96 prm.enter_subsection("temperature");
97 temperature.parse_parameters(prm);
98 prm.leave_subsection();
99 }
100
101 {
102 prm.enter_subsection("tracer");
103 tracer.parse_parameters(prm);
104 prm.leave_subsection();
105 }
106 {
107 prm.enter_subsection("QMOM");
108 qmom.parse_parameters(prm);
109 prm.leave_subsection();
110 }
111
112 {
113 prm.enter_subsection("CLS");
114 phase.parse_parameters(prm);
115 prm.leave_subsection();
116 }
117
118 {
119 prm.enter_subsection("cahn hilliard");
120 cahn_hilliard.parse_parameters(prm);
121 prm.leave_subsection();
122 }
123
124 {
125 prm.enter_subsection("electromagnetics");
126 electromagnetics.parse_parameters(prm);
127 prm.leave_subsection();
128 }
129
130 prm.leave_subsection();
131 }
132
133
134} // namespace AnalyticalSolutions
135// Pre-compile the 2D and 3D
Implements analytical solutions for the Navier-Stokes equations and the other physics supported by le...
Functions::ParsedFunction< dim > cahn_hilliard
Parameters::QMOMFunctions< dim > qmom
Functions::ParsedFunction< dim > temperature
virtual void declare_parameters(ParameterHandler &prm)
Declare the parameters required by the analytical solution within a parameter file.
Functions::ParsedFunction< dim > electromagnetics
Functions::ParsedFunction< dim > phase
Functions::ParsedFunction< dim > uvwp
Functions::ParsedFunction< dim > tracer
virtual void parse_parameters(ParameterHandler &prm)
Parse the parameters required by the analytical solution within a parameter file.
EnumType string_to_enum(const std::string &name)
Return the enumerator whose identifier is name, e.g. to parse the value of a parameter entry into its...
Definition utilities.h:734
void declare_enum_entry(ParameterHandler &prm, const std::string &entry_name, const EnumType default_value, const std::string &description, const DeprecatedEnumNames< EnumType > &deprecated_names={}, const std::vector< EnumType > &allowed_values={})
Declare a parameter entry whose value is an enumerator. The default value, the accepted values and th...
Definition utilities.h:888
Contains all the classes related to the calculation of the analytical solutions for the various physi...
const std::vector< Verbosity > & quiet_or_verbose()
Return the verbosity levels accepted by the parameters which do not support Verbosity::extra_verbose.
const DeprecatedEnumNames< Verbosity > & deprecated_verbosity_names()
Return the deprecated strings of the parameters parsed into a Verbosity, which remain accepted in par...
static void declare_parameters(ParameterHandler &prm)
Declare the "scalars" and "distribution" subsections in the current subsection. All the functions are...