21#ifdef DEAL_II_WITH_OPENCASCADE
24# include <BRepAdaptor_CompCurve.hxx>
25# include <BRepAdaptor_Curve.hxx>
26# if !DEAL_II_OPENCASCADE_VERSION_GTE(7, 6, 0)
27# include <BRepAdaptor_HCompCurve.hxx>
28# include <BRepAdaptor_HCurve.hxx>
30# include <BRepTools.hxx>
31# include <BRep_Tool.hxx>
32# include <GCPnts_AbscissaPoint.hxx>
33# include <ShapeAnalysis_Curve.hxx>
34# include <ShapeAnalysis_Surface.hxx>
36# if !DEAL_II_OPENCASCADE_VERSION_GTE(7, 0, 0)
37# include <Handle_Adaptor3d_HCurve.hxx>
53# if DEAL_II_OPENCASCADE_VERSION_GTE(7, 6, 0)
54 Handle_Adaptor3d_Curve
95# if DEAL_II_OPENCASCADE_VERSION_GTE(7, 6, 0)
106 template <
int dim,
int spacedim>
109 const double tolerance)
111 , tolerance(tolerance)
118 template <
int dim,
int spacedim>
119 std::unique_ptr<Manifold<dim, spacedim>>
122 return std::unique_ptr<Manifold<dim, spacedim>>(
128 template <
int dim,
int spacedim>
147 template <
int dim,
int spacedim>
151 const double tolerance)
153 , direction(direction)
154 , tolerance(tolerance)
161 template <
int dim,
int spacedim>
162 std::unique_ptr<Manifold<dim, spacedim>>
165 return std::unique_ptr<Manifold<dim, spacedim>>(
171 template <
int dim,
int spacedim>
191 template <
int dim,
int spacedim>
194 const double tolerance)
196 , tolerance(tolerance)
202 "NormalToMeshProjectionManifold needs a shape containing faces to operate."));
205 template <
int dim,
int spacedim>
206 std::unique_ptr<Manifold<dim, spacedim>>
209 return std::unique_ptr<Manifold<dim, spacedim>>(
216 template <
int spacedim>
231 const double tolerance,
235 constexpr int spacedim = 3;
266 "Failed to refine cell: the average of the surface normals at the surrounding edge turns out to be a null vector, making the projection direction undetermined."));
278 const double n1_coords[3] = {
u[1] * v[2] -
u[2] * v[1],
279 u[2] * v[0] -
u[0] * v[2],
280 u[0] * v[1] -
u[1] * v[0]};
285 const double n2_coords[3] = {
u[1] * v[2] -
u[2] * v[1],
286 u[2] * v[0] -
u[0] * v[2],
287 u[0] * v[1] -
u[1] * v[0]};
296 "Failed to refine cell: the normal estimated via the surrounding points turns out to be a null vector, making the projection direction undetermined."));
305 const double n1_coords[3] = {
u[1] * v[2] -
u[2] * v[1],
306 u[2] * v[0] -
u[0] * v[2],
307 u[0] * v[1] -
u[1] * v[0]};
312 const double n2_coords[3] = {
u[1] * v[2] -
u[2] * v[1],
313 u[2] * v[0] -
u[0] * v[2],
314 u[0] * v[1] -
u[1] * v[0]};
319 const double n3_coords[3] = {
u[1] * v[2] -
u[2] * v[1],
320 u[2] * v[0] -
u[0] * v[2],
321 u[0] * v[1] -
u[1] * v[0]};
326 const double n4_coords[3] = {
u[1] * v[2] -
u[2] * v[1],
327 u[2] * v[0] -
u[0] * v[2],
328 u[0] * v[1] -
u[1] * v[0]};
337 "Failed to refine cell: the normal estimated via the surrounding points turns out to be a null vector, making the projection direction undetermined."));
350 if (
k !=
j &&
k != i)
356 const double n_coords[3] = {
u[1] * v[2] -
u[2] * v[1],
357 u[2] * v[0] -
u[0] * v[2],
361 if (
n1.norm() > tolerance)
382 "Failed to compute a normal: the normal estimated via the surrounding points turns out to be a null vector, making the projection direction undetermined."));
393 template <
int dim,
int spacedim>
407 template <
int dim,
int spacedim>
410 const double tolerance)
417 , tolerance(tolerance)
425 template <
int dim,
int spacedim>
426 std::unique_ptr<Manifold<dim, spacedim>>
429 return std::unique_ptr<Manifold<dim, spacedim>>(
435 template <
int dim,
int spacedim>
457 *curve, curve->FirstParameter(), t));
459 curve->GetCurve(), curve->GetCurve().FirstParameter(), t));
465 template <
int dim,
int spacedim>
470# if DEAL_II_OPENCASCADE_VERSION_GTE(7, 6, 0)
472 gp_Pnt P = curve->Value(
AP.Parameter());
476 curve->GetCurve().FirstParameter());
477 gp_Pnt P = curve->GetCurve().Value(
AP.Parameter());
483 template <
int dim,
int spacedim>
485 const double tolerance)
487 , tolerance(tolerance)
492 template <
int dim,
int spacedim>
493 std::unique_ptr<Manifold<dim, spacedim>>
496 return std::unique_ptr<Manifold<dim, spacedim>>(
502 template <
int dim,
int spacedim>
518 template <
int dim,
int spacedim>
523 return ::OpenCASCADE::push_forward<spacedim>(face,
528 template <
int dim,
int spacedim>
547 "Expecting derivative along Z to be zero! Bailing out."));
555 "Expecting derivative along Z to be zero! Bailing out."));
559 template <
int dim,
int spacedim>
560 std::tuple<double, double, double, double>
569# include "manifold_lib.inst"
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
virtual Point< spacedim > push_forward(const Point< 1 > &chart_point) const override
ArclengthProjectionLineManifold(const TopoDS_Shape &sh, const double tolerance=1e-7)
virtual Point< 1 > pull_back(const Point< spacedim > &space_point) const override
virtual Point< spacedim > project_to_manifold(const ArrayView< const Point< spacedim > > &surrounding_points, const Point< spacedim > &candidate) const override
DirectionalProjectionManifold(const TopoDS_Shape &sh, const Tensor< 1, spacedim > &direction, const double tolerance=1e-7)
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
std::tuple< double, double, double, double > get_uv_bounds() const
virtual Point< 2 > pull_back(const Point< spacedim > &space_point) const override
virtual Point< spacedim > push_forward(const Point< 2 > &chart_point) const override
NURBSPatchManifold(const TopoDS_Face &face, const double tolerance=1e-7)
virtual DerivativeForm< 1, 2, spacedim > push_forward_gradient(const Point< 2 > &chart_point) const override
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
virtual Point< spacedim > project_to_manifold(const ArrayView< const Point< spacedim > > &surrounding_points, const Point< spacedim > &candidate) const override
NormalProjectionManifold(const TopoDS_Shape &sh, const double tolerance=1e-7)
virtual Point< spacedim > project_to_manifold(const ArrayView< const Point< spacedim > > &surrounding_points, const Point< spacedim > &candidate) const override
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
NormalToMeshProjectionManifold(const TopoDS_Shape &sh, const double tolerance=1e-7)
numbers::NumberTraits< Number >::real_type norm() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_OPENCASCADE_VERSION_GTE(major, minor, subminor)
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcImpossibleInDimSpacedim(int arg1, int arg2)
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcUnsupportedShape()
static ::ExceptionBase & ExcMessage(std::string arg1)
std::tuple< unsigned int, unsigned int, unsigned int > count_elements(const TopoDS_Shape &shape)
std::tuple< Point< 3 >, Tensor< 1, 3 >, double, double > closest_point_and_differential_forms(const TopoDS_Shape &in_shape, const Point< 3 > &origin, const double tolerance=1e-7)
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
Point< dim > closest_point(const TopoDS_Shape &in_shape, const Point< dim > &origin, const double tolerance=1e-7)
Point< dim > line_intersection(const TopoDS_Shape &in_shape, const Point< dim > &origin, const Tensor< 1, dim > &direction, const double tolerance=1e-7)
::VectorizedArray< Number, width > max(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)