gridripper::amr1d::PeriodicGrid Class Reference

1 dimensional periodic grid for the adaptive mesh refinement algorithm. More...

Inheritance diagram for gridripper::amr1d::PeriodicGrid:

gridripper::amr1d::Grid

List of all members.

Public Member Functions

 PeriodicGrid (double minx, double maxx, int maxi, int nc, Integrator proto, Regridder refproto, int r)
 Creates a base grid.
Grid cloneGrid ()
 Clones this grid.
GridGeomInfo getGeomInfo ()
final int getLeftmostI ()
final int getRightmostI ()
final boolean isPeriodic ()
final int getMarginLeft (int ir)
 Gets the left margin size.
final int getMarginRight (int ir)
 Gets the right margin size.
final int distanceFromLeft (int i)
 Gets the distance from the left edge.
final int distanceFromRight (int i)
 Gets the distance from the left edge.
final double getLocationX (int i)
 Gets the location of the point with index i.
final double getSizeX ()
 Gets the grid width.
final boolean hasRefinedData (int i)
 Checks whether refined data at the specified index exists or not.
final void getRefinedData (int i, double[] yout)
 Gets the refined data at the specified grid point if exists.
Grid createTemporaryGrid (int dmargin_L, int dmargin_R, double xshift)
 Creates a temporary grid.
void setTemporaryGridMargins (Grid p, int dmargin_L, int dmargin_R)
 Sets the margins and the shift for a temporary grid.
final void interpolateMargins (PDE pde)
 No operation.
final void initRefinedDataExistenceArray ()
 Initializes the refinedDataExists array.

Protected Member Functions

 PeriodicGrid (PeriodicGrid g)
 Copy constructor.
 PeriodicGrid (Grid p, int r1, int minLevel)
 Creates a refined periodic grid.
final int getInternalIndex (int i)
 Gets the internal array index.
final int getRealIndex (int i)
 Gets the "real" index.
final int getAbsoluteIndex (int i, int mul)
final int getSubgridIndexFromIndex (Grid g, int i)
final int getIndexFromSubgridIndex (Grid g, int j)
Grid createRefinedGrid (IntervalList iv, int margin, int vmargin, int minLevel, int r1)
 Creates a refined grid.
final void fillRefinedDataArray ()
 Fills the refinedData array.
final void blur (byte[] pf, int i)
 Both neighbors of points with the specified value in an array are set to value plus 1.
final int getFirstIndexForRefinement (byte[] pf)
 Gets the first point to start refinement interval searching.
final int findIntervalEndForRefinement (byte[] pf, int i)
 Finds the right edge of an interval that needs refinement.
final int intervalRefinedSize (IntervalList iv, int r)
final int gridIndexLeftOf (int i, int dmax)
final int gridIndexRightOf (int i, int dmax)
final void fixSubgridNearBounds (IntervalList l, IntervalList r, int margin)
 Do nothing.
final int calcNewSubSubgridLocation (int ssloc, int osloc, int nsloc)
 Calculates the new location of a sub-subgrid (relative to the parent) if its parent (a subgrid) changed.

Classes

class  MyGeomInfo


Detailed Description

1 dimensional periodic grid for the adaptive mesh refinement algorithm.

Version:
0.5, 05/08/2009
Author:
Peter Csizmadia

Constructor & Destructor Documentation

gridripper::amr1d::PeriodicGrid::PeriodicGrid ( PeriodicGrid  g  )  [inline, protected]

Copy constructor.

Parameters:
g the grid to copy

gridripper::amr1d::PeriodicGrid::PeriodicGrid ( Grid  p,
int  r1,
int  minLevel 
) [inline, protected]

Creates a refined periodic grid.

Parameters:
p the parent grid
r1 refinement ratio for the refined grid's future subgrids
minLevel set grandparent's sub-subgrid list if its level is larger than or equal to minLevel


Member Function Documentation

Grid gridripper::amr1d::PeriodicGrid::cloneGrid (  )  [inline, virtual]

Clones this grid.

Returns:
the clone

Implements gridripper::amr1d::Grid.

final int gridripper::amr1d::PeriodicGrid::getMarginLeft ( int  ir  )  [inline, virtual]

Gets the left margin size.

Parameters:
ir step count
Returns:
the margin size

Implements gridripper::amr1d::Grid.

final int gridripper::amr1d::PeriodicGrid::getMarginRight ( int  ir  )  [inline, virtual]

Gets the right margin size.

Parameters:
ir step count
Returns:
the margin size

Implements gridripper::amr1d::Grid.

final int gridripper::amr1d::PeriodicGrid::distanceFromLeft ( int  i  )  [inline, virtual]

Gets the distance from the left edge.

Parameters:
i grid point index
Returns:
Integer.MAX_VALUE (a periodic grid has no edge)

Implements gridripper::amr1d::Grid.

final int gridripper::amr1d::PeriodicGrid::distanceFromRight ( int  i  )  [inline, virtual]

Gets the distance from the left edge.

Parameters:
i grid point index
Returns:
Integer.MAX_VALUE (a periodic grid has no edge)

Implements gridripper::amr1d::Grid.

final double gridripper::amr1d::PeriodicGrid::getLocationX ( int  i  )  [inline, virtual]

Gets the location of the point with index i.

Parameters:
i the point index

Implements gridripper::amr1d::Grid.

final double gridripper::amr1d::PeriodicGrid::getSizeX (  )  [inline, virtual]

Gets the grid width.

Returns:
the grid width

Implements gridripper::amr1d::Grid.

final int gridripper::amr1d::PeriodicGrid::getInternalIndex ( int  i  )  [inline, protected, virtual]

Gets the internal array index.

The internal array index is the sum of the "real" index and the left margin size if present.

Parameters:
i the index
Returns:
the internal array index

Implements gridripper::amr1d::Grid.

final int gridripper::amr1d::PeriodicGrid::getRealIndex ( int  i  )  [inline, protected]

Gets the "real" index.

The real index is normally equal to the argument i, it only differs in case of a periodic grid.

Parameters:
i the index
Returns:
the real index

Reimplemented from gridripper::amr1d::Grid.

final boolean gridripper::amr1d::PeriodicGrid::hasRefinedData ( int  i  )  [inline, virtual]

Checks whether refined data at the specified index exists or not.

Parameters:
i refined grid index
Returns:
true if exists, false if not

Implements gridripper::amr1d::Grid.

final void gridripper::amr1d::PeriodicGrid::getRefinedData ( int  i,
double[]  yout 
) [inline, virtual]

Gets the refined data at the specified grid point if exists.

Parameters:
i refined grid index
yout the output array

Implements gridripper::amr1d::Grid.

Grid gridripper::amr1d::PeriodicGrid::createTemporaryGrid ( int  dmargin_L,
int  dmargin_R,
double  xshift 
) [inline, virtual]

Creates a temporary grid.

Parameters:
dmargin neglected
Returns:
the grid

Implements gridripper::amr1d::Grid.

void gridripper::amr1d::PeriodicGrid::setTemporaryGridMargins ( Grid  p,
int  dmargin_L,
int  dmargin_R 
) [inline, virtual]

Sets the margins and the shift for a temporary grid.

Parameters:
p the parent grid
dmargin_L the left margin
dmargin_R the right margin

Implements gridripper::amr1d::Grid.

Grid gridripper::amr1d::PeriodicGrid::createRefinedGrid ( IntervalList  iv,
int  margin,
int  vmargin,
int  minLevel,
int  r1 
) [inline, protected, virtual]

Creates a refined grid.

Parameters:
p the parent grid
iv the left and right edge in the parent grid
margin margin size
vmargin numerical error propagation velocity
minLevel set grandparent's sub-subgrid list if its level is larger than or equal to minLevel
r1 the refinement ratio value if the created grid can be refined further, 1 otherwise

Implements gridripper::amr1d::Grid.

final void gridripper::amr1d::PeriodicGrid::interpolateMargins ( PDE  pde  )  [inline, virtual]

No operation.

Periodic grids do not have margins.

Implements gridripper::amr1d::Grid.

final void gridripper::amr1d::PeriodicGrid::fillRefinedDataArray (  )  [inline, protected, virtual]

Fills the refinedData array.

Should only be called after interpolateMargins!

Implements gridripper::amr1d::Grid.

final void gridripper::amr1d::PeriodicGrid::blur ( byte[]  pf,
int  i 
) [inline, protected, virtual]

Both neighbors of points with the specified value in an array are set to value plus 1.

Parameters:
pf nonzero values in this array indicate the need of refinement
i the value

Implements gridripper::amr1d::Grid.

final int gridripper::amr1d::PeriodicGrid::getFirstIndexForRefinement ( byte[]  pf  )  [inline, protected, virtual]

Gets the first point to start refinement interval searching.

Parameters:
pf nonzero values in this array indicate the need of refinement
Returns:
the first point with nonzero value

Implements gridripper::amr1d::Grid.

final int gridripper::amr1d::PeriodicGrid::findIntervalEndForRefinement ( byte[]  pf,
int  i 
) [inline, protected, virtual]

Finds the right edge of an interval that needs refinement.

Parameters:
pf nonzero values in this array indicate the need of refinement
i the left edge index
Returns:
the right edge index

Implements gridripper::amr1d::Grid.

final int gridripper::amr1d::PeriodicGrid::calcNewSubSubgridLocation ( int  ssloc,
int  osloc,
int  nsloc 
) [inline, protected, virtual]

Calculates the new location of a sub-subgrid (relative to the parent) if its parent (a subgrid) changed.

Parameters:
ssloc old sub-subgrid's (relative) location
osloc its old parent's location (relative to this grid)
nsloc new parent's location (relative to this grid)
Returns:
the new location of the sub-subgrid relative to its new parent

Implements gridripper::amr1d::Grid.


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

Generated on Wed Jun 17 18:47:26 2009 for GridRipper by  doxygen 1.5.6