Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions

gridripper::amr1d::PDE Class Reference

Abstract base class of partial differential equations. More...

#include <PDE.h>

List of all members.

Classes

class  ComponentGridFunction
class  DensityQuantity
 Abstract base class of local density quantities. More...
class  EnergyGridFunction
class  FiniteIntegral
class  FiniteX0Integral
class  MarkerQuantity
class  MarkerQuantityArray
class  PhysicalQuantity
class  PhysicalQuantityArray
class  TimeIntegral
class  TotalIntegral
class  TotalX0Integral
class  X0Flow
class  ZeroDensity

Public Types

enum  { LEFT = 1, RIGHT = 2 }

Public Member Functions

virtual GReal_t getMinX () const =0
 Gets the minimum x (space) coordinate for the simulation.
virtual GReal_t getMaxX () const =0
 Gets the maximum x (space) coordinate for the simulation.
virtual void evalConstrainedComponents (Grid &g, int i, FieldWrapper &f)=0
 Evaluates constrained field components.
virtual void setNonevolvingComponents (Grid &g, Grad &d)
 Sets nonevolving field components.
virtual int getNumConstraintEqs () const
 Gets the number of constraint equations.
virtual void evalConstraintEqs (const Grid &g, int i, const GReal_t *F, GReal_t *lhs, GReal_t *rhs) const
 Evaluates the constraint equations.
int doEval (GReal_t *dF, GReal_t t, const GReal_t *F, GReal_t *tmp, const Grid &g, int i, Grad &d, GReal_t dt)
 PDE evaluation, called by the integrators.
virtual int eval (GReal_t *dF, GReal_t t, GReal_t x, const GReal_t *F, const GReal_t *Fx, const Grid &g, int i, Grad &d, GReal_t dt)=0
 Overridable PDE evaluation method.
virtual bool isScalable () const
 Tests whether this PDE is scalable.
virtual GReal_t calcScaleFactor (const Grid *g) const
 Calculates the best scale factor.
virtual FieldWrappercreateField (int level) const =0
virtual PhysicalQuantityArray getPhysicalQuantities () const
virtual MarkerQuantityArray getMarkerQuantities () const
virtual GReal_t getPhysicalMinX () const
 Gets the minimum "physical" x coordinate.
virtual GReal_t getPhysicalMaxX () const
 Gets the maximum "physical" x coordinate.
virtual bool isXPeriodic () const
 Tests whether the solution is periodic in x.
virtual bool canBeExtended (int where) const
 Can the field be extended beyond the specified bound? This method should not be called without overriding it.
virtual void mirrorLeft (GReal_t x, FieldWrapper &f) const
 Called by the default getExtendedField implementation for points beyond left edge.
virtual void mirrorRight (GReal_t x, FieldWrapper &f) const
 Called by the default getExtendedField implementation for points beyond left edge.
virtual void getExtendedField (const Grid &g, int i, FieldWrapper &f) const
 Gets the extended field value at the specified grid point.
virtual bool hasExtendedRefinedFieldData (const Grid &g, int i) const
 Tests whether refined field data exists at a given point.
virtual void getExtendedRefinedField (const Grid &g, int i, FieldWrapper &f) const
 Gets the extended field value at the specified refined grid point.
virtual string getPhysicalComponentName (int k) const
 Gets the name of a physical field component.
virtual void getFieldWrapper (GReal_t t, GReal_t x, GReal_t *f) const
 Converts the physical field to the field used on the grid.
int getNumGridFunctions () const
 Gets the number of grid functions.
const GridFunctiongetGridFunction (int i) const
 Gets a grid function.
virtual GReal_t calcBestDeltaT (const Grid &g, int i, const FieldWrapper &F, GReal_t dt0, GReal_t dt) const
 Calculates the best time step value for the specified point.
virtual const double * getComponentSigmaArray () const
 Gets an array containing the relative magnitudes of the numerical dissipation term for each component.
string getTimeLabel () const
 Gets the time coordinate label.
string getTimeFormat () const
 Gets the time format string.
string getTimeLabelFormat () const
 Gets the time coordinate label format string.
string getXcoordLabel () const
 Gets the space coordinate label.
int getNumComponents () const
 Gets the number of field components.
int getNumIndependentComponents () const
 Gets the number of independent, non-constrained field components.
string getComponentName (int k) const
 Gets the name of a grid field component.
int getComponentIndex (const string &name) const
 Gets the index of a named grid field component.
int getGridFunctionIndex (const string &name) const
 Gets the index of a named grid function.
string getConstraintName (int k) const
 Gets the name of a constraint.
double constraintError (Grid &g, int i)
const DensityQuantityenergy () const

Static Public Attributes

static const double EPSILON

Protected Member Functions

 PDE (int nc, int nindep, const string *compnames, const string *constrnames, const string *coordlabels)
void setEnergy (const DensityQuantity &e)
void addGridFunction (GridFunction *f)
 Adds a grid function.

Detailed Description

Abstract base class of partial differential equations.

Version:
0.5, 05/13/2009
Author:
Peter Csizmadia
Andras Laszlo

Member Function Documentation

void gridripper::amr1d::PDE::addGridFunction ( GridFunction f  )  [protected]

Adds a grid function.

Parameters:
f the grid function
virtual GReal_t gridripper::amr1d::PDE::calcBestDeltaT ( const Grid g,
int  i,
const FieldWrapper F,
GReal_t  dt0,
GReal_t  dt 
) const [inline, virtual]

Calculates the best time step value for the specified point.

Parameters:
g the grid
i grid point index
F field values in that point
dt0 default time step
dt previous time step
Returns:
the best time step (default implementation returns dt)
virtual GReal_t gridripper::amr1d::PDE::calcScaleFactor ( const Grid g  )  const [inline, virtual]

Calculates the best scale factor.

The default implemention returns 1 without performing any operation.

Parameters:
g the base grid
Returns:
the scale factor
virtual bool gridripper::amr1d::PDE::canBeExtended ( int  where  )  const [virtual]

Can the field be extended beyond the specified bound? This method should not be called without overriding it.

Parameters:
where the bound
int gridripper::amr1d::PDE::doEval ( GReal_t dF,
GReal_t  t,
const GReal_t F,
GReal_t tmp,
const Grid g,
int  i,
Grad d,
GReal_t  dt 
)

PDE evaluation, called by the integrators.

Parameters:
dF the result array, it will contain the dF/dt values
t the time
F the field
tmp an array of the same size as the field array
g the grid
i index of grid location
d the finite difference operator
dt time difference
virtual int gridripper::amr1d::PDE::eval ( GReal_t dF,
GReal_t  t,
GReal_t  x,
const GReal_t F,
const GReal_t Fx,
const Grid g,
int  i,
Grad d,
GReal_t  dt 
) [pure virtual]

Overridable PDE evaluation method.

Parameters:
dF the result array, it will contain the dF/dt values
t the time
x the space coordinate
F the field
Fx the space derivative of the field
g the grid
i index of grid location
d the finite difference operator
dt time difference
virtual void gridripper::amr1d::PDE::evalConstrainedComponents ( Grid g,
int  i,
FieldWrapper f 
) [pure virtual]

Evaluates constrained field components.

Parameters:
g the grid
i the grid point index
F field values in the grid point
virtual void gridripper::amr1d::PDE::evalConstraintEqs ( const Grid g,
int  i,
const GReal_t F,
GReal_t lhs,
GReal_t rhs 
) const [virtual]

Evaluates the constraint equations.

Parameters:
g the grid
i the grid point index
F input field values in the grid point
lhs output left hand sides
rhs output right hand sides
int gridripper::amr1d::PDE::getComponentIndex ( const string &  name  )  const

Gets the index of a named grid field component.

Parameters:
k the component name
Returns:
the index or -1
string gridripper::amr1d::PDE::getComponentName ( int  k  )  const [inline]

Gets the name of a grid field component.

Parameters:
k the component index
Returns:
the name
virtual const double* gridripper::amr1d::PDE::getComponentSigmaArray (  )  const [inline, virtual]

Gets an array containing the relative magnitudes of the numerical dissipation term for each component.

The sigma factor is multiplied by the array elements.

In the default implementation, all elements of the return array are equal to 1. For performance reasons, overriding implementations should return an array allocated and filled in the constructor.

Parameters:
k the component index
Returns:
array containing the relative magnitudes of the numerical dissipation
string gridripper::amr1d::PDE::getConstraintName ( int  k  )  const [inline]

Gets the name of a constraint.

Parameters:
k the constraint index
Returns:
the name
virtual void gridripper::amr1d::PDE::getExtendedField ( const Grid g,
int  i,
FieldWrapper f 
) const [virtual]

Gets the extended field value at the specified grid point.

Parameters:
g the grid
i grid point index
v put the field values into this array
virtual void gridripper::amr1d::PDE::getExtendedRefinedField ( const Grid g,
int  i,
FieldWrapper f 
) const [virtual]

Gets the extended field value at the specified refined grid point.

Parameters:
g the grid
i refined grid point index
v put the field values into this array
virtual void gridripper::amr1d::PDE::getFieldWrapper ( GReal_t  t,
GReal_t  x,
GReal_t f 
) const [inline, virtual]

Converts the physical field to the field used on the grid.

Parameters:
t the time coordinate
x the space coordinate
f the field components (input: physical field values, output: values on the grid)
Returns:
the magnitude
const GridFunction& gridripper::amr1d::PDE::getGridFunction ( int  i  )  const [inline]

Gets a grid function.

Parameters:
i the index
Returns:
the grid functions
int gridripper::amr1d::PDE::getGridFunctionIndex ( const string &  name  )  const

Gets the index of a named grid function.

Parameters:
k the function name
Returns:
the index or -1
virtual GReal_t gridripper::amr1d::PDE::getMaxX (  )  const [pure virtual]

Gets the maximum x (space) coordinate for the simulation.

Returns:
the maximum x coordinate
virtual GReal_t gridripper::amr1d::PDE::getMinX (  )  const [pure virtual]

Gets the minimum x (space) coordinate for the simulation.

Returns:
the minimum x coordinate
int gridripper::amr1d::PDE::getNumComponents (  )  const [inline]

Gets the number of field components.

Returns:
the number of components.
virtual int gridripper::amr1d::PDE::getNumConstraintEqs (  )  const [inline, virtual]

Gets the number of constraint equations.

Constrained components are not counted here.

Returns:
the number of constraint equations or zero
int gridripper::amr1d::PDE::getNumGridFunctions (  )  const [inline]

Gets the number of grid functions.

Returns:
the number of grid functions
int gridripper::amr1d::PDE::getNumIndependentComponents (  )  const [inline]

Gets the number of independent, non-constrained field components.

Returns:
the number of independent components.
virtual string gridripper::amr1d::PDE::getPhysicalComponentName ( int  k  )  const [inline, virtual]

Gets the name of a physical field component.

Parameters:
k the component index
Returns:
the name
virtual GReal_t gridripper::amr1d::PDE::getPhysicalMaxX (  )  const [inline, virtual]

Gets the maximum "physical" x coordinate.

A nonphysical domain is present if maxX is greater than physicalMaxX.

Returns:
the maximum physical coordinate
virtual GReal_t gridripper::amr1d::PDE::getPhysicalMinX (  )  const [inline, virtual]

Gets the minimum "physical" x coordinate.

A nonphysical domain is present if minX is less than physicalMinX.

Returns:
the minimum physical coordinate
string gridripper::amr1d::PDE::getTimeFormat (  )  const [inline]

Gets the time format string.

Returns:
the format string
string gridripper::amr1d::PDE::getTimeLabel (  )  const [inline]

Gets the time coordinate label.

Returns:
the time coordinate label
string gridripper::amr1d::PDE::getTimeLabelFormat (  )  const [inline]

Gets the time coordinate label format string.

Returns:
the format string
string gridripper::amr1d::PDE::getXcoordLabel (  )  const [inline]

Gets the space coordinate label.

Returns:
the space coordinate label
virtual bool gridripper::amr1d::PDE::hasExtendedRefinedFieldData ( const Grid g,
int  i 
) const [virtual]

Tests whether refined field data exists at a given point.

Parameters:
g the grid
i refined grid point index
Returns:
true if the specified point contains refined field data, false otherwise
virtual bool gridripper::amr1d::PDE::isScalable (  )  const [inline, virtual]

Tests whether this PDE is scalable.

Returns:
true if the PDE is scalable, false otherwise
virtual bool gridripper::amr1d::PDE::isXPeriodic (  )  const [inline, virtual]

Tests whether the solution is periodic in x.

Returns:
true if the minimum and maximum x coordinates are equivalent, false otherwise
virtual void gridripper::amr1d::PDE::mirrorLeft ( GReal_t  x,
FieldWrapper f 
) const [inline, virtual]

Called by the default getExtendedField implementation for points beyond left edge.

Parameters:
x the x coordinate
f put the field values here
virtual void gridripper::amr1d::PDE::mirrorRight ( GReal_t  x,
FieldWrapper f 
) const [virtual]

Called by the default getExtendedField implementation for points beyond left edge.

Right mirroring is not available by default, this method should not be called without overriding it.

Parameters:
x the x coordinate
f put the field values here
virtual void gridripper::amr1d::PDE::setNonevolvingComponents ( Grid g,
Grad d 
) [inline, virtual]

Sets nonevolving field components.

Called after the initial condition generation and after each time step. The default implementation does not do anything.

Parameters:
g the grid
d differentiation

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