Forum Replies Created
-
AuthorPosts
-
Jeremie AllardBlocked
Hello,
The addTetra method should only be used before the components are initialized (i.e. the init() methods are called).
If you want to dynamically update the topology once the simulation is initialized they you should use the TetrahedronSetTopologyModifier::addTetrahedra() method (and similar methods to remove the previous ones, add/remove points, …).
After you finished all your changes, you should also call the methods notifyEndingEvent() followed by propagateTopologicalChanges().
By using these methods as well as the Tetra2TriangleTopologicalMapping that Froy indicated, then you should see the collision mesh being correctly updated.Jeremie.
Jeremie AllardBlockedHello,
TriangularFEMForceFieldOptim and FastTriangularBendingSprings do support dynamic topologies, however the topological changes must be sent in the proper way (trough the TopologyModifier component or using a topological mapping). Using a component like BoxROI to create a dynamically changing subset of a topology and linking it directly to the TopologyContainer triangles Data is not valid. It will partially work for some components but not all of them (and quite a few important things can go wrong, like the list of edges of the topology that will not be correctly updated).
The cleanest way to do what you are trying is to code a new component “DynamicSubsetTopologyMapping” that unlike SubsetTopologyMapping do not consider the requested subset as static but detect changes to it (triangles added or removed since the last time step) and infers the required topological change events such that all components can take the new topology into account.
A much simpler but dirty way would be to add an optional triangleIndices vector Data in the forcefield(s) you want to use and let them loop on this subset instead of the full topology.I hope this helps,
Jeremie.
-
AuthorPosts