9 const unsigned int chainLength,
12 :
Base(sim->getConfiguration(), mpcFluid_),
13 simulation(sim), mpcFluid(mpcFluid_),
14 squaredBondLengths(NULL)
21 chainLength, sim, devMemMgr, mpcFluid_);
29 chainLength, sim, devMemMgr, mpcFluid_);
33 if(config.
has(
"instrumentation.gaussianChains.squaredBondLengths"))
39 "Cannot measure bond lengths with less than two beads.");
43 new std::vector<OnTheFlyStatisticsDDDA<MPCParticlePositionType> >();
44 squaredBondLengths->resize(chainLength - 1);
50 if(squaredBondLengths)
54 const unsigned int particlesPerChain =
59 for(
unsigned int chain = 0; chain < chainCount; ++chain)
61 const unsigned int firstParticleID = chain * particlesPerChain;
63 for(
unsigned int p = 0; p < particlesPerChain - 1; ++p)
70 (*squaredBondLengths)[p].addDatum(
79 if(squaredBondLengths)
81 const std::string filePath =
82 rundir +
"/gaussianChains--squaredBondLengths.txt";
83 std::ofstream file(filePath.c_str(), std::ios::out);
85 file <<
"#bond-number\t" <<
"mean-square-bond-length\t"
86 <<
"sample-size\t" <<
"sample-standard-deviation\t"
87 <<
"DDDA-optimal-block-ID\t"
88 <<
"DDDA-optimal-standard-error-of-the-mean\t"
89 <<
"DDDA-optimal-standard-error-of-the-mean-is-reliable\n";
91 for(std::size_t bond = 0; bond < squaredBondLengths->size(); ++bond)
94 sqrt((*squaredBondLengths)[bond].getBlockVariance(0));
97 file << (*squaredBondLengths)[bond].getSampleMean() <<
"\t";
98 file << (*squaredBondLengths)[bond].getSampleSize() <<
"\t";
99 file << standardDeviation <<
"\t";
101 (*squaredBondLengths)[bond].getOptimalBlockIDForStandardErrorOfTheMean()
104 (*squaredBondLengths)[bond].getOptimalStandardErrorOfTheMean()
107 ((*squaredBondLengths)[bond].optimalStandardErrorOfTheMeanEstimateIsReliable()
bool has(const std::string &setting) const
Returns whether a setting with the given name exists.
Represents the configuration of the simulation.
#define OPENMPCD_THROW(ExceptionType, message)
Throws the given ExceptionType, passing the given message along with file and line number information...
Class for managing memory on the CUDA Device.
static bool isConfigured(const Simulation *const sim)
Returns whether the given simulation configured this instrumentation.
#define OPENMPCD_DEBUG_ASSERT(assertion)
Asserts that the given expression evaluates to true, but only if OPENMPCD_DEBUG is defined.
FP MPCParticlePositionType
The data type for the positions of MPC particles.
virtual unsigned int getNumberOfLogicalEntities() const
Returns the number of logical entities in the fluid.
Namespace for instrumentation classes for MPC fluids.
FourierTransformedVelocity::Base * fourierTransformedVelocity
Measures Fourier-transformed velocities.
const Configuration & getConfiguration() const
Returns the configuration.
virtual unsigned int getNumberOfParticlesPerLogicalEntity() const
Returns the number of MPC particles per logical entity.
Class for measurements of velocity autocorrelation in MPC fluids that consist of chains of particles.
void fetchFromDevice() const
Copies the MPC fluid particles from the CUDA Device to the Host.
MPCD simulation with Molecular Dynamics on CUDA-capable GPUs.
GaussianChains(const unsigned int chainLength, const Simulation *const sim, DeviceMemoryManager *const devMemMgr, const MPCFluid::GaussianChains *const mpcFluid_)
The constructor.
Base class for MPC fluids instrumentation.
OPENMPCD_CUDA_HOST_AND_DEVICE T sqrt(const T x)
Returns the sqaure root of the argument.
virtual void saveSpecific(const std::string &rundir) const
Saves the data to the given run directory.
virtual void measureSpecific()
Performs measurements.
Generalization of GaussianDumbbells to chains with an arbitrary number of constituent particles.
const RemotelyStoredVector< const MPCParticlePositionType > getPosition(const unsigned int particleID) const
Returns a MPC fluid particle's position vector.
OPENMPCD_CUDA_HOST_AND_DEVICE RealType getMagnitudeSquared() const
Returns the square of the magnitude of this vector.
VelocityAutocorrelation::Base * velocityAutocorrelation
Measures velocity autocorrelation.