Skip to content

Commit

Permalink
fixed cython interface to import python module
Browse files Browse the repository at this point in the history
  • Loading branch information
gjkennedy committed Mar 7, 2024
1 parent fe14705 commit 429933a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
1 change: 0 additions & 1 deletion tmr/TMR.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import numpy as np

# Import TACS
from tacs import TACS
from tacs cimport TACS
from tacs.TACS import Vec, VecInterp, Assembler, Mg, Element, Function, Pc
from tacs.TACS cimport (
Vec,
Expand Down
2 changes: 2 additions & 0 deletions tmr/TMR.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ from cpython cimport PyObject, Py_INCREF
# Import all of the TMR header files
from tmr.cpp_headers.TMR cimport *

from tacs import TACS

cdef tmr_init():
if not TMRIsInitialized():
TMRInitialize()
Expand Down
26 changes: 21 additions & 5 deletions tmr/cpp_headers/TMR.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,27 @@ from libc.stdint cimport int32_t, int16_t
cimport numpy as np
import numpy as np

# Import TACS
from paropt.cpp_headers.ParOpt cimport *
from tacs.cpp_headers.TACS cimport *
from tacs.cpp_headers.constitutive cimport *
from egads4py.egads cimport *
# Import the definitions from the headers
from paropt.cpp_headers.ParOpt cimport ParOptScalar, ParOptVec, ParOptProblem
from tacs.cpp_headers.TACS cimport (
TacsScalar,
TACSAssembler,
TACSElement,
TACSFunction,
TACSBVec,
TACSBVecInterp,
TACSMg,
OrderingType,
ElementType,
JDRecycleType,
JD_NUM_RECYCLE,
)
from tacs.cpp_headers.constitutive cimport (
TACSMaterialProperties,
TACSPlaneStressConstitutive,
TACSSolidConstitutive,
)
from egads4py.egads cimport ego

cdef extern from "TMRBase.h":
enum:
Expand Down

0 comments on commit 429933a

Please sign in to comment.