Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
time_harmonic_maxwell_scratch_data.h
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
4#ifndef lethe_time_harmonic_maxwell_scratch_data_h
5#define lethe_time_harmonic_maxwell_scratch_data_h
6
8
11
12#include <deal.II/base/point.h>
13#include <deal.II/base/quadrature.h>
14#include <deal.II/base/table.h>
15#include <deal.II/base/tensor.h>
16#include <deal.II/base/types.h>
17
18#include <deal.II/dofs/dof_handler.h>
19
20#include <deal.II/fe/fe.h>
21#include <deal.II/fe/fe_values.h>
22#include <deal.II/fe/fe_values_extractors.h>
23#include <deal.II/fe/mapping.h>
24
25#include <array>
26#include <complex>
27#include <map>
28#include <memory>
29#include <vector>
30
31/**
32 * @brief Compute the effective electromagnetic properties of a material at a
33 * set of points. The effective electric permittivity is
34 * \f$\varepsilon' + i(\varepsilon'' + \sigma)\f$ and the effective magnetic
35 * permeability is \f$\mu' + i\mu''\f$, where each property is evaluated with
36 * the physical property models of the material. If the material is an
37 * effective medium, the properties are given by the effective medium models of
38 * its fluid-dispersed phase interaction. The conductivity of both phases is
39 * then already included in the imaginary part of the effective permittivity.
40 *
41 * @note The time-harmonic Maxwell equations do not support multiple
42 * fluids so the fluid_id is not necessary to determine the material
43 * properties. The material properties only depend on the material_id, which
44 * is used to identify the different materials in the input file and assign
45 * them their corresponding properties.
46 *
47 * @param[in] physical_properties_manager The object that manages the
48 * physical properties of the problem and provides them at any given position
49 * of the domain.
50 * @param[in] field_values_vector A map containing the vector values of the
51 * fields at the current position. This is used to compute the material
52 * properties that depend on the fields.
53 * @param[in] material_id The material id of the current position, used to
54 * determine the appropriate material properties from the input parameters.
55 * @param[out] effective_electric_permittivity Effective electric
56 * permittivity at the current position. This value is updated in place by the
57 * function.
58 * @param[out] effective_magnetic_permeability Effective magnetic
59 * permeability at the current position. This value is updated in place by the
60 * function.
61 */
62void
64 const PhysicalPropertiesManager &physical_properties_manager,
65 const std::map<field, std::vector<double>> &field_values_vectors,
66 const unsigned int material_id,
67 std::vector<std::complex<double>> &effective_electric_permittivities,
68 std::vector<std::complex<double>> &effective_magnetic_permeabilities);
69
70/**
71 * @brief Check if at least one electromagnetic property of a material depends
72 * on a field. If the material is an effective medium, the dependencies are
73 * those of the effective medium models of its fluid-dispersed phase
74 * interaction. Otherwise, they are those of the electric permittivity, electric
75 * conductivity and magnetic permeability models of the material.
76 *
77 * @param[in] physical_properties_manager The object that manages the
78 * physical properties of the problem.
79 * @param[in] material_id The material id of the cell.
80 * @param[in] field_id The field for which the dependency is checked.
81 * @return true if at least one electromagnetic property of the material
82 * depends on the field, false otherwise.
83 */
84bool
86 const PhysicalPropertiesManager &physical_properties_manager,
87 const unsigned int material_id,
88 const field field_id);
89
90
91/**
92 * @brief Class that stores the information required by the assembly of the
93 * Discontinuous Petrov-Galerkin (DPG) ultraweak formulation of the
94 * time-harmonic Maxwell equations. For each cell, it evaluates the base
95 * functions of the test space (\f$\mathbf{F}\f$ and \f$\mathbf{I}\f$) with
96 * their curls, the base functions of the interior trial space (\f$\mathbf{E}\f$
97 * and \f$\mathbf{H}\f$) and the effective material properties at the quadrature
98 * points. Additionally, for each face of the cell, it evaluates the base
99 * functions of the tangential traces of the test space and the base functions
100 * of the skeleton trial space (\f$\hat{\mathbf{E}}\f$ and
101 * \f$\hat{\mathbf{H}}\f$), with their cross products with the normal. Since the
102 * Nedelec base functions whose degrees of freedom are not located on a face
103 * have a zero tangential trace on this face, only the base functions associated
104 * with the face are evaluated.
105 *
106 * @tparam dim An integer that denotes the number of spatial dimensions. Only
107 * dim = 3 is supported.
108 *
109 * @ingroup solvers
110 */
111template <int dim>
113{
114public:
115 /**
116 * @brief Fields of the finite element systems, numbered in the order in which
117 * they appear in the systems following the convention: [E_real, E_imag,
118 * H_real, H_imag].
119 */
121 {
126 };
127
128 // Number of fields of the finite element systems
129 static constexpr unsigned int n_electromagnetic_fields = 4;
130
131 /**
132 * @brief Constructor. Creates the FEValues and FEFaceValues objects of the
133 * interior trial, skeleton trial and test spaces and allocates the memory of
134 * the scratch. It does not do any evaluation, since this is done at the cell
135 * level.
136 *
137 * @param[in] properties_manager Manager of the physical property models.
138 *
139 * @param[in] omega Angular frequency of the electromagnetic fields.
140 *
141 * @param[in] fe_trial_interior Finite element of the interior trial space.
142 *
143 * @param[in] fe_trial_skeleton Finite element of the skeleton trial space.
144 *
145 * @param[in] fe_test Finite element of the test space.
146 *
147 * @param[in] cell_quadrature Quadrature used for the cell integrals.
148 *
149 * @param[in] face_quadrature Quadrature used for the face integrals.
150 *
151 * @param[in] mapping Mapping of the domain.
152 */
155 const double omega,
156 const FiniteElement<dim> &fe_trial_interior,
157 const FiniteElement<dim> &fe_trial_skeleton,
158 const FiniteElement<dim> &fe_test,
159 const Quadrature<dim> &cell_quadrature,
160 const Quadrature<dim - 1> &face_quadrature,
161 const Mapping<dim> &mapping)
163 , omega(omega)
164 , fe_values_trial_interior(mapping,
165 fe_trial_interior,
166 cell_quadrature,
167 update_values | update_quadrature_points |
168 update_JxW_values)
169 , fe_values_test(mapping,
170 fe_test,
171 cell_quadrature,
172 update_values | update_gradients)
174 fe_trial_skeleton,
175 face_quadrature,
176 update_values | update_quadrature_points |
177 update_normal_vectors | update_JxW_values)
178 , fe_face_values_test(mapping, fe_test, face_quadrature, update_values)
179 {
180 gather_temperature = false;
181 gather_void_fraction = false;
182 allocate();
183 }
184
185 /**
186 * @brief Copy constructor. Same as the main constructor. It only uses the
187 * other scratch to build the FEValues objects, it does not copy the content
188 * of the other scratch since, by definition of the WorkStream mechanism, the
189 * content of the scratch is reset on a cell basis.
190 *
191 * @param[in] sd The scratch data to be copied.
192 */
195 , omega(sd.omega)
197 sd.fe_values_trial_interior.get_fe(),
198 sd.fe_values_trial_interior.get_quadrature(),
199 update_values | update_quadrature_points |
200 update_JxW_values)
201 , fe_values_test(sd.fe_values_test.get_mapping(),
202 sd.fe_values_test.get_fe(),
203 sd.fe_values_test.get_quadrature(),
204 update_values | update_gradients)
206 sd.fe_face_values_trial_skeleton.get_mapping(),
208 sd.fe_face_values_trial_skeleton.get_quadrature(),
209 update_values | update_quadrature_points | update_normal_vectors |
210 update_JxW_values)
211 , fe_face_values_test(sd.fe_face_values_test.get_mapping(),
212 sd.fe_face_values_test.get_fe(),
213 sd.fe_face_values_test.get_quadrature(),
214 update_values)
215 {
218
219 allocate();
220
221 if (sd.gather_temperature)
223 sd.fe_values_temperature->get_quadrature(),
224 sd.fe_face_values_temperature->get_quadrature(),
225 sd.fe_values_temperature->get_mapping());
226
229 sd.fe_values_void_fraction->get_quadrature(),
230 sd.fe_face_values_void_fraction->get_quadrature(),
231 sd.fe_values_void_fraction->get_mapping());
232 }
233
234 /**
235 * @brief Allocate the memory of all the members of the scratch. It builds the lists
236 * of the local dof index of each base function for each of the four
237 * fields of the three finite element spaces for the reference cell. It also
238 * builds the lists of the base functions of the test and skeleton trial
239 * spaces whose tangential trace does not vanish on each face of the
240 * reference cell.
241 */
242 void
243 allocate() override;
244
245 /**
246 * @brief Build the local dof index list of each base function for each field of
247 * a finite element space of the time-harmonic Maxwell equations [E_real,
248 * E_imag, H_real, H_imag].
249 *
250 * @param[in] fe Finite element system of the [E_real, E_imag, H_real,
251 * H_imag] fields (interior trial, skeleton trial or test space).
252 *
253 * @param[out] local_dof_index_map Local dof index of each base function for
254 * each field: local_dof_index_map[field][i].
255 */
256 void
258 const FiniteElement<dim> &fe,
259 std::array<std::vector<unsigned int>, n_electromagnetic_fields>
260 &local_dof_index_map) const;
261
262 /**
263 * @brief Identify, for each face of the reference cell, the base functions of
264 * a finite element space whose tangential trace does not vanish on the face
265 * (the relevant ones for the face integrals, this would not be needed if the
266 * FE_FaceNedelec existed). For Nedelec elements, these are the base functions
267 * whose degrees of freedom are located on the edges or the interior of the
268 * face.
269 *
270 * @param[in] fe Finite element system of the [E_real, E_imag, H_real,
271 * H_imag] fields.
272 *
273 * @param[in] local_dof_index_map Local dof index of each base function for
274 * each field (see build_local_dof_index_map()).
275 *
276 * @param[out] tangential_base_functions Base functions whose tangential
277 * trace does not vanish on each face: tangential_base_functions[face_no].
278 */
279 void
281 const FiniteElement<dim> &fe,
282 const std::array<std::vector<unsigned int>, n_electromagnetic_fields>
283 &local_dof_index_map,
284 std::vector<std::vector<unsigned int>> &tangential_base_functions) const;
285
286 /**
287 * @brief Enable the evaluation of the temperature field, on which the
288 * electromagnetic properties may depend.
289 *
290 * @param[in] fe_temperature Finite element of the heat transfer physics.
291 *
292 * @param[in] cell_quadrature Quadrature used for the cell integrals.
293 *
294 * @param[in] face_quadrature Quadrature used for the face integrals.
295 *
296 * @param[in] mapping Mapping of the domain.
297 */
298 void
299 enable_temperature(const FiniteElement<dim> &fe_temperature,
300 const Quadrature<dim> &cell_quadrature,
301 const Quadrature<dim - 1> &face_quadrature,
302 const Mapping<dim> &mapping);
303
304 /**
305 * @brief Enable the evaluation of the void fraction field, on which the
306 * electromagnetic properties of an effective medium may depend.
307 *
308 * @param[in] fe_void_fraction Finite element of the void fraction.
309 *
310 * @param[in] cell_quadrature Quadrature used for the cell integrals.
311 *
312 * @param[in] face_quadrature Quadrature used for the face integrals.
313 *
314 * @param[in] mapping Mapping of the domain.
315 */
316 void
317 enable_void_fraction(const FiniteElement<dim> &fe_void_fraction,
318 const Quadrature<dim> &cell_quadrature,
319 const Quadrature<dim - 1> &face_quadrature,
320 const Mapping<dim> &mapping);
321
322 /**
323 * @brief Reinitialize the content of the scratch for a cell. It evaluates
324 * the shape functions of the test and interior trial spaces at the
325 * quadrature points. The temperature values are set to zero and are only
326 * overwritten by reinit_temperature when the material of the cell depends on
327 * the temperature. Likewise, the void fraction values are set to one (pure
328 * fluid) and are only overwritten by reinit_void_fraction when the material
329 * of the cell depends on the void fraction.
330 *
331 * @param[in] cell The cell of the interior trial space DoFHandler over which
332 * the assembly is carried out.
333 *
334 * @param[in] cell_test The same cell, but for the test space DoFHandler.
335 */
336 void
337 reinit(const typename DoFHandler<dim>::active_cell_iterator &cell,
338 const typename DoFHandler<dim>::active_cell_iterator &cell_test);
339
340 /**
341 * @brief Reinitialize the content of the scratch for a face of the current
342 * cell. It evaluates the test functions and the tangential traces of the
343 * skeleton trial space at the face quadrature points. The face temperature
344 * values are set to zero and are only overwritten by reinit_face_temperature
345 * when the material of the cell depends on the temperature. Likewise, the
346 * face void fraction values are set to one (pure fluid) and are only
347 * overwritten by reinit_face_void_fraction when the material of the cell
348 * depends on the void fraction.
349 *
350 * @param[in] cell_skeleton The current cell, for the skeleton trial space
351 * DoFHandler.
352 *
353 * @param[in] cell_test The current cell, for the test space DoFHandler.
354 *
355 * @param[in] face_no Index of the face within the cell.
356 */
357 void
359 const typename DoFHandler<dim>::active_cell_iterator &cell_skeleton,
360 const typename DoFHandler<dim>::active_cell_iterator &cell_test,
361 const unsigned int face_no);
362
363 /**
364 * @brief Evaluate the temperature field at the cell quadrature points.
365 *
366 * @tparam VectorType The vector type of the temperature solution.
367 *
368 * @param[in] cell_temperature The current cell, for the heat transfer
369 * DoFHandler.
370 *
371 * @param[in] temperature_solution Temperature solution of the heat transfer
372 * physics.
373 */
374 template <typename VectorType>
375 void
377 const typename DoFHandler<dim>::active_cell_iterator &cell_temperature,
378 const VectorType &temperature_solution)
379 {
380 fe_values_temperature->reinit(cell_temperature);
381 fe_values_temperature->get_function_values(temperature_solution,
382 this->temperature_values);
383 }
384
385 /**
386 * @brief Evaluate the temperature field at the quadrature points of a face
387 * of the current cell.
388 *
389 * @tparam VectorType The vector type of the temperature solution.
390 *
391 * @param[in] cell_temperature The current cell, for the heat transfer
392 * DoFHandler.
393 *
394 * @param[in] face_no Index of the face within the cell.
395 *
396 * @param[in] temperature_solution Temperature solution of the heat transfer
397 * physics.
398 */
399 template <typename VectorType>
400 void
402 const typename DoFHandler<dim>::active_cell_iterator &cell_temperature,
403 const unsigned int face_no,
404 const VectorType &temperature_solution)
405 {
406 fe_face_values_temperature->reinit(cell_temperature, face_no);
407 fe_face_values_temperature->get_function_values(
408 temperature_solution, this->face_temperature_values);
409 }
410
411 /**
412 * @brief Evaluate the void fraction field at the cell quadrature points.
413 *
414 * @tparam VectorType The vector type of the void fraction solution.
415 *
416 * @param[in] cell_void_fraction The current cell, for the void fraction
417 * DoFHandler.
418 *
419 * @param[in] void_fraction_solution Void fraction solution.
420 */
421 template <typename VectorType>
422 void
424 const typename DoFHandler<dim>::active_cell_iterator &cell_void_fraction,
425 const VectorType &void_fraction_solution)
426 {
427 fe_values_void_fraction->reinit(cell_void_fraction);
428 fe_values_void_fraction->get_function_values(void_fraction_solution,
430 }
431
432 /**
433 * @brief Evaluate the void fraction field at the quadrature points of a face
434 * of the current cell.
435 *
436 * @tparam VectorType The vector type of the void fraction solution.
437 *
438 * @param[in] cell_void_fraction The current cell, for the void fraction
439 * DoFHandler.
440 *
441 * @param[in] face_no Index of the face within the cell.
442 *
443 * @param[in] void_fraction_solution Void fraction solution.
444 */
445 template <typename VectorType>
446 void
448 const typename DoFHandler<dim>::active_cell_iterator &cell_void_fraction,
449 const unsigned int face_no,
450 const VectorType &void_fraction_solution)
451 {
452 fe_face_values_void_fraction->reinit(cell_void_fraction, face_no);
453 fe_face_values_void_fraction->get_function_values(
454 void_fraction_solution, this->face_void_fraction_values);
455 }
456
457 /**
458 * @brief Compute the effective electromagnetic properties at the cell
459 * quadrature points from the fields gathered by the scratch.
460 */
461 void
463
464 /**
465 * @brief Compute the coefficients of the time-harmonic Maxwell equations of
466 * the cell at the quadrature points.
467 */
468 void
470
471 /**
472 * @brief Compute the effective electromagnetic properties at the face
473 * quadrature points from the fields gathered by the scratch.
474 */
475 void
477
478 // Physical properties
480 // Angular frequency of the electromagnetic fields
481 const double omega;
482 // ID of the material of the current cell, used to determine the appropriate
483 // material properties from the input parameters.
484 unsigned int material_id;
485 // Flag to indicate whether the material of the cell depends on the
486 // temperature.
488 // Flag to indicate whether the material of the cell depends on the void
489 // fraction.
491
492 // FEValues of the interior trial space
494 // FEValues of the test space
495 FEValues<dim> fe_values_test;
496 // FEFaceValues of the skeleton trial space
498 // FEFaceValues of the test space
499 FEFaceValues<dim> fe_face_values_test;
500
501 // Extractor for the FESystem of the real component of the electric field
502 const FEValuesExtractors::Vector extractor_E_real{E_real * dim};
503 // Extractor for the FESystem of the imaginary component of the electric field
504 const FEValuesExtractors::Vector extractor_E_imag{E_imag * dim};
505 // Extractor for the FESystem of the real component of the magnetic field
506 const FEValuesExtractors::Vector extractor_H_real{H_real * dim};
507 // Extractor for the FESystem of the imaginary component of the magnetic field
508 const FEValuesExtractors::Vector extractor_H_imag{H_imag * dim};
509
510 // Number of quadrature points
511 unsigned int n_q_points;
512 // Number of face quadrature points
513 unsigned int n_face_q_points;
514 // Number of base functions of the test space
516 // Number of base functions of the interior trial space
518 // Number of base functions of the skeleton trial space
520
521 // Local dof index of each base function of the test space for each field:
522 // test_local_dof_index_map[field][i]. The electric test functions (F) are
523 // the E_real and E_imag fields of the test space and the magnetic ones (I)
524 // are the H_real and H_imag fields.
525 std::array<std::vector<unsigned int>, n_electromagnetic_fields>
527 // Local dof index of each base function of the interior trial space for each
528 // field: trial_interior_local_dof_index_map[field][i]
529 std::array<std::vector<unsigned int>, n_electromagnetic_fields>
531 // Local dof index of each base function of the skeleton trial space for each
532 // field: trial_skeleton_local_dof_index_map[field][i]
533 std::array<std::vector<unsigned int>, n_electromagnetic_fields>
535
536 // Base functions of the test space whose tangential trace does not vanish on
537 // each face of the reference cell: test_tangential_base_functions[face_no]
538 std::vector<std::vector<unsigned int>> test_tangential_base_functions;
539 // Base functions of the skeleton trial space whose tangential trace does not
540 // vanish on each face of the reference cell:
541 // trial_skeleton_tangential_base_functions[face_no]
542 std::vector<std::vector<unsigned int>>
544
545 // Cell container for the volume integrals weights
546 std::vector<double> JxW;
547 // (1 + |iweps|^2) JxW, weight of (phi_i, phi_j) in the FF block of G
548 std::vector<double> JxW_FF_container;
549 // (1 + |iwmu|^2) JxW, weight of (phi_i, phi_j) in the II block of G
550 std::vector<double> JxW_II_container;
551 // iweps JxW
552 std::vector<std::complex<double>> iweps_JxW_container;
553 // iwmu JxW
554 std::vector<std::complex<double>> iwmu_JxW_container;
555 // Cell container for the quadrature points
556 std::vector<Point<dim>> quadrature_points;
557
558 // Temperature values at the cell quadrature points
559 std::vector<double> temperature_values;
560 // Void fraction values at the cell quadrature points
561 std::vector<double> void_fraction_values;
562 // Map of the field values at the cell quadrature points, indexed by field
563 std::map<field, std::vector<double>> fields;
564 // Effective electric permittivities at the cell quadrature points
565 std::vector<std::complex<double>> effective_electric_permittivities;
566 // Effective magnetic permeabilities at the cell quadrature points
567 std::vector<std::complex<double>> effective_magnetic_permeabilities;
568
569 // Cell base functions of the test space
570 Table<2, Tensor<1, dim>> phi_test;
571 // Cell curl of the base functions of the test space
572 Table<2, Tensor<1, dim>> curl_phi_test;
573 // Cell base functions of the interior trial space
574 Table<2, Tensor<1, dim>> phi_trial_interior;
575
576 // Index of the current face within the cell
577 unsigned int face_no;
578 // Flag to indicate whether the current face is at the boundary of the domain
580 // Boundary ID of the current face, used to determine the appropriate boundary
581 // conditions from the input parameters
582 types::boundary_id face_boundary_id;
583
584 // Face container for the face integrals weights
585 std::vector<double> face_JxW;
586 // Face container for the face quadrature points
587 std::vector<Point<dim>> face_quadrature_points;
588 // Face container for the face normal vectors
589 std::vector<Tensor<1, dim>> face_normals;
590
591 // Face temperature values at the face quadrature points
592 std::vector<double> face_temperature_values;
593 // Face void fraction values at the face quadrature points
594 std::vector<double> face_void_fraction_values;
595 // Map of the field values at the face quadrature points, indexed by field
596 std::map<field, std::vector<double>> face_fields;
597 // Effective electric permittivities at the face quadrature points
598 std::vector<std::complex<double>> face_effective_electric_permittivities;
599 // Effective magnetic permeabilities at the face quadrature points
600 std::vector<std::complex<double>> face_effective_magnetic_permeabilities;
601
602 // Face base functions of the test space: phi_test_face[i][q]
603 Table<2, Tensor<1, dim>> phi_test_face;
604 // Face cross product of the normal with the base functions of the test space
605 Table<2, Tensor<1, dim>> n_cross_phi_test_face;
606 // Face tangential traces of the base functions of the skeleton trial space
607 Table<2, Tensor<1, dim>> tangential_phi_trial_skeleton;
608 // Face cross product of the normal with the tangential traces of the base
609 // functions of the skeleton trial space
611
612 // Flag to indicate whether the temperature field needs to be gathered and
613 // evaluated at the quadrature points
615 // FEValues of the temperature field
616 std::shared_ptr<FEValues<dim>> fe_values_temperature;
617 // FEFaceValues of the temperature field
618 std::shared_ptr<FEFaceValues<dim>> fe_face_values_temperature;
619
620 // Flag to indicate whether the void fraction field needs to be gathered and
621 // evaluated at the quadrature points
623 // FEValues of the void fraction field
624 std::shared_ptr<FEValues<dim>> fe_values_void_fraction;
625 // FEFaceValues of the void fraction field
626 std::shared_ptr<FEFaceValues<dim>> fe_face_values_void_fraction;
627};
628
629#endif
Class that manages the physical properties model which are required to calculate the various physical...
Base class for scratch data objects of physics and subequations.
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
TimeHarmonicMaxwellScratchData(const TimeHarmonicMaxwellScratchData< dim > &sd)
Copy constructor. Same as the main constructor. It only uses the other scratch to build the FEValues ...
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_temperature(const typename DoFHandler< dim >::active_cell_iterator &cell_temperature, const VectorType &temperature_solution)
Evaluate the temperature field at the cell quadrature points.
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
ElectromagneticFieldComponents
Fields of the finite element systems, numbered in the order in which they appear in the systems follo...
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
void reinit_face_temperature(const typename DoFHandler< dim >::active_cell_iterator &cell_temperature, const unsigned int face_no, const VectorType &temperature_solution)
Evaluate the temperature field at the quadrature points of a face of the current cell.
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
void reinit_void_fraction(const typename DoFHandler< dim >::active_cell_iterator &cell_void_fraction, const VectorType &void_fraction_solution)
Evaluate the void fraction field at the cell quadrature points.
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
void reinit_face_void_fraction(const typename DoFHandler< dim >::active_cell_iterator &cell_void_fraction, const unsigned int face_no, const VectorType &void_fraction_solution)
Evaluate the void fraction field at the quadrature points of a face of the current cell.
std::vector< std::complex< double > > effective_electric_permittivities
std::map< field, std::vector< double > > face_fields
std::map< field, std::vector< double > > fields
TimeHarmonicMaxwellScratchData(const PhysicalPropertiesManager &properties_manager, const double omega, const FiniteElement< dim > &fe_trial_interior, const FiniteElement< dim > &fe_trial_skeleton, const FiniteElement< dim > &fe_test, const Quadrature< dim > &cell_quadrature, const Quadrature< dim - 1 > &face_quadrature, const Mapping< dim > &mapping)
Constructor. Creates the FEValues and FEFaceValues objects of the interior trial, skeleton trial and ...
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 ...
GlobalVectorType VectorType
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....