releasedExamples/MultiDimPhase/advectSrc/PatchAdvection.cpp
// Factory method - this object is its own factory.  It returns a pointer
// to new OldPatchGodunov object with its initial and boundary condtions, slope
// parameters, and artificial viscosity information defined.
Factory method - this object is its own factory.  It returns a pointer
to new OldPatchGodunov object with its initial and boundary condtions, slope
parameters, and artificial viscosity information defined.
Factory method - this object is its own factory . It returns a pointer to new OldPatchGodunov object with its initial and boundary condtions slope parameters and artificial viscosity information defined .
OldPatchGodunov* PatchAdvection::new_patchGodunov() const
{
  PatchAdvection* newPtr = new PatchAdvection();
  newPtr->setPhysIBC(getPhysIBC());
  newPtr->setSlopeParameters(m_useFourthOrderSlopes,
                             m_useFlattening,
                             m_limitSlopes);
  newPtr->setArtificialViscosity(m_useArtificialViscosity,
                                 m_artificialViscosity);
  newPtr->m_numCons = m_numCons;
  newPtr->m_numPrim = m_numPrim;
  newPtr->m_numFlux = m_numFlux;
  newPtr->m_numSlope = m_numSlope;
  OldPatchGodunov* retval =
    static_cast<OldPatchGodunov*>(newPtr);
  return retval;
}
OldPatchGodunov * PatchAdvection :: new_patchGodunov ( ) const { PatchAdvection * newPtr = new PatchAdvection ( ) ; newPtr -> setPhysIBC ( getPhysIBC ( ) ) ; newPtr -> setSlopeParameters ( m_useFourthOrderSlopes , m_useFlattening , m_limitSlopes ) ; newPtr -> setArtificialViscosity ( m_useArtificialViscosity , m_artificialViscosity ) ; newPtr -> m_numCons = m_numCons ; newPtr -> m_numPrim = m_numPrim ; newPtr -> m_numFlux = m_numFlux ; newPtr -> m_numSlope = m_numSlope ; OldPatchGodunov * retval = static_cast < OldPatchGodunov * > ( newPtr ) ; return retval ; }
Factory method - this object is its own factory.
Factory method - this object is its own factory .
// Make the new object // Pass the current initial and boundary condition (IBC) object to this new // patch integrator so it can create its own IBC object and define it as it // needs to (i.e. new domain and grid spacing if necessary) // Set the slope and artificial viscosity parameters // copy state info // Return the new object