releasedExamples/MultiDimPhase/advectSrc/PatchAdvection.cpp
// Update the primitive variables using face-centered variables
Update the primitive variables using face-centered variables
Update the primitive variables using face - centered variables
void PatchAdvection::updatePrim(FArrayBox&       a_WMinus,
                                FArrayBox&       a_WPlus,
                                const FArrayBox& a_F,
                                const Real&      a_scale,
                                const int&       a_dir,
                                const Box&       a_box)
{
  CH_assert(isDefined());
  CH_assert(a_WPlus.box().contains(a_box));
  CH_assert(a_WMinus.box().contains(a_box));
  int numCons = numConserved();
  FArrayBox U(a_box,numCons);
  primToCons(U,a_WMinus,a_box);
  updateCons(U,a_F,a_scale,a_dir,a_box);
  consToPrim(a_WMinus,U,a_box);
  primToCons(U,a_WPlus,a_box);
  updateCons(U,a_F,a_scale,a_dir,a_box);
  consToPrim(a_WPlus,U,a_box);
}
void PatchAdvection :: updatePrim ( FArrayBox & a_WMinus , FArrayBox & a_WPlus , const FArrayBox & a_F , const Real & a_scale , const int & a_dir , const Box & a_box ) { CH_assert ( isDefined ( ) ) ; CH_assert ( a_WPlus . box ( ) . contains ( a_box ) ) ; CH_assert ( a_WMinus . box ( ) . contains ( a_box ) ) ; int numCons = numConserved ( ) ; FArrayBox U ( a_box , numCons ) ; primToCons ( U , a_WMinus , a_box ) ; updateCons ( U , a_F , a_scale , a_dir , a_box ) ; consToPrim ( a_WMinus , U , a_box ) ; primToCons ( U , a_WPlus , a_box ) ; updateCons ( U , a_F , a_scale , a_dir , a_box ) ; consToPrim ( a_WPlus , U , a_box ) ; }
Update the primitive variables using face-centered variables
Update the primitive variables using face - centered variables
// Number of conserved variables // Temporary storage for converting primitive variables to conserved // variables and back again (after update with the fluxes) // for W+-, convert primitive quantities to conservative quantities, // update with the fluxes, and convert back