Skip to content

Commit

Permalink
updated cython
Browse files Browse the repository at this point in the history
  • Loading branch information
gjkennedy committed Mar 6, 2024
1 parent ff646da commit 4e8eb71
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ debug:
${CXX} ${SO_LINK_FLAGS} ${TMR_OBJS} ${TMR_EXTERN_LIBS} -o ${TMR_DIR}/lib/libtmr.${SO_EXT}

interface:
pip install -e .\[all\]
pip install -e .

clean:
${RM} lib/*.a lib/*.so
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def get_mpi_flags():
if "tacs" in sys.modules:
inc_dirs.extend(tacs.get_include())
inc_dirs.extend(tacs.get_cython_include())
inc_dirs.append(os.path.split(tacs.get_cython_include()[0])[0])
tacs_lib_dirs, tacs_libs = tacs.get_libraries()
lib_dirs.extend(tacs_lib_dirs)
libs.extend(tacs_libs)
Expand All @@ -87,6 +88,7 @@ def get_mpi_flags():
if "paropt" in sys.modules:
inc_dirs.extend(paropt.get_include())
inc_dirs.extend(paropt.get_cython_include())
inc_dirs.append(os.path.split(paropt.get_cython_include()[0])[0])
paropt_lib_dirs, paropt_libs = paropt.get_libraries()
lib_dirs.extend(paropt_lib_dirs)
libs.extend(paropt_libs)
Expand All @@ -98,6 +100,7 @@ def get_mpi_flags():
if "egads4py" in sys.modules:
inc_dirs.extend(egads4py.get_include())
inc_dirs.extend(egads4py.get_cython_include())
inc_dirs.append(os.path.split(egads4py.get_cython_include()[0])[0])
egads4py_lib_dirs, egads4py_libs = egads4py.get_libraries()
lib_dirs.extend(egads4py_lib_dirs)
libs.extend(egads4py_libs)
Expand Down
47 changes: 35 additions & 12 deletions tmr/TMR.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# limitations under the License.

# For MPI
from mpi4py.libmpi cimport *
cimport mpi4py.MPI as MPI

# Import numpy
Expand All @@ -29,21 +28,45 @@ import numpy as np
# Import TACS
from tacs import TACS
from tacs cimport TACS
from tacs.TACS import *
from tacs.TACS cimport *
from tacs.constitutive import *
from tacs.constitutive cimport *
from tacs.TACS import Vec, VecInterp, Assembler, Mg, Element, Function, Pc
from tacs.TACS cimport (
Vec,
VecInterp,
Assembler,
Mg,
Element,
Function,
Pc,
TACSFunction,
TACSBVec,
TACSBVecInterp,
TACSAssembler,
TACSMg,
_init_Vec,
_init_VecInterp,
_init_Assembler,
_init_Mg,
_dynamicTACSMg,
)
from tacs.constitutive import (
PlaneStressConstitutive,
SolidConstitutive,
MaterialProperties,
)
from tacs.constitutive cimport (
PlaneStressConstitutive,
SolidConstitutive,
MaterialProperties,
TACSMaterialProperties,
)

# Import ParOpt
from paropt.ParOpt import *
from paropt.ParOpt cimport *
from paropt.ParOpt import PVec, ProblemBase
from paropt.ParOpt cimport PVec, ProblemBase, ParOptVec, _init_PVec

# Import EGADS
from egads4py.egads import *
from egads4py.egads cimport *

# Import all of the TMR header files
from tmr.cpp_headers.TMR cimport *
from egads4py.egads import pyego
from egads4py.egads cimport pyego

cdef inline char* tmr_convert_str_to_chars(s):
if isinstance(s, unicode):
Expand Down
4 changes: 3 additions & 1 deletion tmr/TMR.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# limitations under the License.

# # For the use of MPI
from mpi4py.libmpi cimport *
cimport mpi4py.MPI as MPI

# Import numpy
Expand All @@ -41,6 +40,9 @@ from libcpp cimport bool
# Import C methods for python
from cpython cimport PyObject, Py_INCREF

# Import all of the TMR header files
from tmr.cpp_headers.TMR cimport *

cdef tmr_init():
if not TMRIsInitialized():
TMRInitialize()
Expand Down

0 comments on commit 4e8eb71

Please sign in to comment.