[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ESPResSo-users] Coarse Grained Multi sided particles.
From: |
Rohit Goswami |
Subject: |
Re: [ESPResSo-users] Coarse Grained Multi sided particles. |
Date: |
Fri, 19 Jun 2015 16:33:40 +0530 |
Sorry, the code I sent is for the msd calculation. Same error though. It exits
with a cannot open, too many files open error.
19.06.2015, 16:32, "Rohit Goswami" <address@hidden>:
> I was wondering if espresso has any way of defining separate interactions for
> different portions (say halves or quarters) of a single particle.
> Additionally, the rdf calculation from multiple configuration files failes
> for more than 1005 files; would this be a tcl limitation or an espresso
> limitation?
> The code for the rdf calculation is
>
> set out [open "$::datadir/msd_$type.dat" "w"]
> set origin 0
> puts $out "#"
> puts $out "#"
> puts $out "# Mean Square Deviation From Warmup Configurations"
> puts $out "#"
> puts $out "#"
> set cnt 0
> set pmax [setmd max_part]
> set j 0
> while {$j<$::warm_n_times} {
> puts -nonewline "j is $j \r"
> set in [open "$::warmconfdir/config_$j" "r"]
> set f [open "$::warmconfdir/config_$j" "r"]
> while { [blockfile $f read auto] != "eof" } {}
> close $f
>
> while { [set btitle [ blockfile $in read auto] ] != "eof" } {
> set msd 0.0;
> if { $btitle == "particles"} {
> puts "frame_no $j pmax $pmax"
> if {$j == 1} {
> for {set i 0} {$i < $pmax} {incr i} {
> set pos [part $i print pos]
> lappend vec_r0 $pos
> }
> }
> if {$j > 1} {
> for {set i 0} {$i < $pmax} {incr i} {
> set pos [part $i print pos]
> set pos0 [lindex $vec_r0 $i]
> set delta_r [vecsub $pos $pos0]
> puts "delta_r $delta_r"
> set msd [expr $msd + [veclensqr $delta_r] ]
> }
> set msd [expr $msd/$pmax]
> puts $out "$j $msd"
> }
> }
> }
> close $in
> incr j
> }
> close $out
>
> While the configurations are written every integration step by
>
> set f [open "$::warmconfdir/config_$::i" w]
> blockfile $f write tclvariable {box_length density}
> blockfile $f write variable box
> blockfile $f write particles {id pos type}
> flush $f
> close $f