This is an old revision of the document!
Table of Contents
StopCriterion
Introduction
The stop criterion allow to stop a computation when a given criterion is above a given value.
It is usefull to avoid consuming CPU when a computation has no meaning anymore, or to chain operations (remeshing, chained operation based on a criterion, …)
While stopping cleanly the computation, a fac is written at the stop time and the valuesManager are cleanly closed and ascii export is done.
General Commands
For a given criterion (crit
) (see below),
- setStopValue(double) : define the value to overpass (default : 0.0)
- setWriteTSC(bool) : force (remove) the write of TSC (not needed if remeshing) (default : True)
- setRunObjFuncSet(bool) : force (remove) the computation/write of ObjectiveFunctions (not needed if remeshing) (default : True)
- setStopAtNextFac(bool) : compute the criterion at each timeStep, but stop the computation only after the next fac write (default : False)
- checkAtFac(bool) : compute the criterion at fac time write (default : False)
The criterion is finaly added in the Metafor Object :
crit.setStopValue(value) # (default : 0.0) crit.setWriteTSC(True) # (default : True) crit.setRunObjFuncSet(True) # (default : True) crit.setStopAtNextFac(True) # (default : False) crit.checkAtFac(True) # (default : False) metafor.setStopCriterion(crit)
TimeStopCriterion
If you want to stop a model at given times :
- TimeStopCriterion()
ValueExtractorStopCriterion
If you want do define a given ValueExtractor (eventually with a Vector2ScalarOperator) to stop the computation
- ValueExtractorStopCriterion(ValueExtractor &_valueExt, VectorToScalarOperator *_v2sOp=NULL)
ValueManagerStopCriterion
If you want to use a value allready extracted in the ValuesManager :
- ValueManagerStopCriterion(ValuesStruct *_valueStruct, int _comp=0)