We may be in the situation where we use and abd object to store only strain, or just strain and \psi_i through \psi_4 with some smallest value of i. In this case, there are a lot of calculations in e.g. AsymptoticBondiData.transform() that could be skipped. For example, in the lines
|
# ψ0(u, θ', ϕ') exp(2iλ) |
|
ψ0 = sf.Grid(self.psi0.evaluate(distorted_grid_rotors), spin_weight=2) |
|
# ψ1(u, θ', ϕ') exp(iλ) |
|
ψ1 = sf.Grid(self.psi1.evaluate(distorted_grid_rotors), spin_weight=1) |
|
# ψ2(u, θ', ϕ') |
|
ψ2 = sf.Grid(self.psi2.evaluate(distorted_grid_rotors), spin_weight=0) |
|
# ψ3(u, θ', ϕ') exp(-1iλ) |
|
ψ3 = sf.Grid(self.psi3.evaluate(distorted_grid_rotors), spin_weight=-1) |
|
# ψ4(u, θ', ϕ') exp(-2iλ) |
|
ψ4 = sf.Grid(self.psi4.evaluate(distorted_grid_rotors), spin_weight=-2) |
|
# σ(u, θ', ϕ') exp(2iλ) |
|
σ = sf.Grid(self.sigma.evaluate(distorted_grid_rotors), spin_weight=2) |
we can simply skip all the fields which are not stored; and similarly in the lines
|
fprime_of_timenaught_directionprime = np.empty((6, self.n_times, n_theta, n_phi), dtype=complex) |
|
# ψ0'(u, θ', ϕ') |
|
fprime_temp = ψ4.copy() |
|
fprime_temp *= ðuprime_over_k |
|
fprime_temp += -4 * ψ3 |
|
fprime_temp *= ðuprime_over_k |
|
fprime_temp += 6 * ψ2 |
|
fprime_temp *= ðuprime_over_k |
|
fprime_temp += -4 * ψ1 |
|
fprime_temp *= ðuprime_over_k |
|
fprime_temp += ψ0 |
|
fprime_temp *= one_over_k_cubed |
|
fprime_of_timenaught_directionprime[0] = fprime_temp |
|
# ψ1'(u, θ', ϕ') |
|
fprime_temp = -ψ4 |
|
fprime_temp *= ðuprime_over_k |
|
fprime_temp += 3 * ψ3 |
|
fprime_temp *= ðuprime_over_k |
|
fprime_temp += -3 * ψ2 |
|
fprime_temp *= ðuprime_over_k |
|
fprime_temp += ψ1 |
|
fprime_temp *= one_over_k_cubed |
|
fprime_of_timenaught_directionprime[1] = fprime_temp |
|
# ψ2'(u, θ', ϕ') |
|
fprime_temp = ψ4.copy() |
|
fprime_temp *= ðuprime_over_k |
|
fprime_temp += -2 * ψ3 |
|
fprime_temp *= ðuprime_over_k |
|
fprime_temp += ψ2 |
|
fprime_temp *= one_over_k_cubed |
|
fprime_of_timenaught_directionprime[2] = fprime_temp |
|
# ψ3'(u, θ', ϕ') |
|
fprime_temp = -ψ4 |
|
fprime_temp *= ðuprime_over_k |
|
fprime_temp += ψ3 |
|
fprime_temp *= one_over_k_cubed |
|
fprime_of_timenaught_directionprime[3] = fprime_temp |
|
# ψ4'(u, θ', ϕ') |
|
fprime_temp = ψ4.copy() |
|
fprime_temp *= one_over_k_cubed |
|
fprime_of_timenaught_directionprime[4] = fprime_temp |
|
# σ'(u, θ', ϕ') |
|
fprime_temp = σ.copy() |
|
fprime_temp -= ððα |
|
fprime_temp *= one_over_k |
|
fprime_of_timenaught_directionprime[5] = fprime_temp |
we can skip the calculations for fields \psi_j where j<i, i representing the smallest subscript of Weyl scalar we keep, as above.
If I remember correctly, @akhadse has implemented this as a speedup. Was that right, Akshay?
@moble do you think this is a feature worth having for ABD objects?
We may be in the situation where we use and abd object to store only strain, or just strain and \psi_i through \psi_4 with some smallest value of i. In this case, there are a lot of calculations in e.g.
AsymptoticBondiData.transform()that could be skipped. For example, in the linesscri/scri/asymptotic_bondi_data/transformations.py
Lines 325 to 336 in 6db96ad
we can simply skip all the fields which are not stored; and similarly in the lines
scri/scri/asymptotic_bondi_data/transformations.py
Lines 342 to 387 in 6db96ad
we can skip the calculations for fields \psi_j where j<i, i representing the smallest subscript of Weyl scalar we keep, as above.
If I remember correctly, @akhadse has implemented this as a speedup. Was that right, Akshay?
@moble do you think this is a feature worth having for ABD objects?