-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into reflective-boundaries
- Loading branch information
Showing
4 changed files
with
103 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,7 +74,7 @@ Domain::Domain(int rank) { | |
this->_universalSelectiveThermostatWarning = 0; | ||
this->_universalSelectiveThermostatError = 0; | ||
|
||
// explosion heuristics, NOTE: turn off when using slab thermostat | ||
// explosion heuristics, NOTE: turn off when using slab thermostat | ||
_bDoExplosionHeuristics = true; | ||
} | ||
|
||
|
@@ -220,33 +220,33 @@ void Domain::calculateGlobalValues( | |
domainDecomp->collCommAppendUnsLong(numMolecules); | ||
domainDecomp->collCommAppendUnsLong(rotDOF); | ||
domainDecomp->collCommAllreduceSumAllowPrevious(); | ||
summv2 = domainDecomp->collCommGetDouble(); | ||
sumIw2 = domainDecomp->collCommGetDouble(); | ||
_globalsummv2 = domainDecomp->collCommGetDouble(); | ||
_globalsumIw2 = domainDecomp->collCommGetDouble(); | ||
numMolecules = domainDecomp->collCommGetUnsLong(); | ||
rotDOF = domainDecomp->collCommGetUnsLong(); | ||
domainDecomp->collCommFinalize(); | ||
Log::global_log->debug() << "[ thermostat ID " << thermit->first << "]\tN = " << numMolecules << "\trotDOF = " << rotDOF | ||
<< "\tmv2 = " << summv2 << "\tIw2 = " << sumIw2 << std::endl; | ||
<< "\tmv2 = " << _globalsummv2 << "\tIw2 = " << _globalsumIw2 << std::endl; | ||
|
||
this->_universalThermostatN[thermit->first] = numMolecules; | ||
this->_universalRotationalDOF[thermit->first] = rotDOF; | ||
mardyn_assert((summv2 > 0.0) || (numMolecules == 0)); | ||
mardyn_assert((_globalsummv2 > 0.0) || (numMolecules == 0)); | ||
|
||
/* calculate the temperature of the entire system */ | ||
if(numMolecules > 0) | ||
_globalTemperatureMap[thermit->first] = | ||
(summv2 + sumIw2) / (double)(3*numMolecules + rotDOF); | ||
(_globalsummv2 + _globalsumIw2) / (double)(3*numMolecules + rotDOF); | ||
else | ||
_globalTemperatureMap[thermit->first] = _universalTargetTemperature[thermit->first]; | ||
|
||
double Ti = Tfactor * _universalTargetTemperature[thermit->first]; | ||
if((Ti > 0.0) && (numMolecules > 0) && !_universalNVE) | ||
{ | ||
_universalBTrans[thermit->first] = pow(3.0*numMolecules*Ti / summv2, 0.4); | ||
if( sumIw2 == 0.0 ) | ||
_universalBTrans[thermit->first] = pow(3.0*numMolecules*Ti / _globalsummv2, 0.4); | ||
if( _globalsumIw2 == 0.0 ) | ||
_universalBRot[thermit->first] = 1.0; | ||
else | ||
_universalBRot[thermit->first] = pow(rotDOF*Ti / sumIw2, 0.4); | ||
_universalBRot[thermit->first] = pow(rotDOF*Ti / _globalsumIw2, 0.4); | ||
} | ||
else | ||
{ | ||
|
@@ -519,7 +519,7 @@ void Domain::writeCheckpointHeader(std::string filename, | |
#ifndef NDEBUG | ||
checkpointfilestream << "# rho\t" << this->_globalRho << "\n"; | ||
//checkpointfilestream << "# rc\t" << global_simulation->getcutoffRadius() << "\n"; | ||
checkpointfilestream << "# \n# Please address your questions and suggestions to\n# the ls1 mardyn contact point: <[email protected]>.\n# \n"; | ||
checkpointfilestream << "# \n# Please address your questions and suggestions to\n# the ls1 mardyn contact point: <[email protected]>.\n# \n"; | ||
#endif | ||
/* by Stefan Becker: the output line "I ..." causes an error: the restart run does not start!!! | ||
if(this->_globalUSteps > 1) | ||
|
@@ -872,10 +872,10 @@ void Domain::setNumFluidComponents(unsigned nc){_numFluidComponent = nc;} | |
unsigned Domain::getNumFluidComponents(){return _numFluidComponent;} | ||
|
||
unsigned long Domain::getNumFluidMolecules(){ | ||
unsigned long numFluidMolecules = 0; | ||
for(unsigned i = 0; i < _numFluidComponent; i++){ | ||
Component& ci=*(global_simulation->getEnsemble()->getComponent(i)); | ||
numFluidMolecules+=ci.getNumMolecules(); | ||
} | ||
unsigned long numFluidMolecules = 0; | ||
for(unsigned i = 0; i < _numFluidComponent; i++){ | ||
Component& ci=*(global_simulation->getEnsemble()->getComponent(i)); | ||
numFluidMolecules+=ci.getNumMolecules(); | ||
} | ||
return numFluidMolecules; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,11 +215,18 @@ class Domain { | |
//! Before this method is called, it has to be sure that the | ||
//! global potential has been calculated (method calculateGlobalValues) | ||
double getAverageGlobalUpot(); | ||
double getGlobalUpot() const; | ||
double getGlobalUpot() const; | ||
|
||
//! by Stefan Becker: return the average global potential of the fluid-fluid and fluid-solid interaction (but NOT solid-solid interaction) | ||
double getAverageGlobalUpotCSpec(); | ||
|
||
//! @brief get the global kinetic energy | ||
//! | ||
//! Before this method is called, it has to be sure that the | ||
//! global energies has been calculated (method calculateGlobalValues) | ||
double getGlobalUkinTrans() { return 0.5*_globalsummv2; } | ||
double getGlobalUkinRot() { return 0.5*_globalsumIw2; } | ||
|
||
//! by Stefan Becker: determine and return the totel number of fluid molecules | ||
//! this method assumes all molecules with a component-ID less than _numFluidComponent to be fluid molecules | ||
unsigned long getNumFluidMolecules(); | ||
|
@@ -365,8 +372,8 @@ class Domain { | |
void evaluateRho(unsigned long localN, DomainDecompBase* comm); | ||
void submitDU(unsigned cid, double DU, double* r); | ||
void setLambda(double lambda) { this->_universalLambda = lambda; } | ||
void setDensityCoefficient(float coeff) { _globalDecisiveDensity = coeff; } | ||
void setProfiledComponentMass(double m) { _universalProfiledComponentMass = m; } | ||
void setDensityCoefficient(float coeff) { _globalDecisiveDensity = coeff; } | ||
void setProfiledComponentMass(double m) { _universalProfiledComponentMass = m; } | ||
|
||
void init_cv(unsigned N, double U, double UU) { | ||
this->_globalUSteps = N; | ||
|
@@ -376,7 +383,7 @@ class Domain { | |
void record_cv(); | ||
double cv(); | ||
|
||
// by Stefan Becker <[email protected]> | ||
// by Stefan Becker <[email protected]> | ||
/* method returning the sigma parameter of a component | ||
=> needed in the output of the MmspdWriter (specifying the particles' radii in a movie) */ | ||
double getSigma(unsigned cid, unsigned nthSigma); | ||
|
@@ -386,8 +393,8 @@ class Domain { | |
void setUpotCorr(double upotcorr){ _UpotCorr = upotcorr; } | ||
void setVirialCorr(double virialcorr){ _VirialCorr = virialcorr; } | ||
|
||
// explosion heuristics, NOTE: turn off when using slab thermostat | ||
void setExplosionHeuristics(bool bVal) { _bDoExplosionHeuristics = bVal; } | ||
// explosion heuristics, NOTE: turn off when using slab thermostat | ||
void setExplosionHeuristics(bool bVal) { _bDoExplosionHeuristics = bVal; } | ||
|
||
private: | ||
|
||
|
@@ -408,6 +415,10 @@ class Domain { | |
double _globalUpot; | ||
//! global component specific potential (fluid-fluid and fluid-solid but NOT solid-solid) | ||
double _globalUpotCspecif; | ||
//! global translational kinetic energy times two | ||
double _globalsummv2; | ||
//! global rotational kinetic energy times two | ||
double _globalsumIw2; | ||
//! global virial | ||
double _globalVirial; | ||
//! global density | ||
|
@@ -455,9 +466,9 @@ class Domain { | |
double _globalSigmaUU; | ||
//! which components should be considered? | ||
std::map<unsigned, bool> _universalProfiledComponents; | ||
double _universalProfiledComponentMass; // set from outside | ||
double _universalLambda; // set from outside | ||
float _globalDecisiveDensity; // set from outside | ||
double _universalProfiledComponentMass; // set from outside | ||
double _universalLambda; // set from outside | ||
float _globalDecisiveDensity; // set from outside | ||
|
||
int _universalSelectiveThermostatCounter; | ||
int _universalSelectiveThermostatWarning; | ||
|
@@ -486,8 +497,8 @@ class Domain { | |
//! parameter streams for each possible pair of molecule-types | ||
Comp2Param _comp2params; | ||
|
||
// explosion heuristics, NOTE: turn off when using slab thermostat | ||
bool _bDoExplosionHeuristics; | ||
// explosion heuristics, NOTE: turn off when using slab thermostat | ||
bool _bDoExplosionHeuristics; | ||
}; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters