TAGGED: /post1, Output files and saving
-
-
November 16, 2023 at 4:14 pmSebastien ARRIVETSubscriber
Hi,
Â
I'm trying to export results in .csv format, from a static simulation.
I've struggled to understand how to achieve that, but after looking around in various forum I came up with that bit of code:
!--------------------------------------------------------------------------
/POST1
RSYS,0
SET,1,LAST
csv_name = 'out_node_U_s_1_LAST_post.csv'
*cfopen,csv_name
*cfwrite,'node_num',S11,S22,S33,S12,S13,S23,SEQV
/POST1
allsel
cmsel,s,N_POST,NODE
Â
*vget,nodeIds_sel,NODE,,NLIST
*get,nNodes,NODE,0,COUNT
*do,i_noeud,1,nNodes,1
   no_node=nodeIds_sel(i_noeud)
   nsel,s,node,,no_node
   *get,variable_S11,NODE,no_node,S,X
   *get,variable_S22,NODE,no_node,S,Y
   *get,variable_S33,NODE,no_node,S,Z
   *get,variable_S12,NODE,no_node,S,XY
   *get,variable_S13,NODE,no_node,S,XZ
   *get,variable_S23,NODE,no_node,S,YZ
   *get,variable_SEQV,NODE,no_node,S,EQV
Â
   *cfwrite, %no_node%,variable_S11,variable_S22,variable_S33,variable_S12,variable_S13,variable_S23,variable_SEQV
Â
*enddo
*cfclos
!--------------------------------------------------------------------------
Â
The simulation in itself takes less than a second, as the model is very light (around 12k nodes, shell181 elements, one step and simple load), but the export (the selection has around 10k nodes) takes more than 15min on a cluster with loads of ram and cpus.
I have a large amount of such simulation to carry, and I can't understand how outputing 10k nodes can take that much time when the simulation itself wrote it in the .rst file in less than a second.
If you know a better way for outputs I'm listening, as I'm kinda stucked.
Sebastien
-
November 17, 2023 at 12:33 pmGovindan NagappanAnsys Employee
HI Sebastien,
You have a do loop that goes through 10k times(once for each node).Â
A much more efficient way to read data into arrays is to use the *VGET command. *VGET is much like *GET , except instead of returning a scalar parameter, *VGET fills arrays with data.Â
You do not need a do loop. Here is an example:
cmsel, s, N_POSTÂ Â
*vget,NMASK,node,,nsel
*vmask,NMASK(1)
*vget,array_S11,node,,S,XÂ Â !component stress in XCheck help doc for more details: *VGET (ansys.com)
Â
-
November 20, 2023 at 4:13 pmSebastien ARRIVETSubscriber
Thanks for your answer. I've tried the following based on what I understood:
*cfopen,csv_name
*cfwrite,'node_num',S11,S22,S33
/PREP7
allsel
cmsel,s,N_POST,NODE
*vget,NMASK,node,,nsel
*vmask,NMASK(1)
*vget,node_list,node,,NLIST
/POST1
*vmask,NMASK(1)
*vget,array_S11,node,,S,X
*vget,array_S22,node,,S,Y
*vget,array_S33,node,,S,Z
*vwrite, node_list,array_S11,array_S22,array_S33
(I,ES2.3,ES2.3,ES2.3)
*cfclosÂ
And I get the following warning: "Some entities requested in the *VGET were underfined". It happens for the request of S,X; S,Y and S,Z.Â
I'm not familiar with array like variable in ANSYS APDL, so I'm not sure how to solve that.
-
November 20, 2023 at 4:16 pmGovindan NagappanAnsys Employee
select the result set in post prcessor. For example:
/post1
set,last !select last result set
-
November 20, 2023 at 4:17 pmSebastien ARRIVETSubscriber
I selected it just before the code I pasted:
/POST1
RSYS,0
SET,1,LAST
csv_name = 'out_node_U_s_1_LAST_post.csv' -
November 20, 2023 at 4:19 pmSebastien ARRIVETSubscriber
Also: i've tried without the /PREP7 but the doc seems to indicate that NLIST or NSEL only works in /PREP7 for *VGET
-
- The topic ‘Data export from simulation way too slow’ is closed to new replies.
- Problem with access to session files
- Ayuda con Error: “Unable to access the source: EngineeringData”
- At least one body has been found to have only 1 element in at least 2 directions
- Error when opening saved Workbench project
- Geometric stiffness matrix for solid elements
- How to apply Compression-only Support?
- How to select the interface delamination surface of a laminate?
- Timestep range set for animation export
- Image to file in Mechanical is bugged and does not show text
- SMART crack under fatigue conditions, different crack sizes can’t growth
-
1216
-
543
-
523
-
225
-
209
© 2024 Copyright ANSYS, Inc. All rights reserved.