Nektar++
CADSystemCFI.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: CADSystemCFI.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 NekMeshUtils_CADSYSTEM_CFI_CADSYSTEMCFI
36 #define NekMeshUtils_CADSYSTEM_CFI_CADSYSTEMCFI
37 
38 #include "../CADSystem.h"
39 
40 #include "cadfixapi.hxx"
41 
42 namespace Nektar
43 {
44 namespace NekMeshUtils
45 {
46 
47 class CADSystemCFI : public CADSystem
48 {
49 public:
50  static CADSystemSharedPtr create(std::string name)
51  {
53  }
54 
55  static std::string key;
56 
57  /**
58  * @brief Default constructor.
59  */
60  CADSystemCFI(std::string name) : CADSystem(name)
61  {
62  }
64 
65  bool LoadCAD();
66 
68 
69  cfi::Model *GetCFIModel()
70  {
71  return model;
72  }
73  std::map<std::string, int> GetCFICurveId()
74  {
75  return nameToCurveId;
76  }
77  std::map<std::string, int> GetCFIFaceId()
78  {
79  return nameToFaceId;
80  }
81  std::map<std::string, int> GetCFIVertId()
82  {
83  return nameToVertId;
84  }
86  {
87  return m_scal;
88  }
89 
90 private:
91  void AddVert(int i, cfi::Point *in);
92  void AddCurve(int i, cfi::Line *in);
93  void AddSurf(int i, cfi::Face *in);
94  cfi::Cfi cfiHandel;
95  cfi::Model *model;
96  std::vector<cfi::Body* >bodies;
97  std::map<std::string, int> nameToVertId;
98  std::map<std::string, int> nameToCurveId;
99  std::map<std::string, int> nameToFaceId;
100  std::map<std::string, std::vector<std::string> > mapVertToListEdge;
102 };
103 
104 typedef std::shared_ptr<CADSystemCFI> CADSystemCFISharedPtr;
105 }
106 }
107 
108 #endif
Base class for CAD interface system.
Definition: CADSystem.h:66
std::shared_ptr< CADSystem > CADSystemSharedPtr
Definition: CADSystem.h:240
std::map< std::string, int > GetCFIFaceId()
Definition: CADSystemCFI.h:77
std::map< std::string, int > GetCFIVertId()
Definition: CADSystemCFI.h:81
void AddCurve(int i, cfi::Line *in)
std::map< std::string, int > nameToCurveId
Definition: CADSystemCFI.h:98
std::map< std::string, int > GetCFICurveId()
Definition: CADSystemCFI.h:73
void AddSurf(int i, cfi::Face *in)
std::shared_ptr< CADSystemCFI > CADSystemCFISharedPtr
Definition: CADSystemCFI.h:104
bool LoadCAD()
Initialises CAD and makes surface, curve and vertex maps.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::map< std::string, int > nameToVertId
Definition: CADSystemCFI.h:97
double NekDouble
std::map< std::string, std::vector< std::string > > mapVertToListEdge
Definition: CADSystemCFI.h:100
Array< OneD, NekDouble > GetBoundingBox()
Returns bounding box of the domain.
std::map< std::string, int > nameToFaceId
Definition: CADSystemCFI.h:99
void AddVert(int i, cfi::Point *in)
CADSystemCFI(std::string name)
Default constructor.
Definition: CADSystemCFI.h:60
static CADSystemSharedPtr create(std::string name)
Definition: CADSystemCFI.h:50
std::vector< cfi::Body *> bodies
Definition: CADSystemCFI.h:96