Additional functionality to Cython wrappers.

Former-commit-id: 69c34b8ff0fb2d59ee6e62414e9999f2717ecfa0
This commit is contained in:
Marek Nečada 2019-03-24 19:30:33 +02:00
parent 8683c69c0e
commit f04fd9496e
1 changed files with 14 additions and 2 deletions

View File

@ -1197,6 +1197,11 @@ cdef class CTMatrix: # N.B. there is another type called TMatrix in tmatrices.py
''' Replaces the contents of the T-matrix with those of a spherical particle.''' ''' Replaces the contents of the T-matrix with those of a spherical particle.'''
qpms_tmatrix_spherical_fill(&self.t, radius, k_int, k_ext, mu_int, mu_ext) qpms_tmatrix_spherical_fill(&self.t, radius, k_int, k_ext, mu_int, mu_ext)
def spherical_perm_fill(CTMatrix self, double radius, double freq, cdouble epsilon_int,
cdouble epsilon_ext):
'''Replaces the contenst of the T-matrix with those of a spherical particle.'''
qpms_tmatrix_spherical_mu0_fill(&self.t, radius, freq, epsilon_int, epsilon_ext)
@staticmethod @staticmethod
def spherical(BaseSpec spec, double radius, cdouble k_int, cdouble k_ext, def spherical(BaseSpec spec, double radius, cdouble k_int, cdouble k_ext,
cdouble mu_int = 1, cdouble mu_ext = 1): cdouble mu_int = 1, cdouble mu_ext = 1):
@ -1205,6 +1210,13 @@ cdef class CTMatrix: # N.B. there is another type called TMatrix in tmatrices.py
tm.spherical_fill(radius, k_int, k_ext, mu_int, mu_ext) tm.spherical_fill(radius, k_int, k_ext, mu_int, mu_ext)
return tm return tm
@staticmethod
def spherical_perm(BaseSpec spec, double radius, double freq, cdouble epsilon_int, cdouble epsilon_ext):
'''Creates a T-matrix of a spherical nanoparticle.'''
tm = CTMatrix(spec, 0)
tm.spherical_perm_fill(radius, freq, epsilon_int, epsilon_ext)
return tm
cdef char *make_c_string(pythonstring): cdef char *make_c_string(pythonstring):
''' '''
Copies contents of a python string into a char[] Copies contents of a python string into a char[]