Skip to content

Commit 429933a

Browse files
committed
fixed cython interface to import python module
1 parent fe14705 commit 429933a

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

tmr/TMR.pxd

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import numpy as np
2727

2828
# Import TACS
2929
from tacs import TACS
30-
from tacs cimport TACS
3130
from tacs.TACS import Vec, VecInterp, Assembler, Mg, Element, Function, Pc
3231
from tacs.TACS cimport (
3332
Vec,

tmr/TMR.pyx

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ from cpython cimport PyObject, Py_INCREF
4343
# Import all of the TMR header files
4444
from tmr.cpp_headers.TMR cimport *
4545

46+
from tacs import TACS
47+
4648
cdef tmr_init():
4749
if not TMRIsInitialized():
4850
TMRInitialize()

tmr/cpp_headers/TMR.pxd

+21-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,27 @@ from libc.stdint cimport int32_t, int16_t
3030
cimport numpy as np
3131
import numpy as np
3232

33-
# Import TACS
34-
from paropt.cpp_headers.ParOpt cimport *
35-
from tacs.cpp_headers.TACS cimport *
36-
from tacs.cpp_headers.constitutive cimport *
37-
from egads4py.egads cimport *
33+
# Import the definitions from the headers
34+
from paropt.cpp_headers.ParOpt cimport ParOptScalar, ParOptVec, ParOptProblem
35+
from tacs.cpp_headers.TACS cimport (
36+
TacsScalar,
37+
TACSAssembler,
38+
TACSElement,
39+
TACSFunction,
40+
TACSBVec,
41+
TACSBVecInterp,
42+
TACSMg,
43+
OrderingType,
44+
ElementType,
45+
JDRecycleType,
46+
JD_NUM_RECYCLE,
47+
)
48+
from tacs.cpp_headers.constitutive cimport (
49+
TACSMaterialProperties,
50+
TACSPlaneStressConstitutive,
51+
TACSSolidConstitutive,
52+
)
53+
from egads4py.egads cimport ego
3854

3955
cdef extern from "TMRBase.h":
4056
enum:

0 commit comments

Comments
 (0)