packages/MC/geometry/test/tstRTK_Cell.cc
//---------------------------------------------------------------------------//
// See support/tstPin_Cell_Vessel.py for reference solutions.
See support/tstPin_Cell_Vessel.py for reference solutions.
See support / tstPin_Cell_Vessel . py for reference solutions .
TEST(Vessel, Track_LoHiR)
{
    double x_off = 21.62 * 5.0;
    double y_off = 30.0  * 2.0;
    RTK_Cell water(10, 21.62, 30.0, 14.28, 135.0, 140.0, x_off, y_off, 101);
    Geo_State state;
    Vector r, omega;
    double eps = 1.0e-10;
    r     = Vector( -0.52,  -0.25,  11.80);
    omega = Vector(  0.942738909161,   0.021633902593,  -0.332829270666);
    water.initialize(r, state);
    water.distance_to_boundary(r, omega, state);
    EXPECT_EQ(Geo_State::MODERATOR, state.region);
    EXPECT_SOFTEQ(state.dist_to_next_region, 1.2018173738e+01, eps);
    EXPECT_EQ(Geo_State::PLUS_X, state.exiting_face);
    r     = Vector( -0.52,  -0.25,  11.80);
    omega = Vector( -0.638224253549,  -0.728778909543,  -0.248094947929);
    water.initialize(r, state);
    EXPECT_EQ(Geo_State::MODERATOR, state.region);
    EXPECT_EQ(Geo_State::NONE, state.exiting_face);
    water.distance_to_boundary(r, omega, state);
    EXPECT_SOFTEQ(state.dist_to_next_region, 1.4437568710e-02, eps);
    EXPECT_EQ(Geo_State::INTERNAL, state.exiting_face);
    EXPECT_EQ(Geo_State::R1_VESSEL, state.next_face);
    EXPECT_EQ(Geo_State::VESSEL, state.next_region);
    r     = Vector( -2.52,  -4.20,  11.80);
    omega = Vector(  0.130844809690,  -0.929686805689,  -0.344328446552);
    water.initialize(r, state);
    EXPECT_EQ(Geo_State::VESSEL, state.region);
    water.distance_to_boundary(r, omega, state);
    EXPECT_SOFTEQ(state.dist_to_next_region, 3.4045225628e+00, eps);
    EXPECT_EQ(Geo_State::INTERNAL, state.exiting_face);
    EXPECT_EQ(Geo_State::R0_VESSEL, state.next_face);
    EXPECT_EQ(Geo_State::MODERATOR, state.next_region);
    r     = Vector( -2.52,  -4.20,  11.80);
    omega = Vector(  0.077270894187,   0.976053400258,  -0.203344458387);
    water.initialize(r, state);
    EXPECT_EQ(Geo_State::VESSEL, state.region);
    water.distance_to_boundary(r, omega, state);
    EXPECT_SOFTEQ(state.dist_to_next_region,  6.4107157490e+00, eps);
    EXPECT_EQ(Geo_State::INTERNAL, state.exiting_face);
    EXPECT_EQ(Geo_State::R1_VESSEL, state.next_face);
    EXPECT_EQ(Geo_State::MODERATOR, state.next_region);
}
TEST ( Vessel , Track_LoHiR ) { double x_off = 21.62 * 5.0 ; double y_off = 30.0 * 2.0 ; RTK_Cell water ( 10 , 21.62 , 30.0 , 14.28 , 135.0 , 140.0 , x_off , y_off , 101 ) ; Geo_State state ; Vector r , omega ; double eps = 1.0e-10 ; r = Vector ( -0.52 , -0.25 , 11.80 ) ; omega = Vector ( 0.942738909161 , 0.021633902593 , -0.332829270666 ) ; water . initialize ( r , state ) ; water . distance_to_boundary ( r , omega , state ) ; EXPECT_EQ ( Geo_State :: MODERATOR , state . region ) ; EXPECT_SOFTEQ ( state . dist_to_next_region , 1.2018173738e+01 , eps ) ; EXPECT_EQ ( Geo_State :: PLUS_X , state . exiting_face ) ; r = Vector ( -0.52 , -0.25 , 11.80 ) ; omega = Vector ( -0.638224253549 , -0.728778909543 , -0.248094947929 ) ; water . initialize ( r , state ) ; EXPECT_EQ ( Geo_State :: MODERATOR , state . region ) ; EXPECT_EQ ( Geo_State :: NONE , state . exiting_face ) ; water . distance_to_boundary ( r , omega , state ) ; EXPECT_SOFTEQ ( state . dist_to_next_region , 1.4437568710e-02 , eps ) ; EXPECT_EQ ( Geo_State :: INTERNAL , state . exiting_face ) ; EXPECT_EQ ( Geo_State :: R1_VESSEL , state . next_face ) ; EXPECT_EQ ( Geo_State :: VESSEL , state . next_region ) ; r = Vector ( -2.52 , -4.20 , 11.80 ) ; omega = Vector ( 0.130844809690 , -0.929686805689 , -0.344328446552 ) ; water . initialize ( r , state ) ; EXPECT_EQ ( Geo_State :: VESSEL , state . region ) ; water . distance_to_boundary ( r , omega , state ) ; EXPECT_SOFTEQ ( state . dist_to_next_region , 3.4045225628e+00 , eps ) ; EXPECT_EQ ( Geo_State :: INTERNAL , state . exiting_face ) ; EXPECT_EQ ( Geo_State :: R0_VESSEL , state . next_face ) ; EXPECT_EQ ( Geo_State :: MODERATOR , state . next_region ) ; r = Vector ( -2.52 , -4.20 , 11.80 ) ; omega = Vector ( 0.077270894187 , 0.976053400258 , -0.203344458387 ) ; water . initialize ( r , state ) ; EXPECT_EQ ( Geo_State :: VESSEL , state . region ) ; water . distance_to_boundary ( r , omega , state ) ; EXPECT_SOFTEQ ( state . dist_to_next_region , 6.4107157490e+00 , eps ) ; EXPECT_EQ ( Geo_State :: INTERNAL , state . exiting_face ) ; EXPECT_EQ ( Geo_State :: R1_VESSEL , state . next_face ) ; EXPECT_EQ ( Geo_State :: MODERATOR , state . next_region ) ; }
See support/tstPin_Cell_Vessel.py for reference solutions.
See support / tstPin_Cell_Vessel . py for reference solutions .
// offsets // near/far for these offsets // nearR = 123.634986958 farR = 157.883749639