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
this is what I am trying in 1.8 using indicator rotate instead of rotating the cube on construction:
// ramp
Vector<T, 2> straightCubeExtend(6.43, 1.85);
Vector<T, 2> straightCubeOrigin;
straightCubeOrigin[0] = spillwayGeometry.upperReservoirLength;
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] = spillwayGeometry.upperReservoirLength;
std::shared_ptr<IndicatorCuboid2D<T>> straightCube(new IndicatorCuboid2D<T>(straightCubeExtend, straightCubeOrigin));
IndicatorCuboid2D<T> tiltedCube(tiltedCubeExtend, tiltedCubeOrigin);
auto rotX = tiltedCubeOrigin[0] + tiltedCubeExtend[0] / 2.0;
auto rotY = tiltedCubeOrigin[1] + tiltedCubeExtend[1] / 2.0;
Vector<T, 2> rotationPoint(rotX, rotY);
std::shared_ptr<IndicatorRotate<T, 2>> rotatedCube(new IndicatorRotate<T, 2>(rotationPoint, 0.174533, tiltedCube));
std::shared_ptr<IndicatorCuboid2D<T>> lowerCube(new IndicatorCuboid2D<T>(lowerCubeExtend, lowerCubeOrigin));
// * is intersection + is union
IndicatorIdentity2D<T> straightId(straightCube);
IndicatorIdentity2D<T> rotatedId(rotatedCube);
IndicatorIdentity2D<T> lowerId(lowerCube);IndicatorIdentity2D<T> ramp((straightCube * rotatedCube) + lowerCube);