35 std::vector<QCollection<q_dim>>
36 translate(
const QCollection<q_dim> &q_collection)
38 std::vector<QCollection<q_dim>> q_collections;
40 for (
unsigned int q = 0; q < q_collection.size(); ++q)
41 q_collections.emplace_back(q_collection[q]);
52 translate(
const std::vector<QCollection<q_dim>> &q_collections)
54 QCollection<q_dim> result;
56 for (
unsigned int q = 0; q < q_collections.size(); ++q)
57 result.push_back(q_collections[q][0]);
65 template <
int dim,
int q_dim,
class FEValuesType>
72 : fe_collection(&fe_collection)
73 , mapping_collection(&mapping_collection)
74 , q_collection(q_collection)
75 , q_collections(translate(q_collection))
76 , fe_values_table(fe_collection.size(),
77 mapping_collection.size(),
79 , present_fe_values_index(
numbers::invalid_unsigned_int,
82 , update_flags(update_flags)
85 template <
int dim,
int q_dim,
class FEValuesType>
92 : fe_collection(&fe_collection)
93 , mapping_collection(&mapping_collection)
94 , q_collection(translate(q_collections))
95 , q_collections(q_collections)
96 , fe_values_table(fe_collection.size(),
97 mapping_collection.size(),
99 , present_fe_values_index(
numbers::invalid_unsigned_int,
102 , update_flags(update_flags)
106 template <
int dim,
int q_dim,
class FEValuesType>
120 template <
int dim,
int q_dim,
class FEValuesType>
135 template <
int dim,
int q_dim,
class FEValuesType>
139 , fe_collection(other.fe_collection)
140 , mapping_collection(other.mapping_collection)
141 , q_collection(other.q_collection)
142 , q_collections(other.q_collections)
143 , fe_values_table(other.fe_values_table.size(0),
144 other.fe_values_table.size(1),
145 other.fe_values_table.size(2))
146 , present_fe_values_index(other.present_fe_values_index)
147 , update_flags(other.update_flags)
153 for (
unsigned int fe_index = 0; fe_index < other.
fe_values_table.size(0);
155 for (
unsigned int m_index = 0; m_index < other.
fe_values_table.size(1);
157 for (
unsigned int q_index = 0; q_index < other.
fe_values_table.size(2);
162 fe_values_table[fe_index][m_index][q_index] =
163 std::make_unique<FEValuesType>((*mapping_collection)[m_index],
164 (*fe_collection)[fe_index],
165 q_collections[q_index],
174 template <
int dim,
int q_dim,
class FEValuesType>
177 const unsigned int fe_index,
178 const unsigned int mapping_index,
179 const unsigned int q_index)
187 present_fe_values_index = {fe_index, mapping_index, q_index};
191 if (fe_values_table(present_fe_values_index).get() ==
nullptr)
192 fe_values_table(present_fe_values_index) =
193 std::make_unique<FEValuesType>((*mapping_collection)[mapping_index],
194 (*fe_collection)[fe_index],
195 q_collections[q_index],
199 return *fe_values_table(present_fe_values_index);
204 template <
int dim,
int q_dim,
class FEValuesType>
207 const std::vector<unsigned int> &fe_indices,
208 const std::vector<unsigned int> &mapping_indices,
209 const std::vector<unsigned int> &q_indices)
215 for (
unsigned int i = 0; i < fe_indices.size(); ++i)
217 const unsigned int fe_index = fe_indices[i],
218 mapping_index = mapping_indices[i],
219 q_index = q_indices[i];
227 fe_values_table[fe_index][mapping_index][q_index] =
228 std::make_unique<FEValuesType>(
229 (*mapping_collection)[mapping_index],
230 (*fe_collection)[fe_index],
231 q_collections[q_index],
241 template <
int dim,
int q_dim,
class FEValuesType>
245 const unsigned int size = fe_collection->size();
246 std::vector<unsigned int> indices(size);
247 std::iota(indices.begin(), indices.end(), 0);
249 precalculate_fe_values(indices,
251 (mapping_collection->size() > 1) ?
253 std::vector<unsigned int>(size, 0),
255 (q_collections.size() > 1) ?
257 std::vector<unsigned int>(size, 0));
267 template <
int dim,
int spacedim>
280 template <
int dim,
int spacedim>
291 template <
int dim,
int spacedim>
296 const unsigned int q_index,
297 const unsigned int mapping_index,
298 const unsigned int fe_index)
301 unsigned int real_q_index = q_index, real_mapping_index = mapping_index,
302 real_fe_index = fe_index;
306 if (this->q_collections.size() > 1)
307 real_q_index = cell->active_fe_index();
314 if (this->mapping_collection->size() > 1)
315 real_mapping_index = cell->active_fe_index();
317 real_mapping_index = 0;
321 real_fe_index = cell->active_fe_index();
329 this->select_fe_values(real_fe_index, real_mapping_index, real_q_index)
335 template <
int dim,
int spacedim>
339 const unsigned int q_index,
340 const unsigned int mapping_index,
341 const unsigned int fe_index)
344 unsigned int real_q_index = q_index, real_mapping_index = mapping_index,
345 real_fe_index = fe_index;
351 real_mapping_index = 0;
362 this->select_fe_values(real_fe_index, real_mapping_index, real_q_index)
370 template <
int dim,
int spacedim>
383 template <
int dim,
int spacedim>
397 template <
int dim,
int spacedim>
409 template <
int dim,
int spacedim>
421 template <
int dim,
int spacedim>
426 const unsigned int face_no,
427 const unsigned int q_index,
428 const unsigned int mapping_index,
429 const unsigned int fe_index)
433 unsigned int real_q_index = q_index, real_mapping_index = mapping_index,
434 real_fe_index = fe_index;
438 if (this->q_collections.size() > 1)
439 real_q_index = cell->active_fe_index();
446 if (this->mapping_collection->size() > 1)
447 real_mapping_index = cell->active_fe_index();
449 real_mapping_index = 0;
453 real_fe_index = cell->active_fe_index();
461 this->select_fe_values(real_fe_index, real_mapping_index, real_q_index)
462 .reinit(cell, face_no);
467 template <
int dim,
int spacedim>
473 const unsigned int q_index,
474 const unsigned int mapping_index,
475 const unsigned int fe_index)
477 const auto face_n = cell->face_iterator_to_index(face);
478 reinit(cell, face_n, q_index, mapping_index, fe_index);
483 template <
int dim,
int spacedim>
487 const unsigned int face_no,
488 const unsigned int q_index,
489 const unsigned int mapping_index,
490 const unsigned int fe_index)
494 unsigned int real_q_index = q_index, real_mapping_index = mapping_index,
495 real_fe_index = fe_index;
501 real_mapping_index = 0;
512 this->select_fe_values(real_fe_index, real_mapping_index, real_q_index)
513 .reinit(cell, face_no);
518 template <
int dim,
int spacedim>
523 const unsigned int q_index,
524 const unsigned int mapping_index,
525 const unsigned int fe_index)
527 const auto face_n = cell->face_iterator_to_index(face);
528 reinit(cell, face_n, q_index, mapping_index, fe_index);
535 template <
int dim,
int spacedim>
549 template <
int dim,
int spacedim>
561 template <
int dim,
int spacedim>
566 const unsigned int face_no,
567 const unsigned int subface_no,
568 const unsigned int q_index,
569 const unsigned int mapping_index,
570 const unsigned int fe_index)
573 unsigned int real_q_index = q_index, real_mapping_index = mapping_index,
574 real_fe_index = fe_index;
578 if (this->q_collections.size() > 1)
579 real_q_index = cell->active_fe_index();
586 if (this->mapping_collection->size() > 1)
587 real_mapping_index = cell->active_fe_index();
589 real_mapping_index = 0;
593 real_fe_index = cell->active_fe_index();
601 this->select_fe_values(real_fe_index, real_mapping_index, real_q_index)
602 .reinit(cell, face_no, subface_no);
607 template <
int dim,
int spacedim>
611 const unsigned int face_no,
612 const unsigned int subface_no,
613 const unsigned int q_index,
614 const unsigned int mapping_index,
615 const unsigned int fe_index)
618 unsigned int real_q_index = q_index, real_mapping_index = mapping_index,
619 real_fe_index = fe_index;
625 real_mapping_index = 0;
636 this->select_fe_values(real_fe_index, real_mapping_index, real_q_index)
637 .reinit(cell, face_no, subface_no);
643#include "fe_values.inst"
FEValuesBase(const unsigned int n_q_points, const unsigned int dofs_per_cell, const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe)
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, lda > > &cell, const unsigned int face_no, const unsigned int q_index=numbers::invalid_unsigned_int, const unsigned int mapping_index=numbers::invalid_unsigned_int, const unsigned int fe_index=numbers::invalid_unsigned_int)
FEFaceValues(const hp::MappingCollection< dim, spacedim > &mapping_collection, const hp::FECollection< dim, spacedim > &fe_collection, const hp::QCollection< dim - 1 > &q_collection, const UpdateFlags update_flags)
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, lda > > &cell, const unsigned int face_no, const unsigned int subface_no, const unsigned int q_index=numbers::invalid_unsigned_int, const unsigned int mapping_index=numbers::invalid_unsigned_int, const unsigned int fe_index=numbers::invalid_unsigned_int)
FESubfaceValues(const hp::MappingCollection< dim, spacedim > &mapping_collection, const hp::FECollection< dim, spacedim > &fe_collection, const hp::QCollection< dim - 1 > &q_collection, const UpdateFlags update_flags)
FEValuesBase(const MappingCollection< dim, FEValuesType::space_dimension > &mapping_collection, const FECollection< dim, FEValuesType::space_dimension > &fe_collection, const QCollection< q_dim > &q_collection, const UpdateFlags update_flags)
Table< 3, std::unique_ptr< FEValuesType > > fe_values_table
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, lda > > &cell, const unsigned int q_index=numbers::invalid_unsigned_int, const unsigned int mapping_index=numbers::invalid_unsigned_int, const unsigned int fe_index=numbers::invalid_unsigned_int)
FEValues(const MappingCollection< dim, spacedim > &mapping_collection, const FECollection< dim, spacedim > &fe_collection, const QCollection< dim > &q_collection, const UpdateFlags update_flags)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
Task< RT > new_task(const std::function< RT()> &function)
static const unsigned int invalid_unsigned_int