COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Reader.hpp
Go to the documentation of this file.
1 // Copyright (C) 2010-2013 von Karman Institute for Fluid Dynamics, Belgium
2 //
3 // This software is distributed under the terms of the
4 // GNU Lesser General Public License version 3 (LGPLv3).
5 // See doc/lgpl.txt and doc/gpl.txt for the license text.
6 
7 #ifndef cf3_mesh_Smurf_Reader_hpp
8 #define cf3_mesh_Smurf_Reader_hpp
9 
11 
12 #include <set>
13 #include <boost/tuple/tuple.hpp>
14 
15 #include "mesh/MeshReader.hpp"
16 
17 #include "mesh/smurf/LibSmurf.hpp"
18 #include "mesh/smurf/Shared.hpp"
19 
21 
22 namespace cf3 {
23 namespace mesh {
24 
25 class Elements;
26 class Region;
27 class MergedParallelDistribution;
28 class Dictionary;
29 
30 class Mesh;
31 
32 namespace smurf {
33 
35 
39 class smurf_API Reader : public MeshReader, public Shared
40 {
41 public: // functions
43  Reader( const std::string& name );
44 
46  static std::string type_name() { return "Reader"; }
47 
48  virtual std::string get_format() { return "Smurf"; }
49 
50  virtual std::vector<std::string> get_extensions();
51 
52 private: // functions
53 
54  Handle<Region> create_region(std::string const& relative_path);
55 
56 private: // data
57 
58  virtual void do_read_mesh_into(const common::URI& fp, Mesh& mesh);
59 
60  // map< smurf index , pair< elements, index in elements > >
61  std::map<Uint, std::pair<Handle<Elements>,Uint> > m_elem_idx_smurf_to_cf;
62  std::map<Uint, Uint> m_node_idx_smurf_to_cf;
63 
64  boost::filesystem::fstream m_file;
67 
68  std::string m_file_basename;
69 
70  Uint m_nb_regions; // This corresponds to the number of physical groups in
71  // smurf terminology
73 
74  std::vector< std::vector< double > > m_vv;
75 
76  std::set<Uint> m_ghost_nodes;
77  //std::set<Uint> m_ghost_elems;
78  std::set<Uint> m_used_nodes;
79 
80  std::vector<std::set<Uint> > m_node_to_glb_elements;
81 
82  std::vector<std::vector<Uint> > m_nb_smurf_elem_in_region;
85 
86  void fix_negative_volumes(Mesh& mesh);
87 
89 }; // end Reader
90 
92 
93 } // smurf
94 } // mesh
95 } // cf3
96 
98 
99 #endif // cf3_mesh_Smurf_Reader_hpp
std::string name(ComponentWrapper &self)
Safe pointer to an object. This is the supported method for referring to components.
Definition: Handle.hpp:39
std::map< Uint, std::pair< Handle< Elements >, Uint > > m_elem_idx_smurf_to_cf
Definition: Reader.hpp:61
#define smurf_API
Definition: LibSmurf.hpp:22
std::vector< std::vector< Uint > > m_nb_smurf_elem_in_region
Definition: Reader.hpp:82
std::set< Uint > m_ghost_nodes
Definition: Reader.hpp:76
std::vector< std::set< Uint > > m_node_to_glb_elements
Definition: Reader.hpp:80
std::map< Uint, Uint > m_node_idx_smurf_to_cf
Definition: Reader.hpp:62
boost::filesystem::fstream m_file
Definition: Reader.hpp:64
std::string m_file_basename
Definition: Reader.hpp:68
Top-level namespace for coolfluid.
Definition: Action.cpp:18
Handle< Region > m_region
Definition: Reader.hpp:66
virtual std::string get_format()
Definition: Reader.hpp:48
std::vector< std::vector< double > > m_vv
Definition: Reader.hpp:74
unsigned int Uint
typedef for unsigned int
Definition: CF.hpp:90
static std::string type_name()
Gets the Class name.
Definition: Reader.hpp:46
std::set< Uint > m_used_nodes
Definition: Reader.hpp:78
Handle< Mesh > m_mesh
Definition: Reader.hpp:65
Send comments to:
COOLFluiD Web Admin