6#ifndef _MOLECULARDYNAMICS_COUPLING_SOLVERS_LBCOUETTESOLVERINTERFACE_H_
7#define _MOLECULARDYNAMICS_COUPLING_SOLVERS_LBCOUETTESOLVERINTERFACE_H_
9#include "coupling/interface/MacroscopicSolverInterface.h"
44 unsigned int getOuterRegion()
override {
return _outerRegion; }
50 std::vector<unsigned int>
getRanks(I01 idx)
override {
51 std::vector<unsigned int> ranks;
55 for (
int d = 0; d < 3; d++) {
56#if (COUPLING_MD_DEBUG == COUPLING_MD_YES)
57 std::cout <<
"LB cell index for global cell index " << idx <<
": " << globalLBCellIndex << std::endl;
59 globalLBCellIndex[d]--;
64 for (
int z = -1; z < 2; z++) {
65 for (
int y = -1; y < 2; y++) {
66 for (
int x = -1; x < 2; x++) {
72 if (processCoordinates[0] < 0 || processCoordinates[0] >
_numberProcesses[0] - 1)
74 if (processCoordinates[1] < 0 || processCoordinates[1] >
_numberProcesses[1] - 1)
76 if (processCoordinates[2] < 0 || processCoordinates[2] >
_numberProcesses[2] - 1)
83 for (
unsigned int i = 0; i < ranks.size(); i++) {
84 found = found || (rank == ranks[i]);
87 ranks.push_back(rank);
92#if (COUPLING_MD_DEBUG == COUPLING_MD_YES)
93 std::cout <<
"Ranks for cell " << idx <<
":";
94 for (
unsigned int i = 0; i < ranks.size(); i++) {
95 std::cout <<
" " << ranks[i];
97 std::cout << std::endl;
116 for (
int d = 0; d < 3; d++) {
117#if (COUPLING_MD_DEBUG == COUPLING_MD_YES)
118 std::cout <<
"LB cell index for global cell index " << idx <<
": " << globalLBCellIndex << std::endl;
120 globalLBCellIndex[d]--;
122 std::vector<unsigned int> ranks;
127 for (
int d = 0; d < 3; d++)
128 if (processCoordinates[d] < 0 || processCoordinates[d] >
_numberProcesses[d] - 1)
132 ranks.push_back(rank);
133#if (COUPLING_MD_DEBUG == COUPLING_MD_YES)
134 std::cout <<
"Source rank for cell " << idx <<
": " << ranks[0] << std::endl;
value_T get() const
Definition CellIndex.h:138
interface for the macroscopic, i.e. continuum solver
Definition MacroscopicSolverInterface.h:23
interface for the LBCouetteSolver
Definition LBCouetteSolverInterface.h:26
LBCouetteSolverInterface(tarch::la::Vector< 3, unsigned int > avgNumberLBCells, tarch::la::Vector< 3, unsigned int > numberProcesses, tarch::la::Vector< 3, int > offsetMDDomain, tarch::la::Vector< 3, unsigned int > globalNumberCouplingCells, unsigned int outerRegion=1)
a simple constructor
Definition LBCouetteSolverInterface.h:38
std::vector< unsigned int > getRanks(I01 idx) override
returns for a given coupling cell index, which rank holds the correct data @oaram idx global dimensio...
Definition LBCouetteSolverInterface.h:50
const tarch::la::Vector< 3, int > _offsetMDDomain
offset of MD domain (excl. any ghost layers on MD or LB side)
Definition LBCouetteSolverInterface.h:146
const tarch::la::Vector< 3, unsigned int > _globalNumberCouplingCells
global number of coupling cells
Definition LBCouetteSolverInterface.h:151
const tarch::la::Vector< 3, unsigned int > _avgNumberLBCells
avg. number of LB cells per LB process (must be same for Interface and LBCouetteSolver)
Definition LBCouetteSolverInterface.h:142
std::vector< unsigned int > getSourceRanks(I01 idx) override
returns for a given coupling cell index, which source rank holds the correct data
Definition LBCouetteSolverInterface.h:112
const tarch::la::Vector< 3, unsigned int > _numberProcesses
number of processes used by LB solver
Definition LBCouetteSolverInterface.h:144
const unsigned int _outerRegion
defines an offset of cells which is considered to be the outer region
Definition LBCouetteSolverInterface.h:149
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