def _string2ibm(ivp, which_prior, precond_step, **kwargs): if "diffconst" in kwargs.keys(): diffconst = kwargs["diffconst"] else: diffconst = 1.0 if which_prior == "ibm1": return prior.IBM(1, ivp.ndim, diffconst, precond_step) elif which_prior == "ibm2": return prior.IBM(2, ivp.ndim, diffconst, precond_step) elif which_prior == "ibm3": return prior.IBM(3, ivp.ndim, diffconst, precond_step) elif which_prior == "ibm4": return prior.IBM(4, ivp.ndim, diffconst, precond_step) else: raise RuntimeError( "It should have been impossible to reach this point.")
def test_asymptotically_ibm(self): """ Checks that for driftspeed==0, it coincides with the IBM prior. """ ioup_speed0 = prior.IOUP(2, 3, driftspeed=0, diffconst=1.2345) ibm = prior.IBM(2, 3, diffconst=1.2345) self.assertAllClose(ioup_speed0.driftmatrix, ibm.driftmatrix) self.assertAllClose(ioup_speed0.dispersionmatrix, ibm.dispersionmatrix) self.assertAllClose(ioup_speed0.diffusionmatrix, ibm.diffusionmatrix)
def setUp(self): self.prior = prior.IBM(ordint=2, spatialdim=1, diffconst=DIFFCONST, precond_step=STEP)
def setUp(self): self.prior = prior.IBM(2, 2, DIFFCONST)