7#include <deal.II/base/parameter_handler.h>
8#include <deal.II/base/parsed_function.h>
9#include <deal.II/base/patterns.h>
19 <<
"Time Harmonic Maxwell boundary id: " << arg1
20 <<
" has already been declared as a boundary condition");
27 ParameterHandler &prm,
28 const types::boundary_id default_boundary_id)
34 "Type of boundary condition for Time Harmonic Maxwell equations.",
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");
46 prm.enter_subsection(
"E x real part");
47 temporary_em_functions.
e_x_real.declare_parameters(prm);
48 prm.leave_subsection();
50 prm.enter_subsection(
"E y real part");
51 temporary_em_functions.
e_y_real.declare_parameters(prm);
52 prm.leave_subsection();
54 prm.enter_subsection(
"E z real part");
55 temporary_em_functions.
e_z_real.declare_parameters(prm);
56 prm.leave_subsection();
58 prm.enter_subsection(
"E x imag part");
59 temporary_em_functions.
e_x_imag.declare_parameters(prm);
60 prm.leave_subsection();
62 prm.enter_subsection(
"E y imag part");
63 temporary_em_functions.
e_y_imag.declare_parameters(prm);
64 prm.leave_subsection();
66 prm.enter_subsection(
"E z imag part");
67 temporary_em_functions.
e_z_imag.declare_parameters(prm);
68 prm.leave_subsection();
70 prm.enter_subsection(
"H x real part");
71 temporary_em_functions.
h_x_real.declare_parameters(prm);
72 prm.leave_subsection();
74 prm.enter_subsection(
"H y real part");
75 temporary_em_functions.
h_y_real.declare_parameters(prm);
76 prm.leave_subsection();
78 prm.enter_subsection(
"H z real part");
79 temporary_em_functions.
h_z_real.declare_parameters(prm);
80 prm.leave_subsection();
82 prm.enter_subsection(
"H x imag part");
83 temporary_em_functions.
h_x_imag.declare_parameters(prm);
84 prm.leave_subsection();
86 prm.enter_subsection(
"H y imag part");
87 temporary_em_functions.
h_y_imag.declare_parameters(prm);
88 prm.leave_subsection();
90 prm.enter_subsection(
"H z imag part");
91 temporary_em_functions.
h_z_imag.declare_parameters(prm);
92 prm.leave_subsection();
96 Functions::ParsedFunction<dim> temporary_function;
98 prm.enter_subsection(
"surface admittance real part");
99 temporary_function.declare_parameters(prm);
100 prm.leave_subsection();
102 prm.enter_subsection(
"surface admittance imag part");
103 temporary_function.declare_parameters(prm);
104 prm.leave_subsection();
106 prm.enter_subsection(
"excitation x real part");
107 temporary_function.declare_parameters(prm);
108 prm.leave_subsection();
110 prm.enter_subsection(
"excitation x imag part");
111 temporary_function.declare_parameters(prm);
112 prm.leave_subsection();
114 prm.enter_subsection(
"excitation y real part");
115 temporary_function.declare_parameters(prm);
116 prm.leave_subsection();
118 prm.enter_subsection(
"excitation y imag part");
119 temporary_function.declare_parameters(prm);
120 prm.leave_subsection();
122 prm.enter_subsection(
"excitation z real part");
123 temporary_function.declare_parameters(prm);
124 prm.leave_subsection();
126 prm.enter_subsection(
"excitation z imag part");
127 temporary_function.declare_parameters(prm);
128 prm.leave_subsection();
134 ParameterHandler &prm,
137 prm.enter_subsection(
"boundary conditions time harmonic maxwell");
139 prm.declare_entry(
"number",
142 "Number of boundary conditions");
147 "Bool to define if the boundary condition is time-dependent");
151 prm.enter_subsection(
"bc " + std::to_string(n));
155 prm.leave_subsection();
158 prm.leave_subsection();
164 ParameterHandler &prm)
167 std::vector<types::boundary_id> boundary_ids =
172 boundary_ids.size() > 0,
174 "A boundary id has not been set for one of the time harmonic maxwell boundary conditions. Please ensure that the id is set for every boundary condition."));
178 for (
const auto boundary_id : boundary_ids)
180 AssertThrow(this->
type.find(boundary_id) == this->type.end(),
181 TimeHarmonicMaxwellDuplicated(boundary_id));
186 std::make_shared<TimeHarmonicMaxwellBoundaryFunctions<dim>>();
188 prm.enter_subsection(
"E x real part");
191 prm.leave_subsection();
193 prm.enter_subsection(
"E y real part");
196 prm.leave_subsection();
198 prm.enter_subsection(
"E z real part");
201 prm.leave_subsection();
203 prm.enter_subsection(
"E x imag part");
206 prm.leave_subsection();
208 prm.enter_subsection(
"E y imag part");
211 prm.leave_subsection();
213 prm.enter_subsection(
"E z imag part");
216 prm.leave_subsection();
218 prm.enter_subsection(
"H x real part");
221 prm.leave_subsection();
223 prm.enter_subsection(
"H y real part");
226 prm.leave_subsection();
228 prm.enter_subsection(
"H z real part");
231 prm.leave_subsection();
233 prm.enter_subsection(
"H x imag part");
236 prm.leave_subsection();
238 prm.enter_subsection(
"H y imag part");
241 prm.leave_subsection();
243 prm.enter_subsection(
"H z imag part");
246 prm.leave_subsection();
251 prm.enter_subsection(
"surface admittance real part");
253 std::make_shared<Functions::ParsedFunction<dim>>();
255 prm.leave_subsection();
257 prm.enter_subsection(
"surface admittance imag part");
259 std::make_shared<Functions::ParsedFunction<dim>>();
261 prm.leave_subsection();
263 prm.enter_subsection(
"excitation x real part");
265 std::make_shared<Functions::ParsedFunction<dim>>();
267 prm.leave_subsection();
269 prm.enter_subsection(
"excitation y real part");
271 std::make_shared<Functions::ParsedFunction<dim>>();
273 prm.leave_subsection();
275 prm.enter_subsection(
"excitation z real part");
277 std::make_shared<Functions::ParsedFunction<dim>>();
279 prm.leave_subsection();
281 prm.enter_subsection(
"excitation x imag part");
283 std::make_shared<Functions::ParsedFunction<dim>>();
285 prm.leave_subsection();
287 prm.enter_subsection(
"excitation y imag part");
289 std::make_shared<Functions::ParsedFunction<dim>>();
291 prm.leave_subsection();
293 prm.enter_subsection(
"excitation z imag part");
295 std::make_shared<Functions::ParsedFunction<dim>>();
297 prm.leave_subsection();
300 this->
type[boundary_id] =
311 ParameterHandler &prm)
313 prm.enter_subsection(
"boundary conditions time harmonic maxwell");
320 prm.enter_subsection(
"bc " + std::to_string(n));
324 prm.leave_subsection();
327 prm.leave_subsection();
338 const Point<dim> &point,
339 const unsigned int component)
const
341 Assert(component < this->n_components,
342 ExcIndexRange(component, 0, this->n_components));
375 const Point<dim> &point,
376 const unsigned int component)
const
378 Assert(component < this->n_components,
379 ExcIndexRange(component, 0, this->n_components));
std::map< types::boundary_id, TimeHarmonicMaxwellBoundaryType > type
unsigned int number_of_boundary_conditions
This class manages the boundary conditions for Time Harmonic Maxwell solver. It introduces the bounda...
std::map< types::boundary_id, std::shared_ptr< Functions::ParsedFunction< dim > > > surface_admittance_imag
void declare_default_entry(ParameterHandler &prm, types::boundary_id default_boundary_id)
Declare the default parameters for one time-harmonic Maxwell boundary condition.
std::map< types::boundary_id, std::shared_ptr< Functions::ParsedFunction< dim > > > excitation_y_imag
std::map< types::boundary_id, std::shared_ptr< Functions::ParsedFunction< dim > > > excitation_z_imag
std::map< types::boundary_id, std::shared_ptr< Functions::ParsedFunction< dim > > > excitation_z_real
std::map< types::boundary_id, std::shared_ptr< Functions::ParsedFunction< dim > > > excitation_y_real
void declare_parameters(ParameterHandler &prm, unsigned int number_of_boundary_conditions)
Declare the Time Harmonic Maxwell boundary conditions.
std::map< types::boundary_id, std::shared_ptr< Functions::ParsedFunction< dim > > > excitation_x_real
Excitation.
std::map< types::boundary_id, std::shared_ptr< Functions::ParsedFunction< dim > > > excitation_x_imag
void parse_parameters(ParameterHandler &prm)
Parse the Time Harmonic Maxwell boundary conditions.
std::map< types::boundary_id, std::shared_ptr< TimeHarmonicMaxwellBoundaryFunctions< dim > > > imposed_electromagnetic_fields
void parse_boundary(ParameterHandler &prm)
Parse the information for one time-harmonic Maxwell boundary condition.
std::map< types::boundary_id, std::shared_ptr< Functions::ParsedFunction< dim > > > surface_admittance_real
This class manages the functions associated with both imposed electric and magnetic fields boundary c...
Functions::ParsedFunction< dim > h_x_imag
Functions::ParsedFunction< dim > h_y_imag
Functions::ParsedFunction< dim > h_z_imag
Functions::ParsedFunction< dim > e_z_real
Functions::ParsedFunction< dim > e_y_imag
Functions::ParsedFunction< dim > h_z_real
Functions::ParsedFunction< dim > h_y_real
Functions::ParsedFunction< dim > h_x_real
Magnetic field components.
Functions::ParsedFunction< dim > e_x_imag
Functions::ParsedFunction< dim > e_y_real
Functions::ParsedFunction< dim > e_z_imag
Functions::ParsedFunction< dim > e_x_real
This class implements a boundary condition type for the Time Harmonic Maxwell equation where the elec...
Functions::ParsedFunction< dim > * e_y_real
Functions::ParsedFunction< dim > * e_z_real
Functions::ParsedFunction< dim > * e_y_imag
Functions::ParsedFunction< dim > * e_x_imag
Functions::ParsedFunction< dim > * e_x_real
Functions::ParsedFunction< dim > * e_z_imag
double value(const Point< dim > &point, const unsigned int component) const override
Calculates the value of an imposed electric field equations.
This class implements a boundary condition type for the Time Harmonic Maxwell equation where the magn...
Functions::ParsedFunction< dim > * h_y_imag
Functions::ParsedFunction< dim > * h_z_real
Functions::ParsedFunction< dim > * h_x_real
double value(const Point< dim > &point, const unsigned int component) const override
Calculates the value of an imposed magnetic field equations.
Functions::ParsedFunction< dim > * h_x_imag
Functions::ParsedFunction< dim > * h_y_real
Functions::ParsedFunction< dim > * h_z_imag
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 DeprecatedEnumNames< TimeHarmonicMaxwellBoundaryType > deprecated_time_harmonic_maxwell_boundary_type_names
DeclException1(TimeHarmonicMaxwellDuplicated, types::boundary_id,<< "Time Harmonic Maxwell boundary id: "<< arg1<< " has already been declared as a boundary condition")