Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion proteus/m_comp_co2/m_comp_co2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import division
from builtins import range
#from past.utils import old_div
import os
import proteus
from .cm_comp_co2 import *
Expand Down
15 changes: 7 additions & 8 deletions proteus/richards/ADR.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import division
from builtins import range
from past.utils import old_div
import proteus
from .cADR import *
import numpy as np
Expand Down Expand Up @@ -58,7 +57,7 @@ def choose_dt(self):
comm = Comm.get()
maxCFL = 1.0e-6
maxCFL = max(maxCFL, comm.globalMax(self.cfl.max()))
self.dt = old_div(self.runCFL, maxCFL)
self.dt = self.runCFL / maxCFL
if self.dtLast is None:
self.dtLast = self.dt
self.t = self.tLast + self.dt
Expand Down Expand Up @@ -98,15 +97,15 @@ def updateStage(self):
logEvent("Second stage of SSP33 method", level=4)
for ci in range(self.nc):
self.u_dof_stage[ci][self.lstage][:] = self.transport.u[ci].dof
self.u_dof_stage[ci][self.lstage] *= old_div(1., 4.)
self.u_dof_stage[ci][self.lstage] *= 1. / 4.
self.u_dof_stage[ci][self.lstage] += 3. / 4. * self.u_dof_last[ci]
# Update u_dof_old
self.transport.u_dof_old[:] = self.u_dof_stage[ci][self.lstage]
elif self.lstage == 3:
logEvent("Third stage of SSP33 method", level=4)
for ci in range(self.nc):
self.u_dof_stage[ci][self.lstage][:] = self.transport.u[ci].dof
self.u_dof_stage[ci][self.lstage] *= old_div(2.0, 3.0)
self.u_dof_stage[ci][self.lstage] *= 2.0 / 3.0
self.u_dof_stage[ci][self.lstage] += 1.0 / 3.0 * self.u_dof_last[ci]
# update u_dof_old
self.transport.u_dof_old[:] = self.u_dof_last[ci]
Expand All @@ -123,7 +122,7 @@ def updateStage(self):
logEvent("Second stage of SSP22 method", level=4)
for ci in range(self.nc):
self.u_dof_stage[ci][self.lstage][:] = self.transport.u[ci].dof
self.u_dof_stage[ci][self.lstage][:] *= old_div(1., 2.)
self.u_dof_stage[ci][self.lstage][:] *= 1. / 2.
self.u_dof_stage[ci][self.lstage][:] += 1. / 2. * self.u_dof_last[ci]
# update u_dof_old
self.transport.u_dof_old[:] = self.u_dof_last[ci]
Expand Down Expand Up @@ -600,7 +599,7 @@ def __init__(self,
self.edge_based_cfl = np.zeros(self.u[0].dof.shape)+100
#mesh
#self.q['x'] = np.zeros((self.mesh.nElements_global,self.nQuadraturePoints_element,3),'d')
self.q[('dV_u', 0)] = (old_div(1.0, self.mesh.nElements_global)) * np.ones((self.mesh.nElements_global, self.nQuadraturePoints_element), 'd')
self.q[('dV_u', 0)] = (1.0 / self.mesh.nElements_global) * np.ones((self.mesh.nElements_global, self.nQuadraturePoints_element), 'd')
self.ebqe['x'] = np.zeros((self.mesh.nExteriorElementBoundaries_global,self.nElementBoundaryQuadraturePoints_elementBoundary,3),'d')
self.q[('u',0)] = np.zeros((self.mesh.nElements_global,self.nQuadraturePoints_element),'d')
self.q[('grad(u)',0)] = np.zeros((self.mesh.nElements_global,self.nQuadraturePoints_element,self.nSpace_global),'d')
Expand Down Expand Up @@ -723,14 +722,14 @@ def __init__(self,
if 'penalty' in self.ebq_global:
for ebN in range(self.mesh.nElementBoundaries_global):
for k in range(self.nElementBoundaryQuadraturePoints_elementBoundary):
self.ebq_global['penalty'][ebN,k] = old_div(self.numericalFlux.penalty_constant,(self.mesh.elementBoundaryDiametersArray[ebN]**self.numericalFlux.penalty_power))
self.ebq_global['penalty'][ebN,k] = self.numericalFlux.penalty_constant / (self.mesh.elementBoundaryDiametersArray[ebN]**self.numericalFlux.penalty_power)
#penalty term
#cek move to Numerical flux initialization
if 'penalty' in self.ebqe:
for ebNE in range(self.mesh.nExteriorElementBoundaries_global):
ebN = self.mesh.exteriorElementBoundariesArray[ebNE]
for k in range(self.nElementBoundaryQuadraturePoints_elementBoundary):
self.ebqe['penalty'][ebNE,k] = old_div(self.numericalFlux.penalty_constant,self.mesh.elementBoundaryDiametersArray[ebN]**self.numericalFlux.penalty_power)
self.ebqe['penalty'][ebNE,k] = self.numericalFlux.penalty_constant / self.mesh.elementBoundaryDiametersArray[ebN]**self.numericalFlux.penalty_power
logEvent(memory("numericalFlux","OneLevelTransport"),level=4)
self.elementEffectiveDiametersArray = self.mesh.elementInnerDiametersArray
#use post processing tools to get conservative fluxes, None by default
Expand Down
1 change: 0 additions & 1 deletion proteus/richards/Richards.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import division
from builtins import range
#from past.utils import old_div
import proteus
from .cRichards import *
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion scripts/marinExtractHeight.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
phi = pdata.GetArray("phid").GetTuple1(i)

if (phi > 0.0) and (phi_old < 0.0):
height = old_div((float(i-1) + (old_div(phi_old,(phi_old-phi)))),float(opts.resolution))
height = (float(i-1) + phi_old / (phi_old - phi)) / float(opts.resolution)
phi_old=phi

if (height > 0.0):
Expand Down
Loading