Commit 1aae9f7a authored by Gordian Edenhofer's avatar Gordian Edenhofer

correlated_fields.py: Disable via `0.` not `None`

parent 9527d938
......@@ -443,9 +443,9 @@ class CorrelatedFieldMaker:
in this call should hold.
fluctuations_{mean,stddev} : float
Total spectral energy -> Amplitude of the fluctuations
flexibility_{mean,stddev} : float or None
flexibility_{mean,stddev} : float
Amplitude of the non-power-law power spectrum component
asperity_{mean,stddev} : float or None
asperity_{mean,stddev} : float
Roughness of the non-power-law power spectrum component
Used to accommodate single frequency peaks
loglogavgslope_{mean,stddev} : float
......@@ -487,20 +487,20 @@ class CorrelatedFieldMaker:
prefix = str(prefix)
# assert isinstance(target_subdomain[space], (RGSpace, HPSpace, GLSpace)
ve = "{0}_mean and {0}_stddev must be strictly positive (or both None)"
ve = "{0}_mean and {0}_stddev must be strictly positive (or both zero to disable {0})"
if fluctuations_mean > 0. and fluctuations_stddev > 0.:
fluct = LognormalTransform(fluctuations_mean, fluctuations_stddev,
self._prefix + prefix + 'fluctuations', N)
else:
raise ValueError(ve.format("fluctuations"))
if flexibility_mean is None and flexibility_stddev is None:
if flexibility_mean == 0. and flexibility_stddev == 0.:
flex = None
elif flexibility_mean > 0. and flexibility_stddev > 0.:
flex = LognormalTransform(flexibility_mean, flexibility_stddev,
self._prefix + prefix + 'flexibility', N)
else:
raise ValueError(ve.format("flexibility"))
if asperity_mean is None and asperity_stddev is None:
if asperity_mean == 0. and asperity_stddev == 0.:
asp = None
elif asperity_mean > 0. and asperity_stddev > 0.:
asp = LognormalTransform(asperity_mean, asperity_stddev,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment