Cantera  2.4.0
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)
 
 Refiner (const Refiner &)=delete
 
Refineroperator= (const Refiner &)=delete
 
void setCriteria (doublereal ratio=10.0, doublereal slope=0.8, doublereal curve=0.8, doublereal prune=-0.1)
 Set grid refinement criteria. More...
 
vector_fp 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 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 16 of file refine.h.

Member Function Documentation

◆ setCriteria()

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 23 of file refine.cpp.

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

◆ getCriteria()

vector_fp getCriteria ( )
inline

Get the grid refinement criteria.

See also
Refiner::setCriteria

Definition at line 42 of file refine.h.

Referenced by Sim1D::getRefineCriteria().

◆ setMaxPoints()

void setMaxPoints ( int  npmax)
inline

Set the maximum number of points allowed in the domain.

Definition at line 52 of file refine.h.

Referenced by Sim1D::setMaxGridPoints().

◆ maxPoints()

size_t maxPoints ( ) const
inline

Returns the maximum number of points allowed in the domain.

Definition at line 57 of file refine.h.

Referenced by Sim1D::maxGridPoints().

◆ setGridMin()

void setGridMin ( double  gridmin)
inline

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

Definition at line 62 of file refine.h.

References Refiner::m_gridmin.

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

◆ gridMin()

double gridMin ( ) const
inline

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

Definition at line 68 of file refine.h.

References Refiner::m_gridmin.

Member Data Documentation

◆ m_gridmin

doublereal m_gridmin
protected

minimum grid spacing [m]

Definition at line 109 of file refine.h.

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


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