Public Member Functions | Protected Member Functions

gridripper::amr1d::FuncInitCond Class Reference

Initial condition for a PDE. More...

#include <FuncInitCond.h>

Inheritance diagram for gridripper::amr1d::FuncInitCond:
gridripper::amr1d::InitCond gridripper::amr1d::initcond::ODERelaxInit gridripper::amr1d::initcond::UserDef gridripper::amr1d::initcond::Zero gridripper::amr1d::initcond::ODEShootInit

List of all members.

Public Member Functions

int init (tvalarray< tvector< Grid * > > &grids, PDE *pde, GReal_t dt, int r, int maxlevel, int bufzone, AMError *amerr, double maxerr) throw (InitCond::Exception&)
 Creates and initializes base grid and initial subgrids.
virtual GReal_t getTime () const
 Gets the time parameter at the initialization.
int getInterpolatedLevel () const
 Gets the minimum refinement level where interpolation is used instead of the precise calculation of the initial state.
void setInterpolatedLevel (int l)
 Initial values are interpolated on the specified refinement level and finer levels.

Protected Member Functions

 FuncInitCond (string &args, const Parameters *p) throw (InitCond::Exception&)
 Creates initial condition.
virtual void init (PDE *pde, GReal_t x, FieldWrapper &phi)=0 throw (InitCond::Exception&)
 Initializes the grid at the specified point.
int getMostRefinedGridMaxI () const
 Gets the most refined equivalent of the base grid size.
GReal_t getMostRefinedGridDeltaX () const
 Gets the grid spacing of the most refined subgrids.
virtual bool isNumericalConstraintSettingNeeded () const
 Tests whether the constraint condition is set numerically by the PDE.
void setNumericalConstraintSettingNeeded (bool v)
 Enables or disables numerical constraint setting by the PDE.
virtual void endInit ()
 Called at the end of init.

Detailed Description

Initial condition for a PDE.

Version:
0.5, 05/08/2009
Since:
GridRipper 0.3, 04/23/2005
Author:
Peter Csizmadia

Constructor & Destructor Documentation

gridripper::amr1d::FuncInitCond::FuncInitCond ( string &  args,
const Parameters p 
) throw (InitCond::Exception&) [protected]

Creates initial condition.

Parameters:
args the arguments
p the parameters

Member Function Documentation

virtual void gridripper::amr1d::FuncInitCond::endInit (  )  [inline, protected, virtual]

Called at the end of init.

This method can free temporarily allocated memory or perform other clean-up tasks. The default implementations is empty.

Reimplemented in gridripper::amr1d::initcond::ODERelaxInit, and gridripper::amr1d::initcond::ODEShootInit.

int gridripper::amr1d::FuncInitCond::getInterpolatedLevel (  )  const [inline]

Gets the minimum refinement level where interpolation is used instead of the precise calculation of the initial state.

Returns:
the minimum interpolated refinement level or zero if interpolation is not used
GReal_t gridripper::amr1d::FuncInitCond::getMostRefinedGridDeltaX (  )  const [inline, protected]

Gets the grid spacing of the most refined subgrids.

Returns:
the minimum possible grid spacing
int gridripper::amr1d::FuncInitCond::getMostRefinedGridMaxI (  )  const [inline, protected]

Gets the most refined equivalent of the base grid size.

Returns:
the size
virtual GReal_t gridripper::amr1d::FuncInitCond::getTime (  )  const [inline, virtual]

Gets the time parameter at the initialization.

The default implementation returns 0.

Returns:
the time

Implements gridripper::amr1d::InitCond.

Reimplemented in gridripper::amr1d::initcond::UserDef.

virtual void gridripper::amr1d::FuncInitCond::init ( PDE pde,
GReal_t  x,
FieldWrapper phi 
) throw (InitCond::Exception&) [protected, pure virtual]

Initializes the grid at the specified point.

Parameters:
pde the PDE
x the x coordinate
phi output array for the field values

Implemented in gridripper::amr1d::initcond::ODERelaxInit, gridripper::amr1d::initcond::ODEShootInit, gridripper::amr1d::initcond::UserDef, and gridripper::amr1d::initcond::Zero.

int gridripper::amr1d::FuncInitCond::init ( tvalarray< tvector< Grid * > > &  grids,
PDE pde,
GReal_t  dt,
int  r,
int  maxlevel,
int  bufzone,
AMError amerr,
double  maxerr 
) throw (InitCond::Exception&) [virtual]

Creates and initializes base grid and initial subgrids.

Parameters:
grids array of all grids
pde the PDE
dt the time step
r refinement ratio
maxlevel maximum refinement level
bufzone buffer zone size
amerr error function
maxerr error tolerance
Returns:
the finest refinement level

Implements gridripper::amr1d::InitCond.

virtual bool gridripper::amr1d::FuncInitCond::isNumericalConstraintSettingNeeded (  )  const [inline, protected, virtual]

Tests whether the constraint condition is set numerically by the PDE.

Returns:
true in the default implementation
void gridripper::amr1d::FuncInitCond::setInterpolatedLevel ( int  l  ) 

Initial values are interpolated on the specified refinement level and finer levels.

Parameters:
l the minimum refinement level where interpolation is used or zero to avoid interpolation
void gridripper::amr1d::FuncInitCond::setNumericalConstraintSettingNeeded ( bool  v  )  [inline, protected]

Enables or disables numerical constraint setting by the PDE.

Parameters:
v true to set constraints numerically, false if they are initialized by this InitCond

The documentation for this class was generated from the following file: