Reply To: Rotating cuboid not working correctly in 1.8
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › Bug Reports › Rotating cuboid not working correctly in 1.8 › Reply To: Rotating cuboid not working correctly in 1.8
June 19, 2025 at 12:31 am
#10376
stonepreston
Participant
Can you provide the functions for the IndicatorCuboid2d class as well?
The ones provided for the rotate class do work for fixing the rotation issues, but I am needing to be able to combine indicators using union, intersection, difference. I cant seem to work out how to get the rotate indicator to be able to be combined with the cuboid2ds. This is what I did in 1.7:
Vector<T,2> straightCubeExtend(6.43, 1.85);
Vector<T,2> straightCubeOrigin;
straightCubeOrigin[0] = 2;
Vector<T,2> tiltedCubeExtend(8.43, 1.27);
Vector<T,2> tiltedCubeOrigin;
tiltedCubeOrigin[0] = 1;
tiltedCubeOrigin[1] = 0;
Vector<T,2> lowerCubeExtend(6.43, .71);
Vector<T,2> lowerCubeOrigin;
lowerCubeOrigin[0] = 2;
std::shared_ptr<IndicatorCuboid2D<T>> straightCube( new IndicatorCuboid2D<T>(straightCubeExtend, straightCubeOrigin ));
std::shared_ptr<IndicatorCuboid2D<T>> tiltedCube( new IndicatorCuboid2D<T>(tiltedCubeExtend, tiltedCubeOrigin, 0.174533));
std::shared_ptr<IndicatorCuboid2D<T>> lowerCube( new IndicatorCuboid2D<T>(lowerCubeExtend, lowerCubeOrigin ));
IndicatorIdentity2D<T> ramp((straightCube * tiltedCube) + lowerCube);
// Note: have to rename both the 2 material and the 1 material in this indicator region
superGeometry.rename( 2,2,ramp );
superGeometry.rename( 1,2,ramp );
but it seems this does not work when I mix IndicatorCuboids with IndicatorRotates