You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CellVariablehasOld() should set self.old=self.copy() if self.old is None and hasOld was not explicitly set to False in __init__(). This avoids the problem of forgetting to set hasOld=True when using sweep() and then sweep() just iterating forward as if it was a full time step.
Imported from trac ticket #85, created by wd15 on 09-19-2006 at 14:51, last modified: 06-21-2011 at 13:19
The text was updated successfully, but these errors were encountered:
Setting self._old to be self.copy() in updateOld() leads to some unintended consequences. One possible scenario is this
hasOld is False on instantiation
the variable assigns constraints
an explicit diffusion term is used
updateOld is then called
The equation will use the old value without the constraints and the constraints won't get seen by the diffusion term (which uses the old value for explicit cases). Changing what var.old is defined as is quite dangerous in this respect and in others. A better option is to just throw an exception if updateOld() is called when hasOld has not been set to True. This is done in r4632.
CellVariable
hasOld()
should setself.old=self.copy()
ifself.old
isNone
andhasOld
was not explicitly set toFalse
in__init__()
. This avoids the problem of forgetting to sethasOld=True
when usingsweep()
and thensweep()
just iterating forward as if it was a full time step.Imported from trac ticket #85, created by wd15 on 09-19-2006 at 14:51, last modified: 06-21-2011 at 13:19
The text was updated successfully, but these errors were encountered: