ls1-MarDyn
ls1-MarDyn molecular dynamics code
Planar.h
1
2//Calculation of the surface tension in a system with planar interfaces needs a Long Range Correction.
3//
4//The correction terms are based on Janecek (2006) and Lustig (1988).
5
6#ifndef PLANAR_H_
7#define PLANAR_H_
8
9#include "LongRangeCorrection.h"
10
11#include "utils/ObserverBase.h"
12#include "utils/Region.h"
13
14#include <vector>
15#include <cmath>
16#include <string>
17#include <map>
18#include <cstdint>
19
20#include "molecules/MoleculeForwardDeclaration.h"
21class Domain;
23
25public:
26 Planar(double cutoffT,double cutoffLJ,Domain* domain, DomainDecompBase* domainDecomposition, ParticleContainer* particleContainer, unsigned slabs, Simulation* simulation);
27 virtual ~~Planar();
28
50 virtual void init();
51 virtual void readXML(XMLfileUnits& xmlconfig);
52 virtual void calculateLongRange();
53 double lrcLJ(Molecule* mol);
54 // For non-equilibrium simulations the density profile must not be smoothed, therefore the density profile from the actual time step is used.
55 void directDensityProfile();
56 void SetSmoothDensityProfileOption(bool bVal) {_smooth = bVal;}
57 virtual void writeProfiles(DomainDecompBase* domainDecomp, Domain* domain, unsigned long simstep);
58
59 // Observer, ControlInstance
60 SubjectBase* getSubject();
61 void update(SubjectBase* subject) override;
62 std::string getShortName() override {return "Planar";}
63
64private:
65 template<typename T>
66 void resizeExactly(std::vector<T>& v, unsigned int numElements) const {
67 v.reserve(numElements);
68 v.resize(numElements);
69 }
70
71 void centerCenter(double sig,double eps,unsigned ci,unsigned cj,unsigned si, unsigned sj);
72 void centerSite(double sig,double eps,unsigned ci,unsigned cj,unsigned si, unsigned sj);
73 void siteSite(double sig,double eps,unsigned ci,unsigned cj,unsigned si, unsigned sj);
74 void dipoleDipole(unsigned ci,unsigned cj,unsigned si,unsigned sj);
75
76 unsigned _slabs;
77 unsigned numComp;
78 std::vector<unsigned> numLJ;
79 std::vector<unsigned> numDipole;
80 unsigned numLJSum;
81 unsigned numDipoleSum;
82 std::vector<unsigned> numLJSum2;
83 std::vector<unsigned> numDipoleSum2;
84 bool _smooth;
85// bool _dipole;
86 std::vector<double> uLJ;
87 std::vector<double> vNLJ;
88 std::vector<double> vTLJ;
89 std::vector<double> fLJ;
90 std::vector<double> rho_g;
91 std::vector<double> rho_l;
92 std::vector<double> fDipole;
93 std::vector<double> uDipole;
94 std::vector<double> vNDipole;
95 std::vector<double> vTDipole;
96 std::vector<double> rhoDipole;
97 std::vector<double> rhoDipoleL;
98 std::vector<double> muSquare;
99 std::vector<double> eLong;
100 double cutoff;
101 double delta;
102 unsigned cutoff_slabs;
103 int frequency;
104 double ymax;
105 double boxlength[3];
106 struct RegionPos {
107 int refPosID[2]; // kind of reference position, see DistControl
108 double refPos[2]; // left and right boundary (y coord) set in config.xml
109 double actPos[2]; // left and right boundary (y coord) within the correction is applied
110 } _region;
111 SubjectBase* _subject;
112 double V;
113 int sint;
114 double temp;
115 unsigned simstep;
116
117 ParticleContainer* _particleContainer;
118 Domain* _domain;
119 DomainDecompBase* _domainDecomposition;
120
121 // write control
122 uint64_t _nStartWritingProfiles;
123 uint64_t _nWriteFreqProfiles;
124 uint64_t _nStopWritingProfiles;
125};
126
127
128#endif /*Planar_H_*/
Definition: Region.h:29
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
Definition: LongRangeCorrection.h:12
Definition: ObserverBase.h:13
This Interface is used to get access to particles and pairs of particles.
Definition: ParticleContainer.h:69
Definition: Planar.h:24
virtual void init()
Read in XML configuration for Planar and all its included objects.
Definition: Planar.cpp:40
Controls the simulation process.
Definition: Simulation.h:70
Definition: ObserverBase.h:20
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