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

You are not logged in.

## #1 2019-04-04 11:06:48

chenghui62000
Member
From: Norway
Registered: 2018-06-19
Posts: 94

### Question on how to improve the force-assignment efficiency

Dear all,
I have a question in my simulation.

First, I would like to summarize my coding method into the following five steps:

1.    The simulation is carried out using DYNA_NON_LINE solver.
2.    After the DYNA_NON_LINE calculation, POST_RELEVE_T is used to extract the nodes’ position, velocity and acceleration. Those variables are saved using numpy.array format. The three arrays have the same row sequence indicating the node name. (Line 176-216 in the CA17t5.comm file)
3.    An external python module has to be used to calculate the hydrodynamic forces based on the above three arrays and other external environment parameters (those parameters cannot be provided by Code_Aster). The calculated forces are also saved using numpy.array format.  (the row sequence is the same with above three arrays)
4.    Using the following code to assign the forces from the last step node by node. (Line 106-111 in the CA17t5.comm file)

``load[i]=AFFE_CHAR_MECA(FORCE_NODALE=_F(GROUP_NO=( ‘nodename’ ), FX= hyfx[i], FY= hyfy[i], FZ= hyfz[i])``

5.    Rerun the DYNA_NON_LINE again (back to Step 1) to calculate the nodes’ position, velocity and acceleration. Loop: Step 1--> Step 2--> Step 3--> Step 4--> Step 5--> Step 1… until the end time.

My question is Step 4. The force assigning need a lot of time (10 times compared to the DYNA_NON_LINE). That means almost 80% of the computational time is consumed by the force assigning. You can see this from this following snapshot. Is there any way to improve the efficiency? By the way, using CREA_CHAMP to assign the nodes’ force cannot work here. Because it requires a formula (using basic mathematics) to describe the relationship between forces and (perhaps) coordination. However, such formula doesn’t exist. Therefore, this method cannot work in my circumstance.

By the way, I have put the .comm and .med files in the attachment in case you need to check.

Last edited by chenghui62000 (2019-07-15 10:19:00)

Offline

## #2 2019-04-04 22:07:12

chenghui62000
Member
From: Norway
Registered: 2018-06-19
Posts: 94

### Re: Question on how to improve the force-assignment efficiency

Here is the attached files

Attachments:

Offline

## #3 2019-04-05 21:41:44

chenghui62000
Member
From: Norway
Registered: 2018-06-19
Posts: 94

### Re: Question on how to improve the force-assignment efficiency

From the summary of the running time:
The total job costs 7453.15s, the forces assignment spends almost 7000s. (And this process only needs very little CPU recourse)
Actually, the DYNA_NON_LINE solver only uses 400s.
SO It means the forces assignment (AFFE_CHAR_MECA)costs a huge of time
Could we improve the force-assignment efficiency to boost the simulation?

Last edited by chenghui62000 (2019-07-15 11:00:19)

Offline

## #4 2019-07-15 10:21:40

chenghui62000
Member
From: Norway
Registered: 2018-06-19
Posts: 94

### Re: Question on how to improve the force-assignment efficiency

After months of practices, I still have the question on this post. A video on my Youtube channel shows my question more vividly.

``https://www.youtube.com/watch?v=iNZzWCF7OZs&t=1s ``

During the whole simulation, The below instruct uses most of the computational time. Because it only one core to do the forces assignment.

``````for i in range (1,len(Fnh)+1):    % len(Fnh)=1512
grpno = 'node%01g' %i
l[i]=AFFE_CHAR_MECA( FORCE_NODALE=_F(GROUP_NO= (grpno),
FX= Fnh[i-1],
FY= Fnh[i-1],
FZ= Fnh[i-1],),
MODELE=model)``````

Last edited by chenghui62000 (2019-07-15 10:46:33)

Offline