espressomd-users
[Top][All Lists]
Advanced

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

Re: [ESPResSo-users] OIF, deviation in "origin"-command


From: Ivan Cimrak
Subject: Re: [ESPResSo-users] OIF, deviation in "origin"-command
Date: Tue, 25 Feb 2014 15:14:20 +0100
User-agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

Dear Markus,

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.

Ivan

Dňa 25.2.2014 15:02 Wink, Markus wrote / napísal(a):

Dear all,

 

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]

puts $x

 

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:

1)    The source code is correct and the deviation results because of rounding errors

2)    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.

3)    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?

 

Greetings

 

Markus Wink



reply via email to

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