OpenMPCD
Instrumentation/GaussianChains.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * Defines the OpenMPCD::CUDA::MPCFluid::Instrumentation::GaussianRods class.
4  */
5 
6 #ifndef OPENMPCD_CUDA_MPCFLUID_INSTRUMENTATION_GAUSSIANRODS_HPP
7 #define OPENMPCD_CUDA_MPCFLUID_INSTRUMENTATION_GAUSSIANRODS_HPP
8 
13 
14 #include <vector>
15 
16 namespace OpenMPCD
17 {
18 namespace CUDA
19 {
20 namespace MPCFluid
21 {
22 namespace Instrumentation
23 {
24 /**
25  * Instrumentation for Gaussian Chain fluids.
26  *
27  * If the `OpenMPCD::Configuration` contains a key
28  * `instrumentation.gaussianChains.squaredBondLengths`, which must be set only
29  * if there are at least two particles per chain, this object will measure the
30  * squared lengths of each of the bonds, bond `0` being the one connecting
31  * particles `0` and `1` in a chain, bond `1` connecting particles `1` and `2`,
32  * and so forth up to bond `N_particlesPerChain - 1`.
33  *
34  * The data measured this way will be saved to the file
35  * `gaussianChains--squaredBondLengths.txt`, which will contain (after comment
36  * lines starting with `#`) a line for each bond, each consisting of
37  * - the bond number, starting at `0`,
38  * - the mean square bond length,
39  * - the sample size,
40  * - the standard deviation,
41  * - the optimal DDDA block ID, in the sense of
42  * `OpenMPCD::OnTheFlyStatisticsDDDA::getOptimalBlockIDForStandardErrorOfTheMean`,
43  * - the optimal standard error of the mean, in the sense of
44  * `OpenMPCD::OnTheFlyStatisticsDDDA::getOptimalStandardErrorOfTheMean`,
45  * - whether the standard error of the mean estimation is reliable, in the
46  * sense of
47  * `OpenMPCD::OnTheFlyStatisticsDDDA::optimalStandardErrorOfTheMeanEstimateIsReliable`,
48  * as either `1` for `true`, and `0` for `false`.
49  */
50 class GaussianChains : public Base
51 {
52  public:
53  /**
54  * The constructor.
55  * @param[in] chainLength The number of MPC fluid particles per chain.
56  * @param[in] sim The simulation instance.
57  * @param[in] devMemMgr The Device memory manager.
58  * @param[in] mpcFluid_ The MPC fluid to measure.
59  */
61  const unsigned int chainLength,
62  const Simulation* const sim, DeviceMemoryManager* const devMemMgr,
63  const MPCFluid::GaussianChains* const mpcFluid_);
64 
65  /**
66  * The destructor.
67  */
68  virtual ~GaussianChains()
69  {
70  delete squaredBondLengths;
71  }
72 
73  protected:
74  /**
75  * Performs measurements.
76  */
77  virtual void measureSpecific();
78 
79  /**
80  * Saves the data to the given run directory.
81  * @param[in] rundir The path to the run directory.
82  */
83  virtual void saveSpecific(const std::string& rundir) const;
84 
85  private:
86  const Simulation* const simulation; ///< The simulation instance.
87  const MPCFluid::GaussianChains* const mpcFluid; ///< The fluid.
88 
89  std::vector<OnTheFlyStatisticsDDDA<MPCParticlePositionType> >*
90  squaredBondLengths; ///< Measures the squares of the bond lengths.
91 }; //class GaussianChains
92 } //namespace Instrumentation
93 } //namespace MPCFluid
94 } //namespace CUDA
95 } //namespace OpenMPCD
96 
97 #endif
OpenMPCD::CUDA::MPCFluid::Instrumentation::GaussianChains
Instrumentation for Gaussian Chain fluids.
Definition: Instrumentation/GaussianChains.hpp:50
OpenMPCD::CUDA::DeviceMemoryManager
Class for managing memory on the CUDA Device.
Definition: DeviceMemoryManager.hpp:21
OpenMPCD::CUDA::Simulation
MPCD simulation with Molecular Dynamics on CUDA-capable GPUs.
Definition: CUDA/Simulation.hpp:48
OpenMPCD::CUDA::MPCFluid::Instrumentation::GaussianChains::GaussianChains
GaussianChains(const unsigned int chainLength, const Simulation *const sim, DeviceMemoryManager *const devMemMgr, const MPCFluid::GaussianChains *const mpcFluid_)
The constructor.
Definition: GaussianChains.cpp:8
GaussianChains.hpp
Simulation.hpp
OpenMPCD::CUDA::MPCFluid::Instrumentation::Base
Base class for MPC fluids instrumentation.
Definition: CUDA/MPCFluid/Instrumentation/Base.hpp:34
OnTheFlyStatisticsDDDA.hpp
OpenMPCD::CUDA::MPCFluid::Instrumentation::GaussianChains::~GaussianChains
virtual ~GaussianChains()
The destructor.
Definition: Instrumentation/GaussianChains.hpp:68
OpenMPCD::CUDA::MPCFluid::Instrumentation::GaussianChains::saveSpecific
virtual void saveSpecific(const std::string &rundir) const
Saves the data to the given run directory.
Definition: GaussianChains.cpp:77
OpenMPCD::CUDA::MPCFluid::Instrumentation::GaussianChains::measureSpecific
virtual void measureSpecific()
Performs measurements.
Definition: GaussianChains.cpp:48
OpenMPCD::CUDA::MPCFluid::GaussianChains
Generalization of GaussianDumbbells to chains with an arbitrary number of constituent particles.
Definition: GaussianChains.hpp:38
Base.hpp