OpenLB 1.7
Loading...
Searching...
No Matches
forceFromExtField3D.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 Marie-Luise Maier
3 * E-mail contact: info@openlb.net
4 * The most recent release of OpenLB can be downloaded at
5 * <http://www.openlb.net/>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public
18 * License along with this program; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 */
22
23#ifndef ForceFromExtField3D_HH
24#define ForceFromExtField3D_HH
25
26#include "forceFromExtField3D.h"
27
28namespace olb {
29
30template<typename T, template<typename U> class PARTICLETYPE, typename DESCRIPTOR>
32// SuperLattice<T, DESCRIPTOR>& sLattice,
33 // SuperLatticeField3D<T, DESCRIPTOR>& sLatticeForceField,
34 AnalyticalFfromSuperF3D<T>& analyticalExternalField,
35 T scale) :
36 Force3D<T, PARTICLETYPE>(),
37// _sLattice(sLattice),
38 //_sLatticeForceField(sLatticeForceField),
39 _analyticalExternalField(analyticalExternalField),
40 _scale(scale)
41{ }
42
43template<typename T, template<typename U> class PARTICLETYPE, typename DESCRIPTOR>
45 typename std::deque<PARTICLETYPE<T> >::iterator p, int pInt,
47{
48
49// int glob = p->getCuboid();
50// int latticePos[3] = { 0, 0, 0 };
51//
52// _sLattice.getCuboidGeometry().get(p->getCuboid()).getLatticeR(latticePos,
53// &p->getPos()[0]);
54//
55// int X[4] = { glob, latticePos[0], latticePos[1], latticePos[2] };
56//
57 T F[3] = { T(), T(), T() };
58// _sLatticeForceField(F, X);
59
60 _analyticalExternalField(F, &p->getPos()[0]);
61 p->getForce()[0] += F[0] * _scale;
62 p->getForce()[1] += F[1] * _scale;
63 p->getForce()[2] += F[2] * _scale;
64}
65
66}
67#endif
Converts super functors to analytical functors.
Prototype for all particle forces.
Definition force3D.h:43
void applyForce(typename std::deque< PARTICLETYPE< T > >::iterator p, int pInt, ParticleSystem3D< T, PARTICLETYPE > &psSys) override
ForceFromExtField3D(AnalyticalFfromSuperF3D< T > &analyticalExternalField, T scale=T(1.))
Top level namespace for all of OpenLB.