Forum Replies Created
-
AuthorPosts
-
robBlocked
The following items from your example are clearly missing from my code:
root.meca.createObject('TetrahedronSetTopologyContainer', name='Container') root.meca.createObject('TetrahedronSetTopologyModifier') root.meca.createObject('TetrahedronSetTopologyAlgorithms')
If I just add them in I now get an error on loading the scene:
[ERROR] [TetrahedronHyperelasticityFEMForceField(FEM)] ERROR(TetrahedronHyperelasticityFEMForceField): object must have a Tetrahedral Set Topology.
In your example you use a Hexa2TetraTopologicalMapping whereas I thought I was already loading my object as tetras so don’t know whether I need a mapping or if not then what I need to do…
robBlockedNo specific warnings are shown in the console. The MacOS crash dump report that appears shows the stack location as:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libSofaMiscFem.19.06.99.dylib 0x000000010117fe2c sofa::component::forcefield::TetrahedronHyperelasticityFEMForceField<sofa::defaulttype::StdVectorTypes<sofa::defaulttype::Vec<3, double>, sofa::defaulttype::Vec<3, double>, double> >::updateTangentMatrix() + 1132 1 libSofaMiscFem.19.06.99.dylib 0x000000010117f816 sofa::component::forcefield::TetrahedronHyperelasticityFEMForceField<sofa::defaulttype::StdVectorTypes<sofa::defaulttype::Vec<3, double>, sofa::defaulttype::Vec<3, double>, double> >::addDForce(sofa::core::MechanicalParams const*, sofa::core::objectmodel::Data<sofa::helper::vector<sofa::defaulttype::Vec<3, double>, sofa::helper::CPUMemoryManager<sofa::defaulttype::Vec<3, double> > > >&, sofa::core::objectmodel::Data<sofa::helper::vector<sofa::defaulttype::Vec<3, double>, sofa::helper::CPUMemoryManager<sofa::defaulttype::Vec<3, double> > > > const&) + 310
Your example Python scene works perfectly on my build of SOFA. I will try to understand the differences between the two.
Thank you.
robBlockedHere is the code with the commented-out previous force-field and the new one. I’ve put the calculations in as you typed them, so hopefully they are correct. The Young’s Modulus and Poisson Ratio I had been using I had arrived upon through trial and error.
young_modulus = 2 poisson_ratio = 0.35 # pouch.createObject('TetrahedronFEMForceField', template='Vec3d', # name='FEM', method='large', # poissonRatio = poisson_ratio, # youngModulus = young_modulus, # drawAsEdges="true") mu = young_modulus / (2. * (1. + poisson_ratio)) lm = young_modulus * poisson_ratio / ((1. + poisson_ratio) * (1. - 2.*poisson_ratio)) print(young_modulus, poisson_ratio, "->", mu, lm) pouch.createObject('TetrahedronHyperelasticityFEMForceField', name = "FEM", ParameterSet = [ mu, lm ], AnisotropyDirections = "0 1 0", materialName = "StVenantKirchhoff" )
I just get a SEGV on a single step, both from the SOFA I compiled on my MacBook and also the pre-compiled version I downloaded for the soft robotics toolkit (SOFA_v19.06.99_custom_MacOS_v11).
Have tried setting the AnisotropyDirections to all-zeros but the same SEGV.
Also changing the timestep to 0.5, 0.05, or 0.0001 all resulted in similar crashes.
Any ideas welcome!
robBlockedHi J-N,
Many thanks for your suggestion.
I have tried replacing my force-field with this, based on your XML:
pouch.createObject(‘TetrahedronHyperelasticityFEMForceField’, name = “FEM”,
ParameterSet = “3448.2759 31034.483”,
AnisotropyDirections = “0 1 0”,
materialName = “StVenantKirchhoff”)However on a “Step” in SOFA I manage to crash the whole program. Obviously I’m doing something a little wrong… am I transliterating the XML->Python too naively?
robBlockedIn case it’s helpful all my current experimental files are here:
https://drive.google.com/drive/folders/16M5DWp_7wWsTHtN3fDrcyuwlKBUwbuKp?usp=sharing
I tried changing from “large” to “small” and that caused over-expansion of the structure with almost no deformation of the rectangular perimeter.
robBlockedHi Hugo, many thanks for your reply.
The material I had in mind would be similar to the outer material of the inflatable kayak I have from Decathlon! For example: Decathlon Inflatable Kayak.
The idea was to have a flat envelope-like rectangular pouch which when inflated would take on a cylindrical shape. For the most part this works well but I see less contraction of the long edges of the envelope than expected. My guess is that the material is stretching a bit.
I will take a look at the “method” as you recommend.
Thank you.
robBlockedThe image doesn’t show in my browser for some reason, this is the link:
https://drive.google.com/file/d/1t773EuSgLepP9Km8OY_8dBufXI-uwrYa/view?usp=sharing
robBlockedAs my actual objective is to build simulations of inflatable objects I tried out a scene linked to from a recently active thread on that subject (sources here: https://github.com/ALFsarah/SOFA-cube-pneumatic-actuator).
The “Visual” part of the view filled the entire SOFA display window, but the “Behaviour” cube is shown down in the bottom-left quarter of the display. My own demo script has no “Visual” nodes yet so I hadn’t realised this difference yet.
Does this suggest what might be happening?
Many thanks.
robBlockedHi, many thanks for the quick response.
With “runSofa -g qglviewer XYZ.pyscn” I get the same quarter-display. The only possibly relevant information in the stdout is:
The constructor with a QGLFormat is deprecated, use the regular contructor instead.
Within the GUI if I use the View menu to switch to OpenGL then the whole simulation window becomes black. This seems to be because the zoom is increased massively, my object can be “recovered” by zooming out. In this case the following is printed out in the terminal:
QtViewer: OpenGL 2.1 ATI-3.2.29 context created.
Many thanks
-
AuthorPosts