#include <PDE.h>
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 FieldWrapper * | createField (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 GridFunction & | getGridFunction (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 DensityQuantity & | energy () 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. | |
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 |
virtual GReal_t gridripper::amr1d::PDE::getMinX | ( | ) | const [pure virtual] |
Gets the minimum x (space) coordinate for the simulation.
Implemented in gridripper::phys::gr::fixmp::kerrhiggs::KerrHiggs, and gridripper::phys::gr::fixmp::higgsmp::HiggsEq.
virtual GReal_t gridripper::amr1d::PDE::getMaxX | ( | ) | const [pure virtual] |
Gets the maximum x (space) coordinate for the simulation.
Implemented in gridripper::phys::gr::fixmp::kerrhiggs::KerrHiggs, and gridripper::phys::gr::fixmp::higgsmp::HiggsEq.
virtual void gridripper::amr1d::PDE::evalConstrainedComponents | ( | Grid & | g, | |
int | i, | |||
FieldWrapper & | f | |||
) | [pure virtual] |
Evaluates constrained field components.
g | the grid | |
i | the grid point index | |
F | field values in the grid point |
Implemented in gridripper::phys::gr::fixmp::kerrhiggs::KerrHiggs, and gridripper::phys::gr::fixmp::higgsmp::HiggsEq.
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.
g | the grid | |
d | differentiation |
virtual int gridripper::amr1d::PDE::getNumConstraintEqs | ( | ) | const [inline, virtual] |
Gets the number of constraint equations.
Constrained components are not counted here.
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.
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::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.
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.
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 |
Implemented in gridripper::phys::gr::fixmp::kerrhiggs::KerrHiggs, and gridripper::phys::gr::fixmp::higgsmp::HiggsEq.
virtual bool gridripper::amr1d::PDE::isScalable | ( | ) | const [inline, virtual] |
Calculates the best scale factor.
The default implemention returns 1 without performing any operation.
g | the base grid |
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.
Reimplemented in gridripper::phys::gr::fixmp::kerrhiggs::KerrHiggs, and gridripper::phys::gr::fixmp::higgsmp::HiggsEq.
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.
Reimplemented in gridripper::phys::gr::fixmp::kerrhiggs::KerrHiggs, and gridripper::phys::gr::fixmp::higgsmp::HiggsEq.
virtual bool gridripper::amr1d::PDE::isXPeriodic | ( | ) | const [inline, virtual] |
Tests whether the solution is periodic in x.
true
if the minimum and maximum x coordinates are equivalent, false
otherwise Reimplemented in gridripper::phys::gr::fixmp::kerrhiggs::KerrHiggs, and gridripper::phys::gr::fixmp::higgsmp::HiggsEq.
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.
where | the bound |
Reimplemented in gridripper::phys::gr::fixmp::kerrhiggs::KerrHiggs, and gridripper::phys::gr::fixmp::higgsmp::HiggsEq.
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.
x | the x coordinate | |
f | put the field values here |
Reimplemented in gridripper::phys::gr::fixmp::kerrhiggs::KerrHiggs, and gridripper::phys::gr::fixmp::higgsmp::HiggsEq.
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.
x | the x coordinate | |
f | put the field values here |
Reimplemented in gridripper::phys::gr::fixmp::kerrhiggs::KerrHiggs, and gridripper::phys::gr::fixmp::higgsmp::HiggsEq.
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.
g | the grid | |
i | grid point index | |
v | put the field values into this array |
virtual bool gridripper::amr1d::PDE::hasExtendedRefinedFieldData | ( | const Grid & | g, | |
int | i | |||
) | const [virtual] |
Tests whether refined field data exists at a given point.
g | the grid | |
i | refined grid point index |
true
if the specified point contains refined field data, false
otherwise Reimplemented in gridripper::phys::gr::fixmp::kerrhiggs::KerrHiggs, and gridripper::phys::gr::fixmp::higgsmp::HiggsEq.
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.
g | the grid | |
i | refined grid point index | |
v | put the field values into this array |
virtual string gridripper::amr1d::PDE::getPhysicalComponentName | ( | int | k | ) | const [inline, virtual] |
Gets the name of a physical field component.
k | the component index |
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.
t | the time coordinate | |
x | the space coordinate | |
f | the field components (input: physical field values, output: values on the grid) |
int gridripper::amr1d::PDE::getNumGridFunctions | ( | ) | const [inline] |
Gets the number of grid functions.
const GridFunction& gridripper::amr1d::PDE::getGridFunction | ( | int | i | ) | const [inline] |
Gets a grid function.
i | the index |
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.
g | the grid | |
i | grid point index | |
F | field values in that point | |
dt0 | default time step | |
dt | previous time step |
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.
k | the component index |
string gridripper::amr1d::PDE::getTimeLabel | ( | ) | const [inline] |
Gets the time coordinate label.
string gridripper::amr1d::PDE::getTimeFormat | ( | ) | const [inline] |
Gets the time format string.
string gridripper::amr1d::PDE::getTimeLabelFormat | ( | ) | const [inline] |
Gets the time coordinate label format string.
string gridripper::amr1d::PDE::getXcoordLabel | ( | ) | const [inline] |
Gets the space coordinate label.
int gridripper::amr1d::PDE::getNumComponents | ( | ) | const [inline] |
Gets the number of field components.
int gridripper::amr1d::PDE::getNumIndependentComponents | ( | ) | const [inline] |
Gets the number of independent, non-constrained field components.
string gridripper::amr1d::PDE::getComponentName | ( | int | k | ) | const [inline] |
Gets the name of a grid field component.
k | the component index |
int gridripper::amr1d::PDE::getComponentIndex | ( | const string & | name | ) | const |
Gets the index of a named grid field component.
k | the component name |
int gridripper::amr1d::PDE::getGridFunctionIndex | ( | const string & | name | ) | const |
Gets the index of a named grid function.
k | the function name |
string gridripper::amr1d::PDE::getConstraintName | ( | int | k | ) | const [inline] |
Gets the name of a constraint.
k | the constraint index |
void gridripper::amr1d::PDE::addGridFunction | ( | GridFunction * | f | ) | [protected] |
Adds a grid function.
f | the grid function |