IGLib  1.5
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
IG.Num.GridGenerator1dFunc Class Reference

Generates 1D grids with equidistant or geometrically grown intervals. More...

+ Inheritance diagram for IG.Num.GridGenerator1dFunc:
+ Collaboration diagram for IG.Num.GridGenerator1dFunc:

Public Member Functions

 GridGenerator1dFunc ()
 Creates a uniform 1D grid generator that generates two nodes at 0 and 1. More...
 
 GridGenerator1dFunc (double from, double to, int numNodes, IRealFunction function, double firstFunctionArgument, double lastFunctionArgument)
 Creates a 1D grid generator where grid point positions are calculated by the specified function. More...
 
void MakeUniform ()
 Resets the parameters in such away that the generated grid is uniform (equidistant intervals) and with scaling factor 1. More...
 
override void CalculateGrid (ref List< double > nodeList)
 Performs grid generation and stores the generated nodes directly on the provided list. Unless necessary due to nature of generation, results are not stored internally on the current grid generator object. Because of this, the Calculated flag is normally not set after calling this function. WARNING: This method generates a grid even if it has already been generated and is up to date. More...
 
- Public Member Functions inherited from IG.Num.GridGenerator1dBase
virtual void ClearResults ()
 Clears the results of grid generation (releases internal structures). The Calculated flag is set to false. More...
 
virtual void CalculateGrid (ref List< double > nodeList, ref List< double > intervalLengthsList)
 Performs grid generation and stores the generated nodes and intervals between them directly on the provided lists. Unless necessary due to nature of generation, results are not stored internally on the current grid generator object. Because of this, the Calculated flag is normally not set after calling this function. WARNING: This method generates a grid even if it has already been generated and is up to date. More...
 
virtual void CalculateGrid ()
 Performs grid generation according to current settings. The generated grid is stored in internal structures of the generator, from where it can be readily copied (e.g. by GetNodeTable() or by GetNodeList()), used in some other way (e.g. by GetIntervalLengthsList) or just referenced (e.g. by GetNodeListReference()). If the grid has already been generated and it is up to date (according to parameters of the generator) then the grid is not re-calculated. More...
 
virtual double GetNode (int which)
 Returns the specified node of the generated grid. If necessary, grid is generated first in order to obtain the correct data. More...
 
virtual void GetNodeTable (ref double[] result)
 Stores the node positions of the generated 1D grid into the specified table. If necessary, grid is generated first in order to obtain the correct data. More...
 
virtual double[] GetNodeTable ()
 Returns a table containing 1D node positions. A copy of list of node positions is always created and returned, therefore it is guaranteed that this table will not be used by some other object related to the grid generator. If necessary, grid is generated first in order to obtain the correct data. More...
 
virtual void GetNodeList (ref List< double > result)
 Stores the node positions of the generated 1D grid into the specified list. If necessary, grid is generated first in order to obtain the correct data. More...
 
virtual List< double > GetNodeList ()
 Returns a list containing 1D node positions. A copy of list of node positions is always created and returned, therefore it is guaranteed that this table will not be used by some other object related to the grid generator. If necessary, grid is generated first in order to obtain the correct data. More...
 
virtual List< double > GetNodeListReference ()
 Returns a list containing generated 1D node positions. This method can return a reference to the internal list containing the generated node coordinated. This means that any future generation or other operation performed by the generator can override list contents. In order to use contents of the list thread safely, enclose this method call and all subsequent operations you will perform on the returned list of generated nodes, within a lock((...).Lock){ ... } block. If necessary, grid is generated first in order to obtain the correct data. More...
 
virtual void GetIntervalLengthsTable (ref double[] result)
 Stores a table of interval lengths between the generated nodes into the specified array. If necessary, grid is generated first in order to obtain the correct data. More...
 
virtual double[] GetIntervalLengthsTable ()
 Generates and returns a table of interval lengths between the generated nodes. The returned table is a copy that will not be overridden by further operations on the grid generator. If necessary, grid is generated first in order to obtain the correct data. More...
 
virtual void GetIntervalLengthsList (ref List< double > result)
 Stores a table of interval lengths between the generated nodes into the specified list. If necessary, grid is generated first in order to obtain the correct data. More...
 
virtual List< double > GetIntervalLengthsList ()
 Generates and returns a list of interval lengths between the generated nodes. The returned list is a copy that will not be overridden by further operations on the grid generator. If necessary, grid is generated first in order to obtain the correct data. More...
 
virtual double GetIntervalLength (int which)
 Returns the length of the specified interval between generated nodes of the grid. If necessary, grid is generated first in order to obtain the correct data. More...
 

Properties

IRealFunction Function [get, set]
 
double FunctionArgumentFirst [get, set]
 First argument where grid generation function is evaluated. More...
 
double FunctionArgumentLast [get, set]
 Last argument where grid generation function is evaluated. More...
 
- Properties inherited from IG.Num.GridGenerator1dBase
object Lock [get]
 Object used for locking of the current object (ILockable interface). More...
 
virtual double CoordinateFirst [get, set]
 Gets or sets coordinate of the first generated node (usually the minimal generated coordinate). More...
 
virtual double CoordinateLast [get, set]
 Gets or sets coordinate of the last generated node (usually the maximal generated coordinate). More...
 
virtual int NumNodes [get, set]
 Gets or sets teh number of nodes to be generated. More...
 
virtual int NumIntervals [get]
 Gets the number of intervals between the nodes. Simply NumNodes-1. More...
 
virtual bool Calculated [get, protected set]
 Flag indicating whether the grid is generated ready to use. If true then node positions are contained in an internal structure, such that they can be obtained simply by copying this structure (i.e. no need for re-calculation). REMARK: If you intend to do something with results on basis of the value of this flag, don't forget to enclose checking of the flag and your operation into the lock(....Lock){ ... } block. More...
 
- Properties inherited from IG.Num.IGridGenerator1d
double CoordinateFirst [get, set]
 Gets or sets coordinate of the first generated node (usually the minimal generated coordinate). More...
 
double CoordinateLast [get, set]
 Gets or sets coordinate of the last generated node (usually the maximal generated coordinate). More...
 
int NumNodes [get, set]
 Gets or sets teh number of nodes to be generated. More...
 
int NumIntervals [get]
 Gets the number of intervals between the nodes. Simply NumNodes-1. More...
 
bool Calculated [get]
 Flag indicating whether the grid is generated ready to use. If true then node positions are contained in an internal structure, such that they can be obtained simply by copying this structure (i.e. no need for re-calculation). REMARK: If you intend to do something with results on basis of the value of this flag, don't forget to enclose checking of the flag and your operation into the lock(....Lock){ ... } block. More...
 
- Properties inherited from IG.Lib.ILockable
object Lock [get]
 

Private Attributes

IRealFunction _func
 
double _funcArgFirst = 0.0
 
double _funcArgLast = 0.0
 

Additional Inherited Members

- Static Public Member Functions inherited from IG.Num.GridGenerator1dBase
static GridGenerator1d CreateUniform (double from, double to, int numnodes)
 Creates and returns a 1D grid generator for uniform grid (equidistant intervals). More...
 
static GridGenerator1d CreateGeometric (double from, double to, int numNodes, double growthFactor)
 Creates and returns a 1D grid generator. Grid intervals can grow or fall in geometrical series from the lower bound of the grid interval. More...
 
static GridGenerator1d CreateGeometricCentered (double from, double to, int numNodes, double growthFactor)
 Creates and returns a 1D grid generator. Grid intervals can grow or fall in geometric series from the center of the grid interval towards the bounds. More...
 
static GridGenerator1d CreateGeometricScaled (double from, double to, int numNodes, double growthFactor, double scalingFactor)
 Creates and returns a 1D grid generator. Grid intervals can grow or fall in geometric series from the lower bound towards teh upper bound of the grid interval, and the grid can also be scaled. More...
 
static GridGenerator1d CreateGeometricCenteredScaled (double from, double to, int numNodes, double growthFactor, double scalingFactor)
 Creates and returns a 1D grid generator. Grid intervals can grow or fall in geometric series from the center of the grid interval, and the grid can also be scaled. More...
 
static GridGenerator1dFunc CreateFunctionBased (double from, double to, int numNodes, IRealFunction function, double firstFunctionArgument, double lastFunctionArgument)
 Creates and returns a 1D grid generator where grid point positions are calculated by the specified function. More...
 
static void CalculateGridUnitFactors (int numElements, bool centered, double growthFactor, double scalingFactor, ref List< double > factors)
 Calculates factors for a table of values between two points, and stores them to factors. More...
 
static void CalculateGridUnitFactors (int numElements, IRealFunction func, double firstFunctionArgument, double lastFunctionArgument, ref List< double > factors)
 Calculates factors for a table of values between two points, and stores them to a list. Factors are calculated according to values of a function of one variable, evaluated in equidistant points on the specified interval, and scaled such that they lie between 0 and 1. It is caller's responsibility to provide a monotonous function, otherwise some factors can lie outside the [0,1] interval and are not ordered. More...
 
static void CalculateIntervalLenghts (List< double > nodes, ref List< double > lengths)
 Calculates lengths of subsequent intervals defined by the first list, and stores it to the second list. More...
 
static void CalculateIntervalLenghRatios (List< double > nodes, ref List< double > lengthRatios)
 Calculates length ratios between subsequent intervals defined by the first list, ans stores it to the second list. More...
 
static void ExampleTableFactors ()
 Examples for calculating table factors. More...
 
static void FitGridNode (double minCurrent, double maxCurrent, double minTarget, double maxTarget, ref double node)
 Grid stretching to fit the specified interval bounds. Modifies position of the generated 1d grid node in such a way that it fits the new grid interval. More...
 
static void FitGridNodes (double minCurrent, double maxCurrent, double minTarget, double maxTarget, List< double > nodes)
 Grid stretching to fit the specified interval bounds. Modifies positions of the generated 1d grid nodes contained in the specified list in such a way that it fits the new grid interval. More...
 
- Protected Member Functions inherited from IG.Num.GridGenerator1dBase
 GridGenerator1dBase ()
 
- Protected Attributes inherited from IG.Num.GridGenerator1dBase
List< double > _nodes
 Internally stored generated nodes. More...
 

Detailed Description

Generates 1D grids with equidistant or geometrically grown intervals.

$A Igor Apr10 Dec10;

Constructor & Destructor Documentation

IG.Num.GridGenerator1dFunc.GridGenerator1dFunc ( )
inline

Creates a uniform 1D grid generator that generates two nodes at 0 and 1.

IG.Num.GridGenerator1dFunc.GridGenerator1dFunc ( double  from,
double  to,
int  numNodes,
IRealFunction  function,
double  firstFunctionArgument,
double  lastFunctionArgument 
)
inline

Creates a 1D grid generator where grid point positions are calculated by the specified function.

Parameters
fromLower bound of the generated 1D grid.
toUpper bound of the generated 1D grid.
numNodesNumber of nodes generated.
functionFunction used for evaluation of grid points.
firstFunctionArgumentFirst argument (lower bound of the interval) where grid function is evaluated.
lastFunctionArgumentFirst argument (upper bound of the interval) where grid function is evaluated.

Member Function Documentation

void IG.Num.GridGenerator1dFunc.MakeUniform ( )
inline

Resets the parameters in such away that the generated grid is uniform (equidistant intervals) and with scaling factor 1.

References IG.Num.Func.GetIdentity().

override void IG.Num.GridGenerator1dFunc.CalculateGrid ( ref List< double >  nodeList)
inline

Performs grid generation and stores the generated nodes directly on the provided list. Unless necessary due to nature of generation, results are not stored internally on the current grid generator object. Because of this, the Calculated flag is normally not set after calling this function. WARNING: This method generates a grid even if it has already been generated and is up to date.

Parameters
nodeListA list where node coordinates are stored. List is allocated or re-allocated if necessary.

Implements IG.Num.IGridGenerator1d.

Member Data Documentation

IRealFunction IG.Num.GridGenerator1dFunc._func
private
double IG.Num.GridGenerator1dFunc._funcArgFirst = 0.0
private
double IG.Num.GridGenerator1dFunc._funcArgLast = 0.0
private

Property Documentation

IRealFunction IG.Num.GridGenerator1dFunc.Function
getset
double IG.Num.GridGenerator1dFunc.FunctionArgumentFirst
getset

First argument where grid generation function is evaluated.

double IG.Num.GridGenerator1dFunc.FunctionArgumentLast
getset

Last argument where grid generation function is evaluated.


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