| | |
| | | } |
| | | |
| | | |
| | | //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; |
| | |
| | | } |
| | | |
| | | |
| | | //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++){ |
| | |
| | | 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; |
| | |
| | | // 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; |
| | | } |
| | | } |
| | | } |
| | |
| | | #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; |
| | |
| | | |
| | | /* CONSTANTS */ |
| | | |
| | | #define TS_ID_FILAMENT 1 |
| | | |
| | | /* DATA TYPES */ |
| | | /** @brief Sets the default datatype for ts_double |
| | | * |
| | |
| | | ts_double dcell; |
| | | ts_double shift; |
| | | ts_double max_occupancy; |
| | | ts_double dmin_interspecies; |
| | | } ts_cell_list; |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | 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); |
| | |
| | | |
| | | 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); |
| | |
| | | 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), |
| | |
| | | long int brezveze2; |
| | | ts_double xk0; |
| | | ts_double dmax; |
| | | ts_double dmin_interspecies; |
| | | ts_double stepsize; |
| | | ts_double kspring; |
| | | ts_double xi; |
| | |
| | | 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++; |
| | |
| | | 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) |
| | |
| | | |
| | | # 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 |
| | |
| | | |
| | | ####### 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? |
| | |
| | | #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)); |
| | |
| | | #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. |