ls1-MarDyn
ls1-MarDyn molecular dynamics code
VectorizedLJP2PCellProcessor.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <stdlib.h>
10#include "particleContainer/adapter/CellProcessor.h"
11#include "utils/AlignedArray.h"
12#include <iostream>
13#include <vector>
14#include <cmath>
16#include "particleContainer/adapter/vectorization/SIMD_VectorizedCellProcessorHelpers.h"
17#include "WrapOpenMP.h"
18
19#include "molecules/MoleculeForwardDeclaration.h"
20
21class Component;
22class Domain;
23class Comp2Param;
24class CellDataSoA;
25
26namespace bhfmm {
32public:
33 typedef std::vector<Component> ComponentList;
34
39 VectorizedLJP2PCellProcessor(Domain & domain, double cutoffRadius, double LJcutoffRadius);
40
42
46 void initTraversal();
50 void preprocessCell(ParticleCell& /*cell*/) {}
51
52 double processSingleMolecule(Molecule* /*m1*/, ParticleCell& /*cell2*/) {
53 return 0.0;
54 }
55
59 void processCell(ParticleCell& cell);
60
61 void processCellPair(ParticleCell& c1, ParticleCell& c2, bool sumAll = false);
65 void postprocessCell(ParticleCell& /*cell*/) {}
69 void endTraversal();
70
71 void printTimers();
72
73
74private:
78 typedef std::vector<Molecule *> MoleculeList;
79
83 Domain & _domain;
84
88 //const double _cutoffRadiusSquare;
89
93 //const double _LJcutoffRadiusSquare;
94
98 const double _epsRFInvrc3;
99
113 std::vector<AlignedArray<vcp_real_calc> > _eps_sig;
114
120 std::vector<AlignedArray<vcp_real_calc> > _shift6;
121
126 double _upot6lj;
127
131 double _virial;
132
133 struct VLJP2PCPThreadData {
134 public:
135 VLJP2PCPThreadData(): _ljc_dist_lookup(nullptr){
136 _upot6ljV.resize(_numVectorElements);
137 _virialV.resize(_numVectorElements);
138
139 for (size_t j = 0; j < _numVectorElements; ++j) {
140 _upot6ljV[j] = 0.0;
141 _virialV[j] = 0.0;
142 }
143 }
144
150 AlignedArray<vcp_lookupOrMask_single> _centers_dist_lookup;
151
155 vcp_lookupOrMask_single* _ljc_dist_lookup;
156
157 AlignedArray<vcp_real_accum> _upot6ljV, _virialV;
158 };
159
160 std::vector<VLJP2PCPThreadData *> _threadData;
161
162 static const size_t _numVectorElements = VCP_VEC_SIZE;
163 size_t _numThreads;
164
165 template<bool calculateMacroscopic>
166 inline
167 void _loopBodyLJ(
168 const RealCalcVec& m1_r_x, const RealCalcVec& m1_r_y, const RealCalcVec& m1_r_z,
169 const RealCalcVec& r1_x, const RealCalcVec& r1_y, const RealCalcVec& r1_z,
170 const RealCalcVec& m2_r_x, const RealCalcVec& m2_r_y, const RealCalcVec& m2_r_z,
171 const RealCalcVec& r2_x, const RealCalcVec& r2_y, const RealCalcVec& r2_z,
172 RealCalcVec& f_x, RealCalcVec& f_y, RealCalcVec& f_z,
173 RealAccumVec& V_x, RealAccumVec& V_y, RealAccumVec& V_z,
174 RealAccumVec& sum_upot6lj, RealAccumVec& sum_virial,
175 const MaskCalcVec& forceMask,
176 const RealCalcVec& eps_24, const RealCalcVec& sig2,
177 const RealCalcVec& shift6);
178
201 template<class ForcePolicy, bool CalculateMacroscopic, class MaskGatherChooser>
202 void _calculatePairs(CellDataSoA & soa1, CellDataSoA & soa2);
203
204}; /* end of class VectorizedLJP2PCellProcessor */
205
206} // namespace bhfmm
AlignedArray.h.
Defines the length of the vectors and the corresponding functions.
An aligned array.
Definition: AlignedArray.h:75
Structure of Arrays for vectorized force calculation.
Definition: CellDataSoA.h:22
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
Vectorized calculation of the force.
Definition: VectorizedLJP2PCellProcessor.h:31
void processCell(ParticleCell &cell)
Calculate forces between pairs of Molecules in cell.
Definition: VectorizedLJP2PCellProcessor.cpp:469
void processCellPair(ParticleCell &c1, ParticleCell &c2, bool sumAll=false)
Definition: VectorizedLJP2PCellProcessor.cpp:480
VectorizedLJP2PCellProcessor(Domain &domain, double cutoffRadius, double LJcutoffRadius)
Construct and set up the internal parameter table.
Definition: VectorizedLJP2PCellProcessor.cpp:21
void initTraversal()
Reset macroscopic values to 0.0.
Definition: VectorizedLJP2PCellProcessor.cpp:120
void endTraversal()
Store macroscopic values in the Domain.
Definition: VectorizedLJP2PCellProcessor.cpp:134
void preprocessCell(ParticleCell &)
Load the CellDataSoA for cell.
Definition: VectorizedLJP2PCellProcessor.h:50
void postprocessCell(ParticleCell &)
Free the LennardJonesSoA for cell.
Definition: VectorizedLJP2PCellProcessor.h:65
Definition: MaskVec.h:16
Definition: RealVec.h:22
Definition: L2PCellProcessor.cpp:15