ls1-MarDyn
ls1-MarDyn molecular dynamics code
FastMultipoleMethod.h
1/*
2 * FastMultipoleMethod.h
3 *
4 * Created on: Feb 7, 2015
5 * Author: tchipev
6 */
7
8#ifndef FASTMULTIPOLEMETHOD_H_
9#define FASTMULTIPOLEMETHOD_H_
10
11#include <bhfmm/containers/LeafNodesContainer.h>
12#include <bhfmm/containers/UniformPseudoParticleContainer.h>
13#include "bhfmm/containers/PseudoParticleContainer.h"
14#include "particleContainer/ParticleContainer.h"
15#ifdef QUICKSCHED
16#include "quicksched.h"
17#endif
18
19namespace bhfmm {
20class FastMultipoleMethod;
21class UniformPseudoParticleContainer;
22// needed for static runner()
23static FastMultipoleMethod *contextFMM;
24
25#ifdef QUICKSCHED
26 //TODO more unions to save space
27struct qsched_payload {
28 // Stuff for P2P and pre/post processing
29 union {
30 ParticleCellPointers *pointer;
31 int coordinates[3];
32 } cell;
33 int taskBlockSize[3];
34 LeafNodesContainer *leafNodesContainer;
35
36 // Stuff for M2L and init/finalize FFT
37
38 int currentLevel,
39 currentMultipole, // or target
40 sourceMultipole,
41 currentEdgeLength;
42 UniformPseudoParticleContainer *uniformPseudoParticleContainer;
43};
44#endif
46public:
47 FastMultipoleMethod() : _order(-1),
48 _LJCellSubdivisionFactor(0),
49 _wellSeparated(0),
50 _adaptive(false)
51 {}
53
64 void readXML(XMLfileUnits& xmlconfig);
65
66 void setParameters(unsigned LJSubdivisionFactor, int orderOfExpansions,
67 bool periodic = true, bool adaptive = false);
68
69 void init(double globalDomainLength[3], double bBoxMin[3],
70 double bBoxMax[3], double LJCellLength[3], ParticleContainer* ljContainer);
71
72 void computeElectrostatics(ParticleContainer * ljContainer);
73
74 void printTimers();
75
76 enum taskType {
77 P2PPreprocessSingleCell,
78 P2PPostprocessSingleCell,
79 P2Pc08StepBlock,
80 P2MCompleteCell,
81 M2MCompleteCell,
82 M2LInitializeCell,
83 M2LInitializeSource,
84 M2LFinalizeCell,
85 M2LTranslation,
86 M2LPair2Way,
87 L2LCompleteCell,
88 L2PCompleteCell,
89 Dummy
90 };
91
92private:
93 int _order;
94 unsigned _LJCellSubdivisionFactor;
95 int _wellSeparated;
96 int _adaptive;
97 int _periodic;
98
99 PseudoParticleContainer * _pseudoParticleContainer;
100
102 P2MCellProcessor *_P2MProcessor;
103 L2PCellProcessor *_L2PProcessor;
104
105
106#ifdef QUICKSCHED
107 static void runner(int type, void *data);
108 struct qsched *_scheduler;
109#endif // QUICKSCEHD
110};
111
112} /* namespace bhfmm */
113
114#endif /* FASTMULTIPOLEMETHOD_H_ */
This Interface is used to get access to particles and pairs of particles.
Definition: ParticleContainer.h:69
XML file with unit attributes abstraction.
Definition: xmlfileUnits.h:25
Definition: FastMultipoleMethod.h:45
void readXML(XMLfileUnits &xmlconfig)
Read in XML configuration for FastMultipoleMethod and all its included objects.
Definition: FastMultipoleMethod.cpp:33
Definition: L2PCellProcessor.h:17
Definition: P2MCellProcessor.h:18
Definition: PseudoParticleContainer.h:46
Vectorized calculation of the force.
Definition: VectorizedChargeP2PCellProcessor.h:32
Enumeration class corresponding to the type schema type.
Definition: vtk-unstructured.h:1746
Definition: L2PCellProcessor.cpp:15