From fe24d29b3c8684f08dccd01f5785aa48b7137322 Mon Sep 17 00:00:00 2001 From: mihaf <miha.fosnaric@gmail.com> Date: Tue, 25 Mar 2014 12:49:06 +0000 Subject: [PATCH] Added nucleus. Better initial configuration of filaments. --- src/vertexmove.c | 24 +++++++++++++++++++----- 1 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/vertexmove.c b/src/vertexmove.c index da8e70f..9139ae2 100644 --- a/src/vertexmove.c +++ b/src/vertexmove.c @@ -67,11 +67,18 @@ } } - //self avoidance check with distant vertices - cellidx=vertex_self_avoidance(vesicle, vtx); - //check occupation number - retval=cell_occupation_number_and_internal_proximity(vesicle->clist,cellidx,vtx); - +// TODO: Maybe faster if checks only nucleus-neighboring cells +// Nucleus penetration check: + if (vtx->x*vtx->x + vtx->y*vtx->y + vtx->z*vtx->z < vesicle->R_nucleus){ + vtx=memcpy((void *)vtx,(void *)&backupvtx[0],sizeof(ts_vertex)); + return TS_FAIL; + } + +//self avoidance check with distant vertices + cellidx=vertex_self_avoidance(vesicle, vtx); + //check occupation number + retval=cell_occupation_number_and_internal_proximity(vesicle->clist,cellidx,vtx); + if(retval==TS_FAIL){ vtx=memcpy((void *)vtx,(void *)&backupvtx[0],sizeof(ts_vertex)); return TS_FAIL; @@ -291,6 +298,13 @@ } } +// TODO: Maybe faster if checks only nucleus-neighboring cells +// Nucleus penetration check: + if (vtx->x*vtx->x + vtx->y*vtx->y + vtx->z*vtx->z < vesicle->R_nucleus){ + vtx=memcpy((void *)vtx,(void *)&backupvtx,sizeof(ts_vertex)); + return TS_FAIL; + } + //self avoidance check with distant vertices cellidx=vertex_self_avoidance(vesicle, vtx); -- Gitblit v1.9.3