Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
Refiner Class Reference

Refine Domain1D grids so that profiles satisfy adaptation tolerances. More...

#include <refine.h>

Collaboration diagram for Refiner:
[legend]

Public Member Functions

 Refiner (Domain1D &domain)
 
void setCriteria (doublereal ratio=10.0, doublereal slope=0.8, doublereal curve=0.8, doublereal prune=-0.1)
 Set grid refinement criteria. More...
 
void setActive (int comp, bool state=true)
 
void setMaxPoints (int npmax)
 Set the maximum number of points allowed in the domain. More...
 
void setGridMin (double gridmin)
 Set the minimum allowable spacing between adjacent grid points [m]. More...
 
double gridMin () const
 Returns the the minimum allowable spacing between adjacent grid points [m]. More...
 
int analyze (size_t n, const doublereal *z, const doublereal *x)
 
int getNewGrid (int n, const doublereal *z, int nn, doublereal *znew)
 
int nNewPoints ()
 
void show ()
 
bool newPointNeeded (size_t j)
 
bool keepPoint (size_t j)
 
double value (const double *x, size_t i, size_t j)
 
double maxRatio ()
 
double maxDelta ()
 
double maxSlope ()
 
double prune ()
 

Protected Attributes

std::map< size_t, int > m_loc
 
std::map< size_t, int > m_keep
 
std::map< std::string, int > m_c
 
std::vector< bool > m_active
 
doublereal m_ratio
 
doublereal m_slope
 
doublereal m_curve
 
doublereal m_prune
 
doublereal m_min_range
 
Domain1Dm_domain
 
size_t m_nv
 
size_t m_npmax
 
doublereal m_thresh
 
doublereal m_gridmin
 minimum grid spacing [m] More...
 

Detailed Description

Refine Domain1D grids so that profiles satisfy adaptation tolerances.

Definition at line 13 of file refine.h.

Member Function Documentation

void setCriteria ( doublereal  ratio = 10.0,
doublereal  slope = 0.8,
doublereal  curve = 0.8,
doublereal  prune = -0.1 
)

Set grid refinement criteria.

Parameters
ratioMaximum ratio between grid spacing at adjacent intervals. E.g. (x[j+1] - x[j]) / (x[j] - x[j-1]) < ratio
slopeMaximum fractional change in the value of each solution component between adjacent grid points
curveMaximum fractional change in the derivative of each solution component between adjacent grid points.
pruneThreshold for removing unnecessary grid points. prune should be smaller than both slope and curve. Set prune <= 0 to disable pruning.

Definition at line 19 of file refine.cpp.

References Cantera::fp2str().

Referenced by StFlow::restore(), and Sim1D::setRefineCriteria().

void setMaxPoints ( int  npmax)
inline

Set the maximum number of points allowed in the domain.

Definition at line 41 of file refine.h.

void setGridMin ( double  gridmin)
inline

Set the minimum allowable spacing between adjacent grid points [m].

Definition at line 46 of file refine.h.

References Refiner::m_gridmin.

Referenced by StFlow::restore(), and Sim1D::setGridMin().

double gridMin ( ) const
inline

Returns the the minimum allowable spacing between adjacent grid points [m].

Definition at line 52 of file refine.h.

References Refiner::m_gridmin.

Member Data Documentation

doublereal m_gridmin
protected

minimum grid spacing [m]

Definition at line 93 of file refine.h.

Referenced by Refiner::gridMin(), and Refiner::setGridMin().


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