Memosa-FVM  0.2
MeshAssembler.h
Go to the documentation of this file.
1 // This file os part of FVM
2 // Copyright (c) 2012 FVM Authors
3 // See LICENSE file for terms.
4 
5 #ifndef _MESHASSEMBLER_H_
6 #define _MESHASSEMBLER_H_
7 
8 #include "Mesh.h"
9 #include "Array.h"
10 #include "Vector.h"
11 #include <vector>
12 #include <set>
13 #include <fstream>
14 
16 {
17 public:
18 
19  typedef shared_ptr< Array<double> > ArrayDblePtr;
20  typedef shared_ptr< Array<int> > ArrayIntPtr;
21  typedef map<int,ArrayIntPtr> ArrayIntPtrMap;
22  typedef shared_ptr< StorageSite > StorageSitePtr;
23  typedef shared_ptr< CRConnectivity > CRConnectivityPtr;
24  //typedef shared_ptr< Array<int> > ArrayIntPtr;
25  typedef shared_ptr< Array<Mesh::VecD3> > ArrayVecD3Ptr;
26  typedef vector< map<int, set<int> > > VecMap;
27 
28 
29 
32 
33  //return single mesh, for sake of compatibality we return as meshList
34  const MeshList& meshList() const { return _mesh;}
35 
36  void debug_print();
37  void debug_sites();
41  void debug_faceCells();
43 
44  //get methods
45 
46 
47 private:
49  void init();
50 
51  void setCellsSite();
52  void setFacesSite();
53  void setInterfaceNodes();
54  void setNodesSite();
55  void setCellsMapper();
56  void setNodesMapper();
57  void setBoundaryFaceGroup();
58  void setCoord();
59  void setSites();
60  void setMeshCellColor();
61 
62 
63  void setFaceCells();
64  void setFaceNodes();
65  void setMesh();
66 
67  void countInterfaceNodes();
68 
69  int getInnerNodesCount();
72 
73  void debug_file_open( const string& fname );
74  void debug_file_close();
75 
77 
81 
82  VecMap _interfaceNodesSet; //[meshid][faceid] gives set for nodes
83  //mappers for inner cells
84  map<int, ArrayIntPtr > _localCellToGlobal; //this include ghost cells at interfaces, ghostcells on boundary is set =-1
85  vector<int> _globalCellToMeshID; //belongs to which mesh from global Cell ID
86  vector<int> _globalCellToLocal; //gives local Cell ID from Global ID but which mesh comes from mapGlobalCellToMeshID
87 
88  vector < map<int,int> > _localInterfaceNodesToGlobalMap; // for each mesh
89  map<int, ArrayIntPtr > _localNodeToGlobal;
90 
91  set<Mesh::VecD3> _interfaceNodeCoord; //after merging,
92 
96 
97  ofstream _debugFile;
98 
101  MeshList _mesh; //even it is one-element vector, so compatiable with PartMesh class
102 
103 };
104 
105 
106 #endif
int getInterfaceNodesDuplicatedCount()
shared_ptr< Array< Mesh::VecD3 > > ArrayVecD3Ptr
Definition: MeshAssembler.h:25
ofstream _debugFile
Definition: MeshAssembler.h:97
vector< int > _globalCellToLocal
Definition: MeshAssembler.h:86
void debug_globalCellToMeshID_mappers()
shared_ptr< Array< int > > ArrayIntPtr
Definition: MeshAssembler.h:20
void debug_faceCells()
shared_ptr< Array< double > > ArrayDblePtr
Definition: MeshAssembler.h:19
shared_ptr< StorageSite > StorageSitePtr
Definition: MeshAssembler.h:22
StorageSitePtr _cellSite
Definition: MeshAssembler.h:78
void debug_localNodeToGlobal()
MeshList _mesh
void debug_sync_localToGlobal_mappers()
CRConnectivityPtr _faceNodes
Definition: MeshAssembler.h:94
MeshAssembler(const MeshList &meshList)
void setMeshCellColor()
set< Mesh::VecD3 > _interfaceNodeCoord
Definition: MeshAssembler.h:91
void debug_file_open(const string &fname)
vector< int > _globalCellToMeshID
Definition: MeshAssembler.h:85
CRConnectivityPtr _faceCells
Definition: MeshAssembler.h:93
void countInterfaceNodes()
const MeshList & meshList() const
Definition: MeshAssembler.h:34
StorageSitePtr _nodeSite
Definition: MeshAssembler.h:80
void setInterfaceNodes()
int getInterfaceNodesCount()
ArrayVecD3Ptr _coord
Definition: MeshAssembler.h:95
map< int, ArrayIntPtr > _localNodeToGlobal
Definition: MeshAssembler.h:89
const MeshList _meshList
Definition: MeshAssembler.h:76
void debug_localToGlobal_mappers()
shared_ptr< CRConnectivity > CRConnectivityPtr
Definition: MeshAssembler.h:23
map< int, ArrayIntPtr > ArrayIntPtrMap
Definition: MeshAssembler.h:21
void setBoundaryFaceGroup()
map< int, ArrayIntPtr > _localCellToGlobal
Definition: MeshAssembler.h:84
vector< map< int, int > > _localInterfaceNodesToGlobalMap
Definition: MeshAssembler.h:88
VecMap _interfaceNodesSet
Definition: MeshAssembler.h:82
StorageSitePtr _faceSite
Definition: MeshAssembler.h:79
int getInnerNodesCount()
vector< map< int, set< int > > > VecMap
Definition: MeshAssembler.h:26
void debug_file_close()
vector< Mesh * > MeshList
Definition: Mesh.h:439