src/embedded_boundaries/eb_twocylinders.cpp
/********************************************************************************
 *                                                                              *
 * Function to create a annular cylinder EB.                                     *
 *                                                                              *
 ********************************************************************************/
Function to create a annular cylinder EB.
Function to create a annular cylinder EB .
void incflo::make_eb_twocylinders()
{
    int direction1 = 2;
    int direction2 = 2;
    Real radius1 = 0.5;
    Real radius2 = 0.5;
    Vector<Real> centervec1(3);
    Vector<Real> centervec2(3);
    ParmParse pp("twocylinders");
    pp.query("direction1", direction1);
    pp.query("direction2", direction2);
    pp.query("radius1", radius1);
    pp.query("radius2", radius2);
    pp.getarr("center1", centervec1, 0, 3);
    pp.getarr("center2", centervec2, 0, 3);
    Array<Real, 3> center1 = {centervec1[0], centervec1[1], centervec1[2]};
    Array<Real, 3> center2 = {centervec2[0], centervec2[1], centervec2[2]};
    Real offset = 0.0;
    for(int i = 0; i < 3; i++)
        offset += pow(center1[i] - center2[i], 2);
    offset = sqrt(offset);
    amrex::Print() << " CYLINDER 1" << std::endl;
    amrex::Print() << " Direction:       " << direction1 << std::endl;
    amrex::Print() << " Radius:    " << radius1 << std::endl;
    amrex::Print() << " Center:    "
                   << center1[0] << ", " << center1[1] << ", " << center1[2] << std::endl;
    amrex::Print() << " CYLINDER 2" << std::endl;
    amrex::Print() << " Direction:       " << direction2 << std::endl;
    amrex::Print() << " Radius:    " << radius2 << std::endl;
    amrex::Print() << " Center:    "
                   << center2[0] << ", " << center2[1] << ", " << center2[2] << std::endl;
    amrex::Print() << "\n Offset:          " << offset << std::endl;
    EB2::CylinderIF cyl1(radius1, direction1, center1, false);
    EB2::CylinderIF cyl2(radius2, direction2, center2, false);
    auto twocylinders = EB2::makeUnion(cyl1, cyl2);
    auto gshop = EB2::makeShop(twocylinders);
    int max_level_here = 0;
    int max_coarsening_level = 100;
    EB2::Build(gshop, geom.back(), max_level_here, max_level_here + max_coarsening_level);
}
void incflo :: make_eb_twocylinders ( ) { int direction1 = 2 ; int direction2 = 2 ; Real radius1 = 0.5 ; Real radius2 = 0.5 ; Vector < Real > centervec1 ( 3 ) ; Vector < Real > centervec2 ( 3 ) ; ParmParse pp ( " " ) ; pp . query ( " " , direction1 ) ; pp . query ( " " , direction2 ) ; pp . query ( " " , radius1 ) ; pp . query ( " " , radius2 ) ; pp . getarr ( " " , centervec1 , 0 , 3 ) ; pp . getarr ( " " , centervec2 , 0 , 3 ) ; Array < Real , 3 > center1 = { centervec1 [ 0 ] , centervec1 [ 1 ] , centervec1 [ 2 ] } ; Array < Real , 3 > center2 = { centervec2 [ 0 ] , centervec2 [ 1 ] , centervec2 [ 2 ] } ; Real offset = 0.0 ; for ( int i = 0 ; i < 3 ; i ++ ) offset += pow ( center1 [ i ] - center2 [ i ] , 2 ) ; offset = sqrt ( offset ) ; amrex :: Print ( ) << " " << std :: endl ; amrex :: Print ( ) << " " << direction1 << std :: endl ; amrex :: Print ( ) << " " << radius1 << std :: endl ; amrex :: Print ( ) << " " << center1 [ 0 ] << " " << center1 [ 1 ] << " " << center1 [ 2 ] << std :: endl ; amrex :: Print ( ) << " " << std :: endl ; amrex :: Print ( ) << " " << direction2 << std :: endl ; amrex :: Print ( ) << " " << radius2 << std :: endl ; amrex :: Print ( ) << " " << center2 [ 0 ] << " " << center2 [ 1 ] << " " << center2 [ 2 ] << std :: endl ; amrex :: Print ( ) << " \n " << offset << std :: endl ; EB2 :: CylinderIF cyl1 ( radius1 , direction1 , center1 , false ) ; EB2 :: CylinderIF cyl2 ( radius2 , direction2 , center2 , false ) ; auto twocylinders = EB2 :: makeUnion ( cyl1 , cyl2 ) ; auto gshop = EB2 :: makeShop ( twocylinders ) ; int max_level_here = 0 ; int max_coarsening_level = 100 ; EB2 :: Build ( gshop , geom . back ( ) , max_level_here , max_level_here + max_coarsening_level ) ; }
Function to create a annular cylinder EB.
Function to create a annular cylinder EB .
// Initialise parameters // Get information from inputs file.                               * // Compute distance between cylinder centres // Print info about cylinders // Build the implicit function as a union of two cylinders // Generate GeometryShop // Build index space