factor out omega**2 terms

This commit is contained in:
Jan Petykiewicz 2021-07-11 17:26:33 -07:00
parent 204afb8024
commit 8c8f9f6e69

View File

@ -70,9 +70,11 @@ def cylindrical_operator(omega: complex,
b1 = Dby @ Ty @ Dfx b1 = Dby @ Ty @ Dfx
diag = sparse.block_diag diag = sparse.block_diag
op = (omega**2 * diag((Tx, Ty)) + pa) @ diag((a0, a1)) + \
- (sparse.bmat(((None, Ty), (Tx, None))) + omega**-2 * pb) @ diag((b0, b1))
omega2 = omega * omega
op = (omega2 * diag((Tx, Ty)) + pa) @ diag((a0, a1)) + \
- (sparse.bmat(((None, Ty), (Tx, None))) + pb / omega2) @ diag((b0, b1))
return op return op