ls1-MarDyn
ls1-MarDyn molecular dynamics code
VectorizedChargeP2PCellProcessor.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <stdlib.h>
10#include "bhfmm/containers/ParticleCellPointers.h"
11#include "utils/AlignedArray.h"
13#include "particleContainer/adapter/vectorization/SIMD_VectorizedCellProcessorHelpers.h"
14#include "particleContainer/adapter/CellDataSoA.h"
15#include "WrapOpenMP.h"
16
17#include <iostream>
18#include <vector>
19#include <cmath>
20
21#include "molecules/MoleculeForwardDeclaration.h"
22
23class Component;
24class Domain;
25class Comp2Param;
26
27namespace bhfmm {
33public:
34 typedef std::vector<Component> ComponentList;
35
40 VectorizedChargeP2PCellProcessor(Domain & domain, double cutoffRadius=0, double LJcutoffRadius=0);
41
43
47 void initTraversal();
67 void endTraversal();
68
69 void printTimers();
70
71private:
72 double _cutoffRadiusSquare;
73
77 typedef std::vector<Molecule *> MoleculeList;
78
82 Domain & _domain;
83
87 double _upotXpoles;
88
92 double _virial;
93
94 struct VCP2PCPThreadData {
95 public:
96 VCP2PCPThreadData(): _charges_dist_lookup(nullptr){
97 _upotXpolesV.resize(_numVectorElements);
98 _virialV.resize(_numVectorElements);
99
100 for (size_t j = 0; j < _numVectorElements; ++j) {
101 _upotXpolesV[j] = 0.0;
102 _virialV[j] = 0.0;
103 }
104 }
105
111 AlignedArray<vcp_lookupOrMask_single> _centers_dist_lookup;
112
116 vcp_lookupOrMask_single* _charges_dist_lookup;
117
118 AlignedArray<vcp_real_accum> _upotXpolesV, _virialV;
119 };
120
121 std::vector<VCP2PCPThreadData *> _threadData;
122
123 static const size_t _numVectorElements = VCP_VEC_SIZE;
124 size_t _numThreads;
125
126 template<bool calculateMacroscopic>
127 inline void _loopBodyCharge(
128 const RealCalcVec& m1_r_x, const RealCalcVec& m1_r_y, const RealCalcVec& m1_r_z,
129 const RealCalcVec& r1_x, const RealCalcVec& r1_y, const RealCalcVec& r1_z,
130 const RealCalcVec& qii,
131 const RealCalcVec& m2_r_x, const RealCalcVec& m2_r_y, const RealCalcVec& m2_r_z,
132 const RealCalcVec& r2_x, const RealCalcVec& r2_y, const RealCalcVec& r2_z,
133 const RealCalcVec& qjj,
134 RealCalcVec& f_x, RealCalcVec& f_y, RealCalcVec& f_z,
135 RealAccumVec& V_x, RealAccumVec& V_y, RealAccumVec& V_z,
136 RealAccumVec& sum_upotXpoles, RealAccumVec& sum_virial,
137 const MaskCalcVec& forceMask);
138
161 template<class ForcePolicy, bool CalculateMacroscopic, class MaskGatherChooser>
162 void _calculatePairs(CellDataSoA & soa1, CellDataSoA & soa2);
163
164}; /* end of class VectorizedChargeP2PCellProcessor */
165
166} // namespace bhfmm
167
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: 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
Definition: ParticleCellPointers.h:44
Vectorized calculation of the force.
Definition: VectorizedChargeP2PCellProcessor.h:32
void processCellPair(ParticleCellPointers &cell1, ParticleCellPointers &cell2)
Calculate forces between pairs of Molecules in cell1 and cell2.
Definition: VectorizedChargeP2PCellProcessor.cpp:541
void processCell(ParticleCellPointers &cell)
Calculate forces between pairs of Molecules in cell.
Definition: VectorizedChargeP2PCellProcessor.cpp:531
void preprocessCell(ParticleCellPointers &cell)
Load the CellDataSoA for cell.
Definition: VectorizedChargeP2PCellProcessor.cpp:117
void initTraversal()
Reset macroscopic values to 0.0.
Definition: VectorizedChargeP2PCellProcessor.cpp:74
void endTraversal()
Store macroscopic values in the Domain.
Definition: VectorizedChargeP2PCellProcessor.cpp:87
VectorizedChargeP2PCellProcessor(Domain &domain, double cutoffRadius=0, double LJcutoffRadius=0)
Construct and set up the internal parameter table.
Definition: VectorizedChargeP2PCellProcessor.cpp:20
void postprocessCell(ParticleCellPointers &cell)
Free the LennardJonesSoA for cell.
Definition: VectorizedChargeP2PCellProcessor.cpp:194
Definition: MaskVec.h:16
Definition: RealVec.h:22
Definition: L2PCellProcessor.cpp:15