Need some help about the MP_Constrain

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
burnningcat
Posts: 50
Joined: Mon Jun 18, 2007 1:10 am
Location: ROMA

Need some help about the MP_Constrain

Post by burnningcat »

Dear FMK,

I meet a problem about the MP_Constrain and maybe it is very easy for you.
I need to add a MP constrain equation like this:
There are two nodes: Node 1 and Node 2. The displacement of Node 1 is denote by X1, Y1, the displacement of Node 2 is denote by X2,Y2, and I need to add the constrain equation of:

X1=X2+Y2-Y1

The problem is that in the right hand side of the equation it contain a item of Y1. So it has the DOF from both the retained node and the contain node. But in the MP_Constrain it seems that you can just add the constrain matrix between the retained node to the contain node.

So would you please tell me if this constrain equation can be add by the MP_Constrain command and how? Or if it is impossible? Thank you so much!

Best Regards
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

this type of constraint can't be applied using an MP_Constraint:

you have a # of options, all involve writing some code:

1) enforce it using a penalty type constraint where you write a spring type element.
2) you create a new subclass off Node for Node1, give it a pointer to Node2, fix the 1 direction and when you do an update set the x1 displacement.
burnningcat
Posts: 50
Joined: Mon Jun 18, 2007 1:10 am
Location: ROMA

Post by burnningcat »

Thank you very much for your guide. Now I konw that it is impossible to add this type of constrain equaiton using the MP_constrain. But would you please tell me more about the second way? Or can you give some example? Thank you very much. :lol:
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

make a subclass of node that takes the tag of the other node .. fix the nodal constraint in the 2 direction using the fix command and when the nodes is asked for it's displacement return y1 and x1 where you calculate x1 using the displacements x2,y2 from he other node.
Post Reply