diff --git a/PySDM/backends/thrustRTC/impl/c_inline.py b/PySDM/backends/thrustRTC/impl/c_inline.py index ddbd35b94..d4d9a0fbc 100644 --- a/PySDM/backends/thrustRTC/impl/c_inline.py +++ b/PySDM/backends/thrustRTC/impl/c_inline.py @@ -20,6 +20,7 @@ def c_inline(fun, **args): if stripped.startswith('def '): continue source += stripped + source = source.replace("power(", "pow(") source = re.sub("^return ", "", source) for arg in inspect.signature(fun).parameters: source = re.sub(f"{prae}({arg}){post}", f"\\1{real_t}({args[arg]})\\3", source) diff --git a/PySDM/physics/state_variable_triplet/rhod_thd_qv.py b/PySDM/physics/state_variable_triplet/rhod_thd_qv.py index e80aefc58..398ff6168 100644 --- a/PySDM/physics/state_variable_triplet/rhod_thd_qv.py +++ b/PySDM/physics/state_variable_triplet/rhod_thd_qv.py @@ -6,12 +6,7 @@ class RhodThdQv: # A14 in libcloudph++ 1.0 paper @staticmethod def T(rhod, thd): - return thd * ( - power( - (rhod * const.Rd * thd) / const.p1000 ** const.Rd_over_c_pd, - 1 / (1 - const.Rd_over_c_pd) - ) / const.p1000 - ) ** const.Rd_over_c_pd + return thd * power(rhod * thd / const.p1000 * const.Rd, const.Rd_over_c_pd / (1 - const.Rd_over_c_pd)) # A15 in libcloudph++ 1.0 paper @staticmethod