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

You are not logged in.

#1 2010-09-25 10:05:49

Bracchesimo
Member
From: Italy
Registered: 2010-08-17
Posts: 100
Website

[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?

Thanks in advance!

Last edited by Bracchesimo (2010-10-02 12:04:41)

Offline

#2 2010-09-25 14:59:34

dbpatankar
Member
From: Roorkee, Uttarakhand, India
Registered: 2010-05-22
Posts: 191

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

Offline

#3 2010-09-25 15:56:40

Bracchesimo
Member
From: Italy
Registered: 2010-08-17
Posts: 100
Website

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!

Offline

#4 2010-09-25 15:59:48

dbpatankar
Member
From: Roorkee, Uttarakhand, India
Registered: 2010-05-22
Posts: 191

Re: [SOLVED] Applying nodal forces node by node

Bracchesimo wrote:

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!

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.

Offline

#5 2010-09-26 10:02:24

Bracchesimo
Member
From: Italy
Registered: 2010-08-17
Posts: 100
Website

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[0] #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

Offline