Forum Replies Created
-
AuthorPosts
-
Hugo
KeymasterHi @krewcunc
Thanks for pointing out this issue of template recognition in mappings. I get it as well. Could you create an issue on GitHub point this and adding damienmarchal as well ?
Best,
Hugo
Hugo
KeymasterHi @fleonard
Welcome on the SOFA forum!
If you want different object to have different physical properties, it’s compulsory to have separate meshes. BestHugo
11 April 2019 at 19:05 in reply to: [SOLVED] Programmatically create RigidMapping between MechanicalObject and VisualModel #13403Hugo
KeymasterHi @faichele
Long time no see on the forum 😉
I think this comes from the template. We recently worked on homogeneizing the use of double vs float. Therefore I think that the problem comes from the RigidMapping which should be templated on> Let me know if this first hint is a good one.
BestHugo
Hugo
KeymasterThanks @bmarques for the feedback.
@gaetan, the forum is an international tools used by the entire community. Therefore it’s more convenient for everyone to ask questions and reply in English so that the solutions, advises can benefit our worldwide community.Happy to see you and the Epione team back to simulation business. Never hesitate to ask further SOFA questions. We are always here for you!
Best
Hugo
Hugo
KeymasterHi @outtt
I saw this morning a video about wire simulation for possible suture in a SOFA company, but this will remain private for the moment. If such a technology gets open-source, I will warn the entire community, you especially.
I will close this topic for now, if it’s fine for you.
Best wishes,Hugo
Hugo
KeymasterHi @minhtruong
By looking to this article, it seems that VStudio iterator debug level has default value. It might conflict with the level of boost. You should make both match.
Let us know if it helps.
Best
Hugo
Hugo
KeymasterHi @simoncic
I never used both FixedConstraint and LinearMovementConstraint together on the same nodes myself. It does not seem to work. Here is an example on mechanics:
<Node name="root" dt="0.01" gravity="0 0 0"> <Node name="Particle" > <EulerImplicitSolver /> <!-- <EulerExplicitSolver /> --> <CGLinearSolver iterations="200" tolerance="1e-06" threshold="1e-06"/> <MechanicalObject template="Rigid" name="myParticle" position="0 0 0 0 0 0 1 1 0 0 0 0 0 1" showObject="1" /> <UniformMass totalMass="1" /> <ConstantForceField force="1 0 0 0 0 0" /> <LinearMovementConstraint indices="0" keyTimes="0 2 10 40 50" movements="0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 -1 0 0 0 1 0 0 -1 0 0 0 1 0 0 0 0 0 0 1" /> <FixedConstraint indices="0" /> </Node> </Node>
It is doable to make such a first simplistic simulation. To enforce the temperature at some nodes, a solution would be to use a FixedConstraint and modify the temperature on the fly with Python. For modeling a heat source, since it is comparable to a force, a ConstantForceField could be used for a constant flux (it is just a nodal force, not integrated in the volume).
I am following a starting project (for which I wrote you an email) on thermal simulation. We have some private codes for this, and I think it could be a nice collaboration. I stay at your disposal to chat further if needed.
Best
Hugo
Hugo
KeymasterHi @minhtruong
I can’t see your error.
I would recommend to clean the CMake, reconfigure, generate, and recompile everything in Release. If you still have a compilation error, please post it fully.Best
Hugo
Hugo
KeymasterHi @simoncic
The FixedConstraint actually enforces the derivative in time of the DOFs (derivative of temperature) to be zero. So it is a fixed temperature:
where i corresponds to the indices. These indices are defined by a BoundingBox (box-cold).
The LinearMovementConstraint enforces temperature (and not the derivatives) to linearly evolve in time (keyTimes): e.g. between t=[0.005-0.006] the temperature linearly evolves between T=0 and T=1
To constrain the partial derivative of the temperature, you define the initial desired temperature and use the FixedConstraint to keep it constant. If you want to have a specific heat source, especially if you want to integrate it in space, it could be done as a ForceField if I understood your question correctly.
Can you give us more insight about the strong form of the differential equation you want to solve?
Best,
Hugo
Hugo
KeymasterHi @fayad
For sure, the reference paper is not this one (too old).
The simplest way to do is to reference the main SOFA paper: SOFA: A Multi-Model Framework for Interactive Physical SimulationThis plugin was also recently updated by Erik Pernod from InfinyTech3D
Best wishes,
Hugo
Hugo
KeymasterHi @krewcunc
I don’t if this topic is still a bottleneck for your work (it appears from your other post that it isn’t).
But the problem of template comes from the fact that Rigid and Vec3 are really different since they do not include the same nb of degrees of freedom (DOFs) at each vertex. Vec3d has 3 double per node whereas Rigid3d has (x,y,z)+quaternion so 7 DOFs per node. The IdentityMapping works since there might be a hack to ease the mapping between the two templates and keep only the position information and remove the orientation.
About the BeamLinearMapping, I never used this class myself. I don’t really know the level or realism we can expect from it..
Hope this helps
Hugo
Hugo
KeymasterHi @minhtruong
You are compiling SOFA in debug.
Please rather use the option CMAKE_BUILD_TYPE=ReleaseHugo
Hugo
KeymasterHi @fayad
Damned. I designed the scene without a Geomagic, since I don’t have one myself.
Strange that it does not work. I will need more time to find a Geomagic and get back to you.Best wishes,
Hugo
Hugo
KeymasterIndeed @simoncic
You perfectly understood it.
I am currently working on explaining these parts on the documentation. This will come soon (after the recent new doc theoretical page about integration using FEM).
All ForceFields are components that are adding forces. In continuum mechanics, these forces can be either internal or external forces. Internal forces corresponds to the effect of the soft body mechanics (elasticity, plasticity etc) and the external forces arise from external phenomenon (gravity, pressure etc).
In thermodynamics, all effects like diffusion, metabolic heat etc can be considered as ForceFields as well.
For your information tags, can be useful when you browse the graph and look for one specific component: for instance find one specific ForceField in the scene of there is several of them. It is mainly (but not limited to) used by solvers.
We would be glad to see new contributions in the thermodynamic field. Let us know whether you need more help.
Hope this helps.Best wishes,
Hugo
Hugo
KeymasterHi @krewcunc (works well for a forum pseudo!)
The issue comes from your DefaultContactManager.
The implementation defaultLMConstraint is deprecated, not LM are solved in another way (see the LM constraint doc page). We will therefore remove them from the options. Thanks for the notice, I create an issue on the topic.In your case, using:
<DefaultContactManager name="CollisionResponse" response="FrictionContact"/>
should solve the issue.
Best wishes,Hugo
Hugo
KeymasterHI @zliu157
Two things came to my mind:
– first what are your units, what is the dimension of your mesh?
– regarding the Attach constraint, you should activate the option twoWay : if you want to the attach constraint to propagate forces on both objects.Best
Hugo
Hugo
KeymasterHi @simoncic
The Constraint used in the TetrahedronDiffusionFEMForceField.scn are actually constraints on the temperature DOF. The FixedConstraint forces the temperature to remain constant, while the LinearMovementConstraint forces the evolution of temperature (at the head of the raptor).
I am not sure to understand your question “Where we actually define that diffusion equation should be used?”.
The TetrahedronDiffusionFEMForceField implements the diffusion, i.e. the Laplacian on the temperature field.
About the tags, it does not matter in this scene.Best
Hugo
Hugo
KeymasterHi @minhtruong
Did you read my previous post?
–> It appears that it could be related to a mix between 32 and 64 bit version of libraries. I think you installed a 32bit version of either Visual or boost, while your Windows should be a 64bit.Best
Hugo
29 March 2019 at 21:32 in reply to: Rotating an object with an angular velocity and conserving collisions #13296Hugo
KeymasterHi @chrissim
Sorry for the delay.
Here were my files (one is *.scn the other is *.py) it should fit your needs.Scene (xml):
<?xml version="1.0" ?> <Node name="root" dt="0.01" gravity="0 0 0"> <VisualStyle displayFlags="showForceFields showCollisionModels showBehaviorModels" /> <RequiredPlugin name="SofaPython" pluginName="SofaPython" /> <CollisionPipeline /> <BruteForceDetection /> <DefaultContactManager /> <MinProximityIntersection alarmDistance="0.4" contactDistance="0.2" /> <DefaultCollisionGroupManager /> <Node name="ParticleControl" > <TransformEngine template="Rigid3d" name="engine" input_position="0 0 0 0 0 0 1" /> <EulerImplicitSolver name="EulerImplicit" rayleighStiffness="0.1" rayleighMass="0.1" /> <CGLinearSolver name="CG Solver" iterations="25" tolerance="1e-5" threshold="1e-5"/> <MechanicalObject template="Rigid3d" name="myRigidParticleForRotation" position="@engine.output_position" showObject="true" showObjectScale="0.1"/> <Node name="Plane"> <EulerImplicitSolver name="EulerImplicit" rayleighStiffness="0.1" rayleighMass="0.1" /> <CGLinearSolver name="CG Solver" iterations="25" tolerance="1e-5" threshold="1e-5"/> <RegularGrid name="loader" nx="5" ny="5" nz="1" xmin="0" xmax="1" ymin="0" ymax="1" zmin="0" zmax="1" position="@mObject1.position" drawHexahedra="true"/> <MechanicalObject template="Vec3d" name="mObject1" showObject="true" showObjectScale="3"/> <UniformMass template="Vec3d" totalMass="1"/> <MeshSpringForceField template="Vec3d" name="forcefield" linesStiffness="10" /> <BoxROI name="Box" box="-0.1 -0.1 0 1.1 1.1 0" drawBoxes="true"/> <PairBoxROI name="PairBox" inclusiveBox="-0.1 -0.1 0 1.1 1.1 0" includedBox="0.4 0.4 0 0.6 0.6 0"/> <SphereModel radius="0.1"/> <RigidMapping input="@.." output="@." /> <!-- <AffineMovementConstraint name="bilinearConstraint" template="Vec3d" indices="@Box.indices" meshIndices = "@PairBox.indices" rotation="[07 -07 7,0.7 0.7 0,0 0 1]" drawConstrainedPoints="1"/> --> </Node> </Node> <Node name="CubeSphere"> <EulerImplicitSolver name="EulerImplicit" rayleighStiffness="0.1" rayleighMass="0.1" /> <CGLinearSolver name="CG Solver" /> <MechanicalObject name="Particles" template="Vec3d" position="0 0 1 1 0 1 0 1 1 1 1 1 0 0 2 1 0 2 0 1 2 1 1 2" translation="-2 0 -1" /> <MeshTopology name="Topology" hexas="0 4 6 2 1 5 7 3" /> <UniformMass name="Mass" totalMass="1" /> <FixedConstraint fixAll="true"/> <MeshSpringForceField name="Springs" stiffness="100" damping="1" /> <SphereModel name="Spheres Cube" radius="0.4" /> </Node> <PythonScriptController name="angularVel" filename="angularVel.py" classname="rotate"/> </Node>
Associated python script:
import Sofa import sys class rotate(Sofa.PythonScriptController): # optionnally, script can create a graph... def initGraph(self,node): nodeParticle = node.getChild('ParticleControl') self.engine = nodeParticle.getObject('engine') return 0 def onBeginAnimationStep(self,dt): # adding at each time step a rotation angle in x (Euler angle) of 5 degree rotation = self.engine.findData('rotation').value rotation[0][0] = rotation[0][0] + 5 print rotation[0][0] self.engine.findData('rotation').value = rotation return 0
Let me know if it helps.
BestHugo
Hugo
KeymasterDear @mlin
The “plane” datafield that you show is the indices of the slices you want to show in the different directions (transverse, coronal, sagittal). What is your issue exactly? what do you want to visualize ?
Hugo
KeymasterHugo
KeymasterHi @simoncic
The StiffSpringForceField inherits from the SpringForceField where you can see the definition of this “spring” option (in LinearSpring). It corresponds to a vector (each spring can therefore be different from another) of 5 variables:
- indice of 1st extremity of spring
- indice of 2nd extremity of spring
- stiffness
- damping
- rest length
For instance:
spring="0 9 100 5 3.5 1 10 500 5 3.5 2 11 500 5 3.5 ... "
You can find an example in examples/Components/forcefield/StiffSpringForceField.scn
I hope this helps.
BestHugo
-
AuthorPosts