isBoundary()

Hi,

We are trying to get an information about dynamics applied to individual node of the lattice using something like this:

bool isBnd = lattice.get(10,10).getDynamics().isBoundary();

should it work as expected? i.e. if BounceBack was set in 10,10th node should isBnd==true?

We somehow cannot get it working.

All the best,
Maciej

Dear maq,

I know this thread is really old but I have stumbled upon the same problem. Have you figured out a solution? I also found another thread with the same question here

and - also - no answer…

I tried it the following way:

[code=“cpp”]
#include “palabos2D.h”
#include “palabos2D.hh”

using namespace std ;
using namespace plb ;

#define DESCRIPTOR descriptors::D2Q9Descriptor

#define DYNAMICS BGKdynamics

typedef double T ;

int main(int argc, char *argv[]){
plbInit(&argc, &argv) ;
global::directories().setOutputDir("./results-test/") ;

``````// Fluid parameters
const T omega = (T)1 ;
const T rho = (T)1 ;

// Domain size
const plint nx = 5 ;
const plint ny = 5 ;

// Initialize lattice structure
MultiBlockLattice2D<T, DESCRIPTOR> lattice (nx, ny, new DYNAMICS<T, DESCRIPTOR>(omega) ) ;

// Initialize fluid nodes
Box2D interior ( 0, nx-1, 1, ny-2 ) ;
initializeAtEquilibrium(lattice, interior, rho, Array<T,DESCRIPTOR<T>::d> ( (T)0, (T)0 ) ) ;

// Periodicity in x-direction
lattice.periodicity().toggle(0, true) ;

// Boundaries
Box2D topWall  ( 0, nx-1, ny-1, ny-1 ) ;
Box2D botWall  ( 0, nx-1, 0,    0    ) ;
defineDynamics(lattice, topWall, new BounceBack<T, DESCRIPTOR>(rho) ) ;
defineDynamics(lattice, botWall, new BounceBack<T, DESCRIPTOR>(rho) ) ;

lattice.initialize() ;

pcout << lattice.get(0,0).getDynamics().isBoundary() << endl ;
``````

}

``````

which also results in an output of zero, no matter what cell I look at.

Regards,

kk``````