Welcome to the forums. Please post in English or French.

You are not logged in.

#1 2021-01-29 12:41:44

fraperrone18
Member
Registered: 2020-11-12
Posts: 11

Applying nodal displacements node by node

There are probably other threads similar to this, but I have not found analogous to my case.
What I would like to do is apply displacements to individual nodes inside a for loop in python. The displacements will depend on the coordinates of the node, so we need to access it.
We can resume the steps as follows:
- get a list of node IDs from a GROUP_NO
- loop trough for each node in the list
- get the coordinates of the node
- applies a displacement calculated using the node coordinate

This is what i should do in theory, does anyone know how to do it practically?
Thanks in advance!

Offline

#2 2021-01-29 15:18:04

GPSalachs
Member
Registered: 2018-03-10
Posts: 244

Re: Applying nodal displacements node by node

Well... I have an idea...But idk if it will work. Check out this post

/forum2/viewtopic.php?id=25327

so from the tip of my mind i would say, to extract the node coordinates and assign those to a "new" empty variable so like from X_Coord to X_Coord_EM then this variable be taken and with FORMULE command add or retract the wanted quantity (X_Coord_EM + or - the quantity) and re-assign said quantity again to the variable that will be read later as displacement assigned on the nodes on each iteration of the defined loop.

Last edited by GPSalachs (2021-01-29 15:20:03)

Offline

#3 2021-01-29 17:12:37

konyaro
Member
From: Genève
Registered: 2016-04-02
Posts: 262

Re: Applying nodal displacements node by node

Hello,
you can do it easily with AFFE_CHAR_MECA_F, for instance :

def FdispX(INST, X, Y):
    R = sqrt(X**2 + Y**2)
    x = X / R * 0.05 * INST
    return x

deplX=FORMULE(NOM_PARA=('INST','X','Y',),
              VALE='FdispX(INST,X,Y)', FdispX=FdispX);

trans1=AFFE_CHAR_MECA_F(MODELE=model,
                        DDL_IMPO=_F(GROUP_NO='mondaiNai',
                                    DX=deplX,),);

Konyaro

Last edited by konyaro (2021-01-31 07:42:34)


失敗は成功のもと (L'échec est la base de la réussite)

Offline

#4 2021-01-30 16:34:23

fraperrone18
Member
Registered: 2020-11-12
Posts: 11

Re: Applying nodal displacements node by node

Thanks for the tips.
Could you please explain to me what you did?

Offline