espressomd-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ESPResSo-devel] Confused by this code: is it a bug?


From: Josh Berryman
Subject: [ESPResSo-devel] Confused by this code: is it a bug?
Date: Wed, 24 Jul 2013 13:00:00 +0200


Hello devs, 

this is basically a question for Olaf as he is the only author mentioned for pressure_tcl.c.


I have different results for these two commands (which I had thought to be the total stress tensor in both cases): 

     set tens [analyze stress_tensor total] 
     puts $tens

and:
     set tens [analyze stress_tensor] 
     set tens [lindex $tens 0 ]
     puts $tens

 I find this in  the file: tcl/pressure_tcl.c

tclcommand_analyze_parse_and_print_stress_tensor(){
.
.
    else if (ARG0_IS_S("total")) {
      for(j=0; j<9; j++) {
        tvalue[j] = p_tensor.data.e[j];
        for (i = 1; i < p_tensor.data.n/9; i++) tvalue[j] += total_p_tensor.data.e[9*i + j];
     }
    }

But this in:
tclcommand_analyze_print_stress_tensor_all(){
.
.
  for(j=0; j<9; j++) {
    value = total_p_tensor.data.e[j];
    for (i = 1; i < total_p_tensor.data.n/9; i++) value += total_p_tensor.data.e[9*i + j];
    Tcl_PrintDouble(interp, value, buffer);

}

The first version looks a bit suspicious to me, but could be legitimate code.... if these two are supposed to be different, can I have something in the docs to say how and why please?

Josh





reply via email to

[Prev in Thread] Current Thread [Next in Thread]