releasedExamples/MultiDimPhase/advectSrc/OldPatchGodunov.cpp
// Update the conserved variables, return the final fluxes used for this,
// and return the maximum wave speed on this patch/grid
Update the conserved variables, return the final fluxes used for this,
and return the maximum wave speed on this patch/grid
Update the conserved variables return the final fluxes used for this and return the maximum wave speed on this patch / grid
void OldPatchGodunov::updateState(FArrayBox&       a_U,
                                  FArrayBox        a_F[CH_SPACEDIM],
                                  Real&            a_maxWaveSpeed,
                                  const FArrayBox& a_S,
                                  const Real&      a_dt,
                                  const Box&       a_box)
{
  CH_assert(isDefined());
  CH_assert(a_box == m_currentBox);
  int numFlux = numFluxes();
  FArrayBox Uold(a_U.box(),a_U.nComp());
  Uold.copy(a_U);
  const Box& curBox = m_currentBox;
  for (int dir1 = 0; dir1 < SpaceDim; ++dir1)
    {
      Box fluxBox;
      fluxBox = curBox;
      fluxBox.grow(1);
      fluxBox.grow(dir1,-1);
      fluxBox &= m_domain;
      fluxBox.surroundingNodes(dir1);
      FArrayBox& F = a_F[dir1];
      F.resize(fluxBox,numFlux);
    }
  computeFluxes(a_U,a_F, a_S, a_dt, a_box);
  for (int dir1 = 0; dir1 < SpaceDim; dir1++)
    {
      finalUpdate(a_U,a_F[dir1],a_dt/m_dx,dir1,curBox);
    }
  postUpdateCons(a_U,Uold,a_dt,m_dx,curBox);
  a_maxWaveSpeed = getMaxWaveSpeed(a_U,m_currentBox);
}
void OldPatchGodunov :: updateState ( FArrayBox & a_U , FArrayBox a_F [ CH_SPACEDIM ] , Real & a_maxWaveSpeed , const FArrayBox & a_S , const Real & a_dt , const Box & a_box ) { CH_assert ( isDefined ( ) ) ; CH_assert ( a_box == m_currentBox ) ; int numFlux = numFluxes ( ) ; FArrayBox Uold ( a_U . box ( ) , a_U . nComp ( ) ) ; Uold . copy ( a_U ) ; const Box & curBox = m_currentBox ; for ( int dir1 = 0 ; dir1 < SpaceDim ; ++ dir1 ) { Box fluxBox ; fluxBox = curBox ; fluxBox . grow ( 1 ) ; fluxBox . grow ( dir1 , -1 ) ; fluxBox &= m_domain ; fluxBox . surroundingNodes ( dir1 ) ; FArrayBox & F = a_F [ dir1 ] ; F . resize ( fluxBox , numFlux ) ; } computeFluxes ( a_U , a_F , a_S , a_dt , a_box ) ; for ( int dir1 = 0 ; dir1 < SpaceDim ; dir1 ++ ) { finalUpdate ( a_U , a_F [ dir1 ] , a_dt / m_dx , dir1 , curBox ) ; } postUpdateCons ( a_U , Uold , a_dt , m_dx , curBox ) ; a_maxWaveSpeed = getMaxWaveSpeed ( a_U , m_currentBox ) ; }
Update the conserved variables, return the final fluxes used for this,
and return the maximum wave speed on this patch/grid
Update the conserved variables return the final fluxes used for this and return the maximum wave speed on this patch / grid
// Get the number of various variables // Create a temp storage for a_U - RS 06/10/02 // The current box // allocate flux storage // This box is face centered in direction "dir1", is one bigger // than the input box in all directions except "dir1" // Update conserved variables to the next time step using the final // flux in each direction // Post processing on the conserved variables // Get and return the maximum wave speed on this patch/grid