10#include "molecules/Comp2Param.h"
11#include "molecules/Component.h"
12#include "ensemble/EnsembleBase.h"
13#include "Simulation.h"
14#include "utils/CommVar.h"
18#define CHECKPOINT_FILE_VERSION 20160512
21#define KINLIMIT_PER_T 10.0
23#include "molecules/MoleculeForwardDeclaration.h"
71 DomainDecompBase* domainDecomp,
double currentTime,
bool useBinaryFormat =
false);
173 double getCurrentTemperature(
int thermostatID) {
return _globalTemperatureMap[thermostatID]; }
174 double getTargetTemperature(
int thermostatID) {
return _universalTargetTemperature[thermostatID]; }
178 void setTargetTemperature(
int thermostatID,
double T);
212 double getGlobalUpot()
const;
235 this->_localThermostatN[thermostat] = N;
236 this->_localRotationalDOF[thermostat] = rotDOF;
284 bool collectThermostatVelocities,
double Tfactor
325 int getThermostat(
int cid) {
return this->_componentToThermostatIdMap[cid]; }
337 return (_componentwiseThermostat)? (_universalThermostatN.size() - 2): 0;
344 this->_componentToThermostatIdMap[cid] = thermostat;
345 this->_universalThermostatN[thermostat] = 0;
351 unsigned long N() {
return _globalNumMolecules;}
353 void Nadd(
unsigned cid,
int N,
int localN);
355 double getGlobalVolume()
const {
return (_globalLength[0] * _globalLength[1] * _globalLength[2]); }
357 void thermostatOff() { this->_universalNVE =
true; }
358 void thermostatOn() { this->_universalNVE =
false; }
359 bool NVE() {
return this->_universalNVE; }
360 bool thermostatWarning() {
return (this->_universalSelectiveThermostatWarning > 0); }
363 void submitDU(
unsigned cid,
double DU,
double* r);
364 void setLambda(
double lambda) { this->_universalLambda = lambda; }
365 void setDensityCoefficient(
float coeff) { _globalDecisiveDensity = coeff; }
366 void setProfiledComponentMass(
double m) { _universalProfiledComponentMass = m; }
368 void init_cv(
unsigned N,
double U,
double UU) {
369 this->_globalUSteps = N;
370 this->_globalSigmaU = U;
371 this->_globalSigmaUU = UU;
379 double getSigma(
unsigned cid,
unsigned nthSigma);
381 unsigned getNumberOfComponents();
383 void setUpotCorr(
double upotcorr){ _UpotCorr = upotcorr; }
384 void setVirialCorr(
double virialcorr){ _VirialCorr = virialcorr; }
387 void SetExplosionHeuristics(
bool bVal) { _bDoExplosionHeuristics = bVal; }
397 double _localUpotCspecif;
400 unsigned _numFluidComponent;
407 double _globalUpotCspecif;
409 double _globalVirial;
414 unsigned long _globalNumMolecules;
417 double _globalLength[3];
420 bool _componentwiseThermostat;
424 std::map<int, int> _componentToThermostatIdMap;
428 std::map<int, unsigned long> _localThermostatN;
429 std::map<int, unsigned long> _universalThermostatN;
430 std::map<int, unsigned long> _localRotationalDOF;
431 std::map<int, unsigned long> _universalRotationalDOF;
436 std::map<int, double> _globalTemperatureMap;
437 std::map<int, double> _universalTargetTemperature;
438 std::map<int, double> _universalBTrans;
439 std::map<int, double> _universalBRot;
441 std::map<int, bool> _universalUndirectedThermostat;
443 std::map<int, std::array<double, 3> > _universalThermostatDirectedVelocity;
444 std::map<int, std::array<double, 3> > _localThermostatDirectedVelocity;
450 unsigned _globalUSteps;
451 double _globalSigmaU;
452 double _globalSigmaUU;
454 std::map<unsigned, bool> _universalProfiledComponents;
455 double _universalProfiledComponentMass;
456 double _universalLambda;
457 float _globalDecisiveDensity;
459 int _universalSelectiveThermostatCounter;
460 int _universalSelectiveThermostatWarning;
461 int _universalSelectiveThermostatError;
464 std::map<int, double> _local2KETrans;
467 std::map<int, double> _local2KERot;
487 std::vector<double> _mixcoeff;
490 bool _bDoExplosionHeuristics;
Definition: Comp2Param.h:15
handle boundary region and multiple processes
Definition: DomainDecompBase.h:51
This class is used to read in the phasespace and to handle macroscopic values.
Definition: Domain.h:47
int getThermostat(int cid)
thermostat to be applied to component cid
Definition: Domain.h:325
double getGlobalBetaTrans()
get thermostat scaling for translations
Definition: Domain.cpp:118
std::vector< double > & getmixcoeff()
get the mixcoeff
Definition: Domain.cpp:721
double getLocalUpotCompSpecific()
get the fluid and fluid-solid potential of the local process
Definition: Domain.cpp:833
unsigned maxThermostat()
returns the ID of the "last" thermostat in the system
Definition: Domain.h:336
double getLocalUpot() const
get the potential of the local process
Definition: Domain.cpp:111
void setComponentThermostat(int cid, int thermostat)
associates a component with a thermostat
Definition: Domain.h:342
void setLocalUpotCompSpecific(double UpotCspec)
set the fluid and fluid-solid potential of the local process
Definition: Domain.cpp:831
unsigned getNumFluidComponents()
get the numbr of fluid molecules as specified in the config file (*_1R.cfg)
Definition: Domain.cpp:844
bool severalThermostats()
returns whether there are several distinct thermostats in the system
Definition: Domain.h:322
void calculateGlobalValues(DomainDecompBase *domainDecomp, ParticleContainer *particleContainer)
calls this->calculateGlobalValues with Tfactor = 1 and without velocity collection
Definition: Domain.h:289
double getGlobalCurrentTemperature()
get the global temperature for the whole system (i.e. thermostat ID 0)
Definition: Domain.h:172
double getThermostatDirectedVelocity(int thermostat, int d)
returns the directed velocity associated with a thermostat
Definition: Domain.h:319
void setLocalNrotDOF(int thermostat, unsigned long N, unsigned long rotDOF)
sets _localThermostatN and _localRotationalDOF for thermostat
Definition: Domain.h:234
void setglobalRotDOF(unsigned long grotdof)
set globalRotDOF
Definition: Domain.cpp:770
unsigned long getglobalRotDOF()
get globalRotDOF
Definition: Domain.cpp:765
void calculateVelocitySums(ParticleContainer *partCont)
calculate _localSummv2 and _localSumIw2
Definition: Domain.cpp:426
void updateMaxMoleculeID(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp)
update max. moleculeID
Definition: Domain.cpp:746
double getGlobalLength(int d) const
return the length of the domain
Definition: Domain.h:163
void setLocalSummv2(double summv2, int thermostat)
sets _localSummv2 to the given value
Definition: Domain.cpp:123
void setLocalVirial(double Virial)
set the virial of the local process
Definition: Domain.cpp:113
bool thermostatIsUndirected(int thermostat)
Definition: Domain.h:311
void setLocalUpot(double Upot)
set the potential of the local process
Definition: Domain.cpp:109
unsigned long getNumFluidMolecules()
Definition: Domain.cpp:846
double getSigma(unsigned cid, unsigned nthSigma)
methods implemented by Stefan Becker stefan.becker@mv.uni-kl.de
Definition: Domain.cpp:802
double getGlobalPressure()
get the global pressure
Definition: Domain.cpp:136
void writeCheckpoint(std::string filename, ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, double currentTime, bool useBinaryFormat=false)
writes a checkpoint file that can be used to continue the simulation
Definition: Domain.cpp:597
void updateglobalNumMolecules(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp)
update globalNumMolecules
Definition: Domain.cpp:731
void setNumFluidComponents(unsigned nc)
set the number of fluid phase components (specified in the config-file)
Definition: Domain.cpp:842
double getLocalVirial() const
get the virial of the local process
Definition: Domain.cpp:115
void setepsilonRF(double erf)
set the epsilonRF
Definition: Domain.cpp:725
unsigned long getglobalNumMolecules() const
get globalNumMolecules
Definition: Domain.cpp:727
double getepsilonRF() const
get the epsilonRF
Definition: Domain.cpp:723
double getAverageGlobalVirial() const
get the global average virial per particle
Definition: Domain.cpp:142
double getAverageGlobalUpot() const
get the global average potential per particle
Definition: Domain.cpp:144
Comp2Param & getComp2Params()
get the parameter streams
Definition: Domain.cpp:147
void initParameterStreams(double cutoffRadius, double cutoffRadiusLJ)
initialize far field correction parameters
Definition: Domain.cpp:622
void setglobalRho(double grho)
set globalRho
Definition: Domain.cpp:763
void writeCheckpointHeader(std::string filename, ParticleContainer *particleContainer, const DomainDecompBase *domainDecomp, double currentTime)
writes a checkpoint file that can be used to continue the simulation
Definition: Domain.cpp:485
void enableUndirectedThermostat(int thermostat)
enables the "undirected" flag for the specified thermostat
Definition: Domain.cpp:714
double getglobalRho()
get globalRho
Definition: Domain.cpp:761
void enableComponentwiseThermostat()
enables the componentwise thermostat
Definition: Domain.cpp:700
void setGlobalLength(int index, double length)
set the length of the domain
Definition: Domain.cpp:775
void disableComponentwiseThermostat()
disables the componentwise thermostat (so that a single thermostat is applied to all DOF)
Definition: Domain.h:327
CommVar< uint64_t > getMaxMoleculeID() const
get local/global max. moleculeID
Definition: Domain.cpp:742
double getGlobalBetaRot()
get thermostat scaling for rotations
Definition: Domain.cpp:120
double getAverageGlobalUpotCSpec()
by Stefan Becker: return the average global potential of the fluid-fluid and fluid-solid interaction ...
Definition: Domain.cpp:836
void calculateGlobalValues(DomainDecompBase *domainDecomp, ParticleContainer *particleContainer, bool collectThermostatVelocities, double Tfactor)
calculate the global macroscopic values
Definition: Domain.cpp:151
void calculateThermostatDirectedVelocity(ParticleContainer *partCont)
Definition: Domain.cpp:368
void setglobalNumMolecules(unsigned long glnummol)
set globalNumMolecules
Definition: Domain.cpp:729
void setGlobalTemperature(double T)
set the global temperature
Definition: Domain.h:177
void setLocalSumIw2(double sumIw2, int thermostat)
sets _localSumIw2 to the given value
Definition: Domain.cpp:131
void readXML(XMLfileUnits &xmlconfig)
Definition: Domain.cpp:78
This Interface is used to get access to particles and pairs of particles.
Definition: ParticleContainer.h:69
static void exit(int exitcode)
Terminate simulation with given exit code.
Definition: Simulation.cpp:155
XML file with unit attributes abstraction.
Definition: xmlfileUnits.h:25
::xsd::cxx::tree::string< char, simple_type > string
C++ type corresponding to the string XML Schema built-in type.
Definition: vtk-punstructured.h:270