include/meltpooldg/utilities/fe_subcell_face_evaluation.hpp Source File

Developer Documentation: include/meltpooldg/utilities/fe_subcell_face_evaluation.hpp Source File
Developer Documentation
fe_subcell_face_evaluation.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <deal.II/base/vectorization.h>
4
5#include <deal.II/matrix_free/fe_evaluation.h>
6
7#include <bitset>
8#include <ranges>
9#include <vector>
10
11namespace MeltPoolDG
12{
117 template <int dim, int n_components, typename number>
119 {
120 using VectorizedArrayType = dealii::VectorizedArray<number>;
121
122 static constexpr unsigned int n_lanes = VectorizedArrayType::size();
123
124 public:
127 dealii::FEFaceEvaluation<dim, -1, 0, n_components, number, VectorizedArrayType>::value_type;
128
130 using gradient_type = dealii::
131 FEFaceEvaluation<dim, -1, 0, n_components, number, VectorizedArrayType>::gradient_type;
132
142 FESubcellFaceEvaluation(const dealii::MatrixFree<dim, number> &matrix_free,
143 const bool is_interior_face,
144 const unsigned int dof_no,
145 const unsigned int quad_no);
146
160 void
161 reinit(const unsigned int face_batch_index);
162
173 void
174 read_dof_values(const dealii::LinearAlgebra::distributed::Vector<number> &src_vector,
175 const std::bitset<n_lanes> &mask = std::bitset<n_lanes>().flip());
176
184 void
185 evaluate(const dealii::EvaluationFlags::EvaluationFlags evaluation_flags);
186
201 void
202 gather_evaluate(const dealii::LinearAlgebra::distributed::Vector<number> &input_vector,
203 const dealii::EvaluationFlags::EvaluationFlags evaluation_flags,
204 const std::bitset<n_lanes> &mask = std::bitset<n_lanes>().flip());
205
215 get_value(const unsigned int subcell_index) const;
216
229 void
230 submit_flux(const unsigned int subcell_index, const value_type &normal_flux);
231
242 void
243 integrate();
244
255 void
256 distribute_local_to_global(dealii::LinearAlgebra::distributed::Vector<number> &dst_vector,
257 const std::bitset<n_lanes> &mask = std::bitset<n_lanes>().flip());
258
272 void
273 integrate_scatter(dealii::LinearAlgebra::distributed::Vector<number> &dst_vector,
274 const std::bitset<n_lanes> &mask = std::bitset<n_lanes>().flip());
275
284 std::ranges::iota_view<unsigned int, unsigned int>
285 subcell_face_indices() const;
286
294 subcell_face_size(const unsigned int subcell_index) const;
295
302 dealii::Point<dim, VectorizedArrayType>
303 subcell_location(const unsigned int subcell_index) const;
304
309 unsigned int
310 n_subcell_faces() const;
311
319 dealii::Tensor<1, dim, VectorizedArrayType>
320 normal_vector(const unsigned int subcell_index) const;
321
325 bool
326 at_boundary() const;
327
333 dealii::types::boundary_id
334 boundary_id() const;
335
343 subcell_size(const unsigned int subcell_index) const;
344
345 private:
347 unsigned int n_subcells_1d = dealii::numbers::invalid_unsigned_int;
348
350 unsigned int n_subcells_face = dealii::numbers::invalid_unsigned_int;
351
353 unsigned int face_batch_index = dealii::numbers::invalid_unsigned_int;
354
356 const dealii::MatrixFree<dim, number> &matrix_free;
357
361
364 unsigned int face_no = dealii::numbers::invalid_unsigned_int;
365
427 std::vector<value_type> layer_values;
428
430 std::vector<value_type> submitted_fluxes;
431
433 std::vector<VectorizedArrayType> subcell_face_sizes;
434
437 std::vector<VectorizedArrayType> subcell_sizes;
438
441 std::vector<dealii::Tensor<1, dim, VectorizedArrayType>> subcell_face_normals;
442
445 std::vector<dealii::Point<dim, VectorizedArrayType>> subcell_locations;
446
448 std::vector<VectorizedArrayType> integrated_subcell_values_buffer;
449
452 bool is_reinitialized = false;
453
457
461
465
467 bool is_boundary_face = false;
468
471 dealii::FEEvaluation<dim, -1, 0, n_components, number, VectorizedArrayType> fe_cell_evaluator;
472
474 dealii::FEFaceEvaluation<dim, -1, 0, n_components, number, VectorizedArrayType>
476
496 unsigned int
497 layer_index(const unsigned int subcell_index) const;
498
510 unsigned int
512 const unsigned int face_no,
513 const unsigned int q_face,
514 const dealii::internal::MatrixFreeFunctions::ShapeInfo<number> &shape_info) const;
515
520 void
522
529 void
531
537 void
539
545 void
547
551 void
553
563 void
565 const dealii::EvaluationFlags::EvaluationFlags evaluation_flags);
566 };
567} // namespace MeltPoolDG
Definition fe_subcell_face_evaluation.hpp:119
std::ranges::iota_view< unsigned int, unsigned int > subcell_face_indices() const
Definition fe_subcell_face_evaluation.templates.hpp:163
dealii::VectorizedArray< number > VectorizedArrayType
Definition fe_subcell_face_evaluation.hpp:120
void determine_subcell_locations()
Definition fe_subcell_face_evaluation.templates.hpp:354
unsigned int n_subcells_face
Number of subcell faces per DG face,.
Definition fe_subcell_face_evaluation.hpp:350
dealii::FEEvaluation< dim, -1, 0, n_components, number, VectorizedArrayType > fe_cell_evaluator
Definition fe_subcell_face_evaluation.hpp:471
VectorizedArrayType subcell_size(const unsigned int subcell_index) const
Definition fe_subcell_face_evaluation.templates.hpp:227
bool dof_values_initialized
Definition fe_subcell_face_evaluation.hpp:456
void reinit(const unsigned int face_batch_index)
Definition fe_subcell_face_evaluation.templates.hpp:39
dealii::FEFaceEvaluation< dim, -1, 0, n_components, number, VectorizedArrayType > fe_face_evaluator
Finite element evaluator for the face.
Definition fe_subcell_face_evaluation.hpp:475
std::vector< dealii::Point< dim, VectorizedArrayType > > subcell_locations
Definition fe_subcell_face_evaluation.hpp:445
dealii::Tensor< 1, dim, VectorizedArrayType > normal_vector(const unsigned int subcell_index) const
Definition fe_subcell_face_evaluation.templates.hpp:197
void determine_subcell_sizes()
Definition fe_subcell_face_evaluation.templates.hpp:257
void setup_internal_data_structures()
Definition fe_subcell_face_evaluation.templates.hpp:312
void project_dof_values_to_subcell_values(const dealii::EvaluationFlags::EvaluationFlags evaluation_flags)
Definition fe_subcell_face_evaluation.templates.hpp:332
VectorizedArrayType subcell_face_size(const unsigned int subcell_index) const
Definition fe_subcell_face_evaluation.templates.hpp:170
void gather_evaluate(const dealii::LinearAlgebra::distributed::Vector< number > &input_vector, const dealii::EvaluationFlags::EvaluationFlags evaluation_flags, const std::bitset< n_lanes > &mask=std::bitset< n_lanes >().flip())
Definition fe_subcell_face_evaluation.templates.hpp:112
unsigned int face_batch_index
Index of the face batch the object is currently reinitialized on.
Definition fe_subcell_face_evaluation.hpp:353
unsigned int face_no
Definition fe_subcell_face_evaluation.hpp:364
std::vector< VectorizedArrayType > subcell_sizes
Definition fe_subcell_face_evaluation.hpp:437
void read_dof_values(const dealii::LinearAlgebra::distributed::Vector< number > &src_vector, const std::bitset< n_lanes > &mask=std::bitset< n_lanes >().flip())
Definition fe_subcell_face_evaluation.templates.hpp:88
const bool is_interior_face
Definition fe_subcell_face_evaluation.hpp:360
value_type get_value(const unsigned int subcell_index) const
Definition fe_subcell_face_evaluation.templates.hpp:123
bool at_boundary() const
Definition fe_subcell_face_evaluation.templates.hpp:207
void distribute_local_to_global(dealii::LinearAlgebra::distributed::Vector< number > &dst_vector, const std::bitset< n_lanes > &mask=std::bitset< n_lanes >().flip())
Definition fe_subcell_face_evaluation.templates.hpp:303
void submit_flux(const unsigned int subcell_index, const value_type &normal_flux)
Definition fe_subcell_face_evaluation.templates.hpp:136
dealii::FEFaceEvaluation< dim, -1, 0, n_components, number, VectorizedArrayType >::gradient_type gradient_type
The type of the gradients on the subcells.
Definition fe_subcell_face_evaluation.hpp:131
unsigned int n_subcells_1d
Number of subcells per direction of the adjacent cells.
Definition fe_subcell_face_evaluation.hpp:347
void determine_subcell_face_normals()
Definition fe_subcell_face_evaluation.templates.hpp:247
std::vector< VectorizedArrayType > integrated_subcell_values_buffer
Scratch buffer for integrate() holding one value per component and subcell.
Definition fe_subcell_face_evaluation.hpp:448
void determine_subcell_face_sizes()
Definition fe_subcell_face_evaluation.templates.hpp:237
dealii::types::boundary_id boundary_id() const
Definition fe_subcell_face_evaluation.templates.hpp:215
std::vector< dealii::Tensor< 1, dim, VectorizedArrayType > > subcell_face_normals
Definition fe_subcell_face_evaluation.hpp:441
dealii::Point< dim, VectorizedArrayType > subcell_location(const unsigned int subcell_index) const
Definition fe_subcell_face_evaluation.templates.hpp:180
unsigned int n_subcell_faces() const
Definition fe_subcell_face_evaluation.templates.hpp:190
std::vector< VectorizedArrayType > subcell_face_sizes
Sizes of the subcell faces, indexed by the subcell face index.
Definition fe_subcell_face_evaluation.hpp:433
const dealii::MatrixFree< dim, number > & matrix_free
The MatrixFree object providing the face information and the cell data.
Definition fe_subcell_face_evaluation.hpp:356
unsigned int layer_index(const unsigned int subcell_index) const
Definition fe_subcell_face_evaluation.templates.hpp:366
void integrate_scatter(dealii::LinearAlgebra::distributed::Vector< number > &dst_vector, const std::bitset< n_lanes > &mask=std::bitset< n_lanes >().flip())
Definition fe_subcell_face_evaluation.templates.hpp:149
static constexpr unsigned int n_lanes
Definition fe_subcell_face_evaluation.hpp:122
unsigned int face_to_cell_quadrature_index(const unsigned int face_no, const unsigned int q_face, const dealii::internal::MatrixFreeFunctions::ShapeInfo< number > &shape_info) const
Definition fe_subcell_face_evaluation.templates.hpp:389
std::vector< value_type > layer_values
Definition fe_subcell_face_evaluation.hpp:427
bool is_boundary_face
A flag indicating whether the current face batch is a boundary face batch.
Definition fe_subcell_face_evaluation.hpp:467
void evaluate(const dealii::EvaluationFlags::EvaluationFlags evaluation_flags)
Definition fe_subcell_face_evaluation.templates.hpp:100
std::vector< value_type > submitted_fluxes
Fluxes submitted with submit_flux(), indexed by the subcell face index.
Definition fe_subcell_face_evaluation.hpp:430
void integrate()
Definition fe_subcell_face_evaluation.templates.hpp:267
bool subcell_fluxes_submitted
Definition fe_subcell_face_evaluation.hpp:464
bool is_reinitialized
Definition fe_subcell_face_evaluation.hpp:452
dealii::FEFaceEvaluation< dim, -1, 0, n_components, number, VectorizedArrayType >::value_type value_type
The type of the values on the subcells.
Definition fe_subcell_face_evaluation.hpp:127
bool subcell_values_initialized
Definition fe_subcell_face_evaluation.hpp:460
Interface for a general preconditioner.
Definition boundary_condition_functions.hpp:17