49 "The Triangulation has not been classified. You need to call the "
50 "reclassify()-function before using this function.");
54 "The incoming cell does not belong to the triangulation passed to "
65 template <
typename VectorType>
69 const auto [min_element, max_element] =
70 std::minmax_element(local_levelset_values.begin(),
71 local_levelset_values.end());
76 if (*min_element == 0.0 && *max_element == 0.0)
78 if (*max_element <= 0)
80 if (0 <= *min_element)
92 template <
int dim,
typename VectorType>
114 &cell)
const override;
123 const unsigned int face_index,
141 template <
int dim,
typename VectorType>
151 template <
int dim,
typename VectorType>
160 template <
int dim,
typename VectorType>
164 const unsigned int face_index,
167 const auto cell_with_dofs = cell->as_dof_handler_iterator(*
dof_handler);
169 const unsigned int n_dofs_per_face =
171 std::vector<types::global_dof_index> dof_indices(n_dofs_per_face);
172 cell_with_dofs->face(face_index)->get_dof_indices(dof_indices);
174 local_levelset_values.
reinit(dof_indices.size());
176 for (
unsigned int i = 0; i < dof_indices.size(); i++)
177 local_levelset_values[i] =
184 template <
int dim,
typename VectorType>
189 const auto cell_with_dofs = cell->as_dof_handler_iterator(*
dof_handler);
191 return cell_with_dofs->active_fe_index();
223 &cell)
const override;
232 const unsigned int face_index,
264 element.get_unit_face_support_points()),
274 const unsigned int face_index,
281 const std::vector<Point<dim>> &points =
284 for (
unsigned int i = 0; i < points.size(); i++)
285 local_levelset_values[i] =
level_set->value(points[i]);
312 template <
typename VectorType>
314 const VectorType &level_set)
317 std::make_unique<
internal::MeshClassifierImplementation::
318 DiscreteLevelSetDescription<dim, VectorType>>(
322#ifdef DEAL_II_WITH_LAPACK
325 for (
unsigned int i = 0; i < fe_collection.
size(); i++)
330 Assert(fe_collection[i].has_face_support_points(),
332 "The elements in the FECollection of the incoming DoFHandler "
333 "must have face support points."));
348 std::make_unique<
internal::MeshClassifierImplementation::
349 AnalyticLevelSetDescription<dim>>(level_set,
372 const auto contains =
373 [](
const std::set<LocationToLevelSet> &local_face_locations,
375 return local_face_locations.count(location) > 0;
380 for (
const auto &cell :
triangulation->active_cell_iterators())
381 if (!cell->is_artificial())
383 std::set<LocationToLevelSet> local_face_locations;
385 for (
unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
391 local_face_locations.insert(face_location);
396 const bool all_faces_have_same_location =
397 local_face_locations.size() == 1;
399 if (all_faces_have_same_location)
401 cell_location = *local_face_locations.cbegin();
403 else if (contains(local_face_locations,
438 const unsigned int face_index)
450 const unsigned int n_local_dofs =
456 local_levelset_values);
466 const bool is_linear = fe_q_iso_q1 !=
nullptr ||
467 (fe_poly !=
nullptr && fe_poly->
get_degree() == 1);
473 local_levelset_values);
477 local_levelset_values);
480 local_levelset_values);
504 const unsigned int face_index)
const
529 for (
unsigned int i = 0; i < fe_collection.
size(); i++)
539 for (
unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; f++)
545 *fe_q, face_interpolation_matrix, f);
555#include "non_matching/mesh_classifier.inst"
TriaIterator< TriaAccessor< dim - 1, dim, spacedim > > face(const unsigned int i) const
unsigned int active_cell_index() const
const hp::FECollection< dim, spacedim > & get_fe_collection() const
virtual void get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix, const unsigned int face_no=0) const override
unsigned int get_degree() const
const unsigned int dofs_per_face
unsigned int n_components() const
const unsigned int n_components
LocationToLevelSet location_to_level_set(const typename Triangulation< dim >::cell_iterator &cell) const
const ObserverPointer< const Triangulation< dim > > triangulation
std::vector< LocationToLevelSet > face_locations
LocationToLevelSet determine_face_location_to_levelset(const typename Triangulation< dim >::active_cell_iterator &cell, const unsigned int face_index)
const std::unique_ptr< internal::MeshClassifierImplementation::LevelSetDescription< dim > > level_set_description
std::vector< std::array< LAPACKFullMatrix< double >, GeometryInfo< dim >::faces_per_cell > > lagrange_to_bernstein_face
std::vector< LocationToLevelSet > cell_locations
MeshClassifier(const DoFHandler< dim > &level_set_dof_handler, const VectorType &level_set)
AnalyticLevelSetDescription(const Function< dim > &level_set, const FiniteElement< dim > &element)
unsigned int active_fe_index(const typename Triangulation< dim >::active_cell_iterator &cell) const override
FEFaceValues< dim > fe_face_values
const hp::FECollection< dim > & get_fe_collection() const override
const ObserverPointer< const Function< dim > > level_set
const hp::FECollection< dim > fe_collection
void get_local_level_set_values(const typename Triangulation< dim >::active_cell_iterator &cell, const unsigned int face_index, Vector< double > &local_levelset_values) override
void get_local_level_set_values(const typename Triangulation< dim >::active_cell_iterator &cell, const unsigned int face_index, Vector< double > &local_levelset_values) override
const ObserverPointer< const DoFHandler< dim > > dof_handler
unsigned int active_fe_index(const typename Triangulation< dim >::active_cell_iterator &cell) const override
const hp::FECollection< dim > & get_fe_collection() const override
const ObserverPointer< const VectorType > level_set
DiscreteLevelSetDescription(const DoFHandler< dim > &dof_handler, const VectorType &level_set)
const Triangulation< dim, spacedim > & get_triangulation() const
virtual size_type size() const override
virtual void reinit(const size_type N, const bool omit_zeroing_entries=false)
unsigned int size() const
unsigned int n_components() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
#define DeclExceptionMsg(Exception, defaulttext)
static ::ExceptionBase & ExcNeedsLAPACK()
static ::ExceptionBase & ExcReclassifyNotCalled()
static ::ExceptionBase & ExcMessage(std::string arg1)
static ::ExceptionBase & ExcTriangulationMismatch()
#define AssertThrow(cond, exc)
TriaActiveIterator< CellAccessor< dim, spacedim > > active_cell_iterator
TriaIterator< CellAccessor< dim, spacedim > > cell_iterator
@ update_quadrature_points
Transformed quadrature points.
LocationToLevelSet location_from_dof_signs(const VectorType &local_levelset_values)
static constexpr unsigned int faces_per_cell
static VectorType::value_type get(const VectorType &V, const types::global_dof_index i)