Skip to content

Reply To: How to create the cuboidGeometry for a inclined 2D cuboid geometry

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics How to create the cuboidGeometry for a inclined 2D cuboid geometry Reply To: How to create the cuboidGeometry for a inclined 2D cuboid geometry

#6127
Gloriousface
Participant

Hi Fany:
You can use BlockGeometryXD to specify the name of the cell with its location. Firstly you instantiate one object with BlockGeometryXD, BlockGeometryXD<T> &BG=superGeometry.getExtendedBlockGeometry(iC), where iC is the index of the block. Then the size of this BG is get with Nx=BG.getNx() and Ny=BG.getNy(); Then in a for loop with ix from 2 to Nx-2, iy from 2 to Ny-2, get the physical position of the cell with BG.getPhysR(phr,ix,iy); if the physical position statisfies the requiement, rename the cell with BG.get(ix,iy)=2 for example.