34 std::vector<QCollection<q_dim>>
35 translate(
const QCollection<q_dim> &q_collection)
37 std::vector<QCollection<q_dim>> q_collections;
39 for (
unsigned int q = 0; q < q_collection.size(); ++q)
40 q_collections.emplace_back(q_collection[q]);
51 translate(
const std::vector<QCollection<q_dim>> &q_collections)
53 QCollection<q_dim> result;
55 for (
unsigned int q = 0; q < q_collections.size(); ++q)
56 result.push_back(q_collections[q][0]);
64 template <
int dim,
int q_dim,
typename FEValuesType>
71 : fe_collection(&fe_collection)
72 , mapping_collection(&mapping_collection)
73 , q_collection(q_collection)
74 , q_collections(translate(q_collection))
75 , fe_values_table(fe_collection.size(),
76 mapping_collection.size(),
78 , present_fe_values_index(
numbers::invalid_unsigned_int,
81 , update_flags(update_flags)
84 template <
int dim,
int q_dim,
typename FEValuesType>
91 : fe_collection(&fe_collection)
92 , mapping_collection(&mapping_collection)
93 , q_collection(translate(q_collections))
94 , q_collections(q_collections)
95 , fe_values_table(fe_collection.size(),
96 mapping_collection.size(),
98 , present_fe_values_index(
numbers::invalid_unsigned_int,
101 , update_flags(update_flags)
105 template <
int dim,
int q_dim,
typename FEValuesType>
119 template <
int dim,
int q_dim,
typename FEValuesType>
134 template <
int dim,
int q_dim,
typename FEValuesType>
138 , fe_collection(other.fe_collection)
139 , mapping_collection(other.mapping_collection)
140 , q_collection(other.q_collection)
141 , q_collections(other.q_collections)
142 , fe_values_table(other.fe_values_table.size(0),
143 other.fe_values_table.size(1),
144 other.fe_values_table.size(2))
145 , present_fe_values_index(other.present_fe_values_index)
146 , update_flags(other.update_flags)
154 for (
unsigned int m_index = 0; m_index < other.
fe_values_table.size(1);
156 for (
unsigned int q_index = 0; q_index < other.
fe_values_table.size(2);
173 template <
int dim,
int q_dim,
typename FEValuesType>
176 const unsigned int fe_index,
177 const unsigned int mapping_index,
178 const unsigned int q_index)
186 present_fe_values_index = {fe_index, mapping_index, q_index};
190 if (fe_values_table(present_fe_values_index).get() ==
nullptr)
191 fe_values_table(present_fe_values_index) =
192 std::make_unique<FEValuesType>((*mapping_collection)[mapping_index],
193 (*fe_collection)[fe_index],
194 q_collections[q_index],
198 return *fe_values_table(present_fe_values_index);
203 template <
int dim,
int q_dim,
typename FEValuesType>
206 const std::vector<unsigned int> &fe_indices,
207 const std::vector<unsigned int> &mapping_indices,
208 const std::vector<unsigned int> &q_indices)
214 for (
unsigned int i = 0; i < fe_indices.size(); ++i)
216 const unsigned int fe_index = fe_indices[i],
217 mapping_index = mapping_indices[i],
218 q_index = q_indices[i];
226 fe_values_table[fe_index][mapping_index][q_index] =
227 std::make_unique<FEValuesType>(
228 (*mapping_collection)[mapping_index],
229 (*fe_collection)[fe_index],
230 q_collections[q_index],
235 task_group.join_all();
240 template <
int dim,
int q_dim,
typename FEValuesType>
244 const unsigned int size = fe_collection->size();
245 std::vector<unsigned int> indices(size);
246 std::iota(indices.begin(), indices.end(), 0);
248 precalculate_fe_values(indices,
250 (mapping_collection->size() > 1) ?
252 std::vector<unsigned int>(size, 0),
254 (q_collections.size() > 1) ?
256 std::vector<unsigned int>(size, 0));
266 template <
int dim,
int spacedim>
279 template <
int dim,
int spacedim>
290 template <
int dim,
int spacedim>
295 const unsigned int q_index,
296 const unsigned int mapping_index,
297 const unsigned int fe_index)
300 unsigned int real_q_index = q_index, real_mapping_index = mapping_index,
301 real_fe_index = fe_index;
305 if (this->q_collections.size() > 1)
306 real_q_index = cell->active_fe_index();
313 if (this->mapping_collection->size() > 1)
314 real_mapping_index = cell->active_fe_index();
316 real_mapping_index = 0;
320 real_fe_index = cell->active_fe_index();
328 this->select_fe_values(real_fe_index, real_mapping_index, real_q_index)
334 template <
int dim,
int spacedim>
338 const unsigned int q_index,
339 const unsigned int mapping_index,
340 const unsigned int fe_index)
343 unsigned int real_q_index = q_index, real_mapping_index = mapping_index,
344 real_fe_index = fe_index;
350 real_mapping_index = 0;
361 this->select_fe_values(real_fe_index, real_mapping_index, real_q_index)
369 template <
int dim,
int spacedim>
382 template <
int dim,
int spacedim>
396 template <
int dim,
int spacedim>
408 template <
int dim,
int spacedim>
420 template <
int dim,
int spacedim>
425 const unsigned int face_no,
426 const unsigned int q_index,
427 const unsigned int mapping_index,
428 const unsigned int fe_index)
432 unsigned int real_q_index = q_index, real_mapping_index = mapping_index,
433 real_fe_index = fe_index;
437 if (this->q_collections.size() > 1)
438 real_q_index = cell->active_fe_index();
445 if (this->mapping_collection->size() > 1)
446 real_mapping_index = cell->active_fe_index();
448 real_mapping_index = 0;
452 real_fe_index = cell->active_fe_index();
460 this->select_fe_values(real_fe_index, real_mapping_index, real_q_index)
461 .reinit(cell, face_no);
466 template <
int dim,
int spacedim>
472 const unsigned int q_index,
473 const unsigned int mapping_index,
474 const unsigned int fe_index)
476 const auto face_n = cell->face_iterator_to_index(face);
477 reinit(cell, face_n, q_index, mapping_index, fe_index);
482 template <
int dim,
int spacedim>
486 const unsigned int face_no,
487 const unsigned int q_index,
488 const unsigned int mapping_index,
489 const unsigned int fe_index)
493 unsigned int real_q_index = q_index, real_mapping_index = mapping_index,
494 real_fe_index = fe_index;
500 real_mapping_index = 0;
511 this->select_fe_values(real_fe_index, real_mapping_index, real_q_index)
512 .reinit(cell, face_no);
517 template <
int dim,
int spacedim>
522 const unsigned int q_index,
523 const unsigned int mapping_index,
524 const unsigned int fe_index)
526 const auto face_n = cell->face_iterator_to_index(face);
527 reinit(cell, face_n, q_index, mapping_index, fe_index);
534 template <
int dim,
int spacedim>
548 template <
int dim,
int spacedim>
560 template <
int dim,
int spacedim>
565 const unsigned int face_no,
566 const unsigned int subface_no,
567 const unsigned int q_index,
568 const unsigned int mapping_index,
569 const unsigned int fe_index)
572 unsigned int real_q_index = q_index, real_mapping_index = mapping_index,
573 real_fe_index = fe_index;
577 if (this->q_collections.size() > 1)
578 real_q_index = cell->active_fe_index();
585 if (this->mapping_collection->size() > 1)
586 real_mapping_index = cell->active_fe_index();
588 real_mapping_index = 0;
592 real_fe_index = cell->active_fe_index();
600 this->select_fe_values(real_fe_index, real_mapping_index, real_q_index)
601 .reinit(cell, face_no, subface_no);
606 template <
int dim,
int spacedim>
610 const unsigned int face_no,
611 const unsigned int subface_no,
612 const unsigned int q_index,
613 const unsigned int mapping_index,
614 const unsigned int fe_index)
617 unsigned int real_q_index = q_index, real_mapping_index = mapping_index,
618 real_fe_index = fe_index;
624 real_mapping_index = 0;
635 this->select_fe_values(real_fe_index, real_mapping_index, real_q_index)
636 .reinit(cell, face_no, subface_no);
642#include "fe_values.inst"
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)
const std::vector< QCollection< q_dim > > q_collections
FEValuesType & select_fe_values(const unsigned int fe_index, const unsigned int mapping_index, const unsigned int q_index)
const SmartPointer< const FECollection< dim, FEValuesType::space_dimension >, FEValuesBase< dim, q_dim, FEValuesType > > fe_collection
Table< 3, std::unique_ptr< FEValuesType > > fe_values_table
void precalculate_fe_values()
const SmartPointer< const MappingCollection< dim, FEValuesType::space_dimension >, FEValuesBase< dim, q_dim, FEValuesType > > mapping_collection
const UpdateFlags update_flags
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