One more comment, your objects should be numbered consecutively, starting from 0
Thanks a lot for the command on the numbering. That’s a very good point!
When an OIF object deforms, the origin definitely does not need to coincide with the say center of the mass.
That is true, but so far no integration has be done, so no deformation should have taken place.
Simply, the triangulation mesh given in the
$fileNodes file is not centered around the "expected" center of the sphere. Probably, the mesh generator did not produced balanced triangulation, which
is in fact not a mistake.
That is what I thought. Anyway, I have never produced a triangulation on my own. Is there any recommendation of software/literature… you could give?
[mailto:espressomd-users-bounces+address@hidden Im Auftrag von
Gesendet: Dienstag, 25. Februar 2014 15:14
Betreff: Re: [ESPResSo-users] OIF, deviation in "origin"-command
The switch "origin" in the oif_object_analyze command, computes the average of the coordinates of the current positions of the mesh points. When an OIF object deforms, the origin definitely does not need to coincide with the say center of the mass.
There is no wrong calculation in your script. Simply, the triangulation mesh given in the
$fileNodes file is not centered around the "expected" center of the sphere. Probably, the mesh generator did not produced balanced triangulation, which is in fact not a mistake.
One more comment, your objects should be numbered consecutively, starting from 0. I strongly recommend to keep this in mind. Normaly, the software should complain when you do not do this, there will be a patch on this soon.
Dňa 25.2.2014 15:02 Wink, Markus wrote / napísal(a):
I have noticed a quite strange behavior in the command “origin” for the OIF-implementation. Probably somebody can help me out with that. In my script, I have put
a sphere in a channel at a specific position. Afterwards I wanted to check, which result the command “origin” gives. The interesting parts of my scripts are:
oif_create_template template-id 0 nodes-file $fileNodes triangles-file $fileTriangles ks 10 kb 10 kv 50
oif_add_object object-id 1 template-id 0 origin 15 15 15 rotate 0 0 0 part-type 1 mass 1
set x [oif_object_analyze object-id 0 origin]
So I put the object with its origin @ 15 15 15; command “origin” prints out: 15.008655470737903 15.02980503816793 14.995383511450385
No integration of the system has be done so far.
I can think of two reasons for the deviation:
The source code is correct and the deviation results because of rounding errors
The template I have used (I used the sphere_nodes/triangles.dat found on git hub) is somehow not correct. Actually, I have noticed, that the points given do
not exactly fulfill the relation for a sphere (x^2+y^2+z^2=r^2). So it could be that the deviation origins from that artefact.
The calculations performed by the command “origin” has some error. Unfortunately, I could not locate, where the calculation is performed in the source code.
Does anyone have a clue?