TAGGED: apdl, export-data, mechanical, mechanical-apdl, workbench
-
-
November 4, 2021 at 7:31 am
BassaSelim3
SubscriberHello to everybody,
I am trying to export an 2D- with an apdl command. The has n rows and m columns (m is greater than 19). For different simulations the size of the array differs and therefore the export is depended on variables. So far I used this type of command to export:
*VWRITE,Eig(1,1),Eig(1,2),Eig(1,3),Eig(1,4)
(F0.0,';',F0.4,';',F0.4,';',F0.4)
where "Eig" is an array with 4 columns. Since the arrays are increasing in size I think I need an other approach (I also think *VWRITE is limited to 19 columns). With the written code above I have to enter every column and the format of that column seperately. For varaible depending sizes I have to automate this.
Can someone give me a hint or an approach for my problem?
I am grateful for every answer
November 4, 2021 at 9:13 amErKo
Ansys EmployeeHello
I think you are correct - it has a limit.
See *MWRITE instead
All the best
Erik
November 4, 2021 at 10:44 amBassaSelim3
SubscriberHi Erik thank you for the answer. I think the *MWRITE command is the right approach. The problem is the format. I can't set the number of the columns to a varaible. it has to be a written integer. So for example see the line of code down below:
RSTMAC,file,1,ALL,file1,1,ALL,,,,2
*GET,nummode,ACTIVE,0,SOLU,NCMSS
*DIM,MAC,ARRAY,nummode,nummode
*DO,k,1,nummode,1
*DO,n,1,nummode,1
*GET,MAC(n,k),RSTMAC,k,MAC,n
*ENDDO
*ENDDO
*MWRITE,MAC,MAC,csv
(10F0.4)
This works fine (I have 10 modes), but if replace the last line with (nummodeF0.4) or with (nummode(F0.4)) my file stays empty. Is there a way to replace the 10 to a variable?
November 4, 2021 at 11:03 amErKo
Ansys EmployeeHi Just set it perhaps to a high number (say 1000) which is more than enough?
Perhaps that will work.
*mwrite,reP
(1000(F20.10))
All the best
Erik
November 4, 2021 at 1:01 pmBassaSelim3
SubscriberHi Erik Yes that worked perfectly. Thank you very much
November 4, 2021 at 1:44 pmErKo
Ansys EmployeeThank you
Erik
June 7, 2023 at 6:33 amanuj yadav
SubscriberHi Erik,
Im facing a similar issue.
My code
!!!!!!!
/post26
FILE,'file','rst','.'
/UI,COLL,1
NUMVAR,200
SOLU,191,NCMIT
STORE,MERGE
FILLDATA,191,,,,1,1
REALVAR,191,191
nsel,s,loc,x,0.01495,0.01505
*Get,NoNodes,node,0,count !Get the number of nodes in the selected set
*Dim, MyNodeNoArray,array, NoNodes !Array used to save nodes No.
*SET,SelNode,0
!Counter to save the selected node number
*Do,i,1,NoNodes
*SET,NodeNo,NDNEXT(SelNode) !NDNEXT(N) Next selected node having a node number greater than N.
*SET,MyNodeNoArray(i), NodeNo
*SET,SelNode,NodeNo
/AUTO,1
/REP,FASTNSOL,i+1,NodeNo,U,X,NodeNo
STORE,MERGE
*Enddo*CREATE,output,txt
*DIM,_P26_EXPORT,TABLE,401,NoNodes+1
*Do,j,0,NoNodes
VGET,_P26_EXPORT(1,j),j+1
*Enddo
*MWRITE ,_P26_EXPORT,21mm,csv
%G, %G, %G, %G, %G, %G, %G, %G, %G, %G,%G, %G, %G, %G, %G, %G, %G, %G, %G, %G,%G, %G, %G, %G, %G, %G, %G, %G, %G, %G,%G, %G, %G, %G, %G, %G
*END
/INPUT,output,txt!!!!!!
I running a transient analysis and i require time series data for more than 1000 nodes
using mwrite , Im unable to extract more than 41 columns.
also numvar command takes only 200 variables
June 7, 2023 at 6:40 amanuj yadav
Subscriberplease update my code
Viewing 7 reply threads- The topic ‘Export of a 2D- Array with apdl-command-block as an csv- file’ is closed to new replies.
Innovation SpaceTrending discussionsTop Contributors-
6575
-
1906
-
1463
-
1311
-
1022
Top Rated Tags© 2026 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-