7#include <deal.II/base/parameter_handler.h>
8#include <deal.II/base/parsed_function.h>
9#include <deal.II/base/patterns.h>
19 <<
"CLS 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 CLS.",
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;
43 prm.enter_subsection(
"dirichlet");
44 temporary_function.declare_parameters(prm);
45 prm.leave_subsection();
52 "Mesh id for periodic face matching. Default entry is -1 to ensure that the periodic id is set by the user");
54 prm.declare_entry(
"periodic direction",
57 "Direction for periodic boundary condition");
63 ParameterHandler &prm,
66 prm.enter_subsection(
"boundary conditions CLS");
68 prm.declare_entry(
"number",
71 "Number of boundary conditions");
76 "Bool to define if the boundary condition is time-dependent");
80 prm.enter_subsection(
"bc " + std::to_string(n));
84 prm.leave_subsection();
87 prm.leave_subsection();
95 std::vector<types::boundary_id> boundary_ids =
100 boundary_ids.size() > 0,
102 "A boundary id has not been set for one of the CLS boundary conditions. Please ensure that the id is set for every boundary condition."));
106 for (
const auto boundary_id : boundary_ids)
108 AssertThrow(this->
type.find(boundary_id) == this->type.end(),
109 CLSBoundaryDuplicated(boundary_id));
113 this->
type[boundary_id] = boundary_type;
116 prm.enter_subsection(
"dirichlet");
118 std::make_shared<Functions::ParsedFunction<dim>>();
120 prm.leave_subsection();
124 types::boundary_id periodic_boundary_id =
125 prm.get_integer(
"periodic id");
129 this->
type[periodic_boundary_id] =
134 .neighbor_id = periodic_boundary_id,
135 .direction =
static_cast<unsigned int>(
136 prm.get_integer(
"periodic direction"))};
145 prm.enter_subsection(
"boundary conditions CLS");
152 prm.enter_subsection(
"bc " + std::to_string(n));
156 prm.leave_subsection();
159 prm.leave_subsection();
Parameters::PeriodicBoundaries periodic_boundaries
std::map< types::boundary_id, CLSBoundaryType > type
unsigned int number_of_boundary_conditions
This class manages the boundary conditions for CLS solver It introduces the boundary functions and de...
void declare_default_entry(ParameterHandler &prm, types::boundary_id default_boundary_id)
Declare the default parameters for one CLS boundary condition.
void parse_parameters(ParameterHandler &prm)
Parse the CLS boundary condition parameters.
void declare_parameters(ParameterHandler &prm, unsigned int number_of_boundary_conditions)
Declare the CLS boundary condition parameters.
std::map< types::boundary_id, std::shared_ptr< Functions::ParsedFunction< dim > > > phase_indicator
void parse_boundary(ParameterHandler &prm)
Parse the information for one CLS boundary condition.
DeclException1(CLSBoundaryDuplicated, types::boundary_id,<< "CLS boundary id: "<< arg1<< " has already been declared as a boundary condition")
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< CLSBoundaryType > cls_boundary_types