Trisurf Monte Carlo simulator
mihaf
2014-03-24 ea1cce4c80ddb68c0b46a6873ef3b64cc4a958a1
Added dmin_interspecies.
10 files modified
37 ■■■■ changed files
src/cell.c 6 ●●●●● patch | view | raw | blame | history
src/frame.c 1 ●●●● patch | view | raw | blame | history
src/general.h 3 ●●●●● patch | view | raw | blame | history
src/initial_distribution.c 4 ●●●● patch | view | raw | blame | history
src/io.c 1 ●●●● patch | view | raw | blame | history
src/io.h 1 ●●●● patch | view | raw | blame | history
src/main.c 1 ●●●● patch | view | raw | blame | history
src/tape 10 ●●●●● patch | view | raw | blame | history
src/vertex.c 8 ●●●●● patch | view | raw | blame | history
src/vertex.h 2 ●●●●● patch | view | raw | blame | history
src/cell.c
@@ -44,7 +44,6 @@
}
//TODO: not debugged at all!
inline ts_uint vertex_self_avoidance(ts_vesicle *vesicle, ts_vertex *vtx){
    ts_uint cellidx;
    ts_uint ncx, ncy,ncz;
@@ -68,7 +67,6 @@
}
//TODO: looks ok, but debug anyway in the future
inline ts_bool cell_add_vertex(ts_cell *cell, ts_vertex *vtx){
    ts_uint i;
    for(i=0;i<cell->nvertex;i++){
@@ -124,7 +122,7 @@
    return TS_SUCCESS;
}
// TODO: compiles ok, but it is completely untested and undebugged. It was debugged before rewrite, but this was long time ago.
ts_bool cell_occupation_number_and_internal_proximity(ts_cell_list *clist, ts_uint cellidx, ts_vertex *vtx){
    ts_uint ncx,ncy,ncz,remainder,cell_occupation;
    ts_uint i,j,k,l,neigh_cidx;
@@ -155,7 +153,7 @@
                    //        fprintf(stderr,"calling dist on vertex %i\n",l);
                           dist=vtx_distance_sq(clist->cell[neigh_cidx]->vertex[l],vtx);
                    //        fprintf(stderr,"dist was %f\n",dist);
                            if(dist<=1.0) return TS_FAIL;
                            if(dist<=1.0 || (dist<=clist->dmin_interspecies && (clist->cell[neigh_cidx]->vertex[l]->id != vtx->id))) return TS_FAIL;
                        }
                    }
                }
src/frame.c
@@ -2,6 +2,7 @@
#include "general.h"
#include "cell.h"
#include "frame.h"
ts_bool centermass(ts_vesicle *vesicle){
    ts_uint i,j, n=vesicle->vlist->n;
    ts_vertex **vtx=vesicle->vlist->vtx;
src/general.h
@@ -48,6 +48,8 @@
/* CONSTANTS */
#define TS_ID_FILAMENT 1
/* DATA TYPES */
/** @brief Sets the default datatype for ts_double
 *
@@ -213,6 +215,7 @@
    ts_double dcell;
    ts_double shift;
    ts_double max_occupancy;
    ts_double dmin_interspecies;
} ts_cell_list;
src/initial_distribution.c
@@ -69,6 +69,9 @@
        }
    }
    for(i=0;i<vesicle->filament_list->n;i++){
        vertex_list_assign_id(vesicle->filament_list->poly[i]->vlist,TS_ID_FILAMENT);
    }
//    vesicle->spring_constant=tape->kspring;
//    poly_assign_spring_const(vesicle);
@@ -76,6 +79,7 @@
    
    vesicle->nshell=tape->nshell;
    vesicle->dmax=tape->dmax*tape->dmax; /* dmax^2 in the vesicle dmax variable */
    vesicle->clist->dmin_interspecies = tape->dmin_interspecies*tape->dmin_interspecies;
    vesicle->bending_rigidity=tape->xk0;
    vtx_set_global_values(vesicle); /* make xk0 default value for every vertex */ 
    ts_fprintf(stdout, "Tape setting: xk0=%e\n",tape->xk0);
src/io.c
@@ -970,6 +970,7 @@
    CFG_SIMPLE_INT("nfono",&tape->nfono),
    CFG_SIMPLE_INT("R_nucleus",&tape->R_nucleus),
    CFG_SIMPLE_FLOAT("dmax", &tape->dmax),
    CFG_SIMPLE_FLOAT("dmin_interspecies", &tape->dmin_interspecies),
        CFG_SIMPLE_FLOAT("xk0",&tape->xk0),
    CFG_SIMPLE_INT("pswitch",&tape->pswitch),
    CFG_SIMPLE_FLOAT("pressure",&tape->pressure),
src/io.h
@@ -26,6 +26,7 @@
        long int brezveze2;
        ts_double xk0;
    ts_double dmax;
    ts_double dmin_interspecies;
    ts_double stepsize;
    ts_double kspring;
    ts_double xi;
src/main.c
@@ -48,6 +48,7 @@
        vesicle->pressure=tape->pressure;
        vesicle->dmax=tape->dmax*tape->dmax;
        poly_assign_filament_xi(vesicle,tape);
        vesicle->clist->dmin_interspecies = tape->dmin_interspecies*tape->dmin_interspecies;
        if(command_line_args.reset_iteration_count) start_iteration=tape->inititer;
        else start_iteration++;
src/tape
@@ -3,6 +3,8 @@
nshell=17
# dmax is the max. bond length (in units l_min)
dmax=1.7
# dmin_interspecies in the min. dist. between different vertex species (in units l_min)
dmin_interspecies=1
# bending rigidity of the membrane (in units kT)
xk0=10.0
# max step size (in units l_min)
@@ -10,13 +12,13 @@
# Pressure calculations
# (pswitch=1: calc. p*dV energy contribution)
pswitch = 0
pswitch = 1
# pressure difference: p_inside - p_outside (in units kT/l_min^3):
pressure=0.1
pressure=-2.0
####### Polymer (brush) definitions ###########
# npoly is a number of polymers attached to npoly distinct vertices on vesicle
npoly=300
npoly=0
# nmono is a number of monomers in each polymer
nmono=10
# Spring constant between monomers of the polymer
@@ -42,7 +44,7 @@
####### Program Control ############
#how many MC sweeps between subsequent records of states to disk
mcsweeps=500
mcsweeps=100
#how many initial mcsweeps*inititer MC sweeps before recording to disk?
inititer=0
#how many records do you want on the disk iteration are there in a run?
src/vertex.c
@@ -6,6 +6,14 @@
#include "bond.h"
#include<stdio.h>
ts_bool vertex_list_assign_id(ts_vertex_list *vlist, ts_uint id){
    ts_uint i;
    for(i=0;i<vlist->n;i++){
        vlist->vtx[i]->id = id;
    }
    return TS_SUCCESS;
}
ts_vertex_list *init_vertex_list(ts_uint N){    
    ts_int i;
    ts_vertex_list *vlist=(ts_vertex_list *)malloc(sizeof(ts_vertex_list));
src/vertex.h
@@ -1,6 +1,8 @@
#ifndef _VERTEX_H
#define _VERTEX_H
ts_bool vertex_list_assign_id(ts_vertex_list *vlist, ts_uint id);
/** @brief Creates initial vertex list
 *  
 *  Allocates memory and initializes the vertices.