4#ifndef _MOLECULARDYNAMICS_COUPLING_SOLVERS_LBCOUETTESOLVER_H_
5#define _MOLECULARDYNAMICS_COUPLING_SOLVERS_LBCOUETTESOLVER_H_
17#include "coupling/interface/PintableMacroSolver.h"
18#include "coupling/solvers/NumericalSolver.h"
23 LBCouetteSolverState(
int size) : _pdf(size, 0) {}
25 LBCouetteSolverState(
int size,
double* pdf) : LBCouetteSolverState(size) { std::copy(pdf, pdf + size, _pdf.data()); }
27 std::unique_ptr<State> clone()
const override {
return std::make_unique<LBCouetteSolverState>(*
this); }
29 ~LBCouetteSolverState() {}
31 int getSizeBytes()
const override {
return sizeof(double) * _pdf.size(); }
33 std::unique_ptr<State>
operator+(
const State& rhs)
override;
34 std::unique_ptr<State>
operator-(
const State& rhs)
override;
36 double*
getData()
override {
return _pdf.data(); }
37 const double*
getData()
const override {
return _pdf.data(); }
39 void print(std::ostream& os)
const override { os <<
"<LBCouetteSolverState instance with size " <<
getSizeBytes() <<
">"; }
43 const LBCouetteSolverState* other =
dynamic_cast<const LBCouetteSolverState*
>(&rhs);
46 return _pdf == other->_pdf;
50 std::vector<double> _pdf;
76 const unsigned int numThreads = 1,
const Scenario* scen =
nullptr)
77 :
coupling::
solvers::
NumericalSolver(channelheight, dx, dt, kinVisc, plotEveryTimestep, filestem, processes, scen), _mode(Mode::
coupling), _dt_pint(dt),
84 _pdf1 =
new double[_pdfsize];
85 _pdf2 =
new double[_pdfsize];
87 omp_set_num_threads(numThreads);
89#if (COUPLING_MD_DEBUG == COUPLING_MD_YES)
91 std::cout <<
"tau=" << 1.0 /
_omega << std::endl;
96 std::cout << x <<
"," << y <<
"," << z <<
"FLAG=" <<
_flag[
get(x, y, z)] << std::endl;
103 std::cout <<
"ERROR LBCouetteSolver: NULL ptr!" << std::endl;
106#if (COUPLING_MD_PARALLEL == COUPLING_MD_YES)
109 std::cout <<
"ERROR LBCouetteSolver: NULL ptr in send/recv!" << std::endl;
114#pragma omp parallel for
116 for (
int q = 0; q < 19; q++) {
121 computeDensityAndVelocityEverywhere();
146#if (COUPLING_MD_PARALLEL == COUPLING_MD_YES)
180 const int timesteps = floor(dt /
_dt + 0.5);
181 if (fabs(timesteps *
_dt - dt) /
_dt > 1.0e-8) {
182 std::cout <<
"ERROR LBCouetteSolver::advance(): time steps and dt do not match!" << std::endl;
185 for (
int i = 0; i < timesteps; i++) {
187 computeDensityAndVelocityEverywhere();
204#if (COUPLING_MD_ERROR == COUPLING_MD_YES)
205 if (_mode == Mode::supervising) {
206 std::cout <<
"ERROR LBCouetteSolver setMDBoundaryValues() called in supervising mode" << std::endl;
210 computeDensityAndVelocityEverywhere();
213 for (
auto pair : md2macroBuffer) {
216 std::tie(couplingCell, idx) = pair;
222#if (COUPLING_MD_DEBUG == COUPLING_MD_YES)
223 std::cout <<
"Process coords: " <<
_coords <<
": GlobalCellCoords for index " << idx <<
": " << globalCellCoords << std::endl;
225 const int index =
get(globalCellCoords[0], globalCellCoords[1], globalCellCoords[2]);
226#if (COUPLING_MD_ERROR == COUPLING_MD_YES)
228 std::cout <<
"ERROR LBCouetteSolver::setMDBoundaryValues(): Cell " << index <<
" is no MD boundary cell!" << std::endl;
239 for (
unsigned int d = 0; d < 3; d++) {
240 _vel[3 * index + d] = localVel[d];
244 for (
unsigned int q = 0; q < 19; q++) {
246 if (((
int)globalCellCoords[0] +
_C[q][0] > 0) && ((
int)globalCellCoords[0] +
_C[q][0] <
_domainSizeX + 1) &&
247 ((
int)globalCellCoords[1] +
_C[q][1] > 0) && ((
int)globalCellCoords[1] +
_C[q][1] <
_domainSizeY + 1) &&
248 ((
int)globalCellCoords[2] +
_C[q][2] > 0) && ((
int)globalCellCoords[2] +
_C[q][2] <
_domainSizeZ + 1)) {
249 const int nbIndex =
get((
_C[q][0] + globalCellCoords[0]), (
_C[q][1] + globalCellCoords[1]), (
_C[q][2] + globalCellCoords[2]));
251 0.5 * (
_vel[3 * index + 2] +
_vel[3 * nbIndex + 2]));
252 _pdf1[19 * index + q] =
253 _pdf1[19 * nbIndex + 18 - q] -
254 6.0 *
_W[q] *
_density[nbIndex] * (
_C[18 - q][0] * interpolVel[0] +
_C[18 - q][1] * interpolVel[1] +
_C[18 - q][2] * interpolVel[2]);
268 if ((pos[0] < domainOffset[0]) || (pos[0] > domainOffset[0] +
_domainSizeX *
_dx) || (pos[1] < domainOffset[1]) ||
270 std::cout <<
"ERROR LBCouetteSolver::getVelocity(): Position " << pos <<
" out of range!" << std::endl;
271 std::cout <<
"domainOffset = " << domainOffset << std::endl;
272 std::cout <<
"_domainSizeX = " <<
_domainSizeX << std::endl;
273 std::cout <<
"_domainSizeY = " <<
_domainSizeY << std::endl;
274 std::cout <<
"_domainSizeZ = " <<
_domainSizeZ << std::endl;
275 std::cout <<
"_dx = " <<
_dx << std::endl;
280 for (
unsigned int d = 0; d < 3; d++) {
281 coords[d] = (
unsigned int)((
_dx + pos[d] - domainOffset[d]) /
_dx);
283 const int index =
get(coords[0], coords[1], coords[2]);
286 for (
int d = 0; d < 3; d++) {
289#if (COUPLING_MD_DEBUG == COUPLING_MD_YES)
290 std::cout <<
"Position " << pos <<
" corresponds to cell: " << coords <<
"; vel=" << vel << std::endl;
303 if ((pos[0] < domainOffset[0]) || (pos[0] > domainOffset[0] +
_domainSizeX *
_dx) || (pos[1] < domainOffset[1]) ||
305 std::cout <<
"ERROR LBCouetteSolver::getDensity(): Position " << pos <<
" out of range!" << std::endl;
310 for (
unsigned int d = 0; d < 3; d++) {
311 coords[d] = (
unsigned int)((
_dx + pos[d] - domainOffset[d]) /
_dx);
313 const int index =
get(coords[0], coords[1], coords[2]);
326 computeDensityAndVelocityEverywhere();
328 return std::make_unique<LBCouetteSolverState>(0);
329 return std::make_unique<LBCouetteSolverState>(_pdfsize,
_pdf1);
332 void setState(
const std::unique_ptr<State>& input,
int cycle)
override {
338#if (COUPLING_MD_ERROR == COUPLING_MD_YES)
339 if (state ==
nullptr) {
340 std::cout <<
"ERROR LBCouetteSolver setState() wrong state type" << std::endl;
346 computeDensityAndVelocityEverywhere();
351 std::unique_ptr<State>
operator()(
const std::unique_ptr<State>& input,
int cycle)
override {
354#if (COUPLING_MD_ERROR == COUPLING_MD_YES)
355 if (_mode != Mode::supervising) {
356 std::cout <<
"ERROR LBCouetteSolver operator() called but not in supervising mode" << std::endl;
365 Mode
getMode()
const override {
return _mode; }
373 std::unique_ptr<PintableMacroSolver>
getSupervisor(
int num_cycles,
double visc_multiplier)
const override {
374#if (COUPLING_MD_ERROR == COUPLING_MD_YES)
375 if (_mode == Mode::supervising) {
376 std::cout <<
"ERROR LBCouetteSolver getSupervisor(): already in supervising mode" << std::endl;
383 numThreads = omp_get_num_threads();
389 res->_mode = Mode::supervising;
390 res->_dt_pint =
_dt * num_cycles;
395 void print(std::ostream& os)
const override {
396 if (_mode == Mode::supervising)
397 os <<
"<LBCouetteSolver instance in supervising mode >";
398 if (_mode == Mode::coupling)
399 os <<
"<LBCouetteSolver instance in coupling mode >";
402 double get_avg_vel(
const std::unique_ptr<State>& state)
const override {
407 double res[3]{0, 0, 0};
408 for (
int i = 0; i < _pdfsize; i += 19) {
415 res[0] /= (_pdfsize / 19);
416 res[1] /= (_pdfsize / 19);
417 res[2] /= (_pdfsize / 19);
419 return std::sqrt(res[0] * res[0] + res[1] * res[1] + res[2] * res[2]);
422 double get_avg_velX(
const std::unique_ptr<State>& state)
const {
428 for (
int i = 0; i < _pdfsize; i += 19) {
433 res /= (_pdfsize / 19);
442 void computeDensityAndVelocityEverywhere() {
448 const int index =
get(x, y, z);
449 const int pI = 19 * index;
450 double* vel = &
_vel[3 * index];
457 void plot_avg_vel() {
462#if (COUPLING_MD_PARALLEL == COUPLING_MD_YES)
463 MPI_Comm_rank(coupling::indexing::IndexingService<3>::getInstance().getComm(), &rank);
465 std::stringstream ss;
467 if (_scen !=
nullptr) {
468 auto ts = _scen->getTimeIntegrationService();
470 if (ts->isPintEnabled())
471 ss <<
"_i" << ts->getIteration();
475 std::string filename = ss.str();
476 std::ofstream file(filename.c_str(),
_counter == 0 ? std::ofstream::out : std::ofstream::app);
477 if (!file.is_open()) {
478 std::cout <<
"ERROR LBCouetteSolver::plot_avg_vel(): Could not open file " << filename <<
"!" << std::endl;
483 file <<
"coupling_cycle ; avg_vel ; avg_velX" << std::endl;
486 std::unique_ptr<State> s = std::make_unique<LBCouetteSolverState>(_pdfsize,
_pdf1);
488 double velX = get_avg_velX(s);
489 file <<
_counter <<
" ; " << vel <<
" ; " << velX << std::endl;
500#pragma omp parallel for
504 const int index =
get(x, y, z);
513 double* swap =
_pdf1;
520 const int pI = 19 * index;
521 for (
int q = 0; q < 9; q++) {
522 const int nb = 19 * (
_C[q][0] +
_C[q][1] *
_xO +
_C[q][2] *
_yO);
530 void collide(
int index,
int x,
int y,
int z) {
532 const int pI = 19 * index;
534 double* vel = &
_vel[3 * index];
537 const double u2 = 1.0 - 1.5 * (vel[0] * vel[0] + vel[1] * vel[1] + vel[2] * vel[2]);
539 double cu = -vel[1] - vel[2];
541 double feq =
_W[0] *
_density[index] * (u2 + 3.0 * cu + 4.5 * cu * cu);
548 cu = -vel[0] - vel[2];
550 feq =
_W[1] *
_density[index] * (u2 + 3.0 * cu + 4.5 * cu * cu);
559 feq =
_W[2] *
_density[index] * (u2 + 3.0 * cu + 4.5 * cu * cu);
566 cu = vel[0] - vel[2];
568 feq =
_W[3] *
_density[index] * (u2 + 3.0 * cu + 4.5 * cu * cu);
575 cu = vel[1] - vel[2];
577 feq =
_W[4] *
_density[index] * (u2 + 3.0 * cu + 4.5 * cu * cu);
584 cu = -vel[0] - vel[1];
586 feq =
_W[5] *
_density[index] * (u2 + 3.0 * cu + 4.5 * cu * cu);
595 feq =
_W[6] *
_density[index] * (u2 + 3.0 * cu + 4.5 * cu * cu);
602 cu = vel[0] - vel[1];
604 feq =
_W[7] *
_density[index] * (u2 + 3.0 * cu + 4.5 * cu * cu);
613 feq =
_W[8] *
_density[index] * (u2 + 3.0 * cu + 4.5 * cu * cu);
632 void boundary(
double*
const pdf,
int index,
int x,
int y,
int z,
int q,
const Flag& flag,
int nbIndex) {
636 pdf[nbIndex + 18 - q] = pdf[index + q];
640 pdf[nbIndex + 18 - q] =
644 int target[3] = {x, y, z};
645 if (target[0] +
_C[q][0] == 0) {
650 if (target[1] +
_C[q][1] == 0) {
655 if (target[2] +
_C[q][2] == 0) {
661 pdf[19 * periodicNb + q] = pdf[index + q];
671 vel[0] = -(pdf[1] + pdf[5] + pdf[8] + pdf[11] + pdf[15]);
672 density = pdf[3] + pdf[7] + pdf[10] + pdf[13] + pdf[17];
673 vel[1] = (pdf[4] + pdf[11] + pdf[12] + pdf[13] + pdf[18]) - (pdf[0] + pdf[5] + pdf[6] + pdf[7] + pdf[14]);
674 vel[0] = density + vel[0];
675 density = density + pdf[0] + pdf[1] + pdf[2] + pdf[4] + pdf[5] + pdf[6] + pdf[8] + pdf[9] + pdf[11] + pdf[12] + pdf[14] + pdf[15] + pdf[16] + pdf[18];
676 vel[2] = (pdf[14] + pdf[15] + pdf[16] + pdf[17] + pdf[18]) - (pdf[0] + pdf[1] + pdf[2] + pdf[3] + pdf[4]);
677 vel[0] = vel[0] / density;
678 vel[1] = vel[1] / density;
679 vel[2] = vel[2] / density;
698#if (COUPLING_MD_PARALLEL == COUPLING_MD_YES)
700 const int directions[6][5] = {{1, 5, 8, 11, 15}, {3, 7, 10, 13, 17}, {4, 11, 12, 13, 18}, {0, 5, 6, 7, 14}, {0, 1, 2, 3, 4}, {14, 15, 16, 17, 18}};
701 MPI_Request requests[2];
702 MPI_Status status[2];
706 if (nbFlagTo ==
LEFT || nbFlagTo ==
RIGHT) {
711 }
else if (nbFlagTo ==
FRONT || nbFlagTo ==
BACK) {
716 }
else if (nbFlagTo ==
TOP || nbFlagTo ==
BOTTOM) {
722 std::cout <<
"ERROR LBCouetteSolver::communicatePart: d >2 or d < 0!" << std::endl;
727 for (coords[2] = startSend[2]; coords[2] < endSend[2]; coords[2]++) {
728 for (coords[1] = startSend[1]; coords[1] < endSend[1]; coords[1]++) {
729 for (coords[0] = startSend[0]; coords[0] < endSend[0]; coords[0]++) {
730 for (
int q = 0; q < 5; q++) {
731 sendBuffer[q + 5 *
getParBuf(coords[plane[0]], coords[plane[1]], domainSize[0], domainSize[1])] =
732 pdf[directions[nbFlagTo][q] + 19 *
get(coords[0], coords[1], coords[2])];
738 MPI_Irecv(recvBuffer, (domainSize[0] + 2) * (domainSize[1] + 2) * 5, MPI_DOUBLE,
_parallelNeighbours[nbFlagFrom], 1000,
739 coupling::indexing::IndexingService<3>::getInstance().getComm(), &requests[0]);
740 MPI_Isend(sendBuffer, (domainSize[0] + 2) * (domainSize[1] + 2) * 5, MPI_DOUBLE,
_parallelNeighbours[nbFlagTo], 1000,
741 coupling::indexing::IndexingService<3>::getInstance().getComm(), &requests[1]);
742 MPI_Waitall(2, requests, status);
745 for (coords[2] = startRecv[2]; coords[2] < endRecv[2]; coords[2]++) {
746 for (coords[1] = startRecv[1]; coords[1] < endRecv[1]; coords[1]++) {
747 for (coords[0] = startRecv[0]; coords[0] < endRecv[0]; coords[0]++) {
748 for (
int q = 0; q < 5; q++) {
750 pdf[directions[nbFlagTo][q] + 19 *
get(coords[0], coords[1], coords[2])] =
751 recvBuffer[q + 5 *
getParBuf(coords[plane[0]], coords[plane[1]], domainSize[0], domainSize[1])];
764#if (COUPLING_MD_PARALLEL == COUPLING_MD_YES)
802 const int _C[19][3]{{0, -1, -1}, {-1, 0, -1}, {0, 0, -1}, {1, 0, -1}, {0, 1, -1}, {-1, -1, 0}, {0, -1, 0}, {1, -1, 0}, {-1, 0, 0}, {0, 0, 0},
803 {1, 0, 0}, {-1, 1, 0}, {0, 1, 0}, {1, 1, 0}, {0, -1, 1}, {-1, 0, 1}, {0, 0, 1}, {1, 0, 1}, {0, 1, 1}};
805 const double _W[19]{1.0 / 36.0, 1.0 / 36.0, 1.0 / 18.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 18.0, 1.0 / 36.0, 1.0 / 18.0, 1.0 / 3.0,
806 1.0 / 18.0, 1.0 / 36.0, 1.0 / 18.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 18.0, 1.0 / 36.0, 1.0 / 36.0};
defines the cell type with cell-averaged quantities only (no linked cells).
Definition CouplingCell.h:29
const tarch::la::Vector< dim, double > & getMacroscopicMomentum() const
Definition CouplingCell.h:64
const double & getMacroscopicMass() const
Definition CouplingCell.h:58
provides access to coupling cells, which may belong to different indexing domains
Definition FlexibleCellContainer.h:30
value_T get() const
Definition CellIndex.h:138
Definition PintableMacroSolver.h:67
Definition PintableMacroSolver.h:30
Definition LBCouetteSolver.h:21
int getSizeBytes() const override
Definition LBCouetteSolver.h:31
std::unique_ptr< State > operator+(const State &rhs) override
const double * getData() const override
Definition LBCouetteSolver.h:37
bool __equals__(const State &rhs) const override
Definition LBCouetteSolver.h:42
void print(std::ostream &os) const override
Definition LBCouetteSolver.h:39
std::unique_ptr< State > operator-(const State &rhs) override
double * getData() override
Definition LBCouetteSolver.h:36
implements a three-dimensional Lattice-Boltzmann Couette flow solver.
Definition LBCouetteSolver.h:57
static void computeDensityAndVelocity(double *const vel, double &density, const double *const pdf)
refers to the LB method; computes density and velocity on pdf
Definition LBCouetteSolver.h:670
std::unique_ptr< State > operator()(const std::unique_ptr< State > &input, int cycle) override
Definition LBCouetteSolver.h:351
std::unique_ptr< PintableMacroSolver > getSupervisor(int num_cycles, double visc_multiplier) const override
Definition LBCouetteSolver.h:373
void communicatePart(double *pdf, double *sendBuffer, double *recvBuffer, NbFlag nbFlagTo, NbFlag nbFlagFrom, tarch::la::Vector< 3, int > startSend, tarch::la::Vector< 3, int > endSend, tarch::la::Vector< 3, int > startRecv, tarch::la::Vector< 3, int > endRecv)
Definition LBCouetteSolver.h:696
std::unique_ptr< State > getState() override
Definition LBCouetteSolver.h:325
double get_avg_vel(const std::unique_ptr< State > &state) const override
Definition LBCouetteSolver.h:402
const double _omega
relaxation frequency
Definition LBCouetteSolver.h:793
const int _C[19][3]
lattice velocities
Definition LBCouetteSolver.h:802
void setMDBoundaryValues(coupling::datastructures::FlexibleCellContainer< 3 > &md2macroBuffer) override
applies the values received from the MD-solver within the conntinuum solver
Definition LBCouetteSolver.h:200
double * _pdf1
partical distribution function field
Definition LBCouetteSolver.h:798
void collide(int index, int x, int y, int z)
Definition LBCouetteSolver.h:530
void boundary(double *const pdf, int index, int x, int y, int z, int q, const Flag &flag, int nbIndex)
takes care of the correct boundary treatment for the LB method
Definition LBCouetteSolver.h:632
Mode getMode() const override
Definition LBCouetteSolver.h:365
const double _W[19]
lattice weights
Definition LBCouetteSolver.h:805
void communicate()
comunicates the boundary field data between the different processes
Definition LBCouetteSolver.h:763
tarch::la::Vector< 3, double > getVelocity(tarch::la::Vector< 3, double > pos) const override
returns velocity at a certain position
Definition LBCouetteSolver.h:263
void advance(double dt) override
advances one time step dt in time and triggers vtk plot if required
Definition LBCouetteSolver.h:176
virtual ~LBCouetteSolver()
a simple destructor
Definition LBCouetteSolver.h:125
virtual void setWallVelocity(const tarch::la::Vector< 3, double > wallVelocity) override
changes the velocity at the moving wall (z=0)
Definition LBCouetteSolver.h:319
tarch::la::Vector< 3, double > _wallVelocity
velocity of moving wall of Couette flow
Definition LBCouetteSolver.h:795
const bool _plotAverageVelocity
enables avg_vel CSV output
Definition LBCouetteSolver.h:808
void collidestream()
collide-stream algorithm for the Lattice-Boltzmann method
Definition LBCouetteSolver.h:499
void setState(const std::unique_ptr< State > &input, int cycle) override
Definition LBCouetteSolver.h:332
void print(std::ostream &os) const override
Definition LBCouetteSolver.h:395
double * _pdf2
partial distribution function field (stores the old time step)
Definition LBCouetteSolver.h:800
LBCouetteSolver(const double channelheight, tarch::la::Vector< 3, double > wallVelocity, const double kinVisc, const double dx, const double dt, const int plotEveryTimestep, const bool plotAverageVelocity, const std::string filestem, const tarch::la::Vector< 3, unsigned int > processes, const unsigned int numThreads=1, const Scenario *scen=nullptr)
a simple constructor
Definition LBCouetteSolver.h:74
void stream(int index)
the stream part of the LB algorithm (from pdf1 to pdf2)
Definition LBCouetteSolver.h:519
double getDensity(tarch::la::Vector< 3, double > pos) const override
returns density at a certain position
Definition LBCouetteSolver.h:298
is a virtual base class for the interface for a numerical fluid solver for the Couette scenario
Definition NumericalSolver.h:33
const int _domainSizeX
domain size in x-direction
Definition NumericalSolver.h:554
double * _recvBufferY
buffer to receive data from from front/back neighbour
Definition NumericalSolver.h:584
double * _sendBufferX
buffer to send data from left/right to right/left neighbour
Definition NumericalSolver.h:578
const double _channelheight
the height and width of the channel in z and y direction
Definition NumericalSolver.h:539
const double _kinVisc
kinematic viscosity of the fluid
Definition NumericalSolver.h:545
int _counter
time step counter
Definition NumericalSolver.h:569
int get(int i) const
returns i and performs checks in debug mode
Definition NumericalSolver.h:360
const int _yO
offset for z-direction
Definition NumericalSolver.h:593
double * _recvBufferZ
buffer to receive data from from top/buttom neighbour
Definition NumericalSolver.h:588
const int _avgDomainSizeZ
avg. domain size in MPI-parallel simulation in z-direction
Definition NumericalSolver.h:564
int getParBuf(int x, int y, int lengthx, int lengthy) const
returns index in 2D parallel buffer with buffer dimensions lengthx+2,lengthy+2. Performs checks in de...
Definition NumericalSolver.h:409
double * _sendBufferY
buffer to send data from front/back to front/back neighbour
Definition NumericalSolver.h:582
const int _xO
offset for y-direction (lexicographic grid ordering)
Definition NumericalSolver.h:591
double * _sendBufferZ
buffer to send data from top/buttom to top/buttom neighbour
Definition NumericalSolver.h:586
NumericalSolver(const double channelheight, const double dx, const double dt, const double kinVisc, const int plotEveryTimestep, const std::string filestem, const tarch::la::Vector< 3, unsigned int > processes, const Scenario *scen=nullptr)
a simple constructor
Definition NumericalSolver.h:46
Flag * _flag
flag field
Definition NumericalSolver.h:575
const int _avgDomainSizeY
avg. domain size in MPI-parallel simulation in y-direction
Definition NumericalSolver.h:562
const tarch::la::Vector< 3, unsigned int > _coords
coordinates of this process (=1,1,1, unless parallel run of the solver )
Definition NumericalSolver.h:567
const int _domainSizeY
domain size in y-direction
Definition NumericalSolver.h:556
const double _dt
time step
Definition NumericalSolver.h:543
tarch::la::Vector< 3, unsigned int > _processes
domain decomposition on MPI rank basis; total number is given by multipling all entries
Definition NumericalSolver.h:548
double * _density
density field
Definition NumericalSolver.h:573
tarch::la::Vector< 6, int > _parallelNeighbours
neighbour ranks
Definition NumericalSolver.h:595
const std::string _filestem
file stem for vtk plot
Definition NumericalSolver.h:552
NbFlag
The flags are used on parallel boundaries to define in which direction the boundary goes.
Definition NumericalSolver.h:530
@ LEFT
a parallel boundary to the left
Definition NumericalSolver.h:531
@ RIGHT
a parallel boundary to the right
Definition NumericalSolver.h:532
@ BOTTOM
a parallel boundary to the bottom
Definition NumericalSolver.h:535
@ FRONT
a parallel boundary to the front
Definition NumericalSolver.h:534
@ TOP
a parallel boundary to the top
Definition NumericalSolver.h:536
@ BACK
a parallel boundary to the back
Definition NumericalSolver.h:533
Flag
for every cell exists a flag entry, upon this is defined how the cell is handled
Definition NumericalSolver.h:519
@ MD_BOUNDARY
a cell on the boundary to md
Definition NumericalSolver.h:524
@ PERIODIC
a cell on a periodic boundary
Definition NumericalSolver.h:523
@ PARALLEL_BOUNDARY
a cell on a inner boundary of a splitted domain in a parallel run
Definition NumericalSolver.h:525
@ NO_SLIP
a cell on the no slip (non-moving) wall
Definition NumericalSolver.h:521
@ FLUID
a normal fluid cell
Definition NumericalSolver.h:520
@ MOVING_WALL
a cell on the moving wall
Definition NumericalSolver.h:522
const int _plotEveryTimestep
number of time steps between vtk plots
Definition NumericalSolver.h:550
double * _vel
velocity field
Definition NumericalSolver.h:571
const int _avgDomainSizeX
avg. domain size in MPI-parallel simulation in x-direction
Definition NumericalSolver.h:560
bool skipRank() const
returns true, if this rank is not of relevance for the LB simulation
Definition NumericalSolver.h:509
double * _recvBufferX
buffer to receive data from from left/right neighbour
Definition NumericalSolver.h:580
tarch::la::Vector< 3, int > _offset
offset of the md domain
Definition NumericalSolver.h:597
const double _dx
mesh size, dx=dy=dz
Definition NumericalSolver.h:541
const int _domainSizeZ
domain size in z-direction
Definition NumericalSolver.h:558
all numerical solvers are defined in the namespace, and their interfaces
Definition CouetteSolver.h:14
everything necessary for coupling operations, is defined in here
Definition AdditiveMomentumInsertion.h:15