From 2afc2f4f1dd89518995f1b5a539aea932aecab65 Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@gmail.com>
Date: Fri, 08 Mar 2019 19:50:18 +0000
Subject: [PATCH] Full write of constant volume plugin

---
 src/plugins/constant_volume.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/plugins/constant_volume.c b/src/plugins/constant_volume.c
index f86eaee..11d17dd 100644
--- a/src/plugins/constant_volume.c
+++ b/src/plugins/constant_volume.c
@@ -57,16 +57,12 @@
 		if(fabs(vesicle->volume+data->dvol-data->V0)>data->epsvol) return TS_FAIL;
 	}
 	return TS_SUCCESS;
-//	if(vesicle->tape->constvolswitch==2){
-//	/*check whether the dvol is gt than epsvol */
-//		if(fabs(vesicle->volume+data->dvol-data->V0)>data->epsvol) return TS_FAIL;
-//This part doesn't work as expected yet. Delta_energy_cv shoould be accounted for in the total energy change.
+}
 
-/*	}else if(vesicle->tape->constvolswitch == 1){
-	retval=constvolume(vesicle, vtx, -dvol, &delta_energy_cv, &constvol_vtx_moved,&constvol_vtx_backup);
-	if(retval==TS_FAIL){ // if we couldn't move the vertex to assure constant volume
-		return TS_FAIL;
-	} */
-		return TS_SUCCESS;
 
+void vm_new_state_accepted(ts_vesicle *vesicle, ts_vertex *vtx, ts_vertex *old_vtx){
+	if(vesicle->tape->constvolswitch >0){
+		plugin_data *data=(plugin_data *)vesicle->plist->pointer->plugin->details->data;
+		vesicle->volume+=data->dvol;
+	}
 }

--
Gitblit v1.9.3