Cantera 2.6.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.

Constructor & Destructor Documentation

◆ Refiner()

Refiner ( Domain1D domain)

Definition at line 14 of file refine.cpp.

◆ ~Refiner()

virtual ~Refiner ( )
inlinevirtual

Definition at line 20 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. 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 24 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().

◆ setActive()

void setActive ( int  comp,
bool  state = true 
)
inline

Definition at line 47 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.

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.

◆ analyze()

int analyze ( size_t  n,
const doublereal *  z,
const doublereal *  x 
)

Definition at line 47 of file refine.cpp.

◆ getNewGrid()

int getNewGrid ( int  n,
const doublereal *  z,
int  nn,
doublereal *  znew 
)

Definition at line 232 of file refine.cpp.

◆ nNewPoints()

int nNewPoints ( )
inline

Definition at line 74 of file refine.h.

◆ show()

void show ( )

Definition at line 210 of file refine.cpp.

◆ newPointNeeded()

bool newPointNeeded ( size_t  j)
inline

Definition at line 78 of file refine.h.

◆ keepPoint()

bool keepPoint ( size_t  j)
inline

Definition at line 81 of file refine.h.

◆ value()

double value ( const double *  x,
size_t  i,
size_t  j 
)

Definition at line 205 of file refine.cpp.

◆ maxRatio()

double maxRatio ( )
inline

Definition at line 86 of file refine.h.

◆ maxDelta()

double maxDelta ( )
inline

Definition at line 89 of file refine.h.

◆ maxSlope()

double maxSlope ( )
inline

Definition at line 92 of file refine.h.

◆ prune()

double prune ( )
inline

Definition at line 95 of file refine.h.

Member Data Documentation

◆ m_loc

std::map<size_t, int> m_loc
protected

Definition at line 100 of file refine.h.

◆ m_keep

std::map<size_t, int> m_keep
protected

Definition at line 101 of file refine.h.

◆ m_c

std::map<std::string, int> m_c
protected

Definition at line 102 of file refine.h.

◆ m_active

std::vector<bool> m_active
protected

Definition at line 103 of file refine.h.

◆ m_ratio

doublereal m_ratio
protected

Definition at line 104 of file refine.h.

◆ m_slope

doublereal m_slope
protected

Definition at line 104 of file refine.h.

◆ m_curve

doublereal m_curve
protected

Definition at line 104 of file refine.h.

◆ m_prune

doublereal m_prune
protected

Definition at line 104 of file refine.h.

◆ m_min_range

doublereal m_min_range
protected

Definition at line 105 of file refine.h.

◆ m_domain

Domain1D* m_domain
protected

Definition at line 106 of file refine.h.

◆ m_nv

size_t m_nv
protected

Definition at line 107 of file refine.h.

◆ m_npmax

size_t m_npmax
protected

Definition at line 107 of file refine.h.

◆ m_thresh

doublereal m_thresh
protected

Definition at line 108 of file refine.h.

◆ 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: