Trisurf Monte Carlo simulator
Miha Fošnarič
2016-07-11 02d65c3c9baa0e76744ce001c55ec699ab3b956f
A fix in energy.c. Normals are summed now.
2 files modified
10 ■■■■ changed files
src/energy.c 8 ●●●● patch | view | raw | blame | history
src/snapshot.c 2 ●●● patch | view | raw | blame | history
src/energy.c
@@ -216,11 +216,11 @@
    ts_double norml,ddp=0.0;
    ts_uint i;
    ts_double xnorm=0.0,ynorm=0.0,znorm=0.0;
    /*find normal of the vertex as average normal of all the triangles surrounding it. */
    /*find normal of the vertex as sum of all the normals of the triangles surrounding it. */
    for(i=0;i<vtx->tristar_no;i++){
            xnorm=vtx->tristar[i]->xnorm;
            ynorm=vtx->tristar[i]->ynorm;
            znorm=vtx->tristar[i]->znorm;
            xnorm+=vtx->tristar[i]->xnorm;
            ynorm+=vtx->tristar[i]->ynorm;
            znorm+=vtx->tristar[i]->znorm;
    }
    /*normalize*/
    norml=sqrt(xnorm*xnorm+ynorm*ynorm+znorm*znorm);
src/snapshot.c
@@ -24,7 +24,7 @@
ts_bool xml_trisurf_data(FILE *fh, ts_vesicle *vesicle){
    ts_string *data=(ts_string *)malloc(sizeof(ts_sprintf));
    data->string=(char *)malloc(512000*sizeof(char)); /*TODO: warning, can break if the string is to long */
    data->string=(char *)malloc(5120000*sizeof(char)); /*TODO: warning, can break if the string is to long */
    data->beg=0;
    
    xml_trisurf_header(fh, vesicle);