6#ifndef _MOLECULARDYNAMICS_COUPLING_SOLVERS_LBCOUETTESOLVERINTERFACE_H_
7#define _MOLECULARDYNAMICS_COUPLING_SOLVERS_LBCOUETTESOLVERINTERFACE_H_
9#include "coupling/interface/MacroscopicSolverInterface.h"
40 unsigned int outerRegion = 1)
45 unsigned int getOuterRegion()
override {
return _outerRegion; }
51 std::vector<unsigned int>
getRanks(I01 idx)
override {
52 std::vector<unsigned int> ranks;
56 for (
int d = 0; d < 3; d++) {
57#if (COUPLING_MD_DEBUG == COUPLING_MD_YES)
58 std::cout <<
"LB cell index for global cell index " << idx <<
": " << globalLBCellIndex << std::endl;
60 if (globalLBCellIndex[d] > 0) {
61 globalLBCellIndex[d]--;
67 for (
int z = -1; z < 2; z++) {
68 for (
int y = -1; y < 2; y++) {
69 for (
int x = -1; x < 2; x++) {
80 for (
unsigned int i = 0; i < ranks.size(); i++) {
81 found = found || (rank == ranks[i]);
84 ranks.push_back(rank);
89#if (COUPLING_MD_DEBUG == COUPLING_MD_YES)
90 std::cout <<
"Ranks for cell " << idx <<
":";
91 for (
unsigned int i = 0; i < ranks.size(); i++) {
92 std::cout <<
" " << ranks[i];
94 std::cout << std::endl;
113 for (
int d = 0; d < 3; d++) {
114#if (COUPLING_MD_DEBUG == COUPLING_MD_YES)
115 std::cout <<
"LB cell index for global cell index " << idx <<
": " << globalLBCellIndex << std::endl;
117 if (globalLBCellIndex[d] > 0) {
118 globalLBCellIndex[d]--;
125 std::vector<unsigned int> ranks;
126 ranks.push_back(rank);
127#if (COUPLING_MD_DEBUG == COUPLING_MD_YES)
128 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, unsigned 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:51
const tarch::la::Vector< 3, unsigned int > _globalNumberCouplingCells
global number of coupling cells
Definition LBCouetteSolverInterface.h:145
const tarch::la::Vector< 3, unsigned int > _offsetMDDomain
offset of MD domain (excl. any ghost layers on MD or LB side)
Definition LBCouetteSolverInterface.h:140
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:136
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:109
const tarch::la::Vector< 3, unsigned int > _numberProcesses
number of processes used by LB solver
Definition LBCouetteSolverInterface.h:138
const unsigned int _outerRegion
defines an offset of cells which is considered to be the outer region
Definition LBCouetteSolverInterface.h:143
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