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

#6130
Fany
Participant

Hi Gloriousface,
Here is the code of renaming the material numbers.
`
OstreamManager clout(std::cout,”prepareGeometry”);
clout << “Prepare Geometry …” << std::endl;

superGeometry.rename(0,2);
superGeometry.rename(2,1,0,1);

std::vector<T> extend( 2, T(0) );
extend[0] = lx;
extend[1] = converter.getPhysLength(1);
std::vector<T> origin( 2, T(0) );
IndicatorCuboid2D<T> bottom(extend, origin, theta);

origin[1] = ly-converter.getPhysLength(1);
IndicatorCuboid2D<T> top(extend, origin, theta);

origin[0] = lx/2.;
origin[1] = converter.getPhysLength(1);
extend[0] = converter.getPhysLength(1);
extend[1] = converter.getPhysLength(1);
IndicatorCuboid2D<T> perturbation(extend, origin, theta);

/// Set material numbers for bottom, top and pertubation
superGeometry.rename(2,2,1,bottom);
superGeometry.rename(2,3,1,top);
superGeometry.rename(1,4,perturbation);

/// Removes all not needed boundary voxels outside the surface
superGeometry.clean();
/// Removes all not needed boundary voxels inside the surface
superGeometry.innerClean();
superGeometry.checkForErrors();

superGeometry.print();

clout << “Prepare Geometry … OK” << std::endl;