48#include "palabos3D.hh"
56template <
typename T,
template <
typename U>
class Descriptor>
85 std::vector<T> pop(Descriptor<T>::q);
86 for (
plint i = 0; i < Descriptor<T>::q; i++) { pop[i] = populations[i]; }
101 virtual void process(plb::Box3D domain, plb::BlockLattice3D<T, Descriptor> & lattice) {
102 plb::Dot3D absoluteOffset = lattice.getLocation();
105 double gfrac = std::fmod((*this->LEcurrentDisplacement), 1.0);
106 plint globalX, globalY;
107 plint globalZ0 = absoluteOffset.z + domain.z0;
108 plint globalZ1 = absoluteOffset.z + domain.z1;
109 plb::Cell<T, Descriptor> curCell;
110 plb::Cell<T, Descriptor> s1Cell;
111 plb::Cell<T, Descriptor> s2Cell;
115 plb::Array<T, Descriptor<T>::d> j;
117 if (globalZ1 == this->nz - 1)
119 for (
plint iX = domain.x0; iX <= domain.x1; ++iX) {
120 globalX = absoluteOffset.x + iX;
121 for (
plint iY = domain.y0; iY <= domain.y1; ++iY) {
122 globalY = absoluteOffset.y + iY;
123 curCell = lattice.get(iX, iY, domain.z1);
126 curCell.getDynamics().computeRhoBarJ(curCell, rhoBar, j);
127 curCell.getDynamics().collideExternal(curCell, rhoBar, plb::Array<T, 3>(this->topVelocity, 0.0, 0.0),
T(),
128 lattice.getInternalStatistics());
136 s1Cell = lattice.get(s1, iY, domain.z1);
137 s2Cell = lattice.get(s2, iY, domain.z1);
140 (*this->
topPopulations)[globalX][globalY][3] = gfrac * s1Cell[3] + (1 - gfrac) * s2Cell[3];
141 (*this->
topPopulations)[globalX][globalY][6] = gfrac * s1Cell[16] + (1 - gfrac) * s2Cell[16];
142 (*this->
topPopulations)[globalX][globalY][8] = gfrac * s1Cell[8] + (1 - gfrac) * s2Cell[8];
143 (*this->
topPopulations)[globalX][globalY][16] = gfrac * s1Cell[6] + (1 - gfrac) * s2Cell[6];
144 (*this->
topPopulations)[globalX][globalY][18] = gfrac * s1Cell[18] + (1 - gfrac) * s2Cell[18];
150 for (
plint iX = domain.x0; iX <= domain.x1; ++iX) {
151 globalX = absoluteOffset.x + iX;
152 for (
plint iY = domain.y0; iY <= domain.y1; ++iY) {
153 globalY = absoluteOffset.y + iY;
154 curCell = lattice.get(iX, iY, domain.z0);
157 curCell.getDynamics().computeRhoBarJ(curCell, rhoBar, j);
158 curCell.getDynamics().collideExternal(curCell, rhoBar, plb::Array<T, 3>(this->bottomVelocity, 0.0, 0.0),
T(),
159 lattice.getInternalStatistics());
167 s1Cell = lattice.get(s1, iY, domain.z0);
168 s2Cell = lattice.get(s2, iY, domain.z0);
171 (*this->
bottomPopulations)[globalX][globalY][7] = gfrac * s1Cell[15] + (1 - gfrac) * s2Cell[15];
172 (*this->
bottomPopulations)[globalX][globalY][9] = gfrac * s1Cell[9] + (1 - gfrac) * s2Cell[9];
173 (*this->
bottomPopulations)[globalX][globalY][12] = gfrac * s1Cell[12] + (1 - gfrac) * s2Cell[12];
174 (*this->
bottomPopulations)[globalX][globalY][15] = gfrac * s1Cell[7] + (1 - gfrac) * s2Cell[7];
175 (*this->
bottomPopulations)[globalX][globalY][17] = gfrac * s1Cell[17] + (1 - gfrac) * s2Cell[17];
189 modified[0] = plb::modif::nothing;
193 virtual plb::BlockDomain::DomainT
appliesTo()
const {
return plb::BlockDomain::bulk; }
200template <
typename T,
template <
typename U>
class Descriptor>
220 plb::Array<T, Descriptor<T>::q> pop;
221 for (
plint i = 0; i < DESCRIPTOR<T>::q; i++) { pop[i] = populations[i]; }
231 virtual void process(plb::Box3D domain, plb::BlockLattice3D<T, Descriptor> & lattice) {
232 plb::Dot3D absoluteOffset = lattice.getLocation();
234 plint globalZ0 = absoluteOffset.z + domain.z0;
235 plint globalZ1 = absoluteOffset.z + domain.z1;
236 plint globalX, globalY;
237 plb::Array<T, Descriptor<T>::q> populations;
239 if (globalZ1 == this->nz - 1) {
240 for (
plint iX = domain.x0; iX <= domain.x1; ++iX) {
241 globalX = absoluteOffset.x + iX;
242 for (
plint iY = domain.y0; iY <= domain.y1; ++iY) {
243 globalY = absoluteOffset.y + iY;
245 lattice.get(iX, iY, domain.z1).setPopulations(populations);
250 for (
plint iX = domain.x0; iX <= domain.x1; ++iX) {
251 globalX = absoluteOffset.x + iX;
252 for (
plint iY = domain.y0; iY <= domain.y1; ++iY) {
253 globalY = absoluteOffset.y + iY;
255 lattice.get(iX, iY, domain.z0).setPopulations(populations);
268 modified[0] = plb::modif::staticVariables;
272 virtual plb::BlockDomain::DomainT
appliesTo()
const {
return plb::BlockDomain::bulk; }
278template <
typename T,
template <
class U>
class Descriptor>
281 plb::MultiBlockLattice3D<T, Descriptor> &
lattice;
303 this->LEdisplacement = shearRate *
dt;
304 T vHalf = (
nz - 1) * shearRate * 0.5;
305 this->topVelocity = -vHalf;
306 this->bottomVelocity = vHalf;
308 *hemoCellLEcurrentDisplacement =
317 this->lattice.periodicity().toggleAll(
true);
319 this->topPopulations.resize(this->nx, std::vector<std::vector<T>>(this->ny, std::vector<T>(Descriptor<T>::q)));
320 this->bottomPopulations.resize(this->nx, std::vector<std::vector<T>>(this->ny, std::vector<T>(Descriptor<T>::q)));
323 integrateProcessingFunctional(
326 this->lattice.getBoundingBox(), this->lattice, this->dataProcessorLevel);
328 integrateProcessingFunctional(
330 this->lattice.getBoundingBox(), this->lattice, this->dataProcessorLevel + 1);
Definition leesEdwardsBC.h:57
T topVelocity
Definition leesEdwardsBC.h:64
LeesEdwardsBCGetPopulations(plint nx, plint nz, T topVelocity, T bottomVelocity, double *LEcurrentDisplacement, std::vector< std::vector< std::vector< T > > > *topPopulations, std::vector< std::vector< std::vector< T > > > *bottomPopulations)
Definition leesEdwardsBC.h:67
plint nz
Definition leesEdwardsBC.h:60
double * LEcurrentDisplacement
Definition leesEdwardsBC.h:61
plint nx
Definition leesEdwardsBC.h:59
std::vector< std::vector< std::vector< T > > > * topPopulations
Definition leesEdwardsBC.h:62
plint modNonNegative(plint a, plint b)
Definition leesEdwardsBC.h:92
std::vector< std::vector< std::vector< T > > > * bottomPopulations
Definition leesEdwardsBC.h:63
virtual void getTypeOfModification(std::vector< plb::modif::ModifT > &modified) const
Definition leesEdwardsBC.h:188
virtual plb::BlockDomain::DomainT appliesTo() const
Definition leesEdwardsBC.h:193
virtual LeesEdwardsBCGetPopulations< T, Descriptor > * clone() const
Definition leesEdwardsBC.h:183
virtual void process(plb::Box3D domain, plb::BlockLattice3D< T, Descriptor > &lattice)
Definition leesEdwardsBC.h:101
std::vector< T > populationsArrayToVector(plb::Array< T, Descriptor< T >::q > populations)
Definition leesEdwardsBC.h:84
T bottomVelocity
Definition leesEdwardsBC.h:65
Definition leesEdwardsBC.h:201
plint nz
Definition leesEdwardsBC.h:203
LeesEdwardsBCSetPopulations(plint nz, std::vector< std::vector< std::vector< T > > > *topPopulations, std::vector< std::vector< std::vector< T > > > *bottomPopulations)
Definition leesEdwardsBC.h:207
std::vector< std::vector< std::vector< T > > > * topPopulations
Definition leesEdwardsBC.h:204
plb::Array< T, Descriptor< T >::q > populationsVectorToArray(std::vector< T > populations)
Definition leesEdwardsBC.h:219
virtual LeesEdwardsBCSetPopulations< T, Descriptor > * clone() const
Definition leesEdwardsBC.h:262
virtual plb::BlockDomain::DomainT appliesTo() const
Definition leesEdwardsBC.h:272
std::vector< std::vector< std::vector< T > > > * bottomPopulations
Definition leesEdwardsBC.h:205
virtual void getTypeOfModification(std::vector< plb::modif::ModifT > &modified) const
Definition leesEdwardsBC.h:267
virtual void process(plb::Box3D domain, plb::BlockLattice3D< T, Descriptor > &lattice)
Definition leesEdwardsBC.h:231
Definition leesEdwardsBC.h:279
LeesEdwardsBC(const LeesEdwardsBC &)=delete
T dt
Definition leesEdwardsBC.h:288
double LEdisplacement
Definition leesEdwardsBC.h:286
LeesEdwardsBC & operator=(const LeesEdwardsBC &)=delete
T topVelocity
Definition leesEdwardsBC.h:289
plb::MultiBlockLattice3D< T, Descriptor > & lattice
Definition leesEdwardsBC.h:281
std::vector< std::vector< std::vector< T > > > topPopulations
Definition leesEdwardsBC.h:293
plint ny
Definition leesEdwardsBC.h:283
void updateLECurDisplacement(unsigned int iter)
Definition leesEdwardsBC.h:337
T bottomVelocity
Definition leesEdwardsBC.h:290
plint nx
Definition leesEdwardsBC.h:282
LeesEdwardsBC(plb::MultiBlockLattice3D< T, Descriptor > &lattice, T shearRate, T dt, double **hemoCellLEcurrentDisplacement, plint dataProcessorLevel=1)
Definition leesEdwardsBC.h:296
double LEcurrentDisplacement
Definition leesEdwardsBC.h:287
std::vector< std::vector< std::vector< T > > > bottomPopulations
Definition leesEdwardsBC.h:294
plint nz
Definition leesEdwardsBC.h:284
void initialize()
Definition leesEdwardsBC.h:315
plint dataProcessorLevel
Definition leesEdwardsBC.h:291
double T
Definition constant_defaults.h:137
long int plint
Definition constant_defaults.h:149