Skip to content

Commit

Permalink
Fixes Numpy > 1.9.0
Browse files Browse the repository at this point in the history
Removes dependency on numarray
  • Loading branch information
gordon-n-stevenson committed Nov 22, 2016
1 parent debef32 commit ea10098
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions Assembler.py
Expand Up @@ -16,8 +16,7 @@
## Developed with support from the EC FP7/2007-2013: ARCH, Project n. 224390

from DofMap import DofMap
from numpy.core.numeric import zeros
from numpy.numarray.numerictypes import Int32
from numpy.core.numeric import zeros, int32

class Assembler(object):
'''
Expand Down Expand Up @@ -122,7 +121,7 @@ def AssembleBoundaryConditions(self, simulationContext):
self.BoundaryConditions.SetSimulationContext(simulationContext)
for el in self.BoundaryConditions.elementFlow:
self.FlowDof[el.Id] = self.DofMap.DofMap[(el.Id,el.GetLocalDof(int(self.BoundaryConditions.NodeFlow[el.Id])))]
self.PrescribedPressures = PrescribedPressures.astype(Int32)
self.PrescribedPressures = PrescribedPressures.astype(int32)
return self.PrescribedPressures

def AssembleInit(self, simulationContext, evaluator):
Expand Down
9 changes: 4 additions & 5 deletions Elements.py
Expand Up @@ -15,8 +15,7 @@

## Developed with support from the EC FP7/2007-2013: ARCH, Project n. 224390

from numpy.core.numeric import arange, array, zeros, dot
from numpy.numarray.numerictypes import Int32
from numpy.core.numeric import arange, array, zeros, dot, int32
from math import pi
from numpy.core.fromnumeric import sum, mean
from numpy.lib.scimath import sqrt
Expand Down Expand Up @@ -69,7 +68,7 @@ def GetZeroOrderMatrix(self):
'''
circuitMatrix = self.GetCircuitMatrix()
numberOfEdges = circuitMatrix.shape[0]
elementNodes = array(circuitMatrix[:,:2].astype(Int32))
elementNodes = array(circuitMatrix[:,:2].astype(int32))
elementData = circuitMatrix[:,2:]
zeroOrderMatrix = zeros((numberOfEdges+1, numberOfEdges+1))
reverse = array([[1,-1],[-1,1]])
Expand All @@ -90,7 +89,7 @@ def GetFirstOrderMatrix (self):
'''
circuitMatrix = self.GetCircuitMatrix()
numberOfEdges = circuitMatrix.shape[0]
elementNodes = array(circuitMatrix[:,:2].astype(Int32))
elementNodes = array(circuitMatrix[:,:2].astype(int32))
elementData = circuitMatrix[:,2:]
firstOrderMatrix = zeros((numberOfEdges+1, numberOfEdges+1))
reverse = array([[1,-1],[-1,1]])
Expand All @@ -111,7 +110,7 @@ def GetSecondOrderMatrix (self):
'''
circuitMatrix = self.GetCircuitMatrix()
numberOfEdges = circuitMatrix.shape[0]
elementNodes = array(circuitMatrix[:,:2].astype(Int32))
elementNodes = array(circuitMatrix[:,:2].astype(int32))
elementData = circuitMatrix[:,2:]
secondOrderMatrix = zeros((numberOfEdges+1, numberOfEdges+1))
reverse = array([[1,-1],[-1,1]])
Expand Down

0 comments on commit ea10098

Please sign in to comment.