ScatteringSystem, ... definitions to pxd file

This commit is contained in:
Marek Nečada 2020-11-19 04:37:57 +02:00
parent 3a8e5b99cb
commit 94e218c459
2 changed files with 30 additions and 19 deletions

View File

@ -1,4 +1,6 @@
from .qpms_cdefs cimport qpms_finite_group_t from .qpms_cdefs cimport qpms_finite_group_t, qpms_scatsys_t, qpms_iri_t,\
qpms_scatsys_at_omega_t, qpms_scatsys_at_omega_k_t
from .cymaterials cimport EpsMuGenerator
cdef class FinitePointGroup: cdef class FinitePointGroup:
cdef readonly bint owns_data cdef readonly bint owns_data
@ -6,3 +8,30 @@ cdef class FinitePointGroup:
cdef inline qpms_finite_group_t *rawpointer(self): cdef inline qpms_finite_group_t *rawpointer(self):
return self.G return self.G
cdef class ScatteringSystem:
cdef list tmgobjs # here we keep the references to occuring TMatrixFunctions (and hence BaseSpecs and TMatrixGenerators)
#cdef list Tmatrices # Here we keep the references to occuring T-matrices
cdef EpsMuGenerator medium_holder # Here we keep the reference to medium generator
cdef qpms_scatsys_t *s
cdef FinitePointGroup sym
cdef qpms_iri_t iri_py2c(self, iri, allow_None=?)
cdef class _ScatteringSystemAtOmegaK:
cdef qpms_scatsys_at_omega_k_t sswk
cdef _ScatteringSystemAtOmega ssw_pyref
cdef inline qpms_scatsys_at_omega_k_t *rawpointer(self):
return &self.sswk
cdef class _ScatteringSystemAtOmega:
cdef qpms_scatsys_at_omega_t *ssw
cdef ScatteringSystem ss_pyref
cdef inline qpms_scatsys_at_omega_t *rawpointer(self):
return self.ssw

View File

@ -372,12 +372,6 @@ cdef class ScatteringSystem:
Currently, it does not have a standard constructor. Use the Currently, it does not have a standard constructor. Use the
ScatteringSystem.create() method instead. ScatteringSystem.create() method instead.
''' '''
cdef list tmgobjs # here we keep the references to occuring TMatrixFunctions (and hence BaseSpecs and TMatrixGenerators)
#cdef list Tmatrices # Here we keep the references to occuring T-matrices
cdef EpsMuGenerator medium_holder # Here we keep the reference to medium generator
cdef qpms_scatsys_t *s
cdef FinitePointGroup sym
cdef qpms_iri_t iri_py2c(self, iri, allow_None = True): cdef qpms_iri_t iri_py2c(self, iri, allow_None = True):
if iri is None and allow_None: if iri is None and allow_None:
return QPMS_NO_IRREP return QPMS_NO_IRREP
@ -1012,12 +1006,6 @@ cdef class _ScatteringSystemAtOmegaK:
This represents an infinite periodic system with a given (fixed) frequency and Bloch vector. This represents an infinite periodic system with a given (fixed) frequency and Bloch vector.
''' '''
cdef qpms_scatsys_at_omega_k_t sswk
cdef _ScatteringSystemAtOmega ssw_pyref
cdef qpms_scatsys_at_omega_k_t *rawpointer(self):
return &self.sswk
property eta: property eta:
"""Ewald parameter η""" """Ewald parameter η"""
def __get__(self): def __get__(self):
@ -1124,9 +1112,6 @@ cdef class _ScatteringSystemAtOmega:
that keeps the T-matrix and background data evaluated that keeps the T-matrix and background data evaluated
at specific frequency. at specific frequency.
''' '''
cdef qpms_scatsys_at_omega_t *ssw
cdef ScatteringSystem ss_pyref
def check(self): # cdef instead? def check(self): # cdef instead?
if not self.ssw: if not self.ssw:
raise ValueError("_ScatteringSystemAtOmega's ssw-pointer not set. You must not use the default constructor; ScatteringSystem.create() instead") raise ValueError("_ScatteringSystemAtOmega's ssw-pointer not set. You must not use the default constructor; ScatteringSystem.create() instead")
@ -1155,9 +1140,6 @@ cdef class _ScatteringSystemAtOmega:
qpms_scatsysw_apply_Tmatrices_full(&target_view[0], &a_view[0], self.ssw) qpms_scatsysw_apply_Tmatrices_full(&target_view[0], &a_view[0], self.ssw)
return target_np return target_np
cdef qpms_scatsys_at_omega_t *rawpointer(self):
return self.ssw
def scatter_solver(self, iri=None, k=None): def scatter_solver(self, iri=None, k=None):
self.check() self.check()
cdef _ScatteringSystemAtOmegaK sswk # used only for periodic systems cdef _ScatteringSystemAtOmegaK sswk # used only for periodic systems