remove duplicated get_Cw_cpx
@@ -1075,28 +1075,8 @@ class Dynamic(Static):
"""
- MS = self.MS
- K = self.K
- K_star = self.K_star
-
- jjvec = []
- iivec = []
- valvec = []
-
- K0tot, K0totstar = 0, 0
- for ss in range(MS.n_surf):
-
- M, N = self.MS.dimensions[ss]
- Mstar, N = self.MS.dimensions_star[ss]
-
- for mm in range(Mstar):
- jjvec += range(K0tot + N * (M - 1), K0tot + N * M)
- iivec += range(K0totstar + mm * N, K0totstar + (mm + 1) * N)
- valvec += N * [zval ** (-mm - 1)]
- K0tot += MS.KK[ss]
- K0totstar += MS.KK_star[ss]
+ return get_Cw_cpx(self.MS, self.K, self.K_star, zval)
- return libsp.csc_matrix((valvec, (iivec, jjvec)), shape=(K_star, K), dtype=np.complex_)
def balfreq(self, DictBalFreq):
"""
@@ -2929,14 +2909,37 @@ class Frequency(Static):
.. math:: \bar{\goldsymbol{\Gamma}}_w = \bar{\mathbf{C}}(z) \bar{\boldsymbol{\Gamma}}
"""
+ return get_Cw_cpx(self.MS, self.K, self.K_star, zval)
- MS = self.MS
- K = self.K
- K_star = self.K_star
- jjvec = []
- iivec = []
- valvec = []
+ def assemble_profiling(self):
+ """
+ Generate profiling report for assembly and save it in self.prof_out.
+
+ To read the report:
+ import pstats
+ p=pstats.Stats(self.prof_out)
+ """
+
+ import cProfile
+ cProfile.runctx('self.assemble()', globals(), locals(), filename=self.prof_out)
+
+
+def get_Cw_cpx(MS, K, K_star, zval):
+ r"""
+ Produces a sparse matrix
+
+ .. math:: \bar{\mathbf{C}}(z)
+
+ where
+
+ .. math:: z = e^{k \Delta t}
+
+ such that the wake circulation frequency response at :math:`z` is
+
+ .. math:: \bar{\boldsymbol{\Gamma}}_w = \bar{\mathbf{C}}(z) \bar{\mathbf{\Gamma}}
+
+ """
jjvec = []
iivec = []
@@ -2945,8 +2948,8 @@ class Frequency(Static):
K0tot, K0totstar = 0, 0
for ss in range(MS.n_surf):
- M, N = self.MS.dimensions[ss]
- Mstar, N = self.MS.dimensions_star[ss]
+ M, N = MS.dimensions[ss]
+ Mstar, N = MS.dimensions_star[ss]
for mm in range(Mstar):
jjvec += range(K0tot + N * (M - 1), K0tot + N * M)
@@ -2957,18 +2960,6 @@ class Frequency(Static):
return libsp.csc_matrix((valvec, (iivec, jjvec)), shape=(K_star, K), dtype=np.complex_)
- def assemble_profiling(self):
- """
- Generate profiling report for assembly and save it in self.prof_out.
-
- To read the report:
- import pstats
- p=pstats.Stats(self.prof_out)
- """
-
- import cProfile
- cProfile.runctx('self.assemble()', globals(), locals(), filename=self.prof_out)
-
################################################################################
