Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InputStar.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: InputStarTec.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 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: Tecplot (ascii .dat) converter.
33 //
34 ////////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef UTILITIES_NEKMESH_INPUTSTAR
37 #define UTILITIES_NEKMESH_INPUTSTAR
38 
39 #include "../Module.h"
40 
41 #include "ccmio.h"
42 
43 namespace Nektar
44 {
45 namespace Utilities
46 {
47 /// Converter for VTK files.
48 class InputStar : public InputModule
49 {
50 public:
51  /// Creates an instance of this class
53  {
55  }
57 
59  virtual ~InputStar();
60 
61  /// Populate and validate required data structures.
62  virtual void Process();
63 
64  void ReadZone(int &nComposite);
65 
66 protected:
67  void GenElement3D(vector<NodeSharedPtr> &Nodes,
68  int i,
69  vector<int> &ElementFaces,
70  map<int, vector<int> > &FaceNodes,
71  int ncomposite,
72  bool DoOrient);
73 
74  void GenElement2D(vector<NodeSharedPtr> &Nodes,
75  int i,
76  vector<int> &FaceNodes,
77  int ncomposite);
78 
79  Array<OneD, int> SortEdgeNodes(vector<NodeSharedPtr> &Nodes,
80  vector<int> &FaceNodes);
81 
82  Array<OneD, int> SortFaceNodes(vector<NodeSharedPtr> &Nodes,
83  vector<int> &ElementFaces,
84  map<int, vector<int> > &FaceNodes);
85 
86  void ResetNodes(vector<NodeSharedPtr> &Nodes,
87  Array<OneD, vector<int> > &ElementFaces,
88  map<int, vector<int> > &FaceNodes);
89 
90 private:
91  CCMIOError m_ccmErr; // Star CCM error flag
92  CCMIOID m_ccmTopology; // Star CCM mesh topology
93  CCMIOID m_ccmProcessor;
94  map<int, string> m_faceLabels; // label from CCM into composite
95 
96  void InitCCM(void);
97 
98  void ReadNodes(std::vector<NodeSharedPtr> &Nodes);
99 
100  void ReadInternalFaces(map<int, vector<int> > &FacesNodes,
101  Array<OneD, vector<int> > &ElementFaces);
102 
103  void ReadBoundaryFaces(vector<vector<int> > &BndElementFaces,
104  map<int, vector<int> > &FacesNodes,
105  Array<OneD, vector<int> > &ElementFaces,
106  vector<string> &facelabels);
107 
108  void SetupElements(void);
109 };
110 }
111 }
112 
113 #endif
virtual void Process()
Populate and validate required data structures.
Definition: InputStar.cpp:77
static ModuleSharedPtr create(MeshSharedPtr m)
Creates an instance of this class.
Definition: InputStar.h:52
pair< ModuleType, string > ModuleKey
InputStar(MeshSharedPtr m)
Definition: InputStar.cpp:56
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
Array< OneD, int > SortFaceNodes(vector< NodeSharedPtr > &Nodes, vector< int > &ElementFaces, map< int, vector< int > > &FaceNodes)
Definition: InputStar.cpp:613
void GenElement2D(vector< NodeSharedPtr > &Nodes, int i, vector< int > &FaceNodes, int ncomposite)
Definition: InputStar.cpp:458
void ReadNodes(std::vector< NodeSharedPtr > &Nodes)
Definition: InputStar.cpp:929
Converter for VTK files.
Definition: InputStar.h:48
boost::shared_ptr< Module > ModuleSharedPtr
void ReadBoundaryFaces(vector< vector< int > > &BndElementFaces, map< int, vector< int > > &FacesNodes, Array< OneD, vector< int > > &ElementFaces, vector< string > &facelabels)
Definition: InputStar.cpp:1063
void GenElement3D(vector< NodeSharedPtr > &Nodes, int i, vector< int > &ElementFaces, map< int, vector< int > > &FaceNodes, int ncomposite, bool DoOrient)
Definition: InputStar.cpp:498
boost::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
Definition: Mesh.h:137
Array< OneD, int > SortEdgeNodes(vector< NodeSharedPtr > &Nodes, vector< int > &FaceNodes)
Definition: InputStar.cpp:559
map< int, string > m_faceLabels
Definition: InputStar.h:94
static ModuleKey className
Definition: InputStar.h:56
void ReadZone(int &nComposite)
Abstract base class for input modules.
void ResetNodes(vector< NodeSharedPtr > &Nodes, Array< OneD, vector< int > > &ElementFaces, map< int, vector< int > > &FaceNodes)
Definition: InputStar.cpp:210
void ReadInternalFaces(map< int, vector< int > > &FacesNodes, Array< OneD, vector< int > > &ElementFaces)
Definition: InputStar.cpp:969