Nektar++
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_PREPROCESSING_MESHCONVERT_INPUTSTAR
37 #define UTILITIES_PREPROCESSING_MESHCONVERT_INPUTSTAR
38 
39 #include "../Module.h"
40 #include "../MeshElements.h"
41 #include "ccmio.h"
42 
43 
44 namespace Nektar
45 {
46  namespace Utilities
47  {
48  /// Converter for VTK files.
49  class InputStar : public InputModule
50  {
51  public:
52  /// Creates an instance of this class
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 
68  void GenElement3D(vector<NodeSharedPtr> &Nodes,
69  int i, 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 
91  private:
92  CCMIOError m_ccmErr; //Star CCM error flag
93  CCMIOID m_ccmTopology; //Star CCM mesh topology
94  CCMIOID m_ccmProcessor;
95  map<int,string> m_faceLabels; // label from CCM into composite
96 
97  void InitCCM(void);
98 
99  void ReadNodes( std::vector<NodeSharedPtr> &Nodes);
100 
101  void ReadInternalFaces(map<int, vector<int> > &FacesNodes,
102  Array<OneD, vector<int> > &ElementFaces);
103 
104  void ReadBoundaryFaces(vector< vector<int> > &BndElementFaces,
105  map<int, vector<int> > &FacesNodes,
106  Array<OneD, vector<int> > &ElementFaces,
107  vector<string> &facelabels);
108 
109  void SetupElements(void);
110  };
111  }
112 }
113 
114 #endif
virtual void Process()
Populate and validate required data structures.
Definition: InputStar.cpp:83
static ModuleSharedPtr create(MeshSharedPtr m)
Creates an instance of this class.
Definition: InputStar.h:53
pair< ModuleType, string > ModuleKey
InputStar(MeshSharedPtr m)
Definition: InputStar.cpp:62
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:607
void GenElement2D(vector< NodeSharedPtr > &Nodes, int i, vector< int > &FaceNodes, int ncomposite)
Definition: InputStar.cpp:452
void ReadNodes(std::vector< NodeSharedPtr > &Nodes)
Definition: InputStar.cpp:923
map< int, string > m_faceLabels
Definition: InputStar.h:95
boost::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
Converter for VTK files.
Definition: InputStar.h:49
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:1040
void GenElement3D(vector< NodeSharedPtr > &Nodes, int i, vector< int > &ElementFaces, map< int, vector< int > > &FaceNodes, int ncomposite, bool DoOrient)
Definition: InputStar.cpp:491
Array< OneD, int > SortEdgeNodes(vector< NodeSharedPtr > &Nodes, vector< int > &FaceNodes)
Definition: InputStar.cpp:552
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:209
void ReadInternalFaces(map< int, vector< int > > &FacesNodes, Array< OneD, vector< int > > &ElementFaces)
Definition: InputStar.cpp:960