XANSYS Forum Index
    Register    

FAQ    Search    Memberlist    Usergroups    SmartFeedSmartFeed    Profile    Log in
[Xansys] Export of Mode Shapes
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    XANSYS Forum Index -> XANSYS
Author Message
michael.andersen
User


Joined: 15 Apr 2014
Posts: 2

PostPosted: Fri Nov 28, 2014 4:09 am  Reply with quote

Dear ANSYS Users,

I have to export the mode shapes from ANSYS to ascii files.

To do that, I have this neat little code snippet (see below). But for Mode 1, Only the modal results from the first node is exported. For the higher modes, the modal translations for all nodes are written to the file.
Does anybody know why that is?

finish
/post1
allsel
*get,NumNd,node,,count ! total node number
TotMN=8 ! total mode number
*do,i,1,TotMN
allsel
*get,NumNd,node,,count !total node number
*dim,NodalInfo,,Numnd,7
set,1,i
allsel
!*del,MODALFREQ
!*get,MODALFREQ,ACTIVE,,i,FREQ
*vget,NodalInfo(1,1),node,,nlist
*vget,NodalInfo(1,2),node,,loc,x
*vget,NodalInfo(1,3),node,,loc,y
*vget,NodalInfo(1,4),node,,loc,z
*vget,NodalInfo(1,5),node,,u,x
*vget,NodalInfo(1,6),node,,u,y
*vget,NodalInfo(1,7),node,,u,z
*cfopen,C:\temp\Mode%i%,txt
*vwrite
('Node Num X Y Z UX UY UZ')
*vwrite,NodalInfo(1,1),NodalInfo(1,2),NodalInfo(1,3),NodalInfo(1,4),NodalInfo(1,5),NodalInfo(1,6),NodalInfo(1,7)
(f8.0,f11.5,f11.5,f11.5,f11.5,f11.5,f11.5)
*cfclose
*enddo

Best regards

Michael Styrk Andersen
Research Assistant, Department of Technology and Innovation
Tel.

+4565504974<tel:+4565504974>

Mobile

+4541682580<tel:+4541682580>

Email

mian@iti.sdu.dk

Addr.

Niels Bohrs Allé 1, DK-5230 Odense M, Denmark


[cid:image001.jpg@01D00AFB.AD057730]
________________________________


Campusvej 55 ˇ DK-5230 Odense M ˇ Denmark ˇ Tel. +45 6550 1000 ˇ www.sdu.dk<http://www.sdu.dk/>



+-------------------------------------------------------------+
| XANSYS web - www.xansys.org/forum |
| The Online Community for users of ANSYS, Inc. Software |
| Hosted by PADT - www.padtinc.com |
| Send administrative requests to xansys-mod@tynecomp.co.uk |
+-------------------------------------------------------------+

Post generated using Mail2Forum (http://www.mail2forum.com)
Back to top
View user's profile Send private message
jose.galan
User


Joined: 21 Oct 2008
Posts: 140

PostPosted: Fri Nov 28, 2014 6:52 am  Reply with quote

Dear Mr. Andersen:

the code seems correct, as long as your node numbering is continuous
from 1 to NumNd. Remember that *vget loops over all the entity numbers,
even if they are not defined. Is your node numbering continuous? I guess
that it is, because the code seems to work for all the modes except the
first. In addition, ansys would have given you an error.

I would suggest that you remove all the repeated selection commands from
inside the loop. The nodal selection should not change between
iterations, and it does not make sense to repeat the allsel commands.

In addition, I would suggest to extract the definition of matrix
Nodalinfo from the loop. The matrix dimensions do not change between
iterations, and there is no need to define it repeatedly.

finish
/post1
allsel,all
*get,NumNd,node,,count ! total node number
*dim,NodalInfo,,Numnd,7
TotMN=8 ! total mode number
*do,i,1,TotMN
set,1,i
!*del,MODALFREQ
!*get,MODALFREQ,ACTIVE,,i,FREQ
*vget,NodalInfo(1,1),node,,nlist
*vget,NodalInfo(1,2),node,,loc,x
*vget,NodalInfo(1,3),node,,loc,y
*vget,NodalInfo(1,4),node,,loc,z
*vget,NodalInfo(1,5),node,,u,x
*vget,NodalInfo(1,6),node,,u,y
*vget,NodalInfo(1,7),node,,u,z
*cfopen,C:tempMode%i%,txt
*vwrite
('Node Num X Y Z UX UY UZ')
*vwrite,NodalInfo(1,1),NodalInfo(1,2),NodalInfo(1,3),NodalInfo(1,4),NodalInfo(1,5),NodalInfo(1,6),NodalInfo(1,7)
(f8.0,f11.5,f11.5,f11.5,f11.5,f11.5,f11.5)
*cfclose
*enddo

Best regards,

Jose M. Galan

Constr. Eng. Dept.

Univ. Sevilla

Spain


+-------------------------------------------------------------+
| XANSYS web - www.xansys.org/forum |
| The Online Community for users of ANSYS, Inc. Software |
| Hosted by PADT - www.padtinc.com |
| Send administrative requests to xansys-mod@tynecomp.co.uk |
+-------------------------------------------------------------+

Post generated using Mail2Forum (http://www.mail2forum.com)
Back to top
View user's profile Send private message
michael.andersen
User


Joined: 15 Apr 2014
Posts: 2

PostPosted: Fri Nov 28, 2014 7:17 am  Reply with quote

Dear Mr. Galan

Thank you for your code optimizations.
The node numbering is continuous. I solved the first mentioned problem by clearing generated data from the solution and solving again. After I did that, ANSYS wrote modal information for the first mode too.

Best regards

Michael Styrk Andersen
Research Assistant, Department of Technology and Innovation

Tel. +4565504974
Mobile +4541682580
Email mian@iti.sdu.dk
Addr. Niels Bohrs Allé 1, DK-5230 Odense M, Denmark

UNIVERSITY OF SOUTHERN DENMARK
_______________________________________________________________
Campusvej 55 * DK-5230 * Odense M * Denmark * Tel. +45 6550 1000 * www.sdu.dk


-----Oprindelig meddelelse-----
Fra: Xansys [mailto:xansys-bounces@xansys.org] Pĺ vegne af mfernan@us.es
Sendt: 28. november 2014 14:53
Til: ANSYS User Discussion List
Emne: Re: [Xansys] Export of Mode Shapes



Dear Mr. Andersen:

the code seems correct, as long as your node numbering is continuous from 1 to NumNd. Remember that *vget loops over all the entity numbers, even if they are not defined. Is your node numbering continuous? I guess that it is, because the code seems to work for all the modes except the first. In addition, ansys would have given you an error.

I would suggest that you remove all the repeated selection commands from inside the loop. The nodal selection should not change between iterations, and it does not make sense to repeat the allsel commands.

In addition, I would suggest to extract the definition of matrix Nodalinfo from the loop. The matrix dimensions do not change between iterations, and there is no need to define it repeatedly.

finish
/post1
allsel,all
*get,NumNd,node,,count ! total node number
*dim,NodalInfo,,Numnd,7
TotMN=8 ! total mode number
*do,i,1,TotMN
set,1,i
!*del,MODALFREQ
!*get,MODALFREQ,ACTIVE,,i,FREQ
*vget,NodalInfo(1,1),node,,nlist
*vget,NodalInfo(1,2),node,,loc,x
*vget,NodalInfo(1,3),node,,loc,y
*vget,NodalInfo(1,4),node,,loc,z
*vget,NodalInfo(1,5),node,,u,x
*vget,NodalInfo(1,6),node,,u,y
*vget,NodalInfo(1,7),node,,u,z
*cfopen,C:tempMode%i%,txt
*vwrite
('Node Num X Y Z UX UY UZ')
*vwrite,NodalInfo(1,1),NodalInfo(1,2),NodalInfo(1,3),NodalInfo(1,4),NodalInfo(1,5),NodalInfo(1,6),NodalInfo(1,7)
(f8.0,f11.5,f11.5,f11.5,f11.5,f11.5,f11.5)
*cfclose
*enddo

Best regards,

Jose M. Galan

Constr. Eng. Dept.

Univ. Sevilla

Spain


+-------------------------------------------------------------+
| XANSYS web - www.xansys.org/forum |
| The Online Community for users of ANSYS, Inc. Software |
| Hosted by PADT - www.padtinc.com |
| Send administrative requests to xansys-mod@tynecomp.co.uk |
+-------------------------------------------------------------+
+-------------------------------------------------------------+
| XANSYS web - www.xansys.org/forum |
| The Online Community for users of ANSYS, Inc. Software |
| Hosted by PADT - www.padtinc.com |
| Send administrative requests to xansys-mod@tynecomp.co.uk |
+-------------------------------------------------------------+

Post generated using Mail2Forum (http://www.mail2forum.com)
Back to top
View user's profile Send private message
mohammad.gharaibeh
User


Joined: 01 Nov 2012
Posts: 132
Location: Zarqa, Jordan

PostPosted: Fri Nov 28, 2014 12:13 pm  Reply with quote

Hi Mike,

I used to export my mode shapes using submodeling technique and CBDOF
command. First you have to generate nodes at required location then
interpolation from the global model. As follows:


! HERE YOU GENERATE YOUR NODES AT REQUIRED LOCATIONS


! DOF INTERPOLATION

NSEL,ALL
NWRITE
ALLSEL,ALL
NWRITE,DISPL,NODE

SAVE
FINISH

RESUME,global,db
/POST1
FILE,global,rst

! MODE SHAPES - Export
! *******************************

SET,1,1 ! MODE1
CBDOF,,,,MODE1,TXT

SET,1,2 ! MODE2
CBDOF,,,,MODE2,TXT

SET,1,3 ! MODE3
CBDOF,,,,MODE3,TXT

SET,1,4 ! MODE4
CBDOF,,,,MODE4,TXT


--
Mohammad A Gharaibeh
PhD Candidate,
Mechanical Engineering Department
State University of New York at Binghamton
+-------------------------------------------------------------+
| XANSYS web - www.xansys.org/forum |
| The Online Community for users of ANSYS, Inc. Software |
| Hosted by PADT - www.padtinc.com |
| Send administrative requests to xansys-mod@tynecomp.co.uk |
+-------------------------------------------------------------+

Post generated using Mail2Forum (http://www.mail2forum.com)
Back to top
View user's profile Send private message
christopher.wright
User


Joined: 17 Jun 2009
Posts: 927

PostPosted: Fri Nov 28, 2014 9:31 pm  Reply with quote

On Nov 28, 2014, at 4:08 AM, Michael Styrk Andersen wrote:

Quote:
I have to export the mode shapes from ANSYS to ascii files.
You're wasting your time with APDL that you don't understand. Print out the mode shapes with the output listing using one of the print control commands. Or open the solution in POST1 issue the /OUT command to direct the listing to a file, and issue the appropriate SET and PRNSEL commands for the modes you're interested in. See the docs for the command syntax.

Christopher Wright P.E. |"They couldn't hit an elephant at
chrisw@skypoint.com | this distance" (last words of Gen.
.......................................| John Sedgwick, Spotsylvania 1864)
http://www.skypoint.com/members/chrisw/



+-------------------------------------------------------------+
| XANSYS web - www.xansys.org/forum |
| The Online Community for users of ANSYS, Inc. Software |
| Hosted by PADT - www.padtinc.com |
| Send administrative requests to xansys-mod@tynecomp.co.uk |
+-------------------------------------------------------------+

Post generated using Mail2Forum (http://www.mail2forum.com)
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    XANSYS Forum Index -> XANSYS
All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

sleek template created by Andrew Charron