packages/MC/geometry/test/tstCore.cc
//---------------------------------------------------------------------------//
// See support/bwr.png for core figure showing particle path.
See support/bwr.png for core figure showing particle path.
See support / bwr . png for core figure showing particle path .
TEST(Bwr, Symmetry)
{
    SP_Core bwr;
    {
        vector<double> r(2, 0.0);
        vector<int>    rid(2, 1);
        r[0] = 0.125;
        r[1] = 0.25;
        SP_Pin_Cell pin(make_shared<Pin_Cell_t>(rid, r, 5, 0.75, 14.00, 4));
        SP_Pin_Cell plug(make_shared<Pin_Cell_t>(2, 0.6, 5, 1.5, 14.00, 4));
        SP_Pin_Cell g0(make_shared<Pin_Cell_t>(5, 0.25, 14.00));      
        SP_Pin_Cell g1(make_shared<Pin_Cell_t>(5, 0.25, 1.5, 14.00)); 
        SP_Pin_Cell g2(make_shared<Pin_Cell_t>(5, 1.5, 0.25, 14.00)); 
        SP_Lattice lat1(make_shared<Lattice_t>(2, 2, 1, 1));
        lat1->assign_object(pin, 0);
        lat1->complete(0.0, 0.0, 0.0);
        EXPECT_EQ(48, lat1->num_cells());
        SP_Lattice lat2(make_shared<Lattice_t>(1, 1, 1, 1));
        lat2->assign_object(plug, 0);
        lat2->complete(0.0, 0.0, 0.0);
        EXPECT_EQ(8, lat2->num_cells());
         gap lattice
        SP_Lattice lat3(make_shared<Lattice_t>(1, 1, 1, 1));
        lat3->assign_object(g0, 0);
        lat3->complete(0.0, 0.0, 0.0);
        EXPECT_EQ(1, lat3->num_cells());
         gap lattice
        SP_Lattice lat4(make_shared<Lattice_t>(1, 1, 1, 1));
        lat4->assign_object(g1, 0);
        lat4->complete(0.0, 0.0, 0.0);
        EXPECT_EQ(1, lat4->num_cells());
         gap lattice
        SP_Lattice lat5(make_shared<Lattice_t>(1, 1, 1, 1));
        lat5->assign_object(g2, 0);
        lat5->complete(0.0, 0.0, 0.0);
        EXPECT_EQ(1, lat5->num_cells());
        bwr = make_shared<Core_t>(4, 4, 1, 5);
        bwr->assign_object(lat1, 0); 
        bwr->assign_object(lat2, 1); 
        bwr->assign_object(lat3, 2);  gap
        bwr->assign_object(lat4, 3);  gap
        bwr->assign_object(lat5, 4); 
        bwr->id(0, 0, 0) = 2;
        bwr->id(1, 0, 0) = 4;
        bwr->id(2, 0, 0) = 4;
        bwr->id(3, 0, 0) = 2;
        bwr->id(0, 1, 0) = 3;
        bwr->id(1, 1, 0) = 1;
        bwr->id(2, 1, 0) = 0;
        bwr->id(3, 1, 0) = 3;
        bwr->id(0, 2, 0) = 3;
        bwr->id(1, 2, 0) = 0;
        bwr->id(2, 2, 0) = 1;
        bwr->id(3, 2, 0) = 3;
        bwr->id(0, 3, 0) = 2;
        bwr->id(1, 3, 0) = 4;
        bwr->id(2, 3, 0) = 4;
        bwr->id(3, 3, 0) = 2;
        bwr->complete(0.0, 0.0, 0.0);
        EXPECT_TRUE(soft_equiv(bwr->pitch(X), 3.5));
        EXPECT_TRUE(soft_equiv(bwr->pitch(Y), 3.5));
    }
}
TEST ( Bwr , Symmetry ) { SP_Core bwr ; { vector < double > r ( 2 , 0.0 ) ; vector < int > rid ( 2 , 1 ) ; r [ 0 ] = 0.125 ; r [ 1 ] = 0.25 ; SP_Pin_Cell pin ( make_shared < Pin_Cell_t > ( rid , r , 5 , 0.75 , 14.00 , 4 ) ) ; SP_Pin_Cell plug ( make_shared < Pin_Cell_t > ( 2 , 0.6 , 5 , 1.5 , 14.00 , 4 ) ) ; SP_Pin_Cell g0 ( make_shared < Pin_Cell_t > ( 5 , 0.25 , 14.00 ) ) ; SP_Pin_Cell g1 ( make_shared < Pin_Cell_t > ( 5 , 0.25 , 1.5 , 14.00 ) ) ; SP_Pin_Cell g2 ( make_shared < Pin_Cell_t > ( 5 , 1.5 , 0.25 , 14.00 ) ) ; SP_Lattice lat1 ( make_shared < Lattice_t > ( 2 , 2 , 1 , 1 ) ) ; lat1 -> assign_object ( pin , 0 ) ; lat1 -> complete ( 0.0 , 0.0 , 0.0 ) ; EXPECT_EQ ( 48 , lat1 -> num_cells ( ) ) ; SP_Lattice lat2 ( make_shared < Lattice_t > ( 1 , 1 , 1 , 1 ) ) ; lat2 -> assign_object ( plug , 0 ) ; lat2 -> complete ( 0.0 , 0.0 , 0.0 ) ; EXPECT_EQ ( 8 , lat2 -> num_cells ( ) ) ; SP_Lattice lat3 ( make_shared < Lattice_t > ( 1 , 1 , 1 , 1 ) ) ; lat3 -> assign_object ( g0 , 0 ) ; lat3 -> complete ( 0.0 , 0.0 , 0.0 ) ; EXPECT_EQ ( 1 , lat3 -> num_cells ( ) ) ; SP_Lattice lat4 ( make_shared < Lattice_t > ( 1 , 1 , 1 , 1 ) ) ; lat4 -> assign_object ( g1 , 0 ) ; lat4 -> complete ( 0.0 , 0.0 , 0.0 ) ; EXPECT_EQ ( 1 , lat4 -> num_cells ( ) ) ; SP_Lattice lat5 ( make_shared < Lattice_t > ( 1 , 1 , 1 , 1 ) ) ; lat5 -> assign_object ( g2 , 0 ) ; lat5 -> complete ( 0.0 , 0.0 , 0.0 ) ; EXPECT_EQ ( 1 , lat5 -> num_cells ( ) ) ; bwr = make_shared < Core_t > ( 4 , 4 , 1 , 5 ) ; bwr -> assign_object ( lat1 , 0 ) ; bwr -> assign_object ( lat2 , 1 ) ; bwr -> assign_object ( lat3 , 2 ) ; bwr -> assign_object ( lat4 , 3 ) ; bwr -> assign_object ( lat5 , 4 ) ; bwr -> id ( 0 , 0 , 0 ) = 2 ; bwr -> id ( 1 , 0 , 0 ) = 4 ; bwr -> id ( 2 , 0 , 0 ) = 4 ; bwr -> id ( 3 , 0 , 0 ) = 2 ; bwr -> id ( 0 , 1 , 0 ) = 3 ; bwr -> id ( 1 , 1 , 0 ) = 1 ; bwr -> id ( 2 , 1 , 0 ) = 0 ; bwr -> id ( 3 , 1 , 0 ) = 3 ; bwr -> id ( 0 , 2 , 0 ) = 3 ; bwr -> id ( 1 , 2 , 0 ) = 0 ; bwr -> id ( 2 , 2 , 0 ) = 1 ; bwr -> id ( 3 , 2 , 0 ) = 3 ; bwr -> id ( 0 , 3 , 0 ) = 2 ; bwr -> id ( 1 , 3 , 0 ) = 4 ; bwr -> id ( 2 , 3 , 0 ) = 4 ; bwr -> id ( 3 , 3 , 0 ) = 2 ; bwr -> complete ( 0.0 , 0.0 , 0.0 ) ; EXPECT_TRUE ( soft_equiv ( bwr -> pitch ( X ) , 3.5 ) ) ; EXPECT_TRUE ( soft_equiv ( bwr -> pitch ( Y ) , 3.5 ) ) ; } }
See support/bwr.png for core figure showing particle path.
See support / bwr . png for core figure showing particle path .
// make bwr lattice // pin shells // cells // gaps // corner // x-edge // y-edge // 2x2 pin lattice // plug lattice // corner gap lattice // x-edge gap lattice // y-edge gap lattice // 2x2 pin lattice // water plug // corner gap // x-edge gap // y_edge gap // complete the bwr lattice