ESyS-Particle  2.2
SubLatticeControler.h
Go to the documentation of this file.
1 
2 // //
3 // Copyright (c) 2003-2013 by The University of Queensland //
4 // Earth Systems Science Computational Centre (ESSCC) //
5 // http://www.uq.edu.au/esscc //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 #ifndef __SUBLATTICECONTROLER_H
14 #define __SUBLATTICECONTROLER_H
15 
16 //--- MPI ---
17 #include <mpi.h>
18 
19 //--- TML includes ---
20 #include "tml/comm/comm.h"
21 #include "tml/comm/comm_world.h"
22 
23 #include "Parallel/SubLattice.h"
25 #include "Foundation/Timer.h"
26 
27 #include <boost/shared_ptr.hpp>
28 
29 class CheckPointer;
30 
42 {
43  private:
48 
49  MPI_Comm m_global_comm; // global MPI communicator
50  MPI_Comm m_local_comm; // MPI communicator of the spawned workers
51  MPI_Group m_global_group, m_local_group; // MPI groups
52 
55 
57  CheckPointer* m_pCheckPointer; // for restatable checkpoints
58  CheckPointer* m_pSnapShooter; // for visualization dumps
59  std::string m_timingFileName;
60  typedef boost::shared_ptr<MpiWTimers> MpiWTimersPtr;
62 
63  public:
66 
67  void initMPI();
68  void makeLattice();
69  void initLattice();
70  void initLatticeCirc();
71  void init2DTriangularLocal();
72  void init3DTriangularLocal();
73  void searchNeighbors();
74  void performTiming();
75  void saveTimingData();
76  void getIdParticleData();
77  void setTimeStepSize();
78  void setTimingFileName(const std::string &timingFileName) {m_timingFileName=timingFileName;}
79  const std::string &getTimingFileName() const {return m_timingFileName;}
80  void do2dCalculations();
81  void getNumParticles();
83  void getParticlePosn();
84  void moveSingleParticle();
85 // void getBondGroupIdPairs();
86  void translateMeshBy();
87  void run();
88 
89  void setVerbosity();
90 
91  virtual void saveCheckPointData(std::ostream &oStream);
92  virtual void saveSnapShotData(std::ostream &oStream);
93 
94  virtual void loadCheckPointData(std::istream &iStream);
95 
96 };
97 
98 #endif //__SUBLATTICECONTROLER_H