4#ifndef lethe_time_harmonic_maxwell_scratch_data_h
5#define lethe_time_harmonic_maxwell_scratch_data_h
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>
18#include <deal.II/dofs/dof_handler.h>
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>
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);
87 const unsigned int material_id,
88 const field field_id);
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)
167 update_values | update_quadrature_points |
172 update_values | update_gradients)
176 update_values | update_quadrature_points |
177 update_normal_vectors | update_JxW_values)
199 update_values | update_quadrature_points |
204 update_values | update_gradients)
209 update_values | update_quadrature_points | update_normal_vectors |
258 const FiniteElement<dim> &fe,
260 &local_dof_index_map)
const;
281 const FiniteElement<dim> &fe,
283 &local_dof_index_map,
284 std::vector<std::vector<unsigned int>> &tangential_base_functions)
const;
300 const Quadrature<dim> &cell_quadrature,
301 const Quadrature<dim - 1> &face_quadrature,
302 const Mapping<dim> &mapping);
318 const Quadrature<dim> &cell_quadrature,
319 const Quadrature<dim - 1> &face_quadrature,
320 const Mapping<dim> &mapping);
337 reinit(
const typename DoFHandler<dim>::active_cell_iterator &cell,
338 const typename DoFHandler<dim>::active_cell_iterator &cell_test);
359 const typename DoFHandler<dim>::active_cell_iterator &cell_skeleton,
360 const typename DoFHandler<dim>::active_cell_iterator &cell_test,
374 template <
typename VectorType>
377 const typename DoFHandler<dim>::active_cell_iterator &cell_temperature,
399 template <
typename VectorType>
402 const typename DoFHandler<dim>::active_cell_iterator &cell_temperature,
421 template <
typename VectorType>
424 const typename DoFHandler<dim>::active_cell_iterator &cell_void_fraction,
445 template <
typename VectorType>
448 const typename DoFHandler<dim>::active_cell_iterator &cell_void_fraction,
542 std::vector<std::vector<unsigned int>>
563 std::map<field, std::vector<double>>
fields;
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
unsigned int n_base_functions_trial_interior
Table< 2, Tensor< 1, dim > > phi_test_face
types::boundary_id face_boundary_id
FEFaceValues< dim > fe_face_values_test
unsigned int n_base_functions_test
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
std::vector< double > void_fraction_values
void calculate_face_physical_properties()
Compute the effective electromagnetic properties at the face quadrature points from the fields gather...
FEFaceValues< dim > fe_face_values_trial_skeleton
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
std::vector< double > JxW
TimeHarmonicMaxwellScratchData(const TimeHarmonicMaxwellScratchData< dim > &sd)
Copy constructor. Same as the main constructor. It only uses the other scratch to build the FEValues ...
std::vector< double > face_temperature_values
std::vector< Point< dim > > quadrature_points
Table< 2, Tensor< 1, dim > > n_cross_phi_test_face
FEValues< dim > fe_values_trial_interior
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...
FEValues< dim > fe_values_test
std::vector< Point< dim > > face_quadrature_points
std::vector< double > face_void_fraction_values
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
std::vector< Tensor< 1, dim > > face_normals
Table< 2, Tensor< 1, dim > > n_cross_tangential_phi_trial_skeleton
bool cell_material_needs_temperature
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
unsigned int n_face_q_points
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.
Table< 2, Tensor< 1, dim > > phi_trial_interior
std::vector< std::complex< double > > iwmu_JxW_container
const FEValuesExtractors::Vector extractor_H_real
std::vector< double > JxW_II_container
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
Table< 2, Tensor< 1, dim > > curl_phi_test
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
std::vector< double > face_JxW
bool gather_void_fraction
unsigned int n_base_functions_trial_skeleton
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
bool cell_material_needs_void_fraction
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
Table< 2, Tensor< 1, dim > > phi_test
std::vector< double > temperature_values
std::vector< double > JxW_FF_container
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....