Home › Forum › SOFA › Using SOFA › [SOLVED] Issue with initializing StiffSpringForceFied
Tagged: 64_bits, MacOS, SOFA_1806, StiffSpringForceFied
- This topic has 11 replies, 4 voices, and was last updated 5 years, 9 months ago by Damien Marchal.
-
AuthorPosts
-
10 January 2019 at 09:25 #12751pvillardBlocked
Dear SOFA community,
In 2015, I was using the “fileSprings” field of StiffSpringForceField to initialize Ks, Kd and the rest length with a Xsp file. It doesn’t seem to work anymore.
It seems that all the data should already be in the scn file now.How can I ask to automatically initialize Ks, Kd and the rest length based on the mass positions, the global damping and stiffness?
Thank you for any help,
Pierre
10 January 2019 at 19:18 #12758HugoKeymasterDear PF,
after a quick check (SpringForceField.inl line 67), it appears that it is still possible to use “fileSprings” or “filename” to initialize Ks, Kd and the rest length with a Xsp file.
Can you share some examples /files ?Hugo
11 January 2019 at 10:16 #12762pvillardBlockedHi Hugo,
Thank you very much. That is certainly a good news for us.
The (old) file we are using within “fileSprings” is as follow:Xsp 4.0
192 154
mass 1 2 -0.063426 -0.041312 0.016529 0.000000 0.000000 0.000000 1.000000 1.000000
mass 2 2 -0.060689 -0.042977 0.019700 0.000000 0.000000 0.000000 1.000000 1.000000
mass 3 2 -0.060672 -0.043119 0.020056 0.000000 0.000000 0.000000 1.000000 1.000000
mass 4 2 -0.060659 -0.029742 0.021890 0.000000 0.000000 0.000000 1.000000 1.000000
…
lspg 1 45 19 100.000000 0.100000 -1.000000
lspg 2 19 4 100.000000 0.100000 -1.000000
lspg 3 73 48 100.000000 0.100000 -1.000000
lspg 4 48 10 100.000000 0.100000 -1.000000
…Best,
PF
11 January 2019 at 10:45 #12763HugoKeymasterHi PF,
How does this look into your simulation scene ?
11 January 2019 at 11:49 #12770darynapBlockedHi Hugo,
Here are the messages we get :
[WARNING] [MassSpringLoader] Unable to process Xsp command ‘lspg’
[ERROR] [MassSpringLoader] Unable to load punctual masses from file. Either the file is broken or is a file describing a rigid object.Daryna
11 January 2019 at 18:28 #12776HugoKeymasterCould you please share the scene and associated files with us?
In case you do not want to make it public, send them to me in private. Thanks.Hugo
15 January 2019 at 11:01 #12787darynapBlocked16 January 2019 at 13:10 #12788Damien MarchalBlockedHi all,
I remember to have refactor the loader some time ago. I just quickly looked into it and it definitely should understand xsp 4.0 format and the lspg tag. As this seems related to a possible bug/regression, I opened an issue for this on github.
4 February 2019 at 18:06 #12985darynapBlockedHi all,
Is there any news on the issue with MassSpringLoader (https://github.com/sofa-framework/sofa/issues/895) ?
Thank you in advance,
Daryna5 February 2019 at 15:47 #13001Damien MarchalBlockedHi Daryna, hi Pierre,
I’m looking in the code base right now.
And I wonder if you are sure of the file you were using ?
By reading the Sofa source code I noticed several things:
Whatever Xsp 3.0 or 4.0 to specify the number of springs & masses it is neede to use these keywords:Xsp 3.0 numm 2 nums 3 ...
Then with Xsp 3.0 format the expected format is:
lspg 1 45 19 100.000000 0.100000 -1.000000
But with Xsp 4.0 you have more parameters like that:
lspg 1 45 19 100.000000 0.100000 -1.000000 0.0 0.0 0.0
I don’t know a lot about Xsp so I wonder if the code base (or the file format) has changed since last time you use it or if you made a mistake in your Xsp file.
Do you have any ideas ?
Damien.
7 February 2019 at 10:49 #13012pvillardBlockedHi Damien,
Adding numm and nnumms before the numbers of mass and spring did the trick.
For some reason, this Xsp file was working fine on my previous version of SOFA without adding the numm and nnumms keywords.
Thank you very much!
Pierre
7 February 2019 at 10:57 #13013Damien MarchalBlockedHi Pierre,
Good to hear, and feel free to ask when you have questions or see bugs or behavior change in Sofa.
These feedback are really useful to improve our code base.
Damien.
-
AuthorPosts
- You must be logged in to reply to this topic.