Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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 
40 
41 #include "ccmio.h"
42 
43 namespace Nektar
44 {
45 namespace Utilities
46 {
47 /// Converter for VTK files.
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(std::vector<NekMeshUtils::NodeSharedPtr> &Nodes,
68  int i,
69  std::vector<int> &ElementFaces,
70  std::map<int, std::vector<int> > &FaceNodes,
71  int ncomposite,
72  bool DoOrient);
73 
74  void GenElement2D(std::vector<NekMeshUtils::NodeSharedPtr> &Nodes,
75  int i,
76  std::vector<int> &FaceNodes,
77  int ncomposite);
78 
80  std::vector<NekMeshUtils::NodeSharedPtr> &Nodes,
81  std::vector<int> &FaceNodes);
82 
84  std::vector<NekMeshUtils::NodeSharedPtr> &Nodes,
85  std::vector<int> &ElementFaces,
86  std::map<int, std::vector<int> > &FaceNodes);
87 
88  void ResetNodes(std::vector<NekMeshUtils::NodeSharedPtr> &Nodes,
89  Array<OneD, std::vector<int> > &ElementFaces,
90  std::map<int, std::vector<int> > &FaceNodes);
91 
92 private:
93  CCMIOError m_ccmErr; // Star CCM error flag
94  CCMIOID m_ccmTopology; // Star CCM mesh topology
95  CCMIOID m_ccmProcessor;
96  std::map<int, std::string> m_faceLabels; // label from CCM into composite
97 
98  void InitCCM(void);
99 
100  void ReadNodes(std::vector<NekMeshUtils::NodeSharedPtr> &Nodes);
101 
102  void ReadInternalFaces(std::map<int, std::vector<int> > &FacesNodes,
103  Array<OneD, std::vector<int> > &ElementFaces);
104 
105  void ReadBoundaryFaces(std::vector<std::vector<int> > &BndElementFaces,
106  std::map<int, std::vector<int> > &FacesNodes,
107  Array<OneD, std::vector<int> > &ElementFaces,
108  std::vector<std::string> &facelabels);
109 
110  void SetupElements(void);
111 };
112 }
113 }
114 
115 #endif
InputStar(NekMeshUtils::MeshSharedPtr m)
Definition: InputStar.cpp:56
virtual void Process()
Populate and validate required data structures.
Definition: InputStar.cpp:77
static NekMeshUtils::ModuleSharedPtr create(NekMeshUtils::MeshSharedPtr m)
Creates an instance of this class.
Definition: InputStar.h:52
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
void GenElement3D(std::vector< NekMeshUtils::NodeSharedPtr > &Nodes, int i, std::vector< int > &ElementFaces, std::map< int, std::vector< int > > &FaceNodes, int ncomposite, bool DoOrient)
Definition: InputStar.cpp:498
void ReadBoundaryFaces(std::vector< std::vector< int > > &BndElementFaces, std::map< int, std::vector< int > > &FacesNodes, Array< OneD, std::vector< int > > &ElementFaces, std::vector< std::string > &facelabels)
Definition: InputStar.cpp:1057
boost::shared_ptr< Module > ModuleSharedPtr
void ReadNodes(std::vector< NekMeshUtils::NodeSharedPtr > &Nodes)
Definition: InputStar.cpp:923
Converter for VTK files.
Definition: InputStar.h:48
std::map< int, std::string > m_faceLabels
Definition: InputStar.h:96
void ReadInternalFaces(std::map< int, std::vector< int > > &FacesNodes, Array< OneD, std::vector< int > > &ElementFaces)
Definition: InputStar.cpp:963
void GenElement2D(std::vector< NekMeshUtils::NodeSharedPtr > &Nodes, int i, std::vector< int > &FaceNodes, int ncomposite)
Definition: InputStar.cpp:458
Abstract base class for input modules.
boost::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
Definition: Mesh.h:147
Array< OneD, int > SortFaceNodes(std::vector< NekMeshUtils::NodeSharedPtr > &Nodes, std::vector< int > &ElementFaces, std::map< int, std::vector< int > > &FaceNodes)
Definition: InputStar.cpp:613
Array< OneD, int > SortEdgeNodes(std::vector< NekMeshUtils::NodeSharedPtr > &Nodes, std::vector< int > &FaceNodes)
Definition: InputStar.cpp:559
static NekMeshUtils::ModuleKey className
Definition: InputStar.h:56
void ResetNodes(std::vector< NekMeshUtils::NodeSharedPtr > &Nodes, Array< OneD, std::vector< int > > &ElementFaces, std::map< int, std::vector< int > > &FaceNodes)
Definition: InputStar.cpp:210
void ReadZone(int &nComposite)
std::pair< ModuleType, std::string > ModuleKey