Reference documentation for deal.II version Git 78a8940608 2021-04-17 09:24:19 -0400
\(\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 {
63  template <int dim, int spacedim>
64  class NormalProjectionManifold : public FlatManifold<dim, spacedim>
65  {
66  public:
74  NormalProjectionManifold(const TopoDS_Shape &sh,
75  const double tolerance = 1e-7);
76 
80  virtual std::unique_ptr<Manifold<dim, spacedim>>
81  clone() const override;
82 
92  virtual Point<spacedim>
94  const ArrayView<const Point<spacedim>> &surrounding_points,
95  const Point<spacedim> & candidate) const override;
96 
97 
98  protected:
105  const TopoDS_Shape sh;
106 
110  const double tolerance;
111  };
112 
132  template <int dim, int spacedim>
133  class DirectionalProjectionManifold : public FlatManifold<dim, spacedim>
134  {
135  public:
140  DirectionalProjectionManifold(const TopoDS_Shape & sh,
141  const Tensor<1, spacedim> &direction,
142  const double tolerance = 1e-7);
143 
147  virtual std::unique_ptr<Manifold<dim, spacedim>>
148  clone() const override;
149 
159  virtual Point<spacedim>
161  const ArrayView<const Point<spacedim>> &surrounding_points,
162  const Point<spacedim> & candidate) const override;
163 
164  protected:
171  const TopoDS_Shape sh;
172 
177 
181  const double tolerance;
182  };
183 
184 
227  template <int dim, int spacedim>
228  class NormalToMeshProjectionManifold : public FlatManifold<dim, spacedim>
229  {
230  public:
236  NormalToMeshProjectionManifold(const TopoDS_Shape &sh,
237  const double tolerance = 1e-7);
238 
242  virtual std::unique_ptr<Manifold<dim, spacedim>>
243  clone() const override;
244 
251  virtual Point<spacedim>
253  const ArrayView<const Point<spacedim>> &surrounding_points,
254  const Point<spacedim> & candidate) const override;
255 
256  protected:
263  const TopoDS_Shape sh;
264 
268  const double tolerance;
269  };
270 
288  template <int dim, int spacedim>
289  class ArclengthProjectionLineManifold : public ChartManifold<dim, spacedim, 1>
290  {
291  public:
295  ArclengthProjectionLineManifold(const TopoDS_Shape &sh,
296  const double tolerance = 1e-7);
297 
301  virtual std::unique_ptr<Manifold<dim, spacedim>>
302  clone() const override;
303 
309  virtual Point<1>
310  pull_back(const Point<spacedim> &space_point) const override;
311 
315  virtual Point<spacedim>
316  push_forward(const Point<1> &chart_point) const override;
317 
318  protected:
322  const TopoDS_Shape sh;
323 
328  Handle_Adaptor3d_HCurve curve;
329 
333  const double tolerance;
334 
339  const double length;
340  };
341 
347  template <int dim, int spacedim>
348  class NURBSPatchManifold : public ChartManifold<dim, spacedim, 2>
349  {
350  public:
356  NURBSPatchManifold(const TopoDS_Face &face, const double tolerance = 1e-7);
357 
361  virtual std::unique_ptr<Manifold<dim, spacedim>>
362  clone() const override;
363 
368  virtual Point<2>
369  pull_back(const Point<spacedim> &space_point) const override;
370 
375  virtual Point<spacedim>
376  push_forward(const Point<2> &chart_point) const override;
377 
391  push_forward_gradient(const Point<2> &chart_point) const override;
392 
393  protected:
398  std::tuple<double, double, double, double>
399  get_uv_bounds() const;
400 
404  TopoDS_Face face;
405 
410  double tolerance;
411  };
412 
413 } // namespace OpenCASCADE
414 
418 
419 
420 #endif // DEAL_II_WITH_OPENCASCADE
421 #endif // dealii_occ_manifold_lib_h
Point< dim > push_forward(const TopoDS_Shape &in_shape, const double u, const double v)
Definition: utilities.cc:827
const Tensor< 1, spacedim > direction
Definition: manifold_lib.h:176
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
NormalProjectionManifold(const TopoDS_Shape &sh, const double tolerance=1e-7)
Definition: manifold_lib.cc:80
virtual Point< spacedim > project_to_manifold(const ArrayView< const Point< spacedim >> &surrounding_points, const Point< spacedim > &candidate) const override
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:396
Tensor< 1, dim, Number > pull_back(const Tensor< 1, dim, Number > &v, const Tensor< 2, dim, Number > &F)
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:395
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
Definition: manifold_lib.cc:93