Nektar++
Loading...
Searching...
No Matches
CADSystemOCE.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////////////
2//
3// File: CADSystemOCE.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 methods.
32//
33////////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_SPATIALDOMAINS_CADSYSTEM_OCE_CADSYSTEMOCE
36#define NEKTAR_SPATIALDOMAINS_CADSYSTEM_OCE_CADSYSTEMOCE
37
40
42{
43
44class CADSystemOCE : public CADSystem
45{
46public:
47 static CADSystemSharedPtr create(std::string name)
48 {
50 }
51
52 static std::string key;
53
54 /**
55 * @brief Default constructor.
56 */
57 CADSystemOCE(std::string name) : CADSystem(name, "oce")
58 {
59 }
60 ~CADSystemOCE() override {};
61
62 bool LoadCAD() override;
63
64 std::array<NekDouble, 6> GetBoundingBox() override;
65
66 TopoDS_Shape GetShape()
67 {
68 return m_shape;
69 }
70
71private:
72 /// Function to add curve to CADSystem::m_verts.
73 void AddVert(int i, TopoDS_Shape in);
74 /// Function to add curve to CADSystem::m_curves.
75 void AddCurve(int i, TopoDS_Shape in);
76 /// Function to add surface to CADSystem::m_surfs.
77 void AddSurf(int i, TopoDS_Shape in);
78
79 TopoDS_Shape BuildNACA(std::string naca);
80 TopoDS_Shape BuildGeo(std::string geo);
81 /// OCC master object
82 TopoDS_Shape m_shape;
83 TopTools_IndexedMapOfShape m_mapOfVerts, m_mapOfEdges, m_mapOfFaces;
84};
85
86typedef std::shared_ptr<CADSystemOCE> CADSystemOCESharedPtr;
87
88} // namespace Nektar::SpatialDomains
89
90#endif
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Base class for CAD interface system.
Definition CADSystem.h:72
TopTools_IndexedMapOfShape m_mapOfVerts
TopoDS_Shape m_shape
OCC master object.
TopoDS_Shape BuildNACA(std::string naca)
void AddCurve(int i, TopoDS_Shape in)
Function to add curve to CADSystem::m_curves.
bool LoadCAD() override
Initialises CAD and makes surface, curve and vertex maps.
CADSystemOCE(std::string name)
Default constructor.
TopTools_IndexedMapOfShape m_mapOfEdges
static CADSystemSharedPtr create(std::string name)
void AddVert(int i, TopoDS_Shape in)
Function to add curve to CADSystem::m_verts.
std::array< NekDouble, 6 > GetBoundingBox() override
Returns bounding box of the domain.
TopTools_IndexedMapOfShape m_mapOfFaces
void AddSurf(int i, TopoDS_Shape in)
Function to add surface to CADSystem::m_surfs.
TopoDS_Shape BuildGeo(std::string geo)
Create a OpenCASCADE object from a Gmsh file geo.
std::shared_ptr< CADSystemOCE > CADSystemOCESharedPtr
std::shared_ptr< CADSystem > CADSystemSharedPtr
Definition CADSystem.h:360