Refine Domain1D grids so that profiles satisfy adaptation tolerances.
Definition at line 16 of file refine.h.
|
| Refiner (Domain1D &domain) |
|
| Refiner (const Refiner &)=delete |
|
Refiner & | operator= (const Refiner &)=delete |
|
void | setCriteria (double ratio=10.0, double slope=0.8, double curve=0.8, double prune=-0.1) |
| Set grid refinement criteria.
|
|
vector< double > | getCriteria () |
| Get the grid refinement criteria.
|
|
void | setActive (int comp, bool state=true) |
| Set the active state for a component.
|
|
void | setMaxPoints (int npmax) |
| Set the maximum number of points allowed in the domain.
|
|
size_t | maxPoints () const |
| Returns the maximum number of points allowed in the domain.
|
|
void | setGridMin (double gridmin) |
| Set the minimum allowable spacing between adjacent grid points [m].
|
|
double | gridMin () const |
| Returns the the minimum allowable spacing between adjacent grid points [m].
|
|
int | analyze (size_t n, const double *z, const double *x) |
| Determine locations in the grid that need additional grid points and update the internal state of the Refiner with this information.
|
|
int | getNewGrid (int n, const double *z, int nn, double *znew) |
| Constructs a new grid based on refinement locations determined by the analyze() method.
|
|
int | nNewPoints () |
| Returns the number of new grid points that were needed.
|
|
void | show () |
| Displays the results of the grid refinement analysis.
|
|
bool | newPointNeeded (size_t j) |
| Returns true if a new grid point is needed to the right of grid index j.
|
|
bool | keepPoint (size_t j) |
| Returns true if the grid point at index j should be kept.
|
|
double | value (const double *x, size_t n, size_t j) |
| Returns the value of the solution component, n, at grid point j.
|
|
double | maxRatio () |
| Returns the maximum allowable ratio of grid spacing between adjacent intervals.
|
|
double | maxDelta () |
| Returns the maximum allowable difference in value between adjacent points.
|
|
double | maxSlope () |
| Returns the maximum allowable difference in the derivative between adjacent points.
|
|
double | prune () |
| Returns the threshold for removing unnecessary grid points.
|
|
|
set< size_t > | m_insertPts |
| Indices of grid points that need new grid points added after them.
|
|
map< size_t, GridPointStatus > | m_keep |
| Status of whether each grid point should be kept or removed.
|
|
set< string > | m_componentNames |
| Names of components that require the addition of new grid points.
|
|
vector< bool > | m_active |
| Flags for whether each component should be considered for grid refinement.
|
|
double | m_min_range = 0.01 |
| Threshold for ignoring small changes around a constant during refinement.
|
|
Domain1D * | m_domain |
| Pointer to the domain to be refined.
|
|
size_t | m_nv |
| Number of components in the domain.
|
|
size_t | m_npmax = 1000 |
| Maximum number of grid points.
|
|
double | m_thresh = std::sqrt(std::numeric_limits<double>::epsilon()) |
| Absolute tolerance threshold for solution components in the domain.
|
|
double | m_gridmin = 1e-10 |
| minimum grid spacing [m]
|
|
|
double | m_ratio = 10.0 |
| grid spacing refinement criteria
|
|
double | m_slope = 0.8 |
| function change refinement criteria
|
|
double | m_curve = 0.8 |
| function slope refinement criteria
|
|
double | m_prune = -0.001 |
| pruning refinement criteria
|
|
void setCriteria |
( |
double |
ratio = 10.0 , |
|
|
double |
slope = 0.8 , |
|
|
double |
curve = 0.8 , |
|
|
double |
prune = -0.1 |
|
) |
| |
Set grid refinement criteria.
The ratio parameter is the maximum allowed ratio between grid spacing at adjacent intervals. The ratio parameter considers the situation where the left interval is much larger than the right interval, or if the right interval is much larger than the left interval. See ratio.
The slope parameter is the maximum fractional change in the value of each solution component between adjacent grid points. See slope.
The curve parameter is the maximum fractional change in the derivative of each solution component between adjacent grid points. See curve.
The prune parameter is a threshold for removing unnecessary grid points. See prune.
- Parameters
-
ratio | Maximum ratio between grid spacing at adjacent intervals. That is, (x[j+1] - x[j]) / (x[j] - x[j-1]) < ratio |
slope | Maximum fractional change in the value of each solution component between adjacent grid points. |
curve | Maximum fractional change in the derivative of each solution component between adjacent grid points. |
prune | Threshold for removing unnecessary grid points. prune should be smaller than both slope and curve . Set prune <= 0 to disable pruning. |
Definition at line 21 of file refine.cpp.
int getNewGrid |
( |
int |
n, |
|
|
const double * |
z, |
|
|
int |
nn, |
|
|
double * |
znew |
|
) |
| |
Constructs a new grid based on refinement locations determined by the analyze() method.
This function generates a new grid by inserting additional points into the current grid at locations where the analyze() method has identified a need for refinement. The new grid points are placed midway between existing points deemed necessary for increased resolution. If no refinement is needed, the original grid is copied directly.
- Parameters
-
[in] | n | The number of points in the original grid array z . |
[in] | z | Pointer to the array of original grid points. |
[in] | nn | The maximum number of points that the new grid array znew can hold. |
[out] | znew | Pointer to the array where the new grid points will be stored. |
- Returns
- The function returns 0 upon successful creation of the new grid. Throws an exception if the provided output array size is insufficient to hold the new grid.
- Deprecated:
- Unused. To be removed after Cantera 3.1.
Definition at line 238 of file refine.cpp.