Reference documentation for deal.II version 8.4.2
boundary_lib.h
1 // ---------------------------------------------------------------------
2 // @f$Id@f$
3 //
4 // Copyright (C) 2014 - 2015 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // The deal.II library is free software; you can use it, redistribute
9 // it, and/or modify it under the terms of the GNU Lesser General
10 // Public License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 // The full text of the license can be found in the file LICENSE at
13 // the top level of the deal.II distribution.
14 //
15 // ---------------------------------------------------------------------
16 
17 
18 #ifndef dealii__occ_boundary_lib_h
19 #define dealii__occ_boundary_lib_h
20 
21 #include <deal.II/base/config.h>
22 
23 #ifdef DEAL_II_WITH_OPENCASCADE
24 
25 #include <deal.II/opencascade/utilities.h>
26 #include <deal.II/grid/tria_boundary.h>
27 
28 // opencascade needs "HAVE_CONFIG_H" to be exported...
29 #define HAVE_CONFIG_H
30 #include <BRepAdaptor_Curve.hxx>
31 #include <Adaptor3d_Curve.hxx>
32 #undef HAVE_CONFIG_H
33 
34 DEAL_II_NAMESPACE_OPEN
35 
41 namespace OpenCASCADE
42 {
64  template <int dim, int spacedim>
65  class NormalProjectionBoundary : public Boundary<dim,spacedim>
66  {
67  public:
68 
76  NormalProjectionBoundary(const TopoDS_Shape &sh,
77  const double tolerance=1e-7);
78 
88  virtual Point<spacedim>
89  project_to_manifold (const std::vector<Point<spacedim> > &surrounding_points,
90  const Point<spacedim> &candidate) const;
91 
92 
93  private:
100  const TopoDS_Shape sh;
101 
105  const double tolerance;
106  };
107 
129  template <int dim, int spacedim>
130  class DirectionalProjectionBoundary : public Boundary<dim,spacedim>
131  {
132  public:
137  DirectionalProjectionBoundary(const TopoDS_Shape &sh,
138  const Tensor<1,spacedim> &direction,
139  const double tolerance=1e-7);
140 
150  virtual Point<spacedim>
151  project_to_manifold (const std::vector<Point<spacedim> > &surrounding_points,
152  const Point<spacedim> &candidate) const;
153 
154  private:
161  const TopoDS_Shape sh;
162 
167 
171  const double tolerance;
172  };
173 
174 
219  template <int dim, int spacedim>
220  class NormalToMeshProjectionBoundary : public Boundary<dim,spacedim>
221  {
222  public:
228  NormalToMeshProjectionBoundary(const TopoDS_Shape &sh,
229  const double tolerance=1e-7);
230 
237  virtual Point<spacedim>
238  project_to_manifold (const std::vector<Point<spacedim> > &surrounding_points,
239  const Point<spacedim> &candidate) const;
240 
241  private:
248  const TopoDS_Shape sh;
249 
254 
258  const double tolerance;
259  };
260 
280  template <int dim, int spacedim>
281  class ArclengthProjectionLineManifold : public ChartManifold<dim,spacedim,1>
282  {
283  public:
287  ArclengthProjectionLineManifold(const TopoDS_Shape &sh,
288  const double tolerance=1e-7);
289 
295  virtual Point<1>
296  pull_back(const Point<spacedim> &space_point) const;
297 
301  virtual Point<spacedim>
302  push_forward(const Point<1> &chart_point) const;
303 
304  private:
309  Handle_Adaptor3d_HCurve curve;
310 
314  const double tolerance;
315 
320  const double length;
321  };
322 }
323 
326 DEAL_II_NAMESPACE_CLOSE
327 
328 
329 #endif // DEAL_II_WITH_OPENCASCADE
330 
331 /*------------------------------ occ_boundary_lib.h ------------------------------*/
332 #endif
333 /*------------------------------ occ_boundary_lib.h ------------------------------*/
Point< 3 > push_forward(const TopoDS_Shape &in_shape, const double u, const double v)
Definition: utilities.cc:567
Definition: tria.h:46
virtual Point< spacedim > project_to_manifold(const std::vector< Point< spacedim > > &surrounding_points, const Point< spacedim > &candidate) const
Definition: boundary_lib.cc:68
NormalProjectionBoundary(const TopoDS_Shape &sh, const double tolerance=1e-7)
Definition: boundary_lib.cc:57