Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
time_harmonic_maxwell_scratch_data.cc
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2026 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
5
8
9#include <deal.II/base/exceptions.h>
10
11#include <algorithm>
12#include <string>
13
14void
16 const PhysicalPropertiesManager &physical_properties_manager,
17 const std::map<field, std::vector<double>> &field_values_vectors,
18 const unsigned int material_id,
19 std::vector<std::complex<double>> &effective_electric_permittivities,
20 std::vector<std::complex<double>> &effective_magnetic_permeabilities)
21{
22 const unsigned int n_q_points =
23 field_values_vectors.at(field::temperature).size();
24
25 // Create temporary vectors to store the real and imaginary parts of the
26 // electromagnetic properties
27 std::vector<double> permittivity_real(n_q_points);
28 std::vector<double> permittivity_imag(n_q_points);
29 std::vector<double> conductivity(n_q_points);
30 std::vector<double> permeability_real(n_q_points);
31 std::vector<double> permeability_imag(n_q_points);
32
33 // We use the fluid_id = 0 because the time-harmonic Maxwell solver only
34 // supports a single fluid. The material_id is used to identify the different
35 // materials in the input file and assign them their corresponding properties.
36 if (physical_properties_manager.is_effective_medium(0, material_id))
37 {
38 // The material is a mixture of the fluid and of a dispersed phase. The
39 // time-harmonic Maxwell solver supports a single fluid (id 0) and a
40 // single dispersed phase (id 0).
41 const unsigned int material_interaction_id =
42 physical_properties_manager.get_material_interaction_id(
44
45 physical_properties_manager
46 .get_effective_electric_permittivity_real(material_interaction_id)
47 ->vector_value(field_values_vectors, permittivity_real);
48 physical_properties_manager
49 .get_effective_electric_permittivity_imag(material_interaction_id)
50 ->vector_value(field_values_vectors, permittivity_imag);
51 physical_properties_manager
52 .get_effective_magnetic_permeability_real(material_interaction_id)
53 ->vector_value(field_values_vectors, permeability_real);
54 physical_properties_manager
55 .get_effective_magnetic_permeability_imag(material_interaction_id)
56 ->vector_value(field_values_vectors, permeability_imag);
57 }
58 else
59 {
60 // The mixing law is applied to the complete complex permittivity
61 // eps' + i(eps'' + sigma) of each phase, so the conductivity of both
62 // phases is already included in the imaginary part of the effective
63 // permittivity. The conductivity vector is therefore left at zero.
64 physical_properties_manager
65 .get_electric_permittivity_real(0, material_id)
66 ->vector_value(field_values_vectors, permittivity_real);
67 physical_properties_manager
68 .get_electric_permittivity_imag(0, material_id)
69 ->vector_value(field_values_vectors, permittivity_imag);
70 physical_properties_manager.get_electric_conductivity(0, material_id)
71 ->vector_value(field_values_vectors, conductivity);
72 physical_properties_manager
73 .get_magnetic_permeability_real(0, material_id)
74 ->vector_value(field_values_vectors, permeability_real);
75 physical_properties_manager
76 .get_magnetic_permeability_imag(0, material_id)
77 ->vector_value(field_values_vectors, permeability_imag);
78 }
79
80 // We resize the effective electromagnetic property vectors to match the
81 // number of points because this function can be called with a different
82 // number of points (e.g. cell and face quadratures)
83 effective_electric_permittivities.resize(n_q_points);
84 effective_magnetic_permeabilities.resize(n_q_points);
85
86 for (unsigned int q = 0; q < n_q_points; ++q)
87 {
88 effective_electric_permittivities[q] = {permittivity_real[q],
89 permittivity_imag[q] +
90 conductivity[q]};
91 effective_magnetic_permeabilities[q] = {permeability_real[q],
92 permeability_imag[q]};
93 }
94}
95
96bool
98 const PhysicalPropertiesManager &physical_properties_manager,
99 const unsigned int material_id,
100 const field field_id)
101{
102 if (physical_properties_manager.is_effective_medium(0, material_id))
103 {
104 // The time-harmonic Maxwell solver supports a single fluid (id 0) and a
105 // single dispersed phase (id 0). The dependencies of the effective
106 // permittivity models include those of the conductivity models of the
107 // phases used by the mixing law.
108 const unsigned int material_interaction_id =
109 physical_properties_manager.get_material_interaction_id(
111
112 return physical_properties_manager
114 material_interaction_id)
115 ->depends_on(field_id) ||
116 physical_properties_manager
118 material_interaction_id)
119 ->depends_on(field_id) ||
120 physical_properties_manager
122 material_interaction_id)
123 ->depends_on(field_id) ||
124 physical_properties_manager
126 material_interaction_id)
127 ->depends_on(field_id);
128 }
129
130 return physical_properties_manager.get_electric_conductivity(0, material_id)
131 ->depends_on(field_id) ||
132 physical_properties_manager
133 .get_electric_permittivity_real(0, material_id)
134 ->depends_on(field_id) ||
135 physical_properties_manager
136 .get_electric_permittivity_imag(0, material_id)
137 ->depends_on(field_id) ||
138 physical_properties_manager
139 .get_magnetic_permeability_real(0, material_id)
140 ->depends_on(field_id) ||
141 physical_properties_manager
142 .get_magnetic_permeability_imag(0, material_id)
143 ->depends_on(field_id);
144}
145
146template <int dim>
147void
149{
150 const FiniteElement<dim> &fe_test = this->fe_values_test.get_fe();
151 const FiniteElement<dim> &fe_trial_interior =
152 this->fe_values_trial_interior.get_fe();
153 const FiniteElement<dim> &fe_trial_skeleton =
154 this->fe_face_values_trial_skeleton.get_fe();
155
156 // Initialize the sizes
157 this->n_q_points = this->fe_values_test.get_quadrature().size();
158 this->n_face_q_points = this->fe_face_values_test.get_quadrature().size();
159
160 // Build the local dof index array relationship [field][base_function] of each
161 // base function for each field of each space.
163 build_local_dof_index_map(fe_trial_interior,
165 build_local_dof_index_map(fe_trial_skeleton,
167
173
174 // Use the local dof index maps to identify which base functions have a
175 // tangential trace on the face.
180 fe_trial_skeleton,
183
184 // Cell quadrature
185 this->quadrature_points = std::vector<Point<dim>>(n_q_points);
186
187 // Temperature, void fraction and effective properties at the cell quadrature
188 // points. The temperature and the void fraction are the only fields on which
189 // the electromagnetic properties can depend.
190 this->temperature_values = std::vector<double>(n_q_points, 0.);
191 this->void_fraction_values = std::vector<double>(n_q_points, 1.);
192 this->fields.clear();
193 this->fields.insert(
194 std::pair<field, std::vector<double>>(field::temperature, n_q_points));
195 this->fields.insert(
196 std::pair<field, std::vector<double>>(field::void_fraction, n_q_points));
198 std::vector<std::complex<double>>(n_q_points);
200 std::vector<std::complex<double>>(n_q_points);
201
202 // Coefficients of the cell terms of the DPG system
203 this->JxW = std::vector<double>(n_q_points);
204 this->JxW_FF_container = std::vector<double>(n_q_points);
205 this->JxW_II_container = std::vector<double>(n_q_points);
206 this->iweps_JxW_container = std::vector<std::complex<double>>(n_q_points);
207 this->iwmu_JxW_container = std::vector<std::complex<double>>(n_q_points);
208
209 // Test and interior trial functions at the cell quadrature points
213
214 // Face quadrature
215 this->face_no = 0;
216 this->face_at_boundary = false;
217 this->face_boundary_id = numbers::invalid_boundary_id;
218 this->face_JxW = std::vector<double>(n_face_q_points);
219 this->face_quadrature_points = std::vector<Point<dim>>(n_face_q_points);
220 this->face_normals = std::vector<Tensor<1, dim>>(n_face_q_points);
221
222 // Temperature, void fraction and effective properties at the face quadrature
223 // points
224 this->face_temperature_values = std::vector<double>(n_face_q_points, 0.);
225 this->face_void_fraction_values = std::vector<double>(n_face_q_points, 1.);
226 this->face_fields.clear();
227 this->face_fields.insert(
228 std::pair<field, std::vector<double>>(field::temperature, n_face_q_points));
229 this->face_fields.insert(
230 std::pair<field, std::vector<double>>(field::void_fraction,
233 std::vector<std::complex<double>>(n_face_q_points);
235 std::vector<std::complex<double>>(n_face_q_points);
236
237 // Test and skeleton trial base functions at the face quadrature points
244}
245
246template <int dim>
247void
249 const FiniteElement<dim> &fe,
250 std::array<std::vector<unsigned int>, n_electromagnetic_fields>
251 &local_dof_index_map) const
252{
253 // Since the four fields use the same base element, each field has a quarter
254 // of the shape functions of the finite element system. This division only
255 // implies unsigned integer division and is always exact because the finite
256 // element system is built by repeating the same base element.
257 const unsigned int n_base_functions =
258 fe.n_dofs_per_cell() / n_electromagnetic_fields;
259
260 // Extractor of each field, indexed by the ElectromagneticFieldComponents
261 // enumeration
262 const std::array<FEValuesExtractors::Vector, n_electromagnetic_fields>
263 field_extractors = {
265
266 // Initialize the local dof index map with invalid values. The map is a 2D
267 // array indexed by [field][base_function] that stores the local dof index of
268 // each base function for each field.
269 for (auto &field_local_dof_indices : local_dof_index_map)
270 field_local_dof_indices.assign(n_base_functions,
271 numbers::invalid_unsigned_int);
272
273 // Loop over the dofs of the finite element system to identify its field and
274 // shape function. The local dof index of each shape function is stored in the
275 // local dof index map at the position corresponding to its field and base
276 // function.
277 for (unsigned int k = 0; k < fe.n_dofs_per_cell(); ++k)
278 {
279 // Field of the shape function. Each shape function must belong to
280 // exactly one field.
281 unsigned int field_index = numbers::invalid_unsigned_int;
282 unsigned int n_owner_fields = 0;
283 for (unsigned int candidate_field = 0;
284 candidate_field < n_electromagnetic_fields;
285 ++candidate_field)
286 if (fe.shape_function_belongs_to(k, field_extractors[candidate_field]))
287 {
288 field_index = candidate_field;
289 ++n_owner_fields;
290 }
291 Assert(n_owner_fields == 1,
292 ExcMessage("The shape function " + std::to_string(k) +
293 " of the finite element " + fe.get_name() +
294 " does not belong to exactly one of the E_real, "
295 "E_imag, H_real and H_imag fields."));
296
297 // Base function of the shape function k. The function
298 // system_to_base_index identifies k by three indices:
299 // - the base element it belongs to (one per field);
300 // - the component of the field it represents. FE_DGQ^dim builds a
301 // vector field from the scalar FE_DGQ, which represents one component
302 // (x, y or z) of the field. FE_Nedelec is a vector element that
303 // represents the three components at once, so this index is always 0;
304 // - its index within the base element.
305 // The base function combines the field component and the index within
306 // the base element to number the shape functions of one field from 0 to
307 // n_base_functions - 1. Since the four base elements are identical, a
308 // base function is the same function in the four fields.
309 const auto &base_index = fe.system_to_base_index(k);
310 const unsigned int base_element = base_index.first.first;
311 const unsigned int field_component = base_index.first.second;
312 const unsigned int index_in_base_element = base_index.second;
313 const unsigned int n_dofs_base_element =
314 fe.base_element(base_element).n_dofs_per_cell();
315 const unsigned int base_function =
316 field_component * n_dofs_base_element + index_in_base_element;
317
318 // Each base function must appear exactly once in each field. Since the
319 // finite element has 4 * n_base_functions shape functions, checking that
320 // no entry is written twice also guarantees that all the entries of
321 // local_dof_index_map are filled.
322 AssertThrow(base_function < n_base_functions &&
323 local_dof_index_map[field_index][base_function] ==
324 numbers::invalid_unsigned_int,
325 ExcMessage(
326 "The four fields of the finite element " + fe.get_name() +
327 " do not use the same base element. The time-harmonic "
328 "Maxwell solver requires the E_real, E_imag, H_real and "
329 "H_imag fields to be discretized with the same finite "
330 "element."));
331
332 local_dof_index_map[field_index][base_function] = k;
333 }
334}
335
336template <int dim>
337void
339 const FiniteElement<dim> &fe,
340 const std::array<std::vector<unsigned int>, n_electromagnetic_fields>
341 &local_dof_index_map,
342 std::vector<std::vector<unsigned int>> &tangential_base_functions) const
343{
344 // Base function of each local dof, i.e. the inverse of the local dof index
345 // map
346 std::vector<unsigned int> base_function_of_dof(fe.n_dofs_per_cell(),
347 numbers::invalid_unsigned_int);
348 for (const auto &field_local_dof_indices : local_dof_index_map)
349 for (unsigned int i = 0; i < field_local_dof_indices.size(); ++i)
350 base_function_of_dof[field_local_dof_indices[i]] = i;
351
352 const unsigned int n_faces = fe.reference_cell().n_faces();
353 tangential_base_functions.assign(n_faces, std::vector<unsigned int>());
354
355 for (unsigned int face = 0; face < n_faces; ++face)
356 {
357 // The base functions whose degrees of freedom are located on the face
358 // are the only ones whose tangential trace does not vanish on it. These
359 // degrees of freedom belong to the four fields, so each base function
360 // appears four times. The duplicates are removed after sorting the list.
361 tangential_base_functions[face].reserve(fe.n_dofs_per_face(face));
362 for (unsigned int i = 0; i < fe.n_dofs_per_face(face); ++i)
363 tangential_base_functions[face].emplace_back(
364 base_function_of_dof[fe.face_to_cell_index(i, face)]);
365
366 std::ranges::sort(tangential_base_functions[face]);
367 const auto duplicates =
368 std::ranges::unique(tangential_base_functions[face]);
369 tangential_base_functions[face].erase(duplicates.begin(),
370 duplicates.end());
371 }
372}
373
374template <int dim>
375void
377 const FiniteElement<dim> &fe_temperature,
378 const Quadrature<dim> &cell_quadrature,
379 const Quadrature<dim - 1> &face_quadrature,
380 const Mapping<dim> &mapping)
381{
382 this->gather_temperature = true;
384 std::make_shared<FEValues<dim>>(mapping,
385 fe_temperature,
386 cell_quadrature,
387 update_values | update_quadrature_points);
389 std::make_shared<FEFaceValues<dim>>(mapping,
390 fe_temperature,
391 face_quadrature,
392 update_values |
393 update_quadrature_points);
394}
395
396template <int dim>
397void
399 const FiniteElement<dim> &fe_void_fraction,
400 const Quadrature<dim> &cell_quadrature,
401 const Quadrature<dim - 1> &face_quadrature,
402 const Mapping<dim> &mapping)
403{
404 this->gather_void_fraction = true;
406 std::make_shared<FEValues<dim>>(mapping,
407 fe_void_fraction,
408 cell_quadrature,
409 update_values | update_quadrature_points);
411 std::make_shared<FEFaceValues<dim>>(mapping,
412 fe_void_fraction,
413 face_quadrature,
414 update_values |
415 update_quadrature_points);
416}
417
418template <int dim>
419void
421 const typename DoFHandler<dim>::active_cell_iterator &cell,
422 const typename DoFHandler<dim>::active_cell_iterator &cell_test)
423{
424 // The curl of the test functions and the cross products are only defined in
425 // 3D. The dimension is checked at compile time so the 3D operations are not
426 // compiled when dim = 2.
427 if constexpr (dim != 3)
428 {
429 (void)cell;
430 (void)cell_test;
431 AssertThrow(false, TimeHarmonicMaxwellDimensionNotSupported(dim));
432 }
433 else
434 {
435 this->material_id = cell->material_id();
436
437 // We check if the physical properties depend on the temperature and
438 // void fraction fields. If so, the solver will evaluate them at the
439 // quadrature points using reinit_temperature and reinit_void_fraction.
448
449 this->fe_values_trial_interior.reinit(cell);
450 this->fe_values_test.reinit(cell_test);
451
452 this->quadrature_points =
453 this->fe_values_trial_interior.get_quadrature_points();
454
455 for (unsigned int q = 0; q < n_q_points; ++q)
456 this->JxW[q] = this->fe_values_trial_interior.JxW(q);
457
458 // Base functions of the test space and their curl. Since the four
459 // fields share the same base functions, they are evaluated with the
460 // E_real shape functions only.
461 for (unsigned int i = 0; i < n_base_functions_test; ++i)
462 {
463 const unsigned int k = this->test_local_dof_index_map[E_real][i];
464 for (unsigned int q = 0; q < n_q_points; ++q)
465 {
466 phi_test[i][q] = fe_values_test[extractor_E_real].value(k, q);
468 }
469 }
470
471 // Base functions of the interior trial space, evaluated in the same
472 // way
473 for (unsigned int j = 0; j < n_base_functions_trial_interior; ++j)
474 {
475 const unsigned int k =
477 for (unsigned int q = 0; q < n_q_points; ++q)
478 phi_trial_interior[j][q] =
480 }
481 }
482}
483
484template <int dim>
485void
487 const typename DoFHandler<dim>::active_cell_iterator &cell_skeleton,
488 const typename DoFHandler<dim>::active_cell_iterator &cell_test,
489 const unsigned int face_no)
490{
491 if constexpr (dim != 3)
492 {
493 (void)cell_skeleton;
494 (void)cell_test;
495 (void)face_no;
496 AssertThrow(false, TimeHarmonicMaxwellDimensionNotSupported(dim));
497 }
498 else
499 {
500 const auto face = cell_skeleton->face(face_no);
501 this->face_no = face_no;
502 this->face_at_boundary = face->at_boundary();
503 this->face_boundary_id = this->face_at_boundary ?
504 face->boundary_id() :
505 numbers::invalid_boundary_id;
506 std::ranges::fill(this->face_temperature_values, 0.);
507 std::ranges::fill(this->face_void_fraction_values, 1.);
508
509 this->fe_face_values_test.reinit(cell_test, face_no);
510 this->fe_face_values_trial_skeleton.reinit(cell_skeleton, face_no);
511
512 for (unsigned int q = 0; q < n_face_q_points; ++q)
513 {
514 this->face_JxW[q] = this->fe_face_values_trial_skeleton.JxW(q);
515 this->face_quadrature_points[q] =
516 this->fe_face_values_trial_skeleton.quadrature_point(q);
517 this->face_normals[q] =
518 this->fe_face_values_trial_skeleton.normal_vector(q);
519 }
520
521 // Base functions of the test space associated with the face, evaluated
522 // with the E_real shape functions since the four fields share the same
523 // base functions.
524 for (const unsigned int i : this->test_tangential_base_functions[face_no])
525 {
526 const unsigned int k = this->test_local_dof_index_map[E_real][i];
527 for (unsigned int q = 0; q < n_face_q_points; ++q)
528 {
529 phi_test_face[i][q] =
532 cross_product_3d(face_normals[q], phi_test_face[i][q]);
533 }
534 }
535
536 // Base functions of the skeleton trial space associated with the face.
537 // To be in H^-1/2(curl), the fields need to have the tangential trace
538 // mapping (n x (E x n)) which extracts the tangential component of the
539 // field at the face.
540 for (const unsigned int j :
542 {
543 const unsigned int k =
545 for (unsigned int q = 0; q < n_face_q_points; ++q)
546 {
549 face_normals[q]);
551 cross_product_3d(face_normals[q],
553 }
554 }
555 }
556}
557
558template <int dim>
559void
573
574template <int dim>
575void
577{
578 static constexpr std::complex<double> imag{0., 1.};
579
580 for (unsigned int q = 0; q < n_q_points; ++q)
581 {
582 const std::complex<double> iweps =
584 const std::complex<double> iwmu =
586
587 this->JxW_FF_container[q] = (1. + std::norm(iweps)) * this->JxW[q];
588 this->JxW_II_container[q] = (1. + std::norm(iwmu)) * this->JxW[q];
589 this->iweps_JxW_container[q] = iweps * this->JxW[q];
590 this->iwmu_JxW_container[q] = iwmu * this->JxW[q];
591 }
592}
593
594template <int dim>
595void
611
Class that manages the physical properties model which are required to calculate the various physical...
std::shared_ptr< ElectricPermittivityModel > get_electric_permittivity_real(const unsigned int fluid_id=0, const unsigned int material_id=0) const
Returns the electric permittivity model of the real part for a given fluid_id and material_id.
std::shared_ptr< ElectricConductivityModel > get_electric_conductivity(const unsigned int fluid_id=0, const unsigned int material_id=0) const
Returns the electric conductivity model for a given fluid_id and material_id.
std::shared_ptr< MagneticPermeabilityModel > get_magnetic_permeability_real(const unsigned int fluid_id=0, const unsigned int material_id=0) const
Returns the magnetic permeability model of the real part for a given fluid_id and material_id.
bool is_effective_medium(const unsigned int fluid_id, const unsigned int material_id) const
Returns true if the material with the given fluid_id and material_id is defined by an effective mediu...
std::shared_ptr< EffectiveMediumModel > get_effective_electric_permittivity_imag(const unsigned int material_interaction_id) const
Returns the effective medium model of the imaginary part of the electric permittivity of the mixture ...
std::shared_ptr< EffectiveMediumModel > get_effective_magnetic_permeability_imag(const unsigned int material_interaction_id) const
Returns the effective medium model of the imaginary part of the magnetic permeability of the mixture ...
std::shared_ptr< EffectiveMediumModel > get_effective_magnetic_permeability_real(const unsigned int material_interaction_id) const
Returns the effective medium model of the real part of the magnetic permeability of the mixture defin...
std::shared_ptr< EffectiveMediumModel > get_effective_electric_permittivity_real(const unsigned int material_interaction_id) const
Returns the effective medium model of the real part of the electric permittivity of the mixture defin...
std::shared_ptr< ElectricPermittivityModel > get_electric_permittivity_imag(const unsigned int fluid_id=0, const unsigned int material_id=0) const
Returns the electric permittivity model of the imaginary part for a given fluid_id and material_id.
unsigned int get_material_interaction_id(const material_interactions_type material_interaction_type, const unsigned int material_0_id, const unsigned int material_1_id) const
std::shared_ptr< MagneticPermeabilityModel > get_magnetic_permeability_imag(const unsigned int fluid_id=0, const unsigned int material_id=0) const
Returns the magnetic permeability model of the imaginary part for a given fluid_id and material_id.
Class that stores the information required by the assembly of the Discontinuous Petrov-Galerkin (DPG)...
std::shared_ptr< FEFaceValues< dim > > fe_face_values_void_fraction
void allocate() override
Allocate the memory of all the members of the scratch. It builds the lists of the local dof index of ...
std::vector< std::complex< double > > face_effective_electric_permittivities
void calculate_face_physical_properties()
Compute the effective electromagnetic properties at the face quadrature points from the fields gather...
void build_local_dof_index_map(const FiniteElement< dim > &fe, std::array< std::vector< unsigned int >, n_electromagnetic_fields > &local_dof_index_map) const
Build the local dof index list of each base function for each field of a finite element space of the ...
const FEValuesExtractors::Vector extractor_H_imag
void enable_void_fraction(const FiniteElement< dim > &fe_void_fraction, const Quadrature< dim > &cell_quadrature, const Quadrature< dim - 1 > &face_quadrature, const Mapping< dim > &mapping)
Enable the evaluation of the void fraction field, on which the electromagnetic properties of an effec...
std::vector< std::complex< double > > effective_magnetic_permeabilities
Table< 2, Tensor< 1, dim > > tangential_phi_trial_skeleton
void reinit_face(const typename DoFHandler< dim >::active_cell_iterator &cell_skeleton, const typename DoFHandler< dim >::active_cell_iterator &cell_test, const unsigned int face_no)
Reinitialize the content of the scratch for a face of the current cell. It evaluates the test functio...
std::array< std::vector< unsigned int >, n_electromagnetic_fields > trial_skeleton_local_dof_index_map
Table< 2, Tensor< 1, dim > > n_cross_tangential_phi_trial_skeleton
std::vector< std::vector< unsigned int > > trial_skeleton_tangential_base_functions
std::array< std::vector< unsigned int >, n_electromagnetic_fields > trial_interior_local_dof_index_map
std::shared_ptr< FEValues< dim > > fe_values_temperature
void calculate_physical_properties()
Compute the effective electromagnetic properties at the cell quadrature points from the fields gather...
void calculate_cell_coefficients()
Compute the coefficients of the time-harmonic Maxwell equations of the cell at the quadrature points.
std::vector< std::complex< double > > iwmu_JxW_container
const FEValuesExtractors::Vector extractor_H_real
void enable_temperature(const FiniteElement< dim > &fe_temperature, const Quadrature< dim > &cell_quadrature, const Quadrature< dim - 1 > &face_quadrature, const Mapping< dim > &mapping)
Enable the evaluation of the temperature field, on which the electromagnetic properties may depend.
std::array< std::vector< unsigned int >, n_electromagnetic_fields > test_local_dof_index_map
std::shared_ptr< FEValues< dim > > fe_values_void_fraction
void identify_tangential_base_functions(const FiniteElement< dim > &fe, const std::array< std::vector< unsigned int >, n_electromagnetic_fields > &local_dof_index_map, std::vector< std::vector< unsigned int > > &tangential_base_functions) const
Identify, for each face of the reference cell, the base functions of a finite element space whose tan...
std::shared_ptr< FEFaceValues< dim > > fe_face_values_temperature
const PhysicalPropertiesManager properties_manager
std::vector< std::complex< double > > face_effective_magnetic_permeabilities
const FEValuesExtractors::Vector extractor_E_imag
const FEValuesExtractors::Vector extractor_E_real
static constexpr unsigned int n_electromagnetic_fields
std::vector< std::complex< double > > iweps_JxW_container
std::vector< std::vector< unsigned int > > test_tangential_base_functions
std::vector< std::complex< double > > effective_electric_permittivities
std::map< field, std::vector< double > > face_fields
std::map< field, std::vector< double > > fields
void reinit(const typename DoFHandler< dim >::active_cell_iterator &cell, const typename DoFHandler< dim >::active_cell_iterator &cell_test)
Reinitialize the content of the scratch for a cell. It evaluates the shape functions of the test and ...
void set_field_vector(const field &id, const std::vector< double > &data, std::map< field, std::vector< double > > &fields)
DEAL_II_ALWAYS_INLINE Tensor< 1, dim, Number > tangential_component(const Tensor< 1, dim, Number > &tensor, const Tensor< 1, dim > &normal)
Compute the tangential component of a vector on a surface defined by its unit normal vector,...
bool electromagnetic_properties_depend_on(const PhysicalPropertiesManager &physical_properties_manager, const unsigned int material_id, const field field_id)
Check if at least one electromagnetic property of a material depends on a field. If the material is a...
void compute_effective_electromagnetic_properties(const PhysicalPropertiesManager &physical_properties_manager, const std::map< field, std::vector< double > > &field_values_vectors, const unsigned int material_id, std::vector< std::complex< double > > &effective_electric_permittivities, std::vector< std::complex< double > > &effective_magnetic_permeabilities)
Compute the effective electromagnetic properties of a material at a set of points....