Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
manifold_lib.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2014 - 2020 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 
17 #ifndef dealii_occ_manifold_lib_h
18 #define dealii_occ_manifold_lib_h
19 
20 #include <deal.II/base/config.h>
21 
22 #ifdef DEAL_II_WITH_OPENCASCADE
23 
24 # include <deal.II/grid/manifold.h>
25 
27 
28 // opencascade needs "HAVE_CONFIG_H" to be exported...
29 # define HAVE_CONFIG_H
30 # include <Adaptor3d_Curve.hxx>
31 # include <Adaptor3d_HCurve.hxx>
32 # include <BRepAdaptor_Curve.hxx>
33 # undef HAVE_CONFIG_H
34 
36 
42 namespace OpenCASCADE
43 {
65  template <int dim, int spacedim>
66  class NormalProjectionManifold : public FlatManifold<dim, spacedim>
67  {
68  public:
76  NormalProjectionManifold(const TopoDS_Shape &sh,
77  const double tolerance = 1e-7);
78 
82  virtual std::unique_ptr<Manifold<dim, spacedim>>
83  clone() const override;
84 
94  virtual Point<spacedim>
96  const ArrayView<const Point<spacedim>> &surrounding_points,
97  const Point<spacedim> & candidate) const override;
98 
99 
100  protected:
107  const TopoDS_Shape sh;
108 
112  const double tolerance;
113  };
114 
136  template <int dim, int spacedim>
137  class DirectionalProjectionManifold : public FlatManifold<dim, spacedim>
138  {
139  public:
144  DirectionalProjectionManifold(const TopoDS_Shape & sh,
146  const double tolerance = 1e-7);
147 
151  virtual std::unique_ptr<Manifold<dim, spacedim>>
152  clone() const override;
153 
163  virtual Point<spacedim>
165  const ArrayView<const Point<spacedim>> &surrounding_points,
166  const Point<spacedim> & candidate) const override;
167 
168  protected:
175  const TopoDS_Shape sh;
176 
181 
185  const double tolerance;
186  };
187 
188 
233  template <int dim, int spacedim>
234  class NormalToMeshProjectionManifold : public FlatManifold<dim, spacedim>
235  {
236  public:
242  NormalToMeshProjectionManifold(const TopoDS_Shape &sh,
243  const double tolerance = 1e-7);
244 
248  virtual std::unique_ptr<Manifold<dim, spacedim>>
249  clone() const override;
250 
257  virtual Point<spacedim>
259  const ArrayView<const Point<spacedim>> &surrounding_points,
260  const Point<spacedim> & candidate) const override;
261 
262  protected:
269  const TopoDS_Shape sh;
270 
274  const double tolerance;
275  };
276 
296  template <int dim, int spacedim>
297  class ArclengthProjectionLineManifold : public ChartManifold<dim, spacedim, 1>
298  {
299  public:
303  ArclengthProjectionLineManifold(const TopoDS_Shape &sh,
304  const double tolerance = 1e-7);
305 
309  virtual std::unique_ptr<Manifold<dim, spacedim>>
310  clone() const override;
311 
317  virtual Point<1>
318  pull_back(const Point<spacedim> &space_point) const override;
319 
323  virtual Point<spacedim>
324  push_forward(const Point<1> &chart_point) const override;
325 
326  protected:
330  const TopoDS_Shape sh;
331 
336  Handle_Adaptor3d_HCurve curve;
337 
341  const double tolerance;
342 
347  const double length;
348  };
349 
357  template <int dim, int spacedim>
358  class NURBSPatchManifold : public ChartManifold<dim, spacedim, 2>
359  {
360  public:
366  NURBSPatchManifold(const TopoDS_Face &face, const double tolerance = 1e-7);
367 
371  virtual std::unique_ptr<Manifold<dim, spacedim>>
372  clone() const override;
373 
378  virtual Point<2>
379  pull_back(const Point<spacedim> &space_point) const override;
380 
385  virtual Point<spacedim>
386  push_forward(const Point<2> &chart_point) const override;
387 
401  push_forward_gradient(const Point<2> &chart_point) const override;
402 
403  protected:
408  std::tuple<double, double, double, double>
409  get_uv_bounds() const;
410 
414  TopoDS_Face face;
415 
420  double tolerance;
421  };
422 
423 } // namespace OpenCASCADE
424 
428 
429 
430 #endif // DEAL_II_WITH_OPENCASCADE
431 #endif // dealii_occ_manifold_lib_h
OpenCASCADE::NormalProjectionManifold::tolerance
const double tolerance
Definition: manifold_lib.h:112
OpenCASCADE::DirectionalProjectionManifold::clone
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
Definition: manifold_lib.cc:136
OpenCASCADE::NURBSPatchManifold::get_uv_bounds
std::tuple< double, double, double, double > get_uv_bounds() const
Definition: manifold_lib.cc:517
OpenCASCADE::DirectionalProjectionManifold
Definition: manifold_lib.h:137
OpenCASCADE::NormalToMeshProjectionManifold::NormalToMeshProjectionManifold
NormalToMeshProjectionManifold(const TopoDS_Shape &sh, const double tolerance=1e-7)
Definition: manifold_lib.cc:165
OpenCASCADE::ArclengthProjectionLineManifold::length
const double length
Definition: manifold_lib.h:347
ChartManifold
Definition: manifold.h:951
OpenCASCADE::NormalProjectionManifold::project_to_manifold
virtual Point< spacedim > project_to_manifold(const ArrayView< const Point< spacedim >> &surrounding_points, const Point< spacedim > &candidate) const override
Definition: manifold_lib.cc:103
ArrayView
Definition: array_view.h:77
Physics::Elasticity::Kinematics::e
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
OpenCASCADE::NURBSPatchManifold::tolerance
double tolerance
Definition: manifold_lib.h:420
OpenCASCADE::ArclengthProjectionLineManifold::push_forward
virtual Point< spacedim > push_forward(const Point< 1 > &chart_point) const override
Definition: manifold_lib.cc:429
OpenCASCADE::NormalToMeshProjectionManifold
Definition: manifold_lib.h:234
OpenCASCADE::NURBSPatchManifold::NURBSPatchManifold
NURBSPatchManifold(const TopoDS_Face &face, const double tolerance=1e-7)
Definition: manifold_lib.cc:440
OpenCASCADE::ArclengthProjectionLineManifold::ArclengthProjectionLineManifold
ArclengthProjectionLineManifold(const TopoDS_Shape &sh, const double tolerance=1e-7)
Definition: manifold_lib.cc:382
DerivativeForm
Definition: derivative_form.h:60
OpenCASCADE::NURBSPatchManifold::push_forward_gradient
virtual DerivativeForm< 1, 2, spacedim > push_forward_gradient(const Point< 2 > &chart_point) const override
Definition: manifold_lib.cc:486
OpenCASCADE::NURBSPatchManifold
Definition: manifold_lib.h:358
OpenCASCADE::DirectionalProjectionManifold::sh
const TopoDS_Shape sh
Definition: manifold_lib.h:175
OpenCASCADE::NormalProjectionManifold
Definition: manifold_lib.h:66
OpenCASCADE::NURBSPatchManifold::pull_back
virtual Point< 2 > pull_back(const Point< spacedim > &space_point) const override
Definition: manifold_lib.cc:460
Tensor< 1, spacedim >
OpenCASCADE::ArclengthProjectionLineManifold::tolerance
const double tolerance
Definition: manifold_lib.h:341
OpenCASCADE::DirectionalProjectionManifold::DirectionalProjectionManifold
DirectionalProjectionManifold(const TopoDS_Shape &sh, const Tensor< 1, spacedim > &direction, const double tolerance=1e-7)
Definition: manifold_lib.cc:121
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
OpenCASCADE::NURBSPatchManifold::push_forward
virtual Point< spacedim > push_forward(const Point< 2 > &chart_point) const override
Definition: manifold_lib.cc:476
OpenCASCADE::ArclengthProjectionLineManifold::pull_back
virtual Point< 1 > pull_back(const Point< spacedim > &space_point) const override
Definition: manifold_lib.cc:410
OpenCASCADE
Definition: boundary_lib.h:33
OpenCASCADE::NormalProjectionManifold::NormalProjectionManifold
NormalProjectionManifold(const TopoDS_Shape &sh, const double tolerance=1e-7)
Definition: manifold_lib.cc:80
manifold.h
FlatManifold
Definition: manifold.h:682
OpenCASCADE::ArclengthProjectionLineManifold::sh
const TopoDS_Shape sh
Definition: manifold_lib.h:330
OpenCASCADE::DirectionalProjectionManifold::project_to_manifold
virtual Point< spacedim > project_to_manifold(const ArrayView< const Point< spacedim >> &surrounding_points, const Point< spacedim > &candidate) const override
Definition: manifold_lib.cc:146
OpenCASCADE::NormalToMeshProjectionManifold::tolerance
const double tolerance
Definition: manifold_lib.h:274
OpenCASCADE::ArclengthProjectionLineManifold::clone
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
Definition: manifold_lib.cc:400
OpenCASCADE::NURBSPatchManifold::clone
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
Definition: manifold_lib.cc:450
OpenCASCADE::NormalProjectionManifold::clone
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
Definition: manifold_lib.cc:93
OpenCASCADE::NormalToMeshProjectionManifold::sh
const TopoDS_Shape sh
Definition: manifold_lib.h:269
OpenCASCADE::NormalToMeshProjectionManifold::clone
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
Definition: manifold_lib.cc:180
Point< spacedim >
OpenCASCADE::ArclengthProjectionLineManifold
Definition: manifold_lib.h:297
OpenCASCADE::NURBSPatchManifold::face
TopoDS_Face face
Definition: manifold_lib.h:414
config.h
OpenCASCADE::DirectionalProjectionManifold::tolerance
const double tolerance
Definition: manifold_lib.h:185
OpenCASCADE::DirectionalProjectionManifold::direction
const Tensor< 1, spacedim > direction
Definition: manifold_lib.h:180
OpenCASCADE::NormalProjectionManifold::sh
const TopoDS_Shape sh
Definition: manifold_lib.h:107
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
OpenCASCADE::ArclengthProjectionLineManifold::curve
Handle_Adaptor3d_HCurve curve
Definition: manifold_lib.h:336
utilities.h
OpenCASCADE::NormalToMeshProjectionManifold::project_to_manifold
virtual Point< spacedim > project_to_manifold(const ArrayView< const Point< spacedim >> &surrounding_points, const Point< spacedim > &candidate) const override
Definition: manifold_lib.cc:368