espressomd-users
[Top][All Lists]
Advanced

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

Re: [ESPResSo-users] Virtual sites and topology


From: Axel Arnold
Subject: Re: [ESPResSo-users] Virtual sites and topology
Date: Fri, 10 Apr 2015 22:32:50 +0200

Hi Aleksei,

just noticed that the users’  guide is not correct. You actually need to run

analyze set {mol_type1 part1 part2…} {mol_type2 part1 part2…}

so in your case e.g.

analyze set "0 0 1 2 3 4” "0 5 6 7 8 9”

assuming that both molecules are of the same “type” (which only plays a role in undocumented analysis functions like pressure_mol).

That also explains the strange behavior you observe:

analyze set 0 "0 1 2 3 4" 1 "5 6 7 8 9”

leads to two four molecules of types 0, 0, 1, and 5, where particles 1 2 3 4 belong to the 2nd molecule (hence get id=1), and particles 6 7 8 9 belong to the 4th molecule (hence get id=3). Particles 0 5 don’t belong to any molecule and therefore keep the assigned mol_ids 0 and 1.

Note that you don’t need the topo part sync if you set the mol_ids manually. The problem was rather that the analyze set wasn’t what the code expects. If you fix that, it should work also without the topo part sync.

Best,
Axel

Am 10.04.2015 um 12:19 schrieb Aleksei Kabedev <address@hidden>:

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.

On 9 April 2015 at 20:11, Axel Arnold <address@hidden> wrote:
Hi!

Am 06.04.2015 um 17:26 schrieb Aleksei Kabedev <address@hidden>:
2) how the "analyze set topo_part_sync" works? I honestly tried to understand the principle from the code, but it is not trivial at all.

There are several positions in Espresso, where the topology is stored:

- the pretty historic “chain” topology that is only used in analysis ("analyze set chains"). You can’t use this for defining COM groups.

- the generic information stored in the global variable topology, which you set via “analyze set”.

- the mol_id that is attached to each particle.

The virtual sites code uses both last two information sources. More precisely, it uses the mol_id of the virtual particles to determine the particle group of which it should be the center of mass. The information in “topology” is then used to determine the particles that belong to this molecule. As you see, it is pretty vital that those two information sources are consistent; in particular, there needs to be a molecule in “topology” with id equal to the mol_id of each virtual particle.

As described in the users’ guide, you first define the topology using “analyze set {mol_id {member member …} …}”. Then you need to update the mol_ids of at least the virtual particles to match the topology. That can be achieved either manually, or by calling “analyze set topo_part_sync”, since the virtual particle should also be contained in the member list.

So, what topo_data_sync does is simply looping over all molecules, and then over all particles in this molecule in order to overwrite the particles mol_id with the molecules mol_id.

If you see strange mol_ids, that means that your topology definition is wrong. To see what is not working there, you would need to send us the output of “analyze set” and the particles’ mol_ids after topo_part_sync.

Best,
Axel

------------------------------------------------
Dr. Axel Arnold
ICP, Universität Stuttgart
Allmandring 3
70569 Stuttgart, Germany
Email: address@hidden
Phone: +49 711 685 67609

--------------------------------------------
Axel Arnold
Martha-Schmidtmann-Str. 7
70374 Stuttgart, Germany
Email: address@hidden
Phone: +49 173 870 6659




--

Kind regards,
Aleksei Kabedev
<Virt_part_COM_of_chains.tcl>

--------------------------------------------
Axel Arnold
Martha-Schmidtmann-Str. 7
70374 Stuttgart, Germany
Email: address@hidden
Phone: +49 173 870 6659


reply via email to

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