src/mesh/mesh.cpp
//----------------------------------------------------------------------------------------
// \!fn void Mesh::SetBlockSizeAndBoundaries(LogicalLocation loc,
//                 RegionSize &block_size, enum BundaryFlag *block_bcs)
// \brief Set the physical part of a block_size structure and block boundary conditions
\!fn void Mesh::SetBlockSizeAndBoundaries(LogicalLocation loc,
RegionSize █_size, enum BundaryFlag *block_bcs)
\brief Set the physical part of a block_size structure and block boundary conditions
\ !fn void Mesh :: SetBlockSizeAndBoundaries ( LogicalLocation loc RegionSize █_size enum BundaryFlag * block_bcs ) \ brief Set the physical part of a block_size structure and block boundary conditions
void Mesh::SetBlockSizeAndBoundaries(LogicalLocation loc, RegionSize &block_size,
                                     enum BoundaryFlag *block_bcs)
{
  long int &lx1=loc.lx1;
  long int &lx2=loc.lx2;
  long int &lx3=loc.lx3;
  int &ll=loc.level;
  if(lx1==0) {
    block_size.x1min=mesh_size.x1min;
    block_bcs[INNER_X1]=mesh_bcs[INNER_X1];
  }
  else {
    Real rx=(Real)lx1/(Real)(nrbx1<<(ll-root_level));
    block_size.x1min=MeshGenerator_[X1DIR](rx,mesh_size);
    block_bcs[INNER_X1]=BLOCK_BNDRY;
  }
  if(lx1==(nrbx1<<(ll-root_level))-1) {
    block_size.x1max=mesh_size.x1max;
    block_bcs[OUTER_X1]=mesh_bcs[OUTER_X1];
  }
  else {
    Real rx=(Real)(lx1+1)/(Real)(nrbx1<<(ll-root_level));
    block_size.x1max=MeshGenerator_[X1DIR](rx,mesh_size);
    block_bcs[OUTER_X1]=BLOCK_BNDRY;
  }
  if(mesh_size.nx2 == 1) {
    block_size.x2min=mesh_size.x2min;
    block_size.x2max=mesh_size.x2max;
    block_bcs[INNER_X2]=mesh_bcs[INNER_X2];
    block_bcs[OUTER_X2]=mesh_bcs[OUTER_X2];
  }
  else {
    if(lx2==0) {
      block_size.x2min=mesh_size.x2min;
      block_bcs[INNER_X2]=mesh_bcs[INNER_X2];
    }
    else {
      Real rx=(Real)lx2/(Real)(nrbx2<<(ll-root_level));
      block_size.x2min=MeshGenerator_[X2DIR](rx,mesh_size);
      block_bcs[INNER_X2]=BLOCK_BNDRY;
    }
    if(lx2==(nrbx2<<(ll-root_level))-1) {
      block_size.x2max=mesh_size.x2max;
      block_bcs[OUTER_X2]=mesh_bcs[OUTER_X2];
    }
    else {
      Real rx=(Real)(lx2+1)/(Real)(nrbx2<<(ll-root_level));
      block_size.x2max=MeshGenerator_[X2DIR](rx,mesh_size);
      block_bcs[OUTER_X2]=BLOCK_BNDRY;
    }
  }
  if(mesh_size.nx3 == 1) {
    block_size.x3min=mesh_size.x3min;
    block_size.x3max=mesh_size.x3max;
    block_bcs[INNER_X3]=mesh_bcs[INNER_X3];
    block_bcs[OUTER_X3]=mesh_bcs[OUTER_X3];
  }
  else {
    if(lx3==0) {
      block_size.x3min=mesh_size.x3min;
      block_bcs[INNER_X3]=mesh_bcs[INNER_X3];
    }
    else {
      Real rx=(Real)lx3/(Real)(nrbx3<<(ll-root_level));
      block_size.x3min=MeshGenerator_[X3DIR](rx,mesh_size);
      block_bcs[INNER_X3]=BLOCK_BNDRY;
    }
    if(lx3==(nrbx3<<(ll-root_level))-1) {
      block_size.x3max=mesh_size.x3max;
      block_bcs[OUTER_X3]=mesh_bcs[OUTER_X3];
    }
    else {
      Real rx=(Real)(lx3+1)/(Real)(nrbx3<<(ll-root_level));
      block_size.x3max=MeshGenerator_[X3DIR](rx,mesh_size);
      block_bcs[OUTER_X3]=BLOCK_BNDRY;
    }
  }
  return;
}
void Mesh :: SetBlockSizeAndBoundaries ( LogicalLocation loc , RegionSize & block_size , enum BoundaryFlag * block_bcs ) { long int & lx1 = loc . lx1 ; long int & lx2 = loc . lx2 ; long int & lx3 = loc . lx3 ; int & ll = loc . level ; if ( lx1 == 0 ) { block_size . x1min = mesh_size . x1min ; block_bcs [ INNER_X1 ] = mesh_bcs [ INNER_X1 ] ; } else { Real rx = ( Real ) lx1 / ( Real ) ( nrbx1 << ( ll - root_level ) ) ; block_size . x1min = MeshGenerator_ [ X1DIR ] ( rx , mesh_size ) ; block_bcs [ INNER_X1 ] = BLOCK_BNDRY ; } if ( lx1 == ( nrbx1 << ( ll - root_level ) ) - 1 ) { block_size . x1max = mesh_size . x1max ; block_bcs [ OUTER_X1 ] = mesh_bcs [ OUTER_X1 ] ; } else { Real rx = ( Real ) ( lx1 + 1 ) / ( Real ) ( nrbx1 << ( ll - root_level ) ) ; block_size . x1max = MeshGenerator_ [ X1DIR ] ( rx , mesh_size ) ; block_bcs [ OUTER_X1 ] = BLOCK_BNDRY ; } if ( mesh_size . nx2 == 1 ) { block_size . x2min = mesh_size . x2min ; block_size . x2max = mesh_size . x2max ; block_bcs [ INNER_X2 ] = mesh_bcs [ INNER_X2 ] ; block_bcs [ OUTER_X2 ] = mesh_bcs [ OUTER_X2 ] ; } else { if ( lx2 == 0 ) { block_size . x2min = mesh_size . x2min ; block_bcs [ INNER_X2 ] = mesh_bcs [ INNER_X2 ] ; } else { Real rx = ( Real ) lx2 / ( Real ) ( nrbx2 << ( ll - root_level ) ) ; block_size . x2min = MeshGenerator_ [ X2DIR ] ( rx , mesh_size ) ; block_bcs [ INNER_X2 ] = BLOCK_BNDRY ; } if ( lx2 == ( nrbx2 << ( ll - root_level ) ) - 1 ) { block_size . x2max = mesh_size . x2max ; block_bcs [ OUTER_X2 ] = mesh_bcs [ OUTER_X2 ] ; } else { Real rx = ( Real ) ( lx2 + 1 ) / ( Real ) ( nrbx2 << ( ll - root_level ) ) ; block_size . x2max = MeshGenerator_ [ X2DIR ] ( rx , mesh_size ) ; block_bcs [ OUTER_X2 ] = BLOCK_BNDRY ; } } if ( mesh_size . nx3 == 1 ) { block_size . x3min = mesh_size . x3min ; block_size . x3max = mesh_size . x3max ; block_bcs [ INNER_X3 ] = mesh_bcs [ INNER_X3 ] ; block_bcs [ OUTER_X3 ] = mesh_bcs [ OUTER_X3 ] ; } else { if ( lx3 == 0 ) { block_size . x3min = mesh_size . x3min ; block_bcs [ INNER_X3 ] = mesh_bcs [ INNER_X3 ] ; } else { Real rx = ( Real ) lx3 / ( Real ) ( nrbx3 << ( ll - root_level ) ) ; block_size . x3min = MeshGenerator_ [ X3DIR ] ( rx , mesh_size ) ; block_bcs [ INNER_X3 ] = BLOCK_BNDRY ; } if ( lx3 == ( nrbx3 << ( ll - root_level ) ) - 1 ) { block_size . x3max = mesh_size . x3max ; block_bcs [ OUTER_X3 ] = mesh_bcs [ OUTER_X3 ] ; } else { Real rx = ( Real ) ( lx3 + 1 ) / ( Real ) ( nrbx3 << ( ll - root_level ) ) ; block_size . x3max = MeshGenerator_ [ X3DIR ] ( rx , mesh_size ) ; block_bcs [ OUTER_X3 ] = BLOCK_BNDRY ; } } return ; }
\!fn void Mesh::SetBlockSizeAndBoundaries(LogicalLocation loc,
RegionSize &block_size, enum BundaryFlag *block_bcs)
\brief Set the physical part of a block_size structure and block boundary conditions
\ !fn void Mesh :: SetBlockSizeAndBoundaries ( LogicalLocation loc RegionSize &block_size enum BundaryFlag * block_bcs ) \ brief Set the physical part of a block_size structure and block boundary conditions
// calculate physical block size, x1 // calculate physical block size, x2 // calculate physical block size, x3