ls1-MarDyn
ls1-MarDyn molecular dynamics code
WallPotential.h
1//
2// Created by kruegener on 6/8/2018.
3// moved from /molecules/Wall.h by mheinen
4//
5
6#ifndef MARDYN_TRUNK_WALLPOTENTIAL_H
7#define MARDYN_TRUNK_WALLPOTENTIAL_H
8
9#include "PluginBase.h"
10#include "particleContainer/ParticleContainer.h"
11#include "Domain.h"
12#include "parallel/DomainDecompBase.h"
13
43
44private:
45 double _rhoW, _yc, _yOff, _delta;
46 double* _eps_wi;
47 double* _sig3_wi;
48 double* _sig2_wi;
49 double* _sig_wi;
50 double* _uShift_9_3;
51 double* _uPot_9_3;
52 double* _uShift_10_4_3;
53 double* _uPot_10_4_3;
54 unsigned _nc;
55 double _dWidth;
56 double _dWidthHalf;
57 std::vector<bool> _bConsiderComponent;
58 Domain* _domain;
59
60 enum Potential {
61 LJ9_3,
62 LJ10_4,
63 };
64 int _potential;
65
66public:
67 WallPotential(): _rhoW(0.),
68 _yc(0.),
69 _yOff(0.),
70 _delta(0.),
71 _eps_wi(nullptr),
72 _sig3_wi(nullptr),
73 _sig2_wi(nullptr),
74 _sig_wi(nullptr),
75 _uShift_9_3(nullptr),
76 _uPot_9_3(nullptr),
77 _uShift_10_4_3(nullptr),
78 _uPot_10_4_3(nullptr),
79 _nc(0),
80 _dWidth(0.),
81 _dWidthHalf(0.){
82
83 };
85 // free memory
86 delete [] _eps_wi;
87 delete [] _sig3_wi;
88 delete [] _sig2_wi;
89 delete [] _sig_wi;
90 delete [] _uShift_9_3;
91 delete [] _uPot_9_3;
92 delete [] _uShift_10_4_3;
93 delete [] _uPot_10_4_3;
94 };
95
96 void init(ParticleContainer* particleContainer, DomainDecompBase* domainDecomp, Domain* domain) override {
97 global_log -> debug() << "[WallPotential] Wall enabled" << std::endl;
98 _domain = domain;
99 }
100
101 void readXML (XMLfileUnits& xmlconfig) override;
102
104 ParticleContainer *particleContainer, DomainDecompBase *domainDecomp,
105 Domain *domain, unsigned long simstep) override {};
106
107 void finish(ParticleContainer *particleContainer,
108 DomainDecompBase *domainDecomp, Domain *domain) override {};
109
110 std::string getPluginName()override {return std::string("WallPotential");}
111
112 static PluginBase* createInstance(){return new WallPotential();}
113
114 void initializeLJ93(const vector<Component> *components, double in_rhoWall, double in_sigWall, double in_epsWall,
115 vector<double> in_xi, vector<double> in_eta, double in_yOffWall, double in_yWallCut);
116
117 void initializeLJ1043(const vector<Component> *components, double in_rhoWall, double in_sigWall, double in_epsWall,
118 vector<double> in_xi, vector<double> in_eta, double in_yOffWall, double in_yWallCut);
119
120 void calcTSLJ_9_3(ParticleContainer *partContainer);
121
122 void calcTSLJ_10_4(ParticleContainer *partContainer);
123
124 void siteWiseForces(ParticleContainer* particleContainer, DomainDecompBase* domainDecomp,
125 unsigned long simstep) override;
126};
127
128
129#endif //MARDYN_TRUNK_WALLPOTENTIAL_H
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
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
WallPotential exerts the force of a Lennard-Jones potential on the Lennard-Jones centers of particles...
Definition: WallPotential.h:42
void initializeLJ93(const vector< Component > *components, double in_rhoWall, double in_sigWall, double in_epsWall, vector< double > in_xi, vector< double > in_eta, double in_yOffWall, double in_yWallCut)
initialize the LJ93 potential and calculate potential energy at cutoff
Definition: WallPotential.cpp:105
std::string getPluginName() override
return the name of the plugin
Definition: WallPotential.h:110
void finish(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain) override
Method finish will be called at the end of the simulation.
Definition: WallPotential.h:107
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: WallPotential.h:103
void initializeLJ1043(const vector< Component > *components, double in_rhoWall, double in_sigWall, double in_epsWall, vector< double > in_xi, vector< double > in_eta, double in_yOffWall, double in_yWallCut)
initialize the LJ1043 potential and calculate potential energy at cutoff
Definition: WallPotential.cpp:147
void siteWiseForces(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, unsigned long simstep) override
gets called during the force update step. calls the appropriate calculation function.
Definition: WallPotential.cpp:351
void calcTSLJ_10_4(ParticleContainer *partContainer)
Calculate and add forces to lennard-jones-sites. Also calculate new potential energy addition.
Definition: WallPotential.cpp:264
void readXML(XMLfileUnits &xmlconfig) override
reads in configuration from config.xml. see class doc for example .xml
Definition: WallPotential.cpp:13
void calcTSLJ_9_3(ParticleContainer *partContainer)
Calculate and add forces to lennard-jones-sites. Also calculate new potential energy addition.
Definition: WallPotential.cpp:193
void init(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain) override
Method init will be called at the begin of the simulation.
Definition: WallPotential.h:96
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