12#include "PluginBase.h"
13#include "parallel/DomainDecompBase.h"
14#include "particleContainer/ParticleContainer.h"
46 int _measureinterval = 1;
47 double _directedVelocityOld;
49 unsigned _outputFrequency;
53 double _phiIncrements;
58 double _heightMembrane;
68 double _universalInvProfileUnit[3];
69 double _universalCentre[3];
76 unsigned _iterationsSinceStart;
78 std::map<unsigned, std::map<unsigned, double>> _xyzEkin;
79 std::map<unsigned, std::map<unsigned, double>> _xzEkin;
81 std::map<unsigned, double> _localnumberOfParticles;
82 std::map<unsigned, std::map<unsigned, double>> _localXyzVi;
83 std::map<unsigned, std::map<unsigned, double>> _localXyzVelocities;
84 std::map<unsigned, std::map<unsigned, double>> _localXyzVelocities2;
85 std::map<unsigned, double> _localDirYVelocity2;
87 std::map<unsigned, double> _globalnumberOfParticles;
88 std::map<unsigned, std::map<unsigned, double>> _globalXyzVi;
89 std::map<unsigned, std::map<unsigned, double>> _globalXyzVelocities;
90 std::map<unsigned, std::map<unsigned, double>> _globalXyzVelocities2;
91 std::map<unsigned, double> _globalDirYVelocity2;
93 std::map<unsigned, double> _xyzEkinDroplet;
94 std::map<unsigned, double> _xyzEkinGas;
95 std::map<unsigned, double> _xzEkinDroplet;
96 std::map<unsigned, double> _xzEkinGas;
98 std::map<unsigned, double> _permissibleRange;
100 std::map<unsigned, double> _densityBox;
101 std::map<unsigned, double> _temperatureBox;
102 std::map<unsigned, double> _temperatureBoxXZ;
103 std::map<unsigned, double> _EkinBox;
104 std::map<unsigned, double> _virialBox;
106 std::ofstream DPMStreamDensity;
107 std::ofstream DPMStreamVirial;
108 std::ofstream DPMStreamTemperature;
109 std::ofstream DPMStreamTemperatureXZ;
110 std::ofstream DPMStreamEkin;
112 std::map<unsigned long, double> _simstepArray;
113 std::map<unsigned, std::map<unsigned, double>> _velocDroplet;
114 std::ofstream _DPMGlobalStream;
118 global_log->debug() <<
"DirectPM enabled" << std::endl;
120 for (
unsigned d = 0; d < 3; d++) {
123 _iterationsSinceStart = 0;
124 _binSize[0] = _boxLength[0] / _rIncrements;
125 _binSize[1] = _boxLength[1] / _hIncrements;
126 _binSize[2] = _boxLength[2] / _phiIncrements;
127 _yLowestBox = ceil(_heightWall / _binSize[1]);
128 _yHighestBox = floor(_heightMembrane / _binSize[1]);
129 _yLow = _yLowestBox * _binSize[1];
130 _yHigh = _yHighestBox * _binSize[1];
132 _directedVelocityOld = 0.;
136 _minXZ = _boxLength[0];
137 if (_boxLength[2] < _minXZ) {
138 _minXZ = _boxLength[2];
140 _R2max = 0.24 * _minXZ * _minXZ;
141 _universalInvProfileUnit[0] = _rIncrements / (_R2max);
142 _universalInvProfileUnit[1] = _hIncrements / _boxLength[1];
143 _universalInvProfileUnit[2] = _phiIncrements / (2 * M_PI);
144 _universalCentre[0] = 0.5 * _boxLength[0];
145 _universalCentre[1] = 0.;
146 _universalCentre[2] = 0.5 * _boxLength[2];
147 _volumebox = M_PI / (_universalInvProfileUnit[0] * _universalInvProfileUnit[1] * _phiIncrements);
150 for (
int l = 0; l <= ((_rIncrements * _hIncrements * _phiIncrements)); l++) {
151 _permissibleRange[l] = 1.;
154 for (
int i = 0; i <= _yLowestBox; i++) {
155 for (
int j = 0; j <= _rIncrements; j++) {
156 for (
int k = 0; k <= _phiIncrements; k++) {
157 _permissibleRange[(i * _rIncrements * _phiIncrements) + (j * _phiIncrements) + k] = 0.;
162 for (
int m = _yHighestBox; m <= (_hIncrements); m++) {
163 for (
int n = 0; n <= _rIncrements; n++) {
164 for (
int o = 0; o <= _phiIncrements; o++) {
165 _permissibleRange[(m * _rIncrements * _phiIncrements) + (n * _phiIncrements) + o] = 0.;
171 _DPMGlobalStream.open(
"Global_output_DPM_MK.txt", std::ios::out);
172 _DPMGlobalStream <<
"Ausgabe der globalen Gr��en gerichtete Geschwindigkeit, dichteGas, dichteLiq, druckGas, "
173 "druckLiq, TGas, TLiq, EkinxyzGas, EkinxyzLiq, TGasXZ, TLiqXZ,EkinxzGas und EkinxzLiq,"
175 _DPMGlobalStream << endl;
176 _DPMGlobalStream <<
"Timestept \t\t gerichtete Geschw. \t\t dichteGas \t\t dichteLiq \t\t druckGas \t\t "
177 "druckLiq \t\t TGas \t\t TLiq \t\t EkinxyzGas \t\t EkinxyzLiq\t\t TGasXZ\t\t "
178 "TLiqXZ\t\t EkinxzGas \t\t EkinxzLiq\t\t"
180 _DPMGlobalStream.close();
185 unsigned long simstep)
override;
188 unsigned long simstep)
override;
Plugin: can be enabled via config.xml
Definition: DirectedPM.h:40
void init(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain) override
Method init will be called at the begin of the simulation.
Definition: DirectedPM.h:117
void finish(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain) override
Method finish will be called at the end of the simulation.
Definition: DirectedPM.h:190
std::string getPluginName() override
return the name of the plugin
Definition: DirectedPM.h:192
void readXML(XMLfileUnits &xmlconfig) override
will be called to read configuration
Definition: DirectedPM.cpp:15
void beforeForces(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, unsigned long simstep) override
Method beforeForces will be called before forcefields have been applied no alterations w....
Definition: DirectedPM.cpp:44
void endStep(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain, unsigned long simstep) override
Method endStep will be called at the end of each time step.
Definition: DirectedPM.cpp:559
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
double getGlobalLength(int d) const
return the length of the domain
Definition: Domain.h:163
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
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