35#ifndef NEKTAR_SPATIALDOMAINS_CADSYSTEM_CADSURF
36#define NEKTAR_SPATIALDOMAINS_CADSYSTEM_CADSURF
57 std::vector<CADCurveSharedPtr>
edges;
58 std::vector<CADOrientation::Orientation>
edgeo;
91 std::vector<EdgeLoopSharedPtr> &ein);
131 std::array<NekDouble, 2> uv) = 0;
140 std::array<NekDouble, 2> uv) = 0;
149 std::array<NekDouble, 2> uv) = 0;
158 std::array<NekDouble, 2> uv) = 0;
177 std::array<NekDouble, 3> p,
NekDouble &dist) = 0;
185 std::array<NekDouble, 2>
locuv(std::array<NekDouble, 3> p)
188 auto uv =
locuv(p, dist);
189 WARNINGL1(dist < 1e-3,
"large locuv distance: " + std::to_string(dist));
220 std::array<NekDouble, 2> uv) = 0;
250 std::array<NekDouble, 3> p, std::array<NekDouble, 2> guess,
254 return locuv(p, dist);
261 std::array<NekDouble, 2> uv, std::array<NekDouble, 3> &loc)
287 virtual void Test(std::array<NekDouble, 2> uv) = 0;
#define WARNINGL1(condition, msg)
#define SPATIAL_DOMAINS_EXPORT
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
CADType::cadType m_type
type of the cad object
CADOrientation::Orientation m_orientation
orientation of the CADObject
base class for a cad surface
std::vector< EdgeLoopSharedPtr > GetEdges()
Get the loop structures which bound the cad surface.
virtual NekDouble Curvature(std::array< NekDouble, 2 > uv)=0
returns curvature at point uv
virtual void Test(std::array< NekDouble, 2 > uv)=0
Function which tests the the value of uv used is within the surface.
virtual std::array< NekDouble, 2 > locuvOnCurve(const CADCurveSharedPtr &curve, NekDouble t)
virtual std::array< NekDouble, 9 > D1(std::array< NekDouble, 2 > uv)=0
Get the set of first derivatives at parametric point u,v.
void SetEdges(std::vector< EdgeLoopSharedPtr > ein)
Set the edge loop.
virtual bool IsPlanar()=0
Is the surface defined by a planar surface (i.e not nurbs and is flat)
static void OrientateEdges(CADSurfSharedPtr surf, std::vector< EdgeLoopSharedPtr > &ein)
Static function which orientates the edge loop on a surface.
virtual std::array< NekDouble, 3 > P(std::array< NekDouble, 2 > uv)=0
Get the x,y,z at parametric point u,v.
virtual void P(std::array< NekDouble, 2 > uv, NekDouble &x, NekDouble &y, NekDouble &z)=0
Get the x,y,z at parametric point u,v.
CADOrientation::Orientation Orientation() override
query reversed normal
virtual std::array< NekDouble, 6 > BoundingBox(NekDouble scale)=0
Returns the bounding box of the surface that scales the enlargement and the meshing parameters * scal...
virtual void GetBounds(NekDouble &umin, NekDouble &umax, NekDouble &vmin, NekDouble &vmax)=0
Get the limits of the parametric space for the surface.
std::vector< EdgeLoopSharedPtr > m_edges
List of bounding edges in loops with orientation.
virtual std::array< NekDouble, 4 > GetBounds()=0
Get the limits of the parametric space for the surface.
CADSurf()
Default constructor.
virtual std::array< NekDouble, 3 > N(std::array< NekDouble, 2 > uv)=0
Get the normal vector at parametric point u,v.
virtual std::array< NekDouble, 18 > D2(std::array< NekDouble, 2 > uv)=0
Get the set of second derivatives at parametric point u,v.
virtual std::array< NekDouble, 6 > BoundingBox()=0
Returns the bounding box of the surface.
virtual NekDouble CurvatureAndPosition(std::array< NekDouble, 2 > uv, std::array< NekDouble, 3 > &loc)
virtual std::array< NekDouble, 2 > locuvFrom(std::array< NekDouble, 3 > p, std::array< NekDouble, 2 > guess, NekDouble &dist)
Curvature and position at uv together.
std::array< NekDouble, 2 > locuv(std::array< NekDouble, 3 > p)
overload function of locuv ommiting the dist parameter in this case if the projection is greater than...
virtual std::array< NekDouble, 2 > locuv(std::array< NekDouble, 3 > p, NekDouble &dist, NekDouble Umin, NekDouble Usup, NekDouble Vmin, NekDouble Vsup)=0
Performs a reverse look up to find u,v and x,y,z. if xyz is off the surface it will return the closes...
virtual std::array< NekDouble, 2 > locuv(std::array< NekDouble, 3 > p, NekDouble &dist)=0
Performs a reverse look up to find u,v and x,y,z. if xyz is off the surface it will return the closes...
std::shared_ptr< CADCurve > CADCurveSharedPtr
CADSurfFactory & GetCADSurfFactory()
std::shared_ptr< CADSurf > CADSurfSharedPtr
LibUtilities::NekFactory< std::string, CADSurf > CADSurfFactory
std::shared_ptr< EdgeLoop > EdgeLoopSharedPtr
struct which descibes a collection of cad edges which are a loop on the cad surface
std::array< NekDouble, 2 > center
std::vector< CADCurveSharedPtr > edges
std::vector< CADOrientation::Orientation > edgeo