From a2db521649cdcdfef3bdf6b306e05228a01498c0 Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@gmail.com>
Date: Sat, 07 Dec 2013 09:45:07 +0000
Subject: [PATCH] Added poly information to tape& parsing function. Also, poly_list is freed in vesicle_free

---
 src/Makefile.am |    8 ++++----
 src/main.c      |    4 ++--
 src/io.c        |    7 ++++++-
 src/tape        |    5 +++++
 src/vesicle.c   |    3 ++-
 aclocal.m4      |   10 +++++-----
 6 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index da06da5..3094178 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
+# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
@@ -14,8 +14,8 @@
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically `autoreconf'.])])
@@ -38,7 +38,7 @@
 [am__api_version='1.11'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.11.3], [],
+m4_if([$1], [1.11.6], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -54,7 +54,7 @@
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.3])dnl
+[AM_AUTOMAKE_VERSION([1.11.6])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
diff --git a/src/Makefile.am b/src/Makefile.am
index bd95811..e899cd3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,14 +4,14 @@
 #trisurf_LDFLAGS = -lm -lconfuse
 shdiscoverdir=../
 shdiscover_PROGRAMS= shdiscover
-shdiscover_SOURCES= general.c vertex.c bond.c triangle.c cell.c vesicle.c initial_distribution.c io.c energy.c sh.c shdiscover.c
+shdiscover_SOURCES= general.c vertex.c bond.c triangle.c cell.c vesicle.c initial_distribution.c io.c energy.c sh.c shdiscover.c poly.c
 AM_CFLAGS = -Wall -Werror
 co_testdir=../
 co_test_PROGRAMS=co_test
-co_test_SOURCES= general.c vertex.c bond.c triangle.c cell.c vesicle.c initial_distribution.c io.c energy.c sh.c co_test.c frame.c bondflip.c
+co_test_SOURCES= general.c vertex.c bond.c triangle.c cell.c vesicle.c initial_distribution.c io.c energy.c sh.c co_test.c frame.c bondflip.c poly.c
 spherical_trisurfdir=../
 spherical_trisurf_PROGRAMS = spherical_trisurf
-spherical_trisurf_SOURCES = general.c vertex.c bond.c triangle.c cell.c vesicle.c initial_distribution.c io.c frame.c energy.c timestep.c vertexmove.c spherical_trisurf.c sh.c bondflip.c
+spherical_trisurf_SOURCES = general.c vertex.c bond.c triangle.c cell.c vesicle.c initial_distribution.c io.c frame.c energy.c timestep.c vertexmove.c spherical_trisurf.c sh.c bondflip.c poly.c
 spherical_trisurf_ffdir=../
 spherical_trisurf_ff_PROGRAMS = spherical_trisurf_ff
-spherical_trisurf_ff_SOURCES = general.c vertex.c bond.c triangle.c cell.c vesicle.c initial_distribution.c io.c frame.c energy.c timestep.c vertexmove.c spherical_trisurf_ff.c sh.c bondflip.c
+spherical_trisurf_ff_SOURCES = general.c vertex.c bond.c triangle.c cell.c vesicle.c initial_distribution.c io.c frame.c energy.c timestep.c vertexmove.c spherical_trisurf_ff.c sh.c bondflip.c poly.c
diff --git a/src/io.c b/src/io.c
index 9e278ec..aaac102 100644
--- a/src/io.c
+++ b/src/io.c
@@ -9,6 +9,7 @@
 #include <sys/types.h>
 #include <dirent.h>
 #include "initial_distribution.h"
+#include "poly.h"
 
 ts_bool print_vertex_list(ts_vertex_list *vlist){
 	ts_uint i;
@@ -295,7 +296,7 @@
 
 
 ts_vesicle *parsetape(ts_uint *mcsweeps, ts_uint *inititer, ts_uint *iterations){
-    long int nshell=17,ncxmax=60, ncymax=60, nczmax=60;  // THIS IS DUE TO CONFUSE BUG!
+    long int nshell=17,ncxmax=60, ncymax=60, nczmax=60, npoly=10, nmono=20;  // THIS IS DUE TO CONFUSE BUG!
     char *buf=malloc(255*sizeof(char));
     long int brezveze0=1;
     long int brezveze1=1;
@@ -304,6 +305,8 @@
 	long int iter=1000, init=1000, mcsw=1000;
     cfg_opt_t opts[] = {
         CFG_SIMPLE_INT("nshell", &nshell),
+        CFG_SIMPLE_INT("npoly", &npoly),
+        CFG_SIMPLE_INT("nmono", &nmono),
         CFG_SIMPLE_FLOAT("dmax", &dmax),
         CFG_SIMPLE_FLOAT("xk0",&xk0),
         CFG_SIMPLE_FLOAT("stepsize",&stepsize),
@@ -335,6 +338,8 @@
 	*inititer=init;
 	*mcsweeps=mcsw;
 	vesicle=initial_distribution_dipyramid(nshell,ncxmax,ncymax,nczmax,stepsize);
+	vesicle->poly_list=init_poly_list(npoly,nmono, vesicle->vlist);
+
     vesicle->nshell=nshell;
     vesicle->dmax=dmax*dmax;
     vesicle->bending_rigidity=xk0;
diff --git a/src/main.c b/src/main.c
index b756320..53f4b0e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -67,9 +67,9 @@
 vesicle=parsetape(&mcsweeps, &inititer, &iterations);
 
 /*Testing */
-vesicle->poly_list=init_poly_list(1400,20,vesicle->vlist);
+//vesicle->poly_list=init_poly_list(1400,20,vesicle->vlist);
 
-poly_list_free(vesicle->poly_list);
+//poly_list_free(vesicle->poly_list);
 /*End testing*/
 
 run_simulation(vesicle, mcsweeps, inititer, iterations);
diff --git a/src/tape b/src/tape
index 0351c83..e0d0dee 100644
--- a/src/tape
+++ b/src/tape
@@ -8,6 +8,11 @@
 # max step size 
 stepsize=0.15
 
+####### Polymer definitions ###########
+# npoly is a number of polymers attached to npoly distinct vertices on vesicle
+npoly=1000
+# nmono is a number of monomers in each polymere
+nmono=15
 
 #######  Cell definitions ############
 nxmax=60
diff --git a/src/vesicle.c b/src/vesicle.c
index 9c5342a..43b16b5 100644
--- a/src/vesicle.c
+++ b/src/vesicle.c
@@ -5,7 +5,7 @@
 #include "bond.h"
 #include "cell.h"
 #include "stdlib.h"
-
+#include "poly.h"
 
 ts_vesicle *init_vesicle(ts_uint N, ts_uint ncmax1, ts_uint ncmax2, ts_uint
 ncmax3, ts_double stepsize){
@@ -34,6 +34,7 @@
     bond_list_free(vesicle->blist);
     triangle_list_free(vesicle->tlist);
     cell_list_free(vesicle->clist);
+    poly_list_free(vesicle->poly_list);
     free(vesicle);
     return TS_SUCCESS;
 }

--
Gitblit v1.9.3