From 4cd7b401adb315dfe7480dd18cd0a522450a1f8b Mon Sep 17 00:00:00 2001 From: Chris Bradley Date: Tue, 10 Apr 2018 15:15:11 +1200 Subject: [PATCH 1/3] Update for new computation environment routines. --- src/python/monodomain_2D_HH.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/python/monodomain_2D_HH.py b/src/python/monodomain_2D_HH.py index d5da69d..d2d85c5 100644 --- a/src/python/monodomain_2D_HH.py +++ b/src/python/monodomain_2D_HH.py @@ -59,8 +59,9 @@ #DOC-START parallel information # Get the number of computational nodes and this computational node number -numberOfComputationalNodes = iron.ComputationalNumberOfNodesGet() -computationalNodeNumber = iron.ComputationalNodeNumberGet() +computationEnvironment = iron.ComputationEnvironment() +numberOfComputationalNodes = computationEnvironment.NumberOfWorldNodesGet() +computationalNodeNumber = computationEnvironment.WorldNodeNumberGet() #DOC-END parallel information #DOC-START initialisation From c1f12c51e6c4a698e1d7d3d8dddddc03393c1400 Mon Sep 17 00:00:00 2001 From: Chris Bradley Date: Sat, 15 Sep 2018 19:45:40 +1200 Subject: [PATCH 2/3] Back to working with develop --- src/python/monodomain_2D_HH.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/python/monodomain_2D_HH.py b/src/python/monodomain_2D_HH.py index d2d85c5..d5da69d 100644 --- a/src/python/monodomain_2D_HH.py +++ b/src/python/monodomain_2D_HH.py @@ -59,9 +59,8 @@ #DOC-START parallel information # Get the number of computational nodes and this computational node number -computationEnvironment = iron.ComputationEnvironment() -numberOfComputationalNodes = computationEnvironment.NumberOfWorldNodesGet() -computationalNodeNumber = computationEnvironment.WorldNodeNumberGet() +numberOfComputationalNodes = iron.ComputationalNumberOfNodesGet() +computationalNodeNumber = iron.ComputationalNodeNumberGet() #DOC-END parallel information #DOC-START initialisation From dcaa7b9a06fbed2d839639c0d0c2faade19218b9 Mon Sep 17 00:00:00 2001 From: Chris Bradley Date: Sat, 15 Sep 2018 20:21:10 +1200 Subject: [PATCH 3/3] Updates for python 3 --- src/python/monodomain_2D_HH.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python/monodomain_2D_HH.py b/src/python/monodomain_2D_HH.py index d5da69d..df82e9c 100644 --- a/src/python/monodomain_2D_HH.py +++ b/src/python/monodomain_2D_HH.py @@ -246,7 +246,7 @@ # Set the stimulus on half the bottom nodes stimComponent = cellML.FieldComponentGet(cellModel, iron.CellMLFieldTypes.PARAMETERS, "membrane/i_Stim") -for node in range(1,(numberOfXElements + 1)/2 + 1): +for node in range(1,int(round((numberOfXElements + 1)/2 + 1))): nodeDomain = decomposition.NodeDomainGet(node,1) if nodeDomain == computationalNodeNumber: cellMLParametersField.ParameterSetUpdateNode(iron.FieldVariableTypes.U, iron.FieldParameterSetTypes.VALUES, 1, 1, node, stimComponent, stimValue) @@ -309,7 +309,7 @@ problem.Solve() # Now turn the stimulus off -for node in range(1,(numberOfXElements + 1)/2 + 1): +for node in range(1,int(round((numberOfXElements + 1)/2 + 1))): #for node in range(1,numberOfXElements+2): nodeDomain = decomposition.NodeDomainGet(node,1) if nodeDomain == computationalNodeNumber: