espressomd-users
[Top][All Lists]
Advanced

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

Re: [ESPResSo] analyze aggregation error


From: Mehmet Sayar
Subject: Re: [ESPResSo] analyze aggregation error
Date: Mon, 30 Mar 2009 15:23:51 +0300
User-agent: Thunderbird 2.0.0.21 (X11/20090310)

Hi Steven,

You need to define the topology of your system. In other words you need to
define whether if you have chains, dendrimers, molecules, ... in your system.

As an example, the following script defines the topology for a system of  n_poly
polymer chains of length p_length.

# set the topology
for {set i 0} { $i < $n_poly} {incr i} {
    set topo_chain 0
    for {set j 0} { $j < $p_length} {incr j} {
        lappend topo_chain [expr $i * $p_length + $j]
    }
    lappend topo $topo_chain
    #puts "$topo_chain \n $topo"
}

Once the topology is defined the following lines enable the molecule ids to be
defined in the system:

eval analyze set $topo
analyze set "topo_part_sync"


Mehmet


Steven Kirk wrote:
> Hello,
> 
> While running the script below, I get an error:
> 
> -- check your start and finish molecule id's
>      while executing
> "analyze aggregation 4.0 1 3 "
>      ("for" body line 10)
>      invoked from within
> "for {set i 0} { $i < $int_n_times } { incr i} {
> 
> #    puts -nonewline "run $i at time=[setmd time] "
> 
>      integrate $int_steps
>      if { $vmd_output==..."
>      (file "aggregation.tcl" line 171)
> 
> The documentation mentions starting and finishing 'molecule ids', but I 
> cannot find any mention of molecule ids in the manual. Are these 
> intended to be the same as particles IDs in the case where only 
> particles are present (interacting via non-bonded forces)?
> 
> Many thanks for your help!
> 
> ---- script below -----
> 
> #############################################################
> #  Parameters                                               #
> #############################################################
> 
> # System identification:
> puts "[code_info]"
> set name  "aggregation"
> set ident "_s1"
> set u_length 1
> set u_time 1
> set u_energy 1
> set u_mass 1
> #
> set vmd_output "yes"
> 
> # System parameters
> #############################################################
> # Set up no. of particles and box based on volume fraction  #
> #############################################################
> # Set particle characteristics, then scale into appropriate units
> set n_part 1000
> set part_r 1
> set part_r [expr $part_r*$u_length]
> set part_vol [expr 4.0*3.141592654*$part_r*$part_r*$part_r/3.0]
> set part_density [expr 1*$u_mass/($u_length*$u_length*$u_length)]
> set part_mass [expr $part_density*$part_vol]
> #
> 
> set vol_frac 0.04
> set cellvol [expr $n_part*$part_vol/$vol_frac]
> set box_l [expr pow($cellvol,1./3.)]
> setmd box_l $box_l $box_l $box_l
> setmd periodic 1 1 1
> 
> puts "Simulate colloid N=$n_part at volume fraction $vol_frac"
> puts "Cubic simulation box with side length = $box_l"
> 
> # set initial positions of particles randomly
> #############################################
> set q 0; set type 0
> for {set i 0} { $i < $n_part } {incr i} {
>    set posx [expr $box_l*[t_random]]
>    set posy [expr $box_l*[t_random]]
>    set posz [expr $box_l*[t_random]]
>    part $i pos $posx $posy $posz q $q type $type mass $part_mass
> }
> 
> prepare_vmd_connection
> 
> # Interaction parameters (repulsive Lennard Jones)
> #############################################################
> 
> #set lj1_eps     1.0
> #set lj1_sig     1.0
> #set lj1_cut     1.12246
> #set lj1_shift   [calc_lj_shift $lj1_sig $lj1_cut]
> 
> set lj1_eps     4.0
> set lj1_sig     2.0
> set lj1_cut     5.00
> set lj1_shift   [calc_lj_shift $lj1_sig $lj1_cut]
> 
> # Integration parameters
> #############################################################
> 
> setmd time_step 0.01
> setmd skin      0.4
> thermostat langevin 1.0 1.0
> 
> # warmup integration (with capped LJ potential)
> set warm_steps   300
> set warm_n_times 30
> # do the warmup until the particles have at least the distance min__dist
> set min_dist     2.1
> 
> # integration
> set int_steps    1000
> set int_n_times  100
> 
> # Other parameters
> #############################################################
> set tcl_precision 6
> 
> #############################################################
> #  Setup System                                             #
> #############################################################
> 
> # Interaction setup
> #############################################################
> 
> #setmd box_l $box_l $box_l $box_l
> 
> inter 0 0 lennard-jones $lj1_eps $lj1_sig $lj1_cut $lj1_shift 0
> 
> #setmd max_num_cells 2744
> 
> #############################################################
> #  Warmup Integration                                       #
> #############################################################
> 
> 
> 
> #open Observable file
> set obs_file [open "$name$ident.obs" "w"]
> puts $obs_file "\# System: $name$ident"
> puts $obs_file "\# Time\tE_tot\tE_kin\t..."
> 
> puts "\nStart warmup integration:"
> puts "At maximum $warm_n_times times $warm_steps steps"
> puts "Stop if minimal distance is larger than $min_dist"
> 
> set act_min_dist [analyze mindist]
> puts "** Starting minimum distance = $act_min_dist"
> 
> 
> # set LJ cap
> set cap 20
> inter ljforcecap $cap
> set act_min_dist 0
> 
> # Warmup Integration Loop
> set i 0
> while { $i < $warm_n_times && $act_min_dist < $min_dist } {
> 
>      integrate $warm_steps
> 
>      # Warmup criterion
>      set act_min_dist [analyze mindist]
>      puts -nonewline "run $i at time=[setmd time] (LJ cap=$cap) min dist 
> = $act_min_dist\r"
>      flush stdout
> 
> #   write observables
>      puts $obs_file "{ time [setmd time] } [analyze energy]"
>      imd positions
> 
> #   Increase LJ cap
>      set cap [expr $cap+10]
>      inter ljforcecap $cap
>      incr i
> }
> 
> # Just to see what else we may get from the c code
> puts "\nro variables:"
> puts "cell_grid     [setmd cell_grid]"
> puts "cell_size     [setmd cell_size]"
> puts "local_box_l   [setmd local_box_l]"
> puts "max_cut       [setmd max_cut]"
> puts "max_part      [setmd max_part]"
> puts "max_range     [setmd max_range]"
> puts "max_skin      [setmd max_skin]"
> puts "n_nodes       [setmd n_nodes]"
> puts "n_part        [setmd n_part]"
> puts "n_part_types  [setmd n_part_types]"
> puts "periodicity   [setmd periodicity]"
> puts "transfer_rate [setmd transfer_rate]"
> puts "verlet_reuse  [setmd verlet_reuse]"
> 
> # write parameter file
> polyBlockWrite "$name$ident.set" {box_l time_step skin} ""
> 
> #############################################################
> #      Integration                                          #
> #############################################################
> puts "\nStart integration: run $int_n_times times $int_steps steps"
> 
> inter ljforcecap 0
> 
> puts [analyze energy]
> 
> set j 0
> for {set i 0} { $i < $int_n_times } { incr i} {
> 
> 
> #    puts -nonewline "run $i at time=[setmd time] "
> 
>      integrate $int_steps
>      if { $vmd_output=="yes" } { imd positions }
> #   write observables
>      set energies [analyze energy]
>      set clusters [analyze aggregation 4.0 1 3 ]
>      puts $obs_file "{ time [setmd time] } $energies"
>      puts -nonewline "temp = [expr [lindex $energies 1 
> 1]/(([degrees_of_freedom]/2.0)*[setmd n_part])]\r"
>      flush stdout
> 
> #   write intermediate configuration
>      if { $i%10==0 } {
>       polyBlockWrite "$name$ident.[format %04d $j]" {time box_l} {id pos type}
>       incr j
>      }
> }
> 
> # write end configuration
> polyBlockWrite "$name$ident.end" {time box_l} {id pos type}
> 
> close $obs_file
> 
> puts clusters
> 
> # terminate program
> puts "\n\nFinished"
> exit
> 
> ---
> 
> Dr. Steven R. Kirk           <address@hidden, address@hidden>
> Dept. of Technology, Mathematics & Computer Science  (P)+46 520 223215
> University West                                      (F)+46 520 223299
> Trollhattan 461 86 SWEDEN                     http://beacon.webhop.org
> 
> _______________________________________________
> ESPResSo mailing list
> address@hidden
> https://fias.uni-frankfurt.de/mailman/listinfo/espresso
> 

-- 
________________________________________________________
Mehmet Sayar - Assist. Prof.  Koc University
Email:address@hidden        Dept. Mechanical Eng.
Phone:+90-212-338-1840        Rumelifeneri Yolu, Sariyer
Fax:  +90-212-338-1548        34450 Istanbul, Turkey





reply via email to

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