ls1-MarDyn
ls1-MarDyn molecular dynamics code
VCP1CLJRMM.h
1/*
2 * VCP1CLJRMM.h
3 *
4 * Created on: 30 Jan 2017
5 * Author: tchipevn
6 */
7
8#ifndef SRC_PARTICLECONTAINER_ADAPTER_VCP1CLJRMM_H_
9#define SRC_PARTICLECONTAINER_ADAPTER_VCP1CLJRMM_H_
10
11#include "CellProcessor.h"
12
14#include "particleContainer/adapter/vectorization/SIMD_VectorizedCellProcessorHelpers.h"
15#include "WrapOpenMP.h"
16
17#include "molecules/MoleculeForwardDeclaration.h"
18
19#include <vector>
20
21class Component;
22class Domain;
23class Comp2Param;
24class CellDataSoARMM;
25
27public:
28 VCP1CLJRMM(Domain & domain, double cutoffRadius, double LJcutoffRadius);
29 ~~VCP1CLJRMM();
30
31
35 void initTraversal();
39 void preprocessCell(ParticleCell& /*cell*/) {}
40
41 void processCellPair(ParticleCell& cell1, ParticleCell& cell2, bool sumAll = false /* related to ZonalMethod */);
42
43 double processSingleMolecule(Molecule* /*m1*/, ParticleCell& /*cell2*/) {
44 return 0.0;
45 }
46
50 void processCell(ParticleCell& cell);
54 void postprocessCell(ParticleCell& /*cell*/) {}
58 void endTraversal();
59
60 void setDtInvm(double dtInvm) {
61 _dtInvm = static_cast<vcp_real_calc>(dtInvm);
62 }
63
64 double getDtInvm() const {
65 return _dtInvm;
66 }
67
68private:
72 Domain & _domain;
73
74
75 vcp_real_calc _eps24, _sig2, _shift6, _dtInvm;
76
81 double _upot6lj;
82
86 double _virial;
87
88 struct VCP1CLJRMMThreadData {
89 public:
90 VCP1CLJRMMThreadData(): _ljc_dist_lookup(nullptr){
91 _upot6ljV.resize(_numVectorElements);
92 _virialV.resize(_numVectorElements);
93
94 for (size_t j = 0; j < _numVectorElements; ++j) {
95 _upot6ljV[j] = 0.0;
96 _virialV[j] = 0.0;
97 }
98 }
99
105 AlignedArray<vcp_lookupOrMask_single> _centers_dist_lookup;
106
110 vcp_lookupOrMask_single* _ljc_dist_lookup;
111
112 AlignedArray<vcp_real_accum> _upot6ljV, _virialV;
113 };
114
115 std::vector<VCP1CLJRMMThreadData *> _threadData;
116
117 static const size_t _numVectorElements = VCP_VEC_SIZE;
118 size_t _numThreads;
119
120 template<bool calculateMacroscopic>
121 vcp_inline
122 void _loopBodyLJ(
123 const RealCalcVec& c_dx, const RealCalcVec& c_dy, const RealCalcVec& c_dz, const RealCalcVec& c_r2,
124 RealCalcVec& f_x, RealCalcVec& f_y, RealCalcVec& f_z,
125 RealAccumVec& sum_upot6lj, RealAccumVec& sum_virial,
126 const MaskCalcVec& forceMask,
127 const RealCalcVec& eps_24, const RealCalcVec& sig2,
128 const RealCalcVec& shift6);
129
152 template<class ForcePolicy, bool CalculateMacroscopic, class MaskGatherChooser>
153 vcp_inline void _calculatePairs(CellDataSoARMM & soa1, CellDataSoARMM & soa2);
154
155};
156
157#endif /* SRC_PARTICLECONTAINER_ADAPTER_VCP1CLJRMM_H_ */
Defines the length of the vectors and the corresponding functions.
An aligned array.
Definition: AlignedArray.h:75
Structure of Arrays for single-center lennard-Jones molecules for the RMM run.
Definition: CellDataSoARMM.h:16
Definition: CellProcessor.h:29
Definition: Comp2Param.h:15
Class implementing molecules as rigid rotators consisting out of different interaction sites (LJcente...
Definition: Component.h:14
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
FullParticleCell data structure. Renamed from ParticleCell.
Definition: FullParticleCell.h:49
Definition: VCP1CLJRMM.h:26
void preprocessCell(ParticleCell &)
Load the CellDataSoA for cell.
Definition: VCP1CLJRMM.h:39
void endTraversal()
Store macroscopic values in the Domain.
Definition: VCP1CLJRMM.cpp:166
void initTraversal()
Reset macroscopic values to 0.0.
Definition: VCP1CLJRMM.cpp:74
void processCellPair(ParticleCell &cell1, ParticleCell &cell2, bool sumAll=false)
Definition: VCP1CLJRMM.cpp:88
void postprocessCell(ParticleCell &)
Free the LennardJonesSoA for cell.
Definition: VCP1CLJRMM.h:54
void processCell(ParticleCell &cell)
Calculate forces between pairs of Molecules in cell.
Definition: VCP1CLJRMM.cpp:154
Definition: MaskVec.h:16
Definition: RealVec.h:22