Thank you for your respond, Axel.
Here is the sequence with the outputs.
I firstly perform a set of 10 polymer chains - manually or using "polymer" command.
inter 0 harmonic 10.0 2.0
part 0 pos 10 10 10 type 1 mol 0
part 1 pos 11 10 10 type 1 mol 0
part 2 pos 12 10 10 type 1 mol 0
part 3 pos 13 10 10 type 1 mol 0
part 4 pos 11.5 10 10 type 2 virtual 1 mol 0
part 0 bond 0 1
part 1 bond 0 2
part 2 bond 0 3
part 5 pos 10 15 10 type 3 mol 1
part 6 pos 11 15 10 type 3 mol 1
part 7 pos 12 15 10 type 3 mol 1
part 8 pos 13 15 10 type 3 mol 1
part 9 pos 11.5 15 10 type 4 virtual 1 mol 1
part 5 bond 0 6
part 6 bond 0 7
part 7 bond 0 8
analyze set 0 "0 1 2 3 4" 1 "5 6 7 8 9"
puts "before topo [analyze set]"
analyze set topo_part_sync
puts "after topo [analyze set]"At this stage everything seems to be fine, both "before" and "after" displays the right sets
before topo { 0 } { 0 1 2 3 4 } { 1 } { 5 6 7 8 9 }
after topo { 0 } { 0 1 2 3 4 } { 1 } { 5 6 7 8 9 }
but what we observe next is a difference between the centres of mass for types 1 and 2 and for 3 and 4 pairs, whereas it should be no difference.
set cm_1 [analyze centermass 1]
set cm_2 [analyze centermass 2]
set cm_3 [analyze centermass 3]
set cm_4 [analyze centermass 4]
for {set y 0} {$y < 3} {incr y} {
set cm1($y) [lindex $cm_1 $y]
set cm2($y) [lindex $cm_2 $y]
set cm3($y) [lindex $cm_3 $y]
set cm4($y) [lindex $cm_4 $y]
}
set dr1 [expr sqrt(pow(($cm1(0)-$cm2(0)),2) + pow(($cm1(1)-$cm2(1)),2) + pow(($cm1(2)-$cm2(2)),2))]
set dr2 [expr sqrt(pow(($cm3(0)-$cm4(0)),2) + pow(($cm3(1)-$cm4(1)),2) + pow(($cm3(2)-$cm4(2)),2))]
puts "dr1 $dr1 dr2 $dr2"
that gives us
dr1 0.7287259444221816 dr2 0.7846790353386522
dr1 0.658205988609189 dr2 0.6428438028720502
dr1 0.8662146706504111 dr2 0.5200783342353354
and so on.
So, there is smth wrong with it. After that I put the output cycle back to the topo-procedure - just before and after that.
for {set k 0} {$k <= [setmd max_part]} {incr k} {
puts [part $k print id type mol]
}
Before topo
id type mol
0 1 0
1 1 0
2 1 0
3 1 0
4 2 0
5 3 1
6 3 1
7 3 1
8 3 1
9 4 1
and that is what I supposed to get, whereas
After topo
id type mol
0 1 0
1 1 1
2 1 1
3 1 1
4 2 1
5 3 1
6 3 3
7 3 3
8 3 3
9 4 3
is different and I don't understand the nature of the new topology. And now the 9th and 4th particles are the centres of mass for the combinations of 6-7-8 and 3-2-1 particles, we lost 5 and 0. At the same time, if I don't use topo_part_sync all the numbers are correct, but the particles go crazy after the integration command and I get min_local_box_l mistake.
I do not know what exactly I have changed, but most of the time the mol-number for the 5th particle in the after topo output was 2.
Please find the code attached.