
jjcasmar replied to the topic Non linear implicit solver in the forum Programming with SOFA 2 months, 1 week ago
I think this solves all the issue.
I think you did a small typo in
root.object2.mo.position += root.object1.mo.dx
right? 
jjcasmar replied to the topic Non linear implicit solver in the forum Programming with SOFA 2 months, 1 week ago
I think I still have one doubt.
From Caribou
`
// Updating the geometry
x.peq(dx); // x := x + dx// Solving constraints
// Calls “solveConstraint” method of every ConstraintSolver objects found in the current context tree.
// todo(jnbrunet): Shouldn’t this be done AFTER the position propagation of the…[Read more] 
jjcasmar replied to the topic Compute forces programatically in the forum Programming with SOFA 2 months, 1 week ago
So I still need to update the mapping to propagate the positions, right?

jjcasmar replied to the topic Non linear implicit solver in the forum Programming with SOFA 2 months, 1 week ago
Great, that is what I was looking for.
So if I understand correctly,
1) Compute forces and current error to bootstrap the solver
2) Compute a dx
3) Compute x as x0 + dx
4) Propagate this changes through the graph usingMechanicalPropagateOnlyPositionAndVelocityVisitor
5) Recompute forces, now in the new state
6) RepeaSomewhere between 4 and 5,…[Read more]

jjcasmar replied to the topic Compute forces programatically in the forum Programming with SOFA 2 months, 1 week ago
the
mop.computeForce
takes care of updating the mappings in both directions? 
jjcasmar started the topic Compute forces programatically in the forum Programming with SOFA 2 months, 2 weeks ago
I want to debug some forces on the initial state of the simulation. What I am doing right now is set the dt to 0 and do a step, that way the correct visitors are launched and the forces are computed, but looks like a hack.
What is the correct way to ask SOFA to compute force? I guess that I will also need to apply mappings before computing…[Read more]

jjcasmar started the topic Non linear implicit solver in the forum Programming with SOFA 2 months, 2 weeks ago
I have looked at the EulerImplicitSolver and it only does a Newton step integration. I am trying to implement a version of it doing several Newton steps for integrating more complex energies and systems but I am stuck on the design of it.
Normally, when I do this kind of solvers outside of SOFA, I implement a solve very similar to what…[Read more]

jjcasmar replied to the topic Doubts about how ForceField and mapping interact in the forum Programming with SOFA 3 months, 2 weeks ago
Sorry, cant share the scene description right now. Ill do it ASAP.
One thing I normally dont have clear if is I have to add the kFactor or dt on the computations and also the sign of the result.
For example, if used in a EulerImplicit solver, the force is multiplied by the dt and the hessian is multiplied by dt+beta value (or something like…[Read more]

jjcasmar replied to the topic Adding new template for MechanicalObject in the forum Programming with SOFA 3 months, 2 weeks ago
@Froy can you provide a bit more details or documentation on how to do this? I am trying to mimic what I see in other types, but I fail to actually make it work. I am having linking errors when I try to load my plugin.
[Read more]
[ERROR] [PluginManager] Plugin loading failed (/home/jjcasmar/projects/VNCSSofaPlugin/build/Debug/lib/libVNCSSofaPlugin.so):… 
jjcasmar started the topic Doubts about how ForceField and mapping interact in the forum Programming with SOFA 3 months, 2 weeks ago
I am implementing a Mapping that, given my degress of freedom, computes the deformation gradient. Then I have an energy that depends on the deformation gradient. With this scheme, I have some doubts.
First of all, the math for this scheme would be
`
u = DoF
F = g(u) // Deformation gradient is a function of the DoF
E = e(F) // Energy is a…[Read more] 
jjcasmar started the topic Unable to assign rest_position to MO in SofaPython3 plugin in Debug mode in the forum Programming with SOFA 3 months, 2 weeks ago
I have compiled SOFA and SofaPython3 plugni in debug mode. In this scenario, I try to assign a numpy vector to the rest position of a mechanical object, but it fails. This is the python code I am executing:
`
xNObject = coarseObject.addChild(“xN”)
xN_mo = xNObject.addObject(“MechanicalObject”, template=”Vec1″, name=”xN_MO”)…[Read more] 
jjcasmar started the topic Adding new template for MechanicalObject in the forum Programming with SOFA 4 months, 1 week ago
I want to replicate some of the functionality in Flexible plugin, and since I havent been able to make it work properly, I am trying to add some stuff of my own. In particular, I want to add a new template for deformation gradient types (3×3, 3×2, 2×2 and 1×1 matrices) but I am not sure how to create the types so that I can do a…[Read more]

jjcasmar replied to the topic Use Eigen::SparseMatrix in SofaPython3 in the forum Programming with SOFA 4 months, 1 week ago
Thanks for the answer. I guess I will wait until that is ready and code that part in C++ for now.

jjcasmar started the topic Use Eigen::SparseMatrix in SofaPython3 in the forum Programming with SOFA 4 months, 1 week ago
Hi,
I want to use Eigen::SparseMatrix in SofaPython3 and provide it as a scipy csr sparse matrix but SOFA fails to convert it with the following error:
`
[ERROR] [SofaPython3::SceneLoader] RuntimeError: Trying to set the value of the data C, but the later hasn’t register it’s DataTypeInfo (see sofa/defaulttype/DataTypeInfo.h for more…[Read more] 
jjcasmar replied to the topic Preconditioner for an iterative solver in the forum Using SOFA 7 months, 1 week ago
Well, that depends on your preconditioner. For my particular use case, the preconditioned can be represented as a matrix, but its easier to represent it as some functions, kind of matrixfree preconditioner. I think saying that a its based on a external linear direct solver may arise to some misconceptions later. Better to just say that is has to…[Read more]

jjcasmar replied to the topic Preconditioner for an iterative solver in the forum Using SOFA 7 months, 1 week ago
Thanks Hugo. I have read the document you proposed and I think that this:
The ShewchukPCGLinearSolver allows to choose the preconditioner of our choice based on an external direct linear solver: LULinearSolver, SparseLDLSolver, etc
Is not exactly correct.From reading the source code, I think any linear solver can be used, not only direct linear…[Read more]

jjcasmar replied to the topic Preconditioner for an iterative solver in the forum Using SOFA 7 months, 2 weeks ago
So ShewchukPCGSolver is a preconditioned conjugate gradient implementation. Why is not the default CG implementation? Seems like it is a bit hidden…
If I understand correctly, I just need to provide an implementation of my preconditioner, deriving it from
sofa::core::behavior::LinearSolver
and link it to the preconditioners property, right? 
jjcasmar started the topic Preconditioner for an iterative solver in the forum Using SOFA 7 months, 3 weeks ago
I have been looking for preconditioners in SOFA but I havent been able to found any way to use them. Is there anyway to use a preconditioner or implement our own to use with the CG solver?

jjcasmar started the topic Implement a velocity constraint in the forum Programming with SOFA 8 months ago
Hi,
I am trying to implement an AngularVelocityConstraint. I am looking at the LinearVelocityConstraint for inspiration and I see that if the constraint is still active (
if(finished)...
), it applies some corrections to the positions, but if not, it doesn’t. Is this the correct behavior? Do I need to apply the constraint to both the velocity and…[Read more] 
jjcasmar replied to the topic Basic collision scene not working properly in the forum Using SOFA 9 months, 4 weeks ago
Okay, was my problem. Didnt realize the the example scene I was looking to had the fixed collider outside the scope of the ODESolver and the CGSolver. I have put my shere outside the scope of my ODESolver and now is fixed.
 Load More