28#ifndef EUL2LAGR_POST_PROCESSOR_HH
29#define EUL2LAGR_POST_PROCESSOR_HH
36template<
typename T,
typename DESCRIPTOR,
template<
typename U>
class PARTICLETYPE>
38 : _superGeometry(superGeometry),
42template<
typename T,
typename DESCRIPTOR,
template<
typename U>
class PARTICLETYPE>
49 for (
int iX=0; iX<blockLattice.
getNx(); ++iX) {
50 for (
int iY=0; iY<blockLattice.
getNy(); ++iY) {
51 for (
int iZ=0; iZ<blockLattice.
getNz(); ++iZ) {
52 blockLattice.
get(iX,iY,iZ).template setField<descriptors::EUL2LAGR>(0.);
58 int overlap = _superGeometry.getOverlap();
59 for (
auto p : _pSystem.getParticlesPointer()) {
61 T physPosP[] { p->getPos()[0], p->getPos()[1], p->getPos()[2] };
62 int latticeRoundedPosP[] {0, 0, 0, 0};
63 _superGeometry.getCuboidGeometry().getLatticeR (latticeRoundedPosP, physPosP);
64 latticeRoundedPosP[1] += overlap;
65 latticeRoundedPosP[2] += overlap;
66 latticeRoundedPosP[3] += overlap;
68 T eul2LagrRho = blockLattice.
get(&latticeRoundedPosP[1]).template getField<descriptors::EUL2LAGR>();
70 blockLattice.
get(&latticeRoundedPosP[1]).template setField<descriptors::EUL2LAGR>(eul2LagrRho);
80template<
typename T,
typename DESCRIPTOR>
81Eul2LagrPostProcessor3D <T,DESCRIPTOR>::
82Eul2LagrPostProcessor3D (
int x0,
int x1,
int y0,
int y1,
int z0,
int z1,
84 : _x0(x0), _x1(x1), _y0(y0), _y1(y1), _z0(z0), _z1(z1), _eul2LagrOperator(eul2LagrOperator)
86 this->
getName() =
"Eul2LagrPostProcessor3D";
89template<
typename T,
typename DESCRIPTOR>
90Eul2LagrPostProcessor3D <T,DESCRIPTOR>::
92 : _x0(0), _x1(0), _y0(0), _y1(0), _z0(0), _z1(0), _eul2LagrOperator(eul2LagrOperator)
94 this->
getName() =
"Eul2LagrPostProcessor3D";
97template<
typename T,
typename DESCRIPTOR>
100 int x0,
int x1,
int y0,
int y1,
int z0,
int z1 )
102 _eul2LagrOperator->operator()(blockLattice);
105template<
typename T,
typename DESCRIPTOR>
109 processSubDomain(blockLattice, _x0, _x1, _y0, _y1, _z0, _z1);
115template<
typename T,
typename DESCRIPTOR,
template<
typename U>
class PARTICLETYPE>
117 int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_,
121 _eul2LagrOperator = std::make_shared<Eul2LagrOperator3D<T,DESCRIPTOR,PARTICLETYPE>>(spSys[
singleton::mpi().
getRank()], superGeometry);
124template<
typename T,
typename DESCRIPTOR,
template<
typename U>
class PARTICLETYPE>
129 _eul2LagrOperator = std::make_shared<Eul2LagrOperator3D<T,DESCRIPTOR,PARTICLETYPE>>(spSys[
singleton::mpi().
getRank()], superGeometry);
132template<
typename T,
typename DESCRIPTOR,
template<
typename U>
class PARTICLETYPE>
136 this->_eul2LagrOperator);
139template<
typename T,
typename DESCRIPTOR,
template<
typename U>
class PARTICLETYPE>
148template<
typename T,
typename DESCRIPTOR>
149Eul2LagrNormDistrPostProcessor3D <T,DESCRIPTOR>::
150Eul2LagrNormDistrPostProcessor3D(
int x0,
int x1,
int y0,
int y1,
int z0,
int z1, T mean, T stdDev,
SuperGeometry<T,3>& superGeometry)
151 : _x0(x0), _x1(x1), _y0(y0), _y1(y1), _z0(z0), _z1(z1), _randomNormal(mean, stdDev), _superGeometry(superGeometry)
153 this->
getName() =
"Eul2LagrNormDistrPostProcessor3D";
156template<
typename T,
typename DESCRIPTOR>
157Eul2LagrNormDistrPostProcessor3D <T,DESCRIPTOR>::
159 : _x0(0), _x1(0), _y0(0), _y1(0), _z0(0), _z1(0), _randomNormal(mean, stdDev), _superGeometry(superGeometry)
161 this->
getName() =
"Eul2LagrNormDistrPostProcessor3D";
164template<
typename T,
typename DESCRIPTOR>
167 int x0,
int x1,
int y0,
int y1,
int z0,
int z1 )
169 std::cout <<
"ciao" << std::endl;
172 _randomNormal(output, input);
174 T physPos[] {output[0], 0., 0.};
175 int latticeRoundedPos[] {0, 0, 0, 0};
176 _superGeometry.getCuboidGeometry().getLatticeR (latticeRoundedPos, physPos);
177 int overlap = _superGeometry.getOverlap();
178 latticeRoundedPos[1] += overlap;
179 latticeRoundedPos[2] += overlap;
180 latticeRoundedPos[3] += overlap;
182 T eul2LagrRho = blockLattice.
get(&latticeRoundedPos[1]).template getField<descriptors::EUL2LAGR>();
184 blockLattice.
get(&latticeRoundedPos[1]).template setField<descriptors::EUL2LAGR>(eul2LagrRho);
187template<
typename T,
typename DESCRIPTOR>
191 processSubDomain(blockLattice, _x0, _x1, _y0, _y1, _z0, _z1);
197template<
typename T,
typename DESCRIPTOR>
199 int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_, T mean, T stdDev,
SuperGeometry<T,3>& superGeometry )
200 :
PostProcessorGenerator3D<T,DESCRIPTOR>(x0_, x1_, y0_, y1_, z0_, z1_), _mean(mean), _stdDev(stdDev), _superGeometry(superGeometry)
203template<
typename T,
typename DESCRIPTOR>
205 :
PostProcessorGenerator3D<T,DESCRIPTOR>(0, 0, 0, 0, 0, 0), _mean(mean), _stdDev(stdDev), _superGeometry(superGeometry)
208template<
typename T,
typename DESCRIPTOR>
212 this->_mean,this->_stdDev,this->_superGeometry);
215template<
typename T,
typename DESCRIPTOR>
Platform-abstracted block lattice for external access and inter-block interaction.
Cell< T, DESCRIPTOR > get(CellID iCell)
Get Cell interface for index iCell.
int getNy() const
Read only access to block height.
int getNx() const
Read only access to block width.
int getNz() const
Read only access to block height.
void process(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Execute post-processing step.
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0, int x1, int y0, int y1, int z0, int z1) override
Execute post-processing step on a sublattice.
Eul2LagrNormDistrPostProcessorGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T mean, T stdDev, SuperGeometry< T, 3 > &superGeometry)
PostProcessorGenerator3D< T, DESCRIPTOR > * clone() const override
PostProcessor3D< T, DESCRIPTOR > * generate() const override
bool operator()(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Eul2LagrOperator3D(ParticleSystem3D< T, PARTICLETYPE > &pSystem, SuperGeometry< T, 3 > &superGeometry)
void process(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Execute post-processing step.
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0, int x1, int y0, int y1, int z0, int z1) override
Execute post-processing step on a sublattice.
Eul2LagrPostProcessorGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, SuperParticleSystem3D< T, PARTICLETYPE > &spSys, SuperGeometry< T, 3 > &superGeometry)
PostProcessorGenerator3D< T, DESCRIPTOR > * clone() const override
PostProcessor3D< T, DESCRIPTOR > * generate() const override
class for marking output with some text
std::string & getName()
read and write access to name
Representation of a statistic for a parallel 2D geometry.
The class superParticleSystem is the basis for particulate flows within OpenLB.
int getRank() const
Returns the process ID.
Top level namespace for all of OpenLB.