Nektar++
Loading...
Searching...
No Matches
CADSurfOCE.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////////////
2//
3// File: CADSurfOCE.h
4//
5// For more information, please see: http://www.nektar.info/
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: CAD object surface.
32//
33////////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_SPATIALDOMAINS_CADSYSTEM_OCE_CADSURFOCE
36#define NEKTAR_SPATIALDOMAINS_CADSYSTEM_OCE_CADSURFOCE
37
40
42{
43
44class CADSurfOCE : public CADSurf
45{
46public:
51
52 static std::string key;
53
55 {
56 }
57
58 ~CADSurfOCE() override
59 {
60 }
61
62 void Initialise(int i, TopoDS_Shape in);
63
64 std::array<NekDouble, 4> GetBounds() override;
65 void GetBounds(NekDouble &umin, NekDouble &umax, NekDouble &vmin,
66 NekDouble &vmax) override;
67 std::array<NekDouble, 3> N(std::array<NekDouble, 2> uv) override;
68 std::array<NekDouble, 9> D1(std::array<NekDouble, 2> uv) override;
69 std::array<NekDouble, 18> D2(std::array<NekDouble, 2> uv) override;
70 std::array<NekDouble, 3> P(std::array<NekDouble, 2> uv) override;
71 void P(std::array<NekDouble, 2> uv, NekDouble &x, NekDouble &y,
72 NekDouble &z) override;
73 std::array<NekDouble, 2> locuv(std::array<NekDouble, 3> p,
74 NekDouble &dist) override;
75 NekDouble Curvature(std::array<NekDouble, 2> uv) override;
76
77 NekDouble CurvatureAndPosition(std::array<NekDouble, 2> uv,
78 std::array<NekDouble, 3> &loc) override;
79
80 std::array<NekDouble, 2> locuvOnCurve(const CADCurveSharedPtr &curve,
81 NekDouble t) override;
82
83 std::array<NekDouble, 2> locuvFrom(std::array<NekDouble, 3> p,
84 std::array<NekDouble, 2> guess,
85 NekDouble &dist) override;
86 std::array<NekDouble, 6> BoundingBox() override;
87 std::array<NekDouble, 6> BoundingBox(NekDouble scale) override;
88 bool IsPlanar() override;
89 std::array<NekDouble, 2> locuv(std::array<NekDouble, 3> p, NekDouble &dist,
90 NekDouble Umin, NekDouble Usup,
91 NekDouble Vmin, NekDouble Vsup) override;
92
93private:
94 /// Function which tests the the value of uv used is within the surface
95 void Test(std::array<NekDouble, 2> uv) override;
96 /// OpenCascade object for surface.
97 Handle(Geom_Surface) m_s;
98 /// parametric bounds
99 std::array<NekDouble, 4> m_bounds;
100 /// locuv object (stored because it gets faster with stored information)
101 ShapeAnalysis_Surface *m_sas;
102 /// original shape
103 TopoDS_Shape m_shape;
104 ///
105 BRepTopAdaptor_FClass2d *m_2Dclass;
106 /// True if we're a transfinite surface (used for Geo)
108};
109
110} // namespace Nektar::SpatialDomains
111
112#endif
#define N
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
base class for a cad surface
Definition CADSurf.h:70
bool IsPlanar() override
Is the surface defined by a planar surface (i.e not nurbs and is flat)
void Test(std::array< NekDouble, 2 > uv) override
Function which tests the the value of uv used is within the surface.
Handle(Geom_Surface) m_s
OpenCascade object for surface.
std::array< NekDouble, 2 > locuv(std::array< NekDouble, 3 > p, NekDouble &dist) override
Performs a reverse look up to find u,v and x,y,z. if xyz is off the surface it will return the closes...
NekDouble Curvature(std::array< NekDouble, 2 > uv) override
returns curvature at point uv
TopoDS_Shape m_shape
original shape
Definition CADSurfOCE.h:103
std::array< NekDouble, 6 > BoundingBox() override
Returns the bounding box of the surface.
std::array< NekDouble, 4 > m_bounds
parametric bounds
Definition CADSurfOCE.h:99
void Initialise(int i, TopoDS_Shape in)
NekDouble CurvatureAndPosition(std::array< NekDouble, 2 > uv, std::array< NekDouble, 3 > &loc) override
std::array< NekDouble, 2 > locuvOnCurve(const CADCurveSharedPtr &curve, NekDouble t) override
std::array< NekDouble, 18 > D2(std::array< NekDouble, 2 > uv) override
Get the set of second derivatives at parametric point u,v.
ShapeAnalysis_Surface * m_sas
locuv object (stored because it gets faster with stored information)
Definition CADSurfOCE.h:101
std::array< NekDouble, 9 > D1(std::array< NekDouble, 2 > uv) override
Get the set of first derivatives at parametric point u,v.
static CADSurfSharedPtr create()
Definition CADSurfOCE.h:47
bool m_isTransfiniteSurf
True if we're a transfinite surface (used for Geo)
Definition CADSurfOCE.h:107
std::array< NekDouble, 2 > locuvFrom(std::array< NekDouble, 3 > p, std::array< NekDouble, 2 > guess, NekDouble &dist) override
Curvature and position at uv together.
std::array< NekDouble, 4 > GetBounds() override
Get the limits of the parametric space for the surface.
BRepTopAdaptor_FClass2d * m_2Dclass
Definition CADSurfOCE.h:105
std::shared_ptr< CADCurve > CADCurveSharedPtr
Definition CADCurve.h:247
std::shared_ptr< CADSurf > CADSurfSharedPtr
Definition CADCurve.h:51