9#include "plugins/PluginBase.h"
10#include "molecules/Molecule.h"
11#include "utils/CommVar.h"
81 unsigned long simStep);
86 _numberOfRDFTimesteps++;
93 void observeARDFMolecule(
double dd,
double cosPhi,
double cosPhiReverse,
unsigned cid1,
unsigned cid2) {
95 if(dd > _maxDistanceSquare) {
return; }
96 size_t distanceBinID = floor( sqrt(dd) / binwidth() );
97 size_t angularBinID = floor( (-cosPhi + 1.)/ angularbinwidth() );
98 size_t angularBinIDReverse = floor((-cosPhiReverse + 1.)/ angularbinwidth() );
99 size_t binID = distanceBinID * _angularBins + angularBinID;
100 size_t binIDReverse = distanceBinID * _angularBins + angularBinIDReverse;
104 _ARDFdistribution.local[cid1][cid2][binID]++;
108 _ARDFdistribution.local[cid2][cid1][binIDReverse]++;
114 if(isEnabledSiteRDF()) {
120 for(
unsigned m = 0; m < si; m++) {
124 for(
unsigned n = 0; n < sj; n++) {
125 const std::array<double,3> dii = mi.site_d_abs(m);
126 const std::array<double,3> djj = mj.site_d_abs(n);
127 SiteSiteDistanceAbs(dii.data(), djj.data(), drs, dr2);
139 if(dd > _maxDistanceSquare) {
return; }
140 if(i > j) { std::swap(j, i); }
141 size_t binId = floor( sqrt(dd) / binwidth() );
145 _distribution.local[i][j-i][binId]++;
152 inline void observeRDFSite(
double dd,
unsigned i,
unsigned j,
unsigned m,
unsigned n) {
153 if(dd > _maxDistanceSquare) {
return; }
159 unsigned int binId = floor( sqrt(dd) / binwidth() );
163 _siteDistribution.local[i][j-i][m][n][binId] ++;
164 if((i == j) && (m != n)){
168 _siteDistribution.local[i][j-i][n][m][binId] ++;
172 bool isEnabledSiteRDF()
const {
return _doCollectSiteRDF; }
173 bool doARDF()
const {
return _doARDF; }
180 void resizeExactly(std::vector<T>& v,
unsigned int numElements)
const {
181 v.reserve(numElements);
182 v.resize(numElements);
186 unsigned int numBins()
const {
return _bins; }
187 unsigned int numARDFBins()
const {
return _ARDFBins; }
188 double binwidth()
const {
return _intervalLength; }
189 double angularbinwidth()
const {
return _angularIntervalLength; }
194 void accumulateRDF();
196 void writeToFile(
const Domain* domain,
const std::string& filename,
unsigned int i,
unsigned int j)
const;
197 void writeToFileARDF(
const Domain* domain,
const std::string& filename,
unsigned int i,
unsigned int j)
const;
200 double _intervalLength;
204 double _angularIntervalLength;
212 unsigned long _angularBins {1};
216 unsigned long _ARDFBins;
219 unsigned int _numberOfComponents;
222 std::vector<Component>* _components;
225 int _samplingFrequency;
229 int _numberOfRDFTimesteps;
233 int _accumulatedNumberOfRDFTimesteps;
236 double _maxDistanceSquare;
242 std::vector<unsigned long> _globalCtr;
247 std::vector<unsigned long> _globalAccumulatedCtr;
254 std::vector<std::vector<std::vector<unsigned long>>> _globalAccumulatedDistribution;
255 std::vector<std::vector<std::vector<unsigned long>>> _globalAccumulatedARDFDistribution;
257 bool _doCollectSiteRDF;
267 std::vector<std::vector<std::vector<std::vector<std::vector<unsigned long>>>>> _globalAccumulatedSiteDistribution;
269 unsigned int _writeFrequency;
Class implementing molecules as rigid rotators consisting out of different interaction sites (LJcente...
Definition: Component.h:14
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
FullMolecule modeled as LJ sphere with point polarities.
Definition: FullMolecule.h:18
unsigned int numSites() const override
Definition: FullMolecule.h:136
This Interface is used to get access to particles and pairs of particles.
Definition: ParticleContainer.h:69
The PluginBase class provides the interface for any kind of output/plugin classes - called "(output) ...
Definition: PluginBase.h:47
Definition: RDFCellProcessor.h:16
This class calculates the Radial Distribution Function (RDF).
Definition: RDF.h:37
void endStep(ParticleContainer *particleContainer, DomainDecompBase *domainDecomposition, Domain *domain, unsigned long simStep)
plot all the statistics calculated to one or several files
Definition: RDF.cpp:343
void setOutputTimestep(unsigned int timestep)
Definition: RDF.h:73
void observeRDFMolecule(double dd, unsigned i, unsigned j)
Definition: RDF.h:138
void readXML(XMLfileUnits &xmlconfig)
Read in XML configuration for RDFWriter.
Definition: RDF.cpp:154
void observeRDFSite(double dd, unsigned i, unsigned j, unsigned m, unsigned n)
Definition: RDF.h:152
void finish(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain)
Method finish will be called at the end of the simulation.
Definition: RDF.cpp:185
void afterForces(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, unsigned long simstep)
Method afterForces will be called after forcefields have been applied no sitewise Forces can be appli...
Definition: RDF.cpp:573
void accumulateNumberOfMolecules(std::vector< Component > &components)
Definition: RDF.cpp:195
void reset()
reset all values to 0, except the accumulated ones.
Definition: RDF.cpp:309
std::string getPluginName()
return the name of the plugin
Definition: RDF.h:66
void tickRDF()
Definition: RDF.h:85
void setOutputPrefix(std::string prefix)
Definition: RDF.h:77
void init(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain)
Method init will be called at the begin of the simulation.
Definition: RDF.cpp:181
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