ls1-MarDyn
ls1-MarDyn molecular dynamics code
COMaligner.h
1/*
2 * COMaligner.h
3 *
4 * Created on: 7 May 2018
5 * Author: kruegener
6 */
7
8#ifndef MARDYN_TRUNK_COMALIGNER_H
9#define MARDYN_TRUNK_COMALIGNER_H
10
11class COMalignerTest;
12#include "PluginBase.h"
13#include "particleContainer/ParticleContainer.h"
14#include "Domain.h"
15#include "parallel/DomainDecompBase.h"
16
37class COMaligner : public PluginBase{
38
39private:
40 friend COMalignerTest;
41
42 // DEFAULT: ALIGN IN ALL DIMENSIONS
43 bool _alignX = true;
44 bool _alignY = true;
45 bool _alignZ = true;
46
47 bool _enabled = true;
48
49 int _dim_start = 0;
50 int _dim_end = 3;
51 int _dim_step = 1;
52
53 // DEFAULT: EVERY FRAME FULL ALIGNMENT
54 int _interval = 1;
55 float _alignmentCorrection = 1.0f;
56
57 double _motion[3];
58 double _balance[3];
59 double _mass = 0.0;
60 double _boxLength[3];
61 double _cutoff;
62
63public:
64 COMaligner(){
65 // SETUP
66 for (unsigned d = 0; d < 3; d++) {
67 _balance[d] = 0.0;
68 _motion[d] = 0.0;
69 }
70 };
71 ~~COMaligner(){};
72
73 void init(ParticleContainer* particleContainer, DomainDecompBase* domainDecomp, Domain* domain) override {
74 global_log -> debug() << "COM Realignment enabled" << std::endl;
75
76 for(unsigned d = 0; d < 3; d++){
77 _boxLength[d] = domain->getGlobalLength(d);
78 }
79
80 _cutoff = .9*particleContainer->getCutoff();
81
82 }
83
84 void readXML (XMLfileUnits& xmlconfig) override;
85
86 void beforeForces(ParticleContainer* particleContainer, DomainDecompBase* domainDecomp, unsigned long simstep) override;
87
88 void endStep(
89 ParticleContainer *particleContainer, DomainDecompBase *domainDecomp,
90 Domain *domain, unsigned long simstep) override;
91
92
93 void finish(ParticleContainer *particleContainer,
94 DomainDecompBase *domainDecomp, Domain *domain) override {};
95
96 std::string getPluginName()override {return std::string("COMaligner");}
97
98 static PluginBase* createInstance(){return new COMaligner();}
99
100};
101
102
103#endif //MARDYN_TRUNK_COMALIGNER_H
Plugin: can be enabled via config.xml
Definition: COMaligner.h:37
std::string getPluginName() override
return the name of the plugin
Definition: COMaligner.h:96
void beforeForces(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, unsigned long simstep) override
called before Forces are applied calculates realignment motion that is applied after the forces have ...
Definition: COMaligner.cpp:100
void init(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain) override
Method init will be called at the begin of the simulation.
Definition: COMaligner.h:73
void finish(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain) override
Method finish will be called at the end of the simulation.
Definition: COMaligner.h:93
void endStep(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain, unsigned long simstep) override
called after Forces are applied applies the motion calculated earlier
Definition: COMaligner.cpp:185
void readXML(XMLfileUnits &xmlconfig) override
will be called to read configuration
Definition: COMaligner.cpp:20
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