MCPcopy Create free account
hub / github.com/Apress/python-for-matlab-development / solve_subset

Function solve_subset

code/dask/pysolve.py:33–41  ·  view source on GitHub ↗
(K,C,M,b, P_subset, Hertz_subset, keep_dof)

Source from the content-addressed store, hash-verified

31from scikits import umfpack
32from dask.distributed import Client, LocalCluster
33def solve_subset(K,C,M,b, P_subset, Hertz_subset, keep_dof):
34 results_subset = np.zeros((len(keep_dof),len(P_subset)), dtype=np.complex128)
35 for i,(w,P) in enumerate(zip(Hertz_subset,P_subset)):
36 omega = 2*np.pi*w
37 KCM = K + 1j*omega*C - omega**2 * M
38 LU = umfpack.splu(KCM)
39 x = np.squeeze( LU.solve(b*P)[keep_dof] )
40 results_subset[:,i] = x
41 return results_subset
42def submit_solve_jobs(client, KCMb, P, Hertz, keep_dof, n_jobs):
43 K, C, M, b = KCMb
44 results = []

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected