7#include <deal.II/base/parameter_handler.h>
8#include <deal.II/base/parsed_function.h>
9#include <deal.II/base/patterns.h>
19 <<
"Tracer boundary id: " << arg1
20 <<
" has already been declared as a boundary condition");
27 ParameterHandler &prm,
28 const types::boundary_id default_boundary_id)
33 "Type of boundary condition for the tracer.",
37 prm.declare_entry(
"id",
38 Utilities::int_to_string(default_boundary_id, 2),
39 Patterns::List(Patterns::Integer()),
40 "Mesh id for boundary conditions");
42 Functions::ParsedFunction<dim> temporary_function;
44 prm.enter_subsection(
"dirichlet");
45 temporary_function.declare_parameters(prm);
46 prm.leave_subsection();
53 "Mesh id for periodic face matching. Default entry is -1 to ensure that the periodic id is set by the user");
55 prm.declare_entry(
"periodic direction",
58 "Direction for periodic boundary condition");
64 ParameterHandler &prm,
67 prm.enter_subsection(
"boundary conditions tracer");
69 prm.declare_entry(
"number",
72 "Number of boundary conditions");
78 "Bool to define if the boundary condition is time-dependent");
82 prm.enter_subsection(
"bc " + std::to_string(n));
86 prm.leave_subsection();
89 prm.leave_subsection();
97 std::vector<types::boundary_id> boundary_ids =
102 boundary_ids.size() > 0,
104 "A boundary id has not been set for one of the tracer boundary conditions. Please ensure that the id is set for every boundary condition."));
108 for (
const auto boundary_id : boundary_ids)
110 AssertThrow(this->
type.find(boundary_id) == this->type.end(),
111 TracerBoundaryDuplicated(boundary_id));
115 std::make_shared<Functions::ParsedFunction<dim>>();
118 this->
type[boundary_id] = boundary_type;
121 prm.enter_subsection(
"dirichlet");
122 tracer[boundary_id]->parse_parameters(prm);
123 prm.leave_subsection();
127 types::boundary_id periodic_boundary_id =
128 prm.get_integer(
"periodic id");
132 this->
type[periodic_boundary_id] =
137 .neighbor_id = periodic_boundary_id,
138 .direction =
static_cast<unsigned int>(
139 prm.get_integer(
"periodic direction"))};
148 prm.enter_subsection(
"boundary conditions tracer");
155 prm.enter_subsection(
"bc " + std::to_string(n));
159 prm.leave_subsection();
162 prm.leave_subsection();
Parameters::PeriodicBoundaries periodic_boundaries
std::map< types::boundary_id, TracerBoundaryType > type
unsigned int number_of_boundary_conditions
This class manages the boundary conditions for Tracer solver It introduces the boundary functions and...
void declare_parameters(ParameterHandler &prm, unsigned int number_of_boundary_conditions)
Declare the tracer boundary condition parameters.
void parse_parameters(ParameterHandler &prm)
Parse the tracer boundary condition parameters.
void declare_default_entry(ParameterHandler &prm, types::boundary_id default_boundary_id)
Declare the default parameters for one tracer boundary condition.
void parse_boundary(ParameterHandler &prm)
Parse the information for one tracer boundary condition.
std::map< types::boundary_id, std::shared_ptr< Functions::ParsedFunction< dim > > > tracer
std::vector< T > convert_string_to_vector(const ParameterHandler &prm, const std::string &entry_string)
Return the vector of size N of entry @entry_string. If the entry is specified in the ....
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...
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...
const std::vector< TracerBoundaryType > tracer_boundary_types
DeclException1(TracerBoundaryDuplicated, types::boundary_id,<< "Tracer boundary id: "<< arg1<< " has already been declared as a boundary condition")