# applying force to FEM point ?

## Recommended Posts

Hi,

I would like to deform an organic tissue using some force applyed to a specific point. I have some trouble explaining it so if you can take a look to the attached file It might help understand what I'm trying to achieve.

On a simple sphere converted to organic tissue I'd like to have a point of the surface pushing toward a rivet placed on the other side of the sphere, thus deforming and pushing the sphere.

Being really new to houdini I don't know if such effect is achievable and in what ways.

If anybody has a clue on where to begin or maybe direct me to some similar post/tutorial it would help a lot !

Thanks

##### Share on other sites

If I understand it right, you should create a solid object with relatively low stiffness.

Then wire a sbd pinconstraint in dops, after the finite element solver. In that node you can select the point constrained and animate it.

I think is the simplest way.

Cheers!

##### Share on other sites

Thanks for you reply, gonna try it right away !

Yes it's definitly what I'm looking for   , but this adds more questions:

how can I get the position of one point of my sphere and inject it into the sbd pinconstraint position (the idea is to have the sbd pinconstraint doing nothing while being activated) and then have some kind of slider to change between the sphere point position to the rivet position (or simply another point position of the sphere) ?

Edited by tious13
##### Share on other sites

I think (but I'm not 100% sure about it) you can punt on the point positions the expression point()

The syntax is point( surface_node , point_number , attribute , index ) so suppose you found useful your point "354", the expression should be point("TO/SURFACE/NODE", 354, "P", 0) 0 stays for x, as 1 for y and 2 for z as they are the components of the P vector.

Also, you can group the point at sop level, transform it there, and reference it with an expression with `pointlist(.......)` (remember to use the ``) where you put the point numbers in the sbd constarint node in dop.

Aaaaaalso, you can upload you actual file so and I can help better

##### Share on other sites

If you want to do this for more than a single point:

You can also use the 'fexternal' point attribute if you want to apply custom forces per point, or the vary the pintoanimation attribute for a hard constraint effect, and use targetstiffness for a soft constraint effect.

https://www.sidefx.com/docs/houdini14.0/nodes/dop/finiteelementsolver

##### Share on other sites

thanks guys, it's a lots to take in I'm really new.. I might need waaay more time than it should to understand simple expressions

I'm gonna study those options, meanwhile, here is my hip file

FEM_force.hip

Edited by tious13
##### Share on other sites

trying the point() method, I con't make it work, because referencing the point of my sphere creates a loop that immobilize it completely instead of following the simulation.

Gonna take a look to Jason's method, applying a force instead of constraining a position might looks better, but once again I have no idea how to setup things.

edit: how should I use it ? in SOP I plug an attributecreate on a group of point called "fexternal". the attribute must be a vector. Once this is done how can I orient my vector toward the centroid of my sphere at each frame ?

FEM_force_point.hip

Edited by tious13
##### Share on other sites

Could someone explain how to use the fexternal attribute ? or direct me to a link where it is explained ? my google skils have failed me on this one...

Why cant I animate this value ?

fexternal.hipnc

Edited by tious13
##### Share on other sites

To use the fexternal attribute you should use a multisolver: plug into the multi solvers input a sop solver and there you can feed the system with the attribute you create and animate in sop. I asked about that a few days ago, look here:

http://forums.odforce.net/topic/23758-solid-object-dynamic-map-attribute/

About the pin constraint, in sop you can put a transform node that works just for your point and animate that point there. Then in dop, you can reference that xform node, not the dopimport node. It should works.

##### Share on other sites

Thanks a lot Merlino !  I'm gonna take a look at this

##### Share on other sites

I've tryed to understand what you did but I still can't, could you take a look to my hip file and see where I did wrong ? Moreover, when looking at your Hip file I don't understand how you animated your stiffness, I kinda got that you made 2 values and switching between them I guess but can't figure out how, can you enlighten me ?

Thanks

fexternal_sopsolver.hipnc

##### Share on other sites

To animate in my example I imported the 2 values, created at sop level, into the sop solver. Then mixed into the attribvop, with the mix node. That way was simple to animate that value.

fexternal_sopsolver_animated_fexternal.hipnc

##### Share on other sites

Alright thanks I understand your shapestiffness much better now, whereas for your last file the imput in fexternal +Y changes nothing, 0 - 999999999 + sin(x)  gives the same result. Maybe I can't understand properly, anyway I'm gonna keep trying to learn how to do it..

Your help is very valuable, thanks again !

##### Share on other sites

Actually if you look at attribcreate1 > RMB > spreasheet you can see the value changing a lot, the expression is sin((\$F-1)*20)*100000 and that's why the ball is bouncing that strange way

Cheers!

##### Share on other sites

My bad, I was on houdini 14....  so I had the bug where the fexternal weren't used by the FEM solver.

it is now working I can animate the value of my fexternal parameter thanks to you.

But its at object scale level.
Now I need to specify the orientation of the force based on a vector from two points of the surface, ad apply the force to only one point.

In VOP I use a parameter node to get some point position, i wish to enter this expression: point("defgeo.bgeo", "P", 3)    but I don't know how to sepecify wich component I want.

##### Share on other sites

Matthieu, look at your "point" syntax and look http://forums.odforce.net/topic/23772-applying-force-to-fem-point/#entry139781 for the correct syntax

EDIT:

I just realized it's in VOP, so you have to promote that parameter to reference it outside the VOP context

Edited by merlino
##### Share on other sites

I think (but I'm not 100% sure about it) you can punt on the point positions the expression point()

The syntax is point( surface_node , point_number , attribute , index ) so suppose you found useful your point "354", the expression should be point("TO/SURFACE/NODE", 354, "P", 0) 0 stays for x, as 1 for y and 2 for z as they are the components of the P vector.

Also, you can group the point at sop level, transform it there, and reference it with an expression with `pointlist(.......)` (remember to use the ``) where you put the point numbers in the sbd constarint node in dop.

Aaaaaalso, you can upload you actual file so and I can help better

Thanks; I can now animate my fexternal at will and have it influence my Dop sym. Sorry but above you explained me how to apply it only to a group but I don't really understand how.

you mean, at sop I create a group containing the points I wish to apply fexternal to; and in VOP, using the expression `pointlist(..)` output fexternal to them ? in that  case where/how do I use 'pointlist' ?

Here is my hip file

FEM_fexternal_working.hipnc

Edited by tious13
##### Share on other sites

Based on the hip file above, how can I export my fexternal from VOP to a specified group on my geo ?

Thanks

##### Share on other sites

Well, I think you can create the group at sop level, then, in the sopsolver - attribvop1 specify the group you created. It should works that way.

EDIT: looking at your attribvop1, you can allway subtract two (or more vectors) without the need to separate his components. Houdini automatically detect you'r using vector and the operation will be a vector subtraction, or a scalar multiplication enventually. No need to separate the components, just subtract the vectors, in your case

Edited by merlino
##### Share on other sites

You're damn right once angain ! Thanks for your answer and for the tips

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×