Cantera  3.1.0a1
Refiner Class Reference

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

#include <refine.h>

Detailed Description

Refine Domain1D grids so that profiles satisfy adaptation tolerances.

Definition at line 16 of file refine.h.

Public Member Functions

 Refiner (Domain1D &domain)
 
 Refiner (const Refiner &)=delete
 
Refineroperator= (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. More...
 
vector< double > getCriteria ()
 Get the 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...
 
size_t maxPoints () const
 Returns 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 double *z, const double *x)
 
int getNewGrid (int n, const double *z, int nn, double *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

set< size_t > m_loc
 Indices of grid points that need new grid points added after them. More...
 
map< size_t, int > m_keep
 
set< string > m_c
 Names of components that require the addition of new grid points. More...
 
vector< bool > m_active
 
double m_ratio = 10.0
 
double m_slope = 0.8
 
double m_curve = 0.8
 
double m_prune = -0.001
 
double m_min_range = 0.01
 
Domain1Dm_domain
 
size_t m_nv
 
size_t m_npmax = 1000
 
double m_thresh = std::sqrt(std::numeric_limits<double>::epsilon())
 
double m_gridmin = 1e-10
 minimum grid spacing [m] More...
 

Member Function Documentation

◆ setCriteria()

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

Set grid refinement criteria.

Parameters
ratioMaximum ratio between grid spacing at adjacent intervals. That is, (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 21 of file refine.cpp.

◆ getCriteria()

vector<double> getCriteria ( )
inline

Get the grid refinement criteria.

See also
Refiner::setCriteria

Definition at line 42 of file refine.h.

◆ setMaxPoints()

void setMaxPoints ( int  npmax)
inline

Set the maximum number of points allowed in the domain.

Definition at line 52 of file refine.h.

◆ maxPoints()

size_t maxPoints ( ) const
inline

Returns the maximum number of points allowed in the domain.

Definition at line 57 of file refine.h.

◆ setGridMin()

void setGridMin ( double  gridmin)
inline

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

Definition at line 62 of file refine.h.

◆ gridMin()

double gridMin ( ) const
inline

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

Definition at line 68 of file refine.h.

Member Data Documentation

◆ m_loc

set<size_t> m_loc
protected

Indices of grid points that need new grid points added after them.

Definition at line 101 of file refine.h.

◆ m_c

set<string> m_c
protected

Names of components that require the addition of new grid points.

Definition at line 104 of file refine.h.

◆ m_gridmin

double m_gridmin = 1e-10
protected

minimum grid spacing [m]

Definition at line 115 of file refine.h.


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