15#ifndef dealii_tria_manifold_h
16#define dealii_tria_manifold_h
35template <
int,
typename>
51 template <
typename MeshIteratorType>
52 inline constexpr std::size_t
110 template <
typename MeshIteratorType>
111 std::pair<std::array<Point<MeshIteratorType::AccessorType::space_dimension>,
113 std::array<double, n_default_points_per_cell<MeshIteratorType>()>>
115 const bool with_interpolation =
false);
284template <
int dim,
int spacedim = dim>
289 static_assert(dim <= spacedim,
290 "The dimension <dim> of a Manifold must be less than or "
291 "equal to the space dimension <spacedim> in which it lives.");
320 virtual std::unique_ptr<Manifold<dim, spacedim>>
348 const double w)
const;
633template <
int dim,
int spacedim = dim>
670 virtual std::unique_ptr<Manifold<dim, spacedim>>
808 <<
"The component number " << arg1 <<
" of the point [ "
809 << arg2 <<
" ] is not in the interval [ 0, " << arg3
810 <<
"), bailing out.");
906template <
int dim,
int spacedim = dim,
int chartdim = dim>
911 static_assert(dim <= spacedim,
912 "The dimension <dim> of a ChartManifold must be less than or "
913 "equal to the space dimension <spacedim> in which it lives.");
944 const double w)
const override;
1142template <
int dim,
int spacedim>
1153 template <
typename MeshIteratorType>
1154 std::pair<std::array<Point<MeshIteratorType::AccessorType::space_dimension>,
1156 std::array<double, n_default_points_per_cell<MeshIteratorType>()>>
1158 const bool with_interpolation)
1160 const int dim = MeshIteratorType::AccessorType::structure_dimension;
1161 const int spacedim = MeshIteratorType::AccessorType::space_dimension;
1162 constexpr std::size_t points_per_cell =
1165 std::pair<std::array<Point<spacedim>, points_per_cell>,
1166 std::array<double, points_per_cell>>
1179 points_weights.first[0] = iterator->vertex(0);
1180 points_weights.second[0] = .5;
1181 points_weights.first[1] = iterator->vertex(1);
1182 points_weights.second[1] = .5;
1188 for (
unsigned int i = 0; i < 4; ++i)
1190 points_weights.first[i] = iterator->vertex(i);
1191 points_weights.first[4 + i] =
1192 (iterator->line(i)->has_children() ?
1193 iterator->line(i)->child(0)->vertex(1) :
1194 iterator->line(i)->get_manifold().get_new_point_on_line(
1195 iterator->line(i)));
1198 if (with_interpolation)
1200 std::fill(points_weights.second.begin(),
1201 points_weights.second.begin() + 4,
1203 std::fill(points_weights.second.begin() + 4,
1204 points_weights.second.end(),
1208 std::fill(points_weights.second.begin(),
1209 points_weights.second.end(),
1221 auto *sp3 =
reinterpret_cast<
1223 *>(&points_weights.first);
1232 if (with_interpolation)
1234 for (
unsigned int i = 0;
1235 i < GeometryInfo<dim>::vertices_per_cell;
1238 (*sp3)[j] = hex->vertex(i);
1239 points_weights.second[j] = 1.0 / 8.0;
1241 for (
unsigned int i = 0; i < GeometryInfo<dim>::lines_per_cell;
1245 (hex->line(i)->has_children() ?
1246 hex->line(i)->child(0)->vertex(1) :
1247 hex->line(i)->get_manifold().get_new_point_on_line(
1249 points_weights.second[j] = -1.0 / 4.0;
1251 for (
unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell;
1255 (hex->quad(i)->has_children() ?
1256 hex->quad(i)->isotropic_child(0)->vertex(3) :
1257 hex->quad(i)->get_manifold().get_new_point_on_quad(
1259 points_weights.second[j] = 1.0 / 2.0;
1265 std::fill(points_weights.second.begin(),
1266 points_weights.second.end(),
1274 return points_weights;
virtual Point< spacedim > push_forward(const Point< chartdim > &chart_point) const =0
const FlatManifold< chartdim, chartdim > sub_manifold
ChartManifold(const Tensor< 1, chartdim > &periodicity=Tensor< 1, chartdim >())
virtual void get_new_points(const ArrayView< const Point< spacedim > > &surrounding_points, const Table< 2, double > &weights, ArrayView< Point< spacedim > > new_points) const override
virtual Point< chartdim > pull_back(const Point< spacedim > &space_point) const =0
virtual Tensor< 1, spacedim > get_tangent_vector(const Point< spacedim > &x1, const Point< spacedim > &x2) const override
virtual DerivativeForm< 1, chartdim, spacedim > push_forward_gradient(const Point< chartdim > &chart_point) const
const Tensor< 1, chartdim > & get_periodicity() const
virtual ~ChartManifold() override=default
virtual Point< spacedim > get_intermediate_point(const Point< spacedim > &p1, const Point< spacedim > &p2, const double w) const override
virtual Point< spacedim > get_new_point(const ArrayView< const Point< spacedim > > &surrounding_points, const ArrayView< const double > &weights) const override
virtual Tensor< 1, spacedim > normal_vector(const typename Triangulation< dim, spacedim >::face_iterator &face, const Point< spacedim > &p) const override
virtual void get_normals_at_vertices(const typename Triangulation< dim, spacedim >::face_iterator &face, typename Manifold< dim, spacedim >::FaceVertexNormals &face_vertex_normals) const override
virtual Tensor< 1, spacedim > get_tangent_vector(const Point< spacedim > &x1, const Point< spacedim > &x2) const override
double get_tolerance() const
virtual Point< spacedim > project_to_manifold(const ArrayView< const Point< spacedim > > &points, const Point< spacedim > &candidate) const override
const Tensor< 1, spacedim > & get_periodicity() const
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
virtual Point< spacedim > get_new_point(const ArrayView< const Point< spacedim > > &surrounding_points, const ArrayView< const double > &weights) const override
const Tensor< 1, spacedim > periodicity
FlatManifold(const Tensor< 1, spacedim > &periodicity=Tensor< 1, spacedim >(), const double tolerance=1e-10)
virtual void get_new_points(const ArrayView< const Point< spacedim > > &surrounding_points, const Table< 2, double > &weights, ArrayView< Point< spacedim > > new_points) const override
virtual Point< spacedim > get_new_point_on_hex(const typename Triangulation< dim, spacedim >::hex_iterator &hex) const
virtual Point< spacedim > get_new_point_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line) const
virtual Point< spacedim > project_to_manifold(const ArrayView< const Point< spacedim > > &surrounding_points, const Point< spacedim > &candidate) const
virtual void get_new_points(const ArrayView< const Point< spacedim > > &surrounding_points, const Table< 2, double > &weights, ArrayView< Point< spacedim > > new_points) const
virtual void get_normals_at_vertices(const typename Triangulation< dim, spacedim >::face_iterator &face, FaceVertexNormals &face_vertex_normals) const
virtual ~Manifold() override=default
virtual Tensor< 1, spacedim > get_tangent_vector(const Point< spacedim > &x1, const Point< spacedim > &x2) const
virtual Point< spacedim > get_intermediate_point(const Point< spacedim > &p1, const Point< spacedim > &p2, const double w) const
Point< spacedim > get_new_point_on_face(const typename Triangulation< dim, spacedim >::face_iterator &face) const
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const =0
virtual Point< spacedim > get_new_point_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad) const
virtual Tensor< 1, spacedim > normal_vector(const typename Triangulation< dim, spacedim >::face_iterator &face, const Point< spacedim > &p) const
std::array< Tensor< 1, spacedim >, GeometryInfo< dim >::vertices_per_face > FaceVertexNormals
Point< spacedim > get_new_point_on_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
virtual Point< spacedim > get_new_point(const ArrayView< const Point< spacedim > > &surrounding_points, const ArrayView< const double > &weights) const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcPeriodicBox(int arg1, Point< spacedim > arg2, double arg3)
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
#define DeclException3(Exception3, type1, type2, type3, outsequence)
typename IteratorSelector::hex_iterator hex_iterator
typename IteratorSelector::quad_iterator quad_iterator
typename IteratorSelector::line_iterator line_iterator
#define DEAL_II_ASSERT_UNREACHABLE()
std::pair< std::array< Point< MeshIteratorType::AccessorType::space_dimension >, n_default_points_per_cell< MeshIteratorType >()>, std::array< double, n_default_points_per_cell< MeshIteratorType >()> > get_default_points_and_weights(const MeshIteratorType &iterator, const bool with_interpolation=false)
constexpr std::size_t n_default_points_per_cell()