From a17e910df3b4849571e5ed9cf2a7767f1b461676 Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@gmail.com>
Date: Tue, 14 Jun 2016 18:30:55 +0000
Subject: [PATCH] Fixed restarting when inititer is not 0

---
 src/main.c                |    6 +++---
 python/tape               |    2 +-
 python/trisurf/trisurf.py |    4 ++--
 src/tape                  |    2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/python/tape b/python/tape
index f207db2..53d9b82 100644
--- a/python/tape
+++ b/python/tape
@@ -55,7 +55,7 @@
 mcsweeps=200
 #how many initial mcsweeps*inititer MC sweeps before recording to disk?
 #2
-inititer=0
+inititer=10
 #how many records do you want on the disk iteration are there in a run?
 #10000
 iterations=100
diff --git a/python/trisurf/trisurf.py b/python/trisurf/trisurf.py
index ddcb7f9..57d300d 100644
--- a/python/trisurf/trisurf.py
+++ b/python/trisurf/trisurf.py
@@ -350,7 +350,7 @@
 		return int(status)
 
 	def isCompleted(self):
-		if (int(self.tape.getValue("iterations"))==self.getLastIteration()+1):
+		if int(self.tape.getValue("iterations"))+int(self.tape.getValue("inititer"))==self.getLastIteration()+1:
 			return True
 		else:
 			return False
@@ -493,7 +493,7 @@
 
 
 	def getLastVTU(self):
-		vtuidx=self.getLastIteration()
+		vtuidx=self.getLastIteration()-int(self.tape.getValue("inititer"))+1
 		if vtuidx<0:
 			return None
 		else:
diff --git a/src/main.c b/src/main.c
index 7c1ff29..c2e51af 100644
--- a/src/main.c
+++ b/src/main.c
@@ -54,13 +54,13 @@
 		if(fd!=NULL){
 			arguments_no=fscanf(fd,"%u", &start_iteration);
 			if(arguments_no==0){
-				ts_fprintf(stdout,"No information of start iteration in .status file");
+				ts_fprintf(stdout,"No information of start iteration in .status file\n");
 				}
 			fclose(fd);
-			start_iteration++;
+			start_iteration++; 
 		}
 		else
-			ts_fprintf(stdout,"No .status file. The iteration count will start from 0");
+			ts_fprintf(stdout,"No .status file. The iteration count will start from 0\n");
 /* Here you should read new tape file, reassign some values in vertex from the tape and assign read tape to vesicle->tape */
 //        tape=parsetape(command_line_args.tape_fullfilename);
   //      vesicle=vtk2vesicle(command_line_args.dump_from_vtk,tape);
diff --git a/src/tape b/src/tape
index 59cc09c..6319c97 100644
--- a/src/tape
+++ b/src/tape
@@ -57,7 +57,7 @@
 mcsweeps=200
 #how many initial mcsweeps*inititer MC sweeps before recording to disk?
 #2
-inititer=0
+inititer=10
 #how many records do you want on the disk iteration are there in a run?
 #10000
 iterations=100

--
Gitblit v1.9.3