src/mesh/mesh.cpp
//----------------------------------------------------------------------------------------
// \!fn void Mesh::NewTimeStep(void)
// \brief function that loops over all MeshBlocks and find new timestep
//        this assumes that phydro->NewBlockTimeStep is already called
\!fn void Mesh::NewTimeStep(void)
\brief function that loops over all MeshBlocks and find new timestep
this assumes that phydro->NewBlockTimeStep is already called
\ !fn void Mesh :: NewTimeStep ( void ) \ brief function that loops over all MeshBlocks and find new timestep this assumes that phydro - > NewBlockTimeStep is already called
void Mesh::NewTimeStep(void)
{
  MeshBlock *pmb = pblock;
  Real min_dt=pmb->new_block_dt;
  pmb=pmb->next;
  while (pmb != NULL)  {
    min_dt=std::min(min_dt,pmb->new_block_dt);
    pmb=pmb->next;
  }
#ifdef MPI_PARALLEL
  MPI_Allreduce(MPI_IN_PLACE,&min_dt,1,MPI_ATHENA_REAL,MPI_MIN,MPI_COMM_WORLD);
#endif
  dt=std::min(min_dt,2.0*dt);
  if (time < tlim && tlim-time < dt)  
    dt = tlim-time;
  return;
}
void Mesh :: NewTimeStep ( void ) { MeshBlock * pmb = pblock ; Real min_dt = pmb -> new_block_dt ; pmb = pmb -> next ; while ( pmb != NULL ) { min_dt = std :: min ( min_dt , pmb -> new_block_dt ) ; pmb = pmb -> next ; } #ifdef MPI_PARALLEL MPI_Allreduce ( MPI_IN_PLACE , & min_dt , 1 , MPI_ATHENA_REAL , MPI_MIN , MPI_COMM_WORLD ) ; #endif dt = std :: min ( min_dt , 2.0 * dt ) ; if ( time < tlim && tlim - time < dt ) dt = tlim - time ; return ; }
\!fn void Mesh::NewTimeStep(void)
\brief function that loops over all MeshBlocks and find new timestep
this assumes that phydro->NewBlockTimeStep is already called
\ !fn void Mesh :: NewTimeStep ( void ) \ brief function that loops over all MeshBlocks and find new timestep this assumes that phydro - > NewBlockTimeStep is already called
// set it // timestep would take us past desired endpoint