38 |
|
#include <utility> |
39 |
|
|
40 |
|
#include "brains/fSimulation.h" |
41 |
+ |
#include "brains/SimInfo.hpp" |
42 |
|
#include "primitives/Molecule.hpp" |
43 |
|
#include "types/MoleculeStamp.hpp" |
44 |
|
#include "utils/PropertyMap.hpp" |
58 |
|
*/ |
59 |
|
class SimInfo { |
60 |
|
public: |
61 |
< |
typedef MoleculeIterator MoleculeIterator; |
61 |
> |
typedef std::map<int, Molecule*>::iterator MoleculeIterator; |
62 |
|
|
63 |
|
/** |
64 |
|
* Constructor of SimInfo |
67 |
|
* @param ff pointer of a concrete ForceField instance |
68 |
|
* @param globals |
69 |
|
* @note |
69 |
– |
* <p> |
70 |
– |
* The major change of SimInfo |
71 |
– |
* </p> |
70 |
|
*/ |
71 |
|
SimInfo(const std::vector<std::pair<MoleculeStamp*, int> >& molStampPairs, ForceField* ff, Globals* globals); |
72 |
|
virtual ~SimInfo(); |
97 |
|
/** Returns the total number of cutoff groups in the system. */ |
98 |
|
int getNGlobalCutoffGroups() { |
99 |
|
return nGlobalCutoffGroups_; |
100 |
+ |
} |
101 |
+ |
|
102 |
+ |
/** |
103 |
+ |
* Returns the total number of integrable objects (total number of rigid bodies plus the total number |
104 |
+ |
* of atoms which do not belong to the rigid bodies) in the system |
105 |
+ |
*/ |
106 |
+ |
int getNGlobalIntegrableObjects() { |
107 |
+ |
return nGlobalIntegrableObjects_; |
108 |
|
} |
109 |
|
|
110 |
|
/** |
269 |
|
double getRcut() { |
270 |
|
return rcut_; |
271 |
|
} |
266 |
– |
|
267 |
– |
void setRcut(double rcut) { |
268 |
– |
rcut_ = rcut; |
269 |
– |
} |
272 |
|
|
273 |
|
double getRsw() { |
274 |
|
return rsw_; |
275 |
|
} |
274 |
– |
void setRsw(double rsw) { |
275 |
– |
rsw_ = rsw; |
276 |
– |
} |
276 |
|
|
277 |
|
std::string getFinalConfigFileName() { |
278 |
|
return finalConfigFileName_; |
282 |
|
finalConfigFileName_ = fileName; |
283 |
|
} |
284 |
|
|
286 |
– |
|
285 |
|
std::string getDumpFileName() { |
286 |
|
return dumpFileName_; |
287 |
|
} |
313 |
|
int* getGlobalMolMembershipPointer() { |
314 |
|
return globalMolMembership_[0]; |
315 |
|
} |
316 |
+ |
|
317 |
+ |
|
318 |
+ |
bool isFortranInitialized() { |
319 |
+ |
return fortranInitialized_; |
320 |
+ |
} |
321 |
|
|
322 |
|
//below functions are just forward functions |
323 |
|
//To compose or to inherit is always a hot debate. In general, is-a relation need subclassing, in the |
376 |
|
*/ |
377 |
|
void setupFortranSim(); |
378 |
|
|
379 |
+ |
/** Figure out the radius of cutoff, radius of switching function and pass them to fortran */ |
380 |
+ |
void setupCutoff(); |
381 |
+ |
|
382 |
|
/** Calculates the number of degress of freedom in the whole system */ |
383 |
|
void calcNdf(); |
384 |
|
void calcNdfRaw(); |
405 |
|
int nGlobalMols_; /**< number of molecules in the system */ |
406 |
|
int nGlobalAtoms_; /**< number of atoms in the system */ |
407 |
|
int nGlobalCutoffGroups_; /**< number of cutoff groups in this system */ |
408 |
+ |
int nGlobalIntegrableObjects_; /**< number of integrable objects in this system */ |
409 |
|
|
410 |
|
/** |
411 |
|
* the size of globalGroupMembership_ is nGlobalAtoms. Its index is global index of an atom, and the |
458 |
|
|
459 |
|
double rcut_; /**< cutoff radius*/ |
460 |
|
double rsw_; /**< radius of switching function*/ |
461 |
+ |
|
462 |
+ |
bool fortranInitialized_; /**< flag indicate whether fortran side is initialized */ |
463 |
|
|
464 |
|
#ifdef IS_MPI |
465 |
|
//in Parallel version, we need MolToProc |