MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
GssaVoxelPools.cpp File Reference
#include "header.h"
#include "RateTerm.h"
#include "FuncTerm.h"
#include "SparseMatrix.h"
#include "KinSparseMatrix.h"
#include "VoxelPoolsBase.h"
#include "../mesh/VoxelJunction.h"
#include "XferInfo.h"
#include "ZombiePoolInterface.h"
#include "Stoich.h"
#include "GssaSystem.h"
#include "GssaVoxelPools.h"
#include "../randnum/RNG.h"
#include "../basecode/global.h"
+ Include dependency graph for GssaVoxelPools.cpp:

Go to the source code of this file.

Variables

const double SAFETY_FACTOR = 1.0 + 1.0e-9
 

Variable Documentation

const double SAFETY_FACTOR = 1.0 + 1.0e-9

The SAFETY_FACTOR Protects against the total propensity exceeding the cumulative sum of propensities, atot. We do a lot of adding and subtracting of dependency terms from atot. Roundoff error will eventually cause this to drift from the true sum. To guarantee that we never lose the propensity of the last reaction, this safety factor scales the first calculation of atot to be slightly larger. Periodically this will cause the reaction picking step to exceed the last reaction index. This is safe, we just pick another random number. This will happen rather infrequently. That is also a good time to update the cumulative sum. A double should have >15 digits, so cumulative error will be much smaller than this.

Definition at line 44 of file GssaVoxelPools.cpp.

Referenced by GssaVoxelPools::refreshAtot().