diff --git a/qpms/cytmatrices.pyx b/qpms/cytmatrices.pyx index 29c8d7c..63bbc14 100644 --- a/qpms/cytmatrices.pyx +++ b/qpms/cytmatrices.pyx @@ -244,6 +244,10 @@ cdef class TMatrixGenerator: self.holder = what self.g.function = qpms_tmatrix_generator_axialsym self.g.params = (<__AxialSymParams?>self.holder).rawpointer() + elif isinstance(what, CTMatrix): + self.holder = what + self.g.function = qpms_tmatrix_generator_constant + self.g.params = (self.holder).rawpointer() # TODO INTERPOLATOR else: raise TypeError("Can't construct TMatrixGenerator from that") diff --git a/qpms/qpms_cdefs.pxd b/qpms/qpms_cdefs.pxd index 56ac441..7e9bcd7 100644 --- a/qpms/qpms_cdefs.pxd +++ b/qpms/qpms_cdefs.pxd @@ -408,6 +408,7 @@ cdef extern from "tmatrices.h": qpms_errno_t qpms_tmatrix_generator_axialsym(qpms_tmatrix_t *t, cdouble omega, const void *params) qpms_errno_t qpms_tmatrix_generator_interpolator(qpms_tmatrix_t *t, cdouble omega, const void *params) qpms_errno_t qpms_tmatrix_generator_sphere(qpms_tmatrix_t *t, cdouble omega, const void *params) + qpms_errno_t qpms_tmatrix_generator_constant(qpms_tmatrix_t *t, cdouble omega, const void *params) struct qpms_tmatrix_generator_sphere_param_t: qpms_epsmu_generator_t outside qpms_epsmu_generator_t inside