Diffpack Documentation


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

SpaceTimeScale Class Reference

stores a physical scaling for space and time. More...

#include <SpaceTimeScale.h>

Inheritance diagram for SpaceTimeScale::

HandleId List of all members.

Public Methods

 SpaceTimeScale (int nsd)
 ~SpaceTimeScale ()
void defaultInit ()
bool defaultScale ()
void define (MenuSystem &menu, int level=MAIN)
void scan (MenuSystem &menu)
void setSpaceScale (const Ptv(real) &scale, const Ptv(real) &origin)
void setSpaceScale (real scale)
void setTimeScale (real scale)
void scale (MatSimple(real) &grid_point_coordinates)
void unscale (MatSimple(real) &grid_point_coordinates)
void scale (VecSimple(real) &grid_point_coordinates, int dir)
void unscale (VecSimple(real) &grid_point_coordinates, int dir)
void scale (Ptv(real) &x, bool interval=false)
void unscale (Ptv(real) &x, bool interval=false)

Static Public Methods

void defineStatic (MenuSystem &menu, int level=MAIN)

Public Attributes

Ptv(real) grid_scale_factor
Ptv(real) grid_scale_reference
real time_scale_factor
real time_scale_reference

Detailed Description

stores a physical scaling for space and time.

NAME: SpaceTimeScale - stores a physical scaling for space and time

DESCRIPTION:

The class represent a scaling of space and time to be used together with field and grid classes when solving PDEs. The user can conveniently set the scaling parameters on the menu. A "SpaceTimeScale" object is attached to grid(s) and fields prior to their use. Normally, grids and fields have handles to a single "SpaceTimeScale" object.

The scaling is described in terms of a factor and a reference value according to the formula "p=factor*(q-reference)", where "p" is the new dimensionless parameter, "q" is the physical parameter (usually with a dimension), "reference" is a reference value that is often zero and "factor" is the scaling factor (hence "1/factor" is the scale of the "q" parameter).

The "SpaceTimeScale" object contains a grid scaling (factor and reference) for each space dimension and a time scaling (factor and reference).


Constructor & Destructor Documentation

SpaceTimeScale::SpaceTimeScale ( int nsd )
 

There is one constructor that takes the number of space dimensions as reference. This constructor calls "defaultInit" which sets the standard default scaling: the factor is unity and the reference is zero, that is, the scaling has no effect. Further initialization is not necessary, but non-trivial scalings can be assigned either by using the menu functions or by setting the scale parmeters directly (these are public data members).

SpaceTimeScale::~SpaceTimeScale ( )
 


Member Function Documentation

void SpaceTimeScale::defaultInit ( )
 

sets the factor to unity and the reference to zero for both the space and time scale.

bool SpaceTimeScale::defaultScale ( )
 

returns true if the scale for both space and time corresponds to unity factor and zero reference (the defualt, or trivial, scale).

void SpaceTimeScale::define ( MenuSystem & menu,
int level = MAIN )
 

standard menu functions that enable convenient settings of the scale parameters on a menu.

static void SpaceTimeScale::defineStatic ( MenuSystem & menu,
int level = MAIN ) [static]
 

standard menu functions that enable convenient settings of the scale parameters on a menu.

void SpaceTimeScale::scale ( Ptv(real) & x,
bool interval = false )
 

See documentation of one of the overloaded functions.

void SpaceTimeScale::scale ( VecSimple(real) & grid_point_coordinates,
int dir )
 

See documentation of one of the overloaded functions.

void SpaceTimeScale::scale ( MatSimple(real) & grid_point_coordinates )
 

performs the scaling on the argument (matrix or "Ptv" object). This is a utility function that is called from grid objects. Time parameter objects (of class "TimePrm") have special built-in for manipulating the time parameters. Grids, on the other hand, often have many arrays and it is convenient to have utility functions like "scale" and "unscale" here in class "SpaceTimeScale" which can be re-used by many grid classes. The second argument "interval" in one of the overloaded "scale" functions indicates whether the argument "x" reflects an interval, contrary to a length (the reference value has no effect on interval quantities). Contrary to other objects that also have "scale" and "unscale" functions ("ScalarScale", fields, grids), there is no indicator in "SpaceTimeScale" that "scale" or "unscale" has been called. Hence, calling "scale" twice for the same argument, the scaling will also be applied twice. However, grid objects (which are the users of the "scale" and "unscale" functions here) have internal indicators ("is_scaled") such that calling a grid's "scale" function twice will only lead to one call to the real scaling in "SpaceTimeScale scale".

void SpaceTimeScale::scan ( MenuSystem & menu )
 

standard menu functions that enable convenient settings of the scale parameters on a menu.

void SpaceTimeScale::setSpaceScale ( real scale )
 

See documentation of one of the overloaded functions.

void SpaceTimeScale::setSpaceScale ( const Ptv(real) & scale,
const Ptv(real) & origin )
 

alternative to "scan" for setting the space and time scale directly in a program.

void SpaceTimeScale::setTimeScale ( real scale )
 

alternative to "scan" for setting the space and time scale directly in a program.

void SpaceTimeScale::unscale ( Ptv(real) & x,
bool interval = false )
 

See documentation of one of the overloaded functions.

void SpaceTimeScale::unscale ( VecSimple(real) & grid_point_coordinates,
int dir )
 

See documentation of one of the overloaded functions.

void SpaceTimeScale::unscale ( MatSimple(real) & grid_point_coordinates )
 

performs the inverse operation of "scale".


Member Data Documentation

Ptv(real) SpaceTimeScale::grid_scale_factor
 

Ptv(real) SpaceTimeScale::grid_scale_reference
 

real SpaceTimeScale::time_scale_factor
 

real SpaceTimeScale::time_scale_reference
 


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.