<![CDATA[Code_Aster forums / [SOLVED] Applying nodal forces node by node]]> 2010-09-26T09:02:24Z FluxBB https://code-aster.org/forum2/viewtopic.php?id=14348 <![CDATA[Re: [SOLVED] Applying nodal forces node by node]]> Well,

it took me a while to figure it out, but I found a general way, maybe not the most elegant, but a working one.

Suppose you have a vector (or python list, whatever) named "F" and containing the forces you want to apply. You also have a group named 'Fz in which you want to apply forces in Z direction. Of course the number of elements in F equals the number of nodes in in the "Fz" group.

All it takes is:

``````from partition import *  #you need to have the aster/STA9.4/bibpyt/Utilitai in the search folder

MAIL=LIRE_MAILLAGE(FORMAT='MED',);#   Reading the mesh file in Aster Format
mesh1 = MAIL_PY()#   Creating empty new MAIL_PY "class istantiation"
mesh1.FromAster(MAIL)#    Reading mesh Data From Aster using object referencing to the   class function FromAster

NodeGroup = mesh1.gno # extracting nodes group (see help(MAiL_PY) for object methods reference)

Fznodes = list(NodeGroup['Fz'])# extracting all ids' of the Fz nodes group

forcelist=[];#empty python list to nitialize the BC forces list

c=0 # F iterator
for i in Fznodes : #loop trough all nodes int he group
forcelist.append(_F(NOEUD = 'N%d' % (i),FZ=F[c],),) #add to the list the code aster macros for nodal forces
c=c+1#next iter next F element

print forcelist #check the format

CHAR=AFFE_CHAR_MECA(MODELE=MODE,
DDL_IMPO=(_F(GROUP_NO='fixed',DX=0.0,DY=0.0, DZ=0.0,),
_F(GROUP_NO='slidey',DY=0.0,),),
FORCE_NODALE=(forcelist), #that's all!

);``````

Hope it helps!

Ciao

]]>
https://code-aster.org/forum2/profile.php?id=1798 2010-09-26T09:02:24Z https://code-aster.org/forum2/viewtopic.php?pid=23375#p23375
<![CDATA[Re: [SOLVED] Applying nodal forces node by node]]> Bracchesimo wrote:

I was thinking about using more python to do such operation, but it will be a waste of time. AFFE_CHAR_MECA_F will work fine.

Thanks again!

Great to know that it solved your problem.
It would be great if you can edit your first post and change the subject adding [SOLVED] to it. It will help others.

]]>
https://code-aster.org/forum2/profile.php?id=1232 2010-09-25T14:59:48Z https://code-aster.org/forum2/viewtopic.php?pid=23361#p23361
<![CDATA[Re: [SOLVED] Applying nodal forces node by node]]> Thanks for the answer,

I was thinking about using more python to do such operation, but it will be a waste of time. AFFE_CHAR_MECA_F will work fine.

Thanks again!

]]>
https://code-aster.org/forum2/profile.php?id=1798 2010-09-25T14:56:40Z https://code-aster.org/forum2/viewtopic.php?pid=23360#p23360
<![CDATA[Re: [SOLVED] Applying nodal forces node by node]]> Hi,

1. If load on all nodes is same then you can simply use FORCE_NODALE over the GROUP_NO under AFFE_CHAR_MECA

2. If load on nodes follow some relation, still you can use above keywords in AFFE_CHAR_MECA_F where you can define the variation of load.

3. If Variation is arbitrary, extract the values in a python list and make this list as DEFI_LIST_REEL. Then use this list to apply load on node in AFFE_CHAR_MECA_F

]]>
https://code-aster.org/forum2/profile.php?id=1232 2010-09-25T13:59:34Z https://code-aster.org/forum2/viewtopic.php?pid=23356#p23356
<![CDATA[[SOLVED] Applying nodal forces node by node]]> There is probably some other threads similar to this, but I found nothing so specific.

What I would like to do is to apply nodal forces to single nodes inside a loop. The nodal force will be dependent from the node coordinates so we need to access them.

We can resume the steps as follows:

- get a node id list from a GROUP_NO
- loop trough for each node in the list
- get the node coordinates
- apply a nodal force computed using the node coordinate

Do you know how to do that?