48 template <
class VectorType>
54 const VectorType & level_set,
57 , fe_collection(&fe_collection)
58 , q_collection_1D(quadrature)
59 , region_update_flags(region_update_flags)
60 , mesh_classifier(&mesh_classifier)
61 , quadrature_generator(q_collection_1D,
78 template <
class VectorType>
86 const VectorType & level_set,
88 : mapping_collection(&mapping_collection)
89 , fe_collection(&fe_collection)
90 , q_collection_1D(q_collection_1D)
91 , region_update_flags(region_update_flags)
92 , mesh_classifier(&mesh_classifier)
93 , quadrature_generator(q_collection_1D,
110 Assert(fe_collection->size() > 0,
111 ExcMessage(
"Incoming hp::FECollection can not be empty."));
112 Assert(mapping_collection->size() == fe_collection->size() ||
113 mapping_collection->size() == 1,
114 ExcMessage(
"Size of hp::MappingCollection must be "
115 "the same as hp::FECollection or 1."));
116 Assert(q_collection.
size() == fe_collection->size() ||
117 q_collection.
size() == 1,
118 ExcMessage(
"Size of hp::QCollection<dim> must be the "
119 "same as hp::FECollection or 1."));
120 Assert(q_collection_1D.size() == fe_collection->size() ||
121 q_collection_1D.size() == 1,
122 ExcMessage(
"Size of hp::QCollection<1> must be the "
123 "same as hp::FECollection or 1."));
127 fe_values_inside_full_quadrature.resize(fe_collection->size());
128 fe_values_outside_full_quadrature.resize(fe_collection->size());
129 for (
unsigned int fe_index = 0; fe_index < fe_collection->size();
132 const unsigned int mapping_index =
133 mapping_collection->size() > 1 ? fe_index : 0;
134 const unsigned int q_index = q_collection.
size() > 1 ? fe_index : 0;
136 fe_values_inside_full_quadrature[fe_index].emplace(
137 (*mapping_collection)[mapping_index],
138 (*fe_collection)[fe_index],
139 q_collection[q_index],
140 region_update_flags.inside);
141 fe_values_outside_full_quadrature[fe_index].emplace(
142 (*mapping_collection)[mapping_index],
143 (*fe_collection)[fe_index],
144 q_collection[q_index],
145 region_update_flags.outside);
152 template <
bool level_dof_access>
157 current_cell_location = mesh_classifier->location_to_level_set(cell);
158 active_fe_index = cell->active_fe_index();
162 fe_values_inside.reset();
163 fe_values_surface.reset();
164 fe_values_outside.reset();
166 switch (current_cell_location)
170 fe_values_inside_full_quadrature.at(active_fe_index)->reinit(cell);
175 fe_values_outside_full_quadrature.at(active_fe_index)->reinit(cell);
180 const unsigned int mapping_index =
181 mapping_collection->size() > 1 ? active_fe_index : 0;
183 const unsigned int q1D_index =
184 q_collection_1D.size() > 1 ? active_fe_index : 0;
185 quadrature_generator.set_1D_quadrature(q1D_index);
186 quadrature_generator.generate(cell);
189 quadrature_generator.get_inside_quadrature();
191 quadrature_generator.get_outside_quadrature();
193 quadrature_generator.get_surface_quadrature();
198 if (inside_quadrature.
size() > 0)
200 fe_values_inside.emplace((*mapping_collection)[mapping_index],
201 (*fe_collection)[active_fe_index],
203 region_update_flags.inside);
205 fe_values_inside->reinit(cell);
208 if (outside_quadrature.
size() > 0)
210 fe_values_outside.emplace((*mapping_collection)[mapping_index],
211 (*fe_collection)[active_fe_index],
213 region_update_flags.outside);
215 fe_values_outside->reinit(cell);
218 if (surface_quadrature.
size() > 0)
220 fe_values_surface.emplace((*mapping_collection)[mapping_index],
221 (*fe_collection)[active_fe_index],
223 region_update_flags.surface);
224 fe_values_surface->reinit(cell);
240 const std_cxx17::optional<::FEValues<dim>> &
244 return fe_values_inside_full_quadrature.at(active_fe_index);
246 return fe_values_inside;
252 const std_cxx17::optional<::FEValues<dim>> &
256 return fe_values_outside_full_quadrature.at(active_fe_index);
258 return fe_values_outside;
264 const std_cxx17::optional<FEImmersedSurfaceValues<dim>> &
267 return fe_values_surface;
273 template <
class VectorType>
280 const VectorType & level_set,
283 , fe_collection(&fe_collection)
284 , q_collection_1D(quadrature)
285 , region_update_flags(region_update_flags)
286 , mesh_classifier(&mesh_classifier)
287 , face_quadrature_generator(q_collection_1D,
304 template <
class VectorType>
313 const VectorType & level_set,
315 : mapping_collection(&mapping_collection)
316 , fe_collection(&fe_collection)
317 , q_collection_1D(q_collection_1D)
318 , region_update_flags(region_update_flags)
319 , mesh_classifier(&mesh_classifier)
320 , face_quadrature_generator(q_collection_1D,
338 Assert(fe_collection->size() > 0,
339 ExcMessage(
"Incoming hp::FECollection can not be empty."));
341 mapping_collection->size() == fe_collection->size() ||
342 mapping_collection->size() == 1,
344 "Size of hp::MappingCollection must be the same as hp::FECollection or 1."));
346 q_collection.
size() == fe_collection->size() || q_collection.
size() == 1,
348 "Size of hp::QCollection<dim> must be the same as hp::FECollection or 1."));
350 q_collection_1D.size() == fe_collection->size() ||
351 q_collection_1D.size() == 1,
353 "Size of hp::QCollection<1> must be the same as hp::FECollection or 1."));
357 fe_values_inside_full_quadrature.resize(fe_collection->size());
358 fe_values_outside_full_quadrature.resize(fe_collection->size());
359 for (
unsigned int fe_index = 0; fe_index < fe_collection->size();
362 const unsigned int mapping_index =
363 mapping_collection->size() > 1 ? fe_index : 0;
364 const unsigned int q_index = q_collection.
size() > 1 ? fe_index : 0;
366 fe_values_inside_full_quadrature[fe_index].emplace(
367 (*mapping_collection)[mapping_index],
368 (*fe_collection)[fe_index],
369 q_collection[q_index],
370 region_update_flags.inside);
371 fe_values_outside_full_quadrature[fe_index].emplace(
372 (*mapping_collection)[mapping_index],
373 (*fe_collection)[fe_index],
374 q_collection[q_index],
375 region_update_flags.outside);
382 template <
bool level_dof_access>
386 const unsigned int face_no,
389 current_face_location =
390 mesh_classifier->location_to_level_set(cell, face_no);
391 active_fe_index = cell->active_fe_index();
395 fe_values_inside.reset();
396 fe_values_outside.reset();
398 switch (current_face_location)
402 call_reinit(*fe_values_inside_full_quadrature.at(active_fe_index));
407 call_reinit(*fe_values_outside_full_quadrature.at(active_fe_index));
412 const unsigned int mapping_index =
413 mapping_collection->size() > 1 ? active_fe_index : 0;
414 const unsigned int q1D_index =
415 q_collection_1D.size() > 1 ? active_fe_index : 0;
417 face_quadrature_generator.set_1D_quadrature(q1D_index);
418 face_quadrature_generator.generate(cell, face_no);
420 const Quadrature<dim - 1> &inside_quadrature =
421 face_quadrature_generator.get_inside_quadrature();
422 const Quadrature<dim - 1> &outside_quadrature =
423 face_quadrature_generator.get_outside_quadrature();
428 if (inside_quadrature.size() > 0)
430 fe_values_inside.emplace((*mapping_collection)[mapping_index],
431 (*fe_collection)[active_fe_index],
433 region_update_flags.inside);
435 call_reinit(*fe_values_inside);
438 if (outside_quadrature.size() > 0)
440 fe_values_outside.emplace((*mapping_collection)[mapping_index],
441 (*fe_collection)[active_fe_index],
443 region_update_flags.outside);
445 call_reinit(*fe_values_outside);
460 const std_cxx17::optional<::FEInterfaceValues<dim>> &
464 return fe_values_inside_full_quadrature.at(active_fe_index);
466 return fe_values_inside;
472 const std_cxx17::optional<::FEInterfaceValues<dim>> &
476 return fe_values_outside_full_quadrature.at(active_fe_index);
478 return fe_values_outside;
482#include "fe_values.inst"
void initialize(const hp::QCollection< dim - 1 > &q_collection)
const hp::QCollection< 1 > q_collection_1D
typename FaceQuadratureGenerator< dim >::AdditionalData AdditionalData
const std_cxx17::optional<::FEInterfaceValues< dim > > & get_inside_fe_values() const
const std_cxx17::optional<::FEInterfaceValues< dim > > & get_outside_fe_values() const
FEInterfaceValues(const hp::FECollection< dim > &fe_collection, const Quadrature< 1 > &quadrature, const RegionUpdateFlags region_update_flags, const MeshClassifier< dim > &mesh_classifier, const DoFHandler< dim > &dof_handler, const VectorType &level_set, const AdditionalData &additional_data=AdditionalData())
void do_reinit(const TriaIterator< DoFCellAccessor< dim, dim, level_dof_access > > &cell, const unsigned int face_no, const std::function< void(::FEInterfaceValues< dim > &)> &call_reinit)
void initialize(const hp::QCollection< dim > &q_collection)
const hp::QCollection< 1 > q_collection_1D
void reinit(const TriaIterator< DoFCellAccessor< dim, dim, level_dof_access > > &cell)
const std_cxx17::optional<::FEValues< dim > > & get_outside_fe_values() const
typename QuadratureGenerator< dim >::AdditionalData AdditionalData
FEValues(const hp::FECollection< dim > &fe_collection, const Quadrature< 1 > &quadrature, const RegionUpdateFlags region_update_flags, const MeshClassifier< dim > &mesh_classifier, const DoFHandler< dim > &dof_handler, const VectorType &level_set, const AdditionalData &additional_data=AdditionalData())
const std_cxx17::optional< FEImmersedSurfaceValues< dim > > & get_surface_fe_values() const
const std_cxx17::optional<::FEValues< dim > > & get_inside_fe_values() const
unsigned int size() const
unsigned int size() const
void push_back(const Quadrature< dim_in > &new_quadrature)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
@ update_default
No update.
static const unsigned int invalid_unsigned_int