Skip to content

Commit c818b17

Browse files
committed
added impor_array call
1 parent 429933a commit c818b17

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

tmr/TMR.pxd

-7
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@
1818
# See the License for the specific language governing permissions and
1919
# limitations under the License.
2020

21-
# For MPI
22-
cimport mpi4py.MPI as MPI
23-
24-
# Import numpy
25-
cimport numpy as np
26-
import numpy as np
27-
2821
# Import TACS
2922
from tacs import TACS
3023
from tacs.TACS import Vec, VecInterp, Assembler, Mg, Element, Function, Pc

tmr/TMR.pyx

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ cimport mpi4py.MPI as MPI
2525
cimport numpy as np
2626
import numpy as np
2727

28+
# Ensure that numpy is initialized
29+
np.import_array()
30+
2831
# Import the string library
2932
from libcpp.string cimport string
3033
from libc.string cimport strcpy
@@ -49,9 +52,6 @@ cdef tmr_init():
4952
if not TMRIsInitialized():
5053
TMRInitialize()
5154

52-
# Ensure that numpy is initialized
53-
np.import_array()
54-
5555
# Initialize the MPI libraries in TMR (if not already done)
5656
tmr_init()
5757

tmr/cpp_headers/TMR.pxd

-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ cimport mpi4py.MPI as MPI
2626
from libc.string cimport const_char
2727
from libc.stdint cimport int32_t, int16_t
2828

29-
# Import numpy
30-
cimport numpy as np
31-
import numpy as np
32-
3329
# Import the definitions from the headers
3430
from paropt.cpp_headers.ParOpt cimport ParOptScalar, ParOptVec, ParOptProblem
3531
from tacs.cpp_headers.TACS cimport (

0 commit comments

Comments
 (0)