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: 63

Question on how to improve the force-assignment efficiency

Dear all,
Here I have a very hard problem. I would appreciate your kind help in my research.

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?
statue.png?raw=true

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-04-04 11:08:04)

Offline

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

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

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

Here is the attached files


Attachments:
files.zip, Size: 110.93 KiB, Downloads: 23

Offline

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

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

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.

Could we improve the force-assignment efficiency to boost the simulation?

Offline

Board footer