OpenLB 1.7
Loading...
Searching...
No Matches
particleManager.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2022 Nicolas Hafen, Mathias J. Krause
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22*/
23
24
25/* The particle manager is intended to provide a semi-generic wrapper for dynamic functions in
26 * struct form. Its main purpose is the reduction of loops over all particles. Fitting structs
27 * can both be administered by the particle manager or by calling them directly it, if desired.
28*/
29
31
32#ifndef PARTICLE_MANAGER_H
33#define PARTICLE_MANAGER_H
34
35namespace olb {
36
37namespace particles {
38
39namespace dynamics {
40
41template<typename T, typename DESCRIPTOR, typename PARTICLETYPE>
43private:
44 XParticleSystem<T,PARTICLETYPE>& _xParticleSystem;
47 UnitConverter<T,DESCRIPTOR> const& _converter;
48 Vector<T,PARTICLETYPE::d> _externalAcceleration;
51
52 //Condition for TASKs requiring no particle loop
53 template <typename TASK>
54 using requires_no_loop = std::integral_constant<bool, !TASK::particleLoop>;
55
56 //Unpack tasks requiring loop
57 template<typename taskList, typename ISEQ>
58 void unpackTasksLooped(Particle<T,PARTICLETYPE>& particle, T timeStepSize, ISEQ seq, int globiC=0);
59
60public:
61 //Constructor
63 XParticleSystem<T,PARTICLETYPE>& xParticleSystem,
66 UnitConverter<T,DESCRIPTOR> const& converter,
69
70 //Execute task and pass time step
71 template<typename ...TASKLIST>
72 void execute(T timeStepSize);
73
74 //Execute task and use timestep provided by the converter
75 template<typename ...TASKLIST>
76 void execute();
77
78 // Getter for particle communicator
80
82 void setExternalAcceleration(const Vector<T,PARTICLETYPE::d>& externalAcceleration);
83};
84
85
86} //namespace dynamics
87
88} //namespace particles
89
90} //namespace olb
91
92
93#endif
Representation of a statistic for a parallel 2D geometry.
Super class maintaining block lattices for a cuboid decomposition.
Conversion between physical and lattice units, as well as discretization.
Plain old scalar vector.
Definition vector.h:47
ParticleManager(XParticleSystem< T, PARTICLETYPE > &xParticleSystem, SuperGeometry< T, DESCRIPTOR::d > &sGeometry, SuperLattice< T, DESCRIPTOR > &sLattice, UnitConverter< T, DESCRIPTOR > const &converter, Vector< T, PARTICLETYPE::d > externalAcceleration=Vector< T, PARTICLETYPE::d >(0.), Vector< bool, PARTICLETYPE::d > periodic=Vector< bool, PARTICLETYPE::d >(false))
const communication::ParticleCommunicator & getParticleCommunicator()
void setExternalAcceleration(const Vector< T, PARTICLETYPE::d > &externalAcceleration)
Set external acceleration.
std::conditional_t< PARTICLETYPE::template providesNested< descriptors::PARALLELIZATION >(), SuperParticleSystem< T, PARTICLETYPE >, ParticleSystem< T, PARTICLETYPE > > XParticleSystem
Top level namespace for all of OpenLB.