You are on page 1of 51

MSC.

Software Corporation

2 MacArthur Place
Santa Ana, CA 92707 USA
Tel: (714) 540-8900
Fax: (714) 784-4056
Web: http://www.mscsoftware.com

T okyo, Japan United States Munich, Germany


Tel: 81-3-3505-0266 Software Support Tel: (49) (89) 43 19 87 0
Fax: 81-3-3505-0914 Tel: 1-800-732-7284 Fax: (49) (89) 43 61 716
Fax: (714) 979-2990

Workbook: DMAP and


Database Applications in
MSC.Nastran V2001

NAS110 Exercise Workbook

August 2002

Part Number NA*V2001*Z*Z*Z*SM-NAS110-WBK

1
DISCLAIMER

MSC.Software Corporation reserves the right to make changes in specifications


and other information contained in this document without prior notice.
The concepts, methods, and examples presented in this text are for illustrative
and educational purposes only, and are not intended to be exhaustive or to apply
to any particular engineering problem or design. MSC.Software Corporation
assumes no liability or responsibility to any person or company for direct or
indirect damages resulting from the use of any information contained herein.
User Documentation: Copyright2002 MSC.Software Corporation. Printed in
U.S.A. All Rights Reserved.
This notice shall be marked on any reproduction of this documentation, in whole
or in part. Any reproduction or distribution of this document, in whole or in part,
without the prior written consent of MSC.Software Corporation is prohibited.
MSC is a registered trademark of the MSC.Software Corporation. NASTRAN is a
registered trademark of the National Aeronautics and Space Administration.
MSC.Nastran is an enhanced proprietary version developed and maintained by
MSC.Software Corporation. MSC. and MSC.Patran are trademarks of
MSC.Software Corporation.
All other trademarks are the property of their respective owners.

2
TABLE OF CONTENTS

Workshop Description Page #

1. Simple Dmap Using Parameters Defined Inside 3


The DMAP.

2. Simple Dmap Using Parameters Defined Inside 7


the Bulk Data.

3. Read Matrix Using DMI and Write Matrix 13


Using Output2 and OUTPUT4 Formats.

4. Read Matrices Previously Created in Workshop # 3 18


and Perform Eigenvalue Analysis.

5. Solve Linear Equation Using An Iterative Scheme. 22

6. Create Reduced Stiffness Matrix and Punch it out 26


in DMIG Format.

7. DMAP to Calculate Element Strain Energy due to 36


DMIG.

8. DMAP to Perform Rigid Body Check. 43

3
Workshop # 1

Simple DMAP Using Parameters Defined


Inside the DMAP

4
Workshop #1

Objective:

 Calculate the average and standard deviation using DMAP with


parameters defined inside the dmap.

Procedure:

There are 15 students in an algebra class. The following are test scores from
a recent test:

92,85,70,82,90,82,32,94,100,50,95,80,65,100, and 70

Write a DMAP using parameters to represent the test scores and calculate
the average and standard deviation for the test. Assign the test scores inside
the DMAP. Use the MESSAGE module to label the output.

AVG = 1/N XI
I=I

STD = SQRT [ {(X1-AVG)**2 + (X2-AVG)**2 +…+ (Xn-AVG)**2 }/N]

The results from the f06 file is shown below.

^^^
^^^ AVERAGE TEST SCORE = 7.913333E+01
^^^
^^^
^^^ STANDARD DEVIATION = 1.846751E+01
^^^

5
Solution File for Workshop # 1

$ soln1.dat
$
SOL AVGSTD
COMPILE AVGSTD LIST
SUBDMAP AVGSTD
$
$ DECLARE PARAMETERS
$
TYPE PARM,,RS,N,sc1,sc2,sc3,sc4,sc5,sc6,sc7,sc8,sc9,sc10
TYPE PARM,,RS,N,sc11,sc12,sc13,sc14,sc15
TYPE PARM,,RS,N,AVG,STD
$
sc1 = 92.
sc2 = 85.
sc3 = 70.
sc4 = 82.
sc5 = 90.
sc6 = 82.
sc7 = 32.
sc8 = 94.
sc9 = 100.
sc10 = 50.
sc11 = 95.
sc12 = 80.
sc13 = 65.
sc14 = 100.
sc15 = 70.
$
$ 2 3 4 5 6 7 8 9
AVG = (sc1 + sc2 + sc3 + sc4 + sc5 + sc6 + sc7 + sc8 + sc9 +
sc10 + sc11 + sc12 + sc13 + sc14 + sc15 ) / 15.
$
MESSAGE //' ' $ PRINT BLANK LINE
MESSAGE //' AVERAGE TEST SCORE = '/AVG $
MESSAGE //' ' $
$
STD = SQRT ( ((sc1-AVG)**2 + (sc2-AVG)**2 + (sc3-AVG)**2 +
(sc4-AVG)**2 + (sc5-AVG)**2 + (sc6-AVG)**2 +
(sc7-AVG)**2 + (sc8-AVG)**2 + (sc9-AVG)**2 +
(sc10-AVG)**2 + (sc11-AVG)**2 + (sc12-AVG)**2 +
(sc13-AVG)**2 + (sc14-AVG)**2 + (sc15-AVG)**2)
/ 15. )
$
MESSAGE //' ' $
MESSAGE // ' STANDARD DEVIATION = '/STD $
MESSAGE// ' ' $
$
END
$
CEND
$

6
TITLE = WORKSHOP # 1 -- USE PARAMETERS TO
Solution File for Workshop # 1 (cont.)

SUBTITLE = CALCULATE AVERAGE AND STANDARD DEVIATION


$
BEGIN BULK
ENDDATA

7
Workshop # 2

Simple DMAP Using Parameters Defined


Inside the Bulk Data Section

8
Workshop #2

Objective:

 Calculate the Average and Standard Deviation Using DMAP


with Parameters Defined Inside the Bulk Data Section

Procedure:

Repeat workshop # 1 by reading in the test scores from the bulk data section
instead of defining them inside the DMAP. Note that the preface modules—
IFP1, XSORT, and IFP are needed. These modules are provided in the
preface.dat file. Perform this workshop using two different methods.

a. Create your own solution name (as in workshop # 1) and bring in the
preface modules using the include command.

b. Repeat step a using SOL 100. Note that SOL 100 has the preface
modules already built in.

The results from the f06 file is shown below.

^^^
^^^ AVERAGE TEST SCORE = 7.913333E+01
^^^
^^^
^^^ STANDARD DEVIATION = 1.846751E+01
^^^

9
Solution for Workshop # 2A

$
$ soln2a.dat
$
SOL avgstd
compile avgstd $
subdmap svgstd $
$
include 'preface.dat'
$
$ DECLARE PARAMETERS
$
TYPE PARM,,RS,y,sc1,sc2,sc3,sc4,sc5,sc6,sc7,sc8,sc9,sc10
TYPE PARM,,RS,y,sc11,sc12,sc13,sc14,sc15
TYPE PARM,,I,Y,NSTUDENT
TYPE PARM,,RS,N,AVG,STD,nstudr
$
nstudr = real(nstudent)
AVG = ( sc1 + sc2 + sc3 + sc4 + sc5 + sc6 + sc7 + sc8 + sc9 +
sc10 + sc11 + sc12 + sc13 + sc14 + sc15 ) / nstudr
$
MESSAGE //' ' $ PRINT BLANK LINE
MESSAGE //' AVERAGE TEST SCORE = '/AVG $
MESSAGE //' ' $
$
STD = SQRT ( ((sc1-AVG)**2 + (sc2-AVG)**2 + (sc3-AVG)**2 +
(sc4-AVG)**2 + (sc5-AVG)**2 + (sc6-AVG)**2 +
(sc7-AVG)**2 + (sc8-AVG)**2 + (sc9-AVG)**2 +
(sc10-AVG)**2 + (sc11-AVG)**2 + (sc12-AVG)**2 +
(sc13-AVG)**2 + (sc14-AVG)**2 + (sc15-AVG)**2)
/ nstudr )
$
MESSAGE //' ' $
MESSAGE // ' STANDARD DEVIATION = '/STD $
MESSAGE// ' ' $
$
END
$
CEND
$
TITLE = WORKSHOP # 2 -- READ PARAMETERS FROM BULK DATA SECTION
SUBTITLE = CALCULATE AVERAGE AND STANDARD DEVIATION
$
BEGIN BULK
$
PARAM,sc1,92.
PARAM,sc2,85.
PARAM,sc3,70.
PARAM,sc4,82.
PARAM,sc5,90.
PARAM,sc6,82.
PARAM,sc7,32.

10
Solution for Workshop # 2A (cont.)

PARAM,sc8,94.
PARAM,sc9,100.
PARAM,sc10,50.
PARAM,sc11,95.
PARAM,sc12,80.
PARAM,sc13,65.
PARAM,sc14,100.
PARAM,sc15,70.
$
param,nstudent,15
$
ENDDATA

11
Solution for Workshop # 2B

$
$ soln2b.dat
$
SOL 100
compile userdmap list $
alter 2 $
$
$ DECLARE PARAMETERS
$
TYPE PARM,,RS,y,sc1,sc2,sc3,sc4,sc5,sc6,sc7,sc8,sc9,sc10
TYPE PARM,,RS,y,sc11,sc12,sc13,sc14,sc15
TYPE PARM,,I,Y,NSTUDENT
TYPE PARM,,RS,N,AVG,STD,nstudr
$
nstudr = real(nstudent)
AVG = ( sc1 + sc2 + sc3 + sc4 + sc5 + sc6 + sc7 + sc8 + sc9 +
sc10 + sc11 + sc12 + sc13 + sc14 + sc15 ) / nstudr
$
MESSAGE //' ' $ PRINT BLANK LINE
MESSAGE //' AVERAGE TEST SCORE = '/AVG $
MESSAGE //' ' $
$
STD = SQRT ( ((sc1-AVG)**2 + (sc2-AVG)**2 + (sc3-AVG)**2 +
(sc4-AVG)**2 + (sc5-AVG)**2 + (sc6-AVG)**2 +
(sc7-AVG)**2 + (sc8-AVG)**2 + (sc9-AVG)**2 +
(sc10-AVG)**2 + (sc11-AVG)**2 + (sc12-AVG)**2 +
(sc13-AVG)**2 + (sc14-AVG)**2 + (sc15-AVG)**2)
/ nstudr )
$
MESSAGE //' ' $
MESSAGE // ' STANDARD DEVIATION = '/STD $
MESSAGE// ' ' $
$
END
$
CEND
$
TITLE = WORKSHOP # 2 -- READ PARAMETERS FROM BULK DATA SECTION
SUBTITLE = CALCULATE AVERAGE AND STANDARD DEVIATION
$
BEGIN BULK
$
PARAM,sc1,92.
PARAM,sc2,85.
PARAM,sc3,70.
PARAM,sc4,82.
PARAM,sc5,90.
PARAM,sc6,82.
PARAM,sc7,32.
PARAM,sc8,94.
PARAM,sc9,100.

12
PARAM,sc10,50.
Solution for Workshop # 2B (cont.)

PARAM,sc11,95.
PARAM,sc12,80.
PARAM,sc13,65.
PARAM,sc14,100.
PARAM,sc15,70.
$
param,nstudent,15
$
ENDDATA

13
Workshop # 3

Read Matrix Using DMI and Write


Matrix Using OUTPUT2 and OUTPUT4
Formats.

14
Workshop #3

Objective:

 Read matrix A using DMI and Write A using OUTPUT2 and


OUTPUT4 in both binary and ascii format.

Procedure:

Read the following matrix A using DMI.

2. 1. 0. 0.
1. 2. 1. 0.
A
0. 1. 2. 1.
0. 0. 1. 2.

Provide checks to ensure that matrix A is read in and print matrix A using
MATPRN and MATPRT.

Write out matrix using the following formats:

 OUTPUT2 in ascii format.


 OUTPUT2 in binary format.
 OUTPUT4 in ascii format.
 OUTPUT4 in binary format.

15
PARTIAL F06 RESULTS

^^^MATRIX MASS READ IN OK, MATPRN FOLLOWS


1 USE MTRXIN TO READ DMIG ENTRIES MARCH 19, 2000 MSC.NASTRAN 12/14/99 PAGE 5

0
0 MATRIX A (GINO NAME 101 ) IS A DB PREC 4 COLUMN X 4 ROW SYMMETRC MATRIX.
0COLUMN 1 ROWS 1 THRU 2 --------------------------------------------------
ROW
1) 2.0000D+00 -1.0000D+00
0COLUMN 2 ROWS 1 THRU 3 --------------------------------------------------
ROW
1) -1.0000D+00 2.0000D+00 -1.0000D+00
0COLUMN 3 ROWS 2 THRU 4 --------------------------------------------------
ROW
2) -1.0000D+00 2.0000D+00 -1.0000D+00
0COLUMN 4 ROWS 3 THRU 4 --------------------------------------------------
ROW
3) -1.0000D+00 2.0000D+00
0THE NUMBER OF NON-ZERO TERMS IN THE DENSEST COLUMN = 3
0THE DENSITY OF THIS MATRIX IS 62.50 PERCENT.
^^^MAPTRT FOLLOWS
1 USE MTRXIN TO READ DMIG ENTRIES MARCH 19, 2000 MSC.NASTRAN 12/14/99 PAGE 6

0
INTERMEDIATE MATRIX ... A

COLUMN 1
1 2.000000E+00 -1.000000E+00 0.000000E+00 0.000000E+00 4

COLUMN 2
1 -1.000000E+00 2.000000E+00 -1.000000E+00 0.000000E+00 4

COLUMN 3
1 0.000000E+00 -1.000000E+00 2.000000E+00 -1.000000E+00 4

COLUMN 4
1 0.000000E+00 0.000000E+00 -1.000000E+00 2.000000E+00 4

*** USER INFORMATION MESSAGE 4114 (OUTPN2)


DATA BLOCK A WRITTEN ON FORTRAN UNIT 41, TRL =
101 4 4 6 2 6 6250
(MAXIMUM POSSIBLE FORTRAN RECORD SIZE = 2000 WORDS.)
(MAXIMUM SIZE OF FORTRAN RECORDS WRITTEN = 7 WORDS.)
(NUMBER OF FORTRAN RECORDS WRITTEN = 34 RECORDS.)
(TOTAL DATA WRITTEN FOR DATA BLOCK = 64 WORDS.)
*** USER INFORMATION MESSAGE 4114 (OUTPX2)
DATA BLOCK A WRITTEN ON FORTRAN UNIT 42, TRL =
101 4 4 6 2 6 6250
(MAXIMUM POSSIBLE FORTRAN RECORD SIZE = 4098 WORDS.)
(MAXIMUM SIZE OF FORTRAN RECORDS WRITTEN = 7 WORDS.)
(NUMBER OF FORTRAN RECORDS WRITTEN = 30 RECORDS.)
(TOTAL DATA WRITTEN FOR DATA BLOCK = 62 WORDS.)
*** USER WARNING MESSAGE 6450 (OUTPT4)
THE SELECTION OF THE ASCII FORMAT OPTION IN THE OUTPUT4 MODULE FOR DATABLOCK A MAY RESULT
IN NUMERIC TRUNCATION.
USER INFORMATION:
1. THE FORTRAN FORMAT BEING USED IS (1P,5E16.9)
2. THE DEFAULT FORTRAN FORMAT IS (1P,5E16.9)
3. THE FIFTH PARAMETER OF THE OUTPUT4 MODULE CAN BE USED TO INCREASE THE NUMBER OF
SIGNIFICANT DIGITS.
USER ACTION:
1. IF THE NUMBER OF SIGNIFICANT DIGITS IS ACCEPTABLE, THEN NO ACTION IS REQUIRED.

PARTIAL F06 RESULTS (cont.)

16
2. IF ADDITIONAL SIGNIFICANT DIGITS ARE REQUIRED, THEN INCREASE THE VALUE OF THE FIFTH PARAMETER,
AND
RERUN THE JOB.
DATA BLOCK A WRITTEN ON FORTRAN UNIT 51 FROM DMAP MODULE OUTPUT4 IN ASCII FORMAT (1P,5E16.9)
TRAILER = 101 4 4 6 2 6 6250
DATA BLOCK A WRITTEN ON FORTRAN UNIT 52 FROM DMAP MODULE OUTPUT4 IN BINARY FORMAT
TRAILER = 101 4 4 6 2 6 6250
1 * * * END OF JOB * * *

17
Solution for Workshop # 3

$ soln3.dat
$
assign output2='soln3.opa2',unit=41,form=formatted, delete $
assign output2='soln3.opb2',unit=42,delete $
assign output4='soln3.opa4',unit=51, form=formatted,delete $
assign output4='soln3.opb4',unit=52,delete $
$
SOL 100 $
COMPILE USERDMAP $
ALTER 2
type parm,,logical,n,got1 $
dmiin dmi,dmindx/A,,,,,,,,,/s,n,got1 $
if (got1) then $
MESSAGE //'matrix A read in ok, matprn follows' $
MATPRN A// $
MESSAGE //'MAPTRT FOLLOWS' $
MATPRT A// $
ELSE $
MESSAGE //'MATRIX A NOT IN INPUT FILE' $
ENDIF $
$
output2 A,,,,///41///'matrix' $ ascii format
output2 A,,,,///42/// $ binary format
output4 A,,,,///51/-1 $ ascii format
output4 A,,,,///52/1 $ binary format
$
END $
CEND
TITLE = USE DMIIN TO READ IN MATRIX A
SUBTITLE = OUTPUT MATRIX A USING OUTPUT2 AND OUTPUT4 USING ASCII AND
BINARY
BEGIN BULK
$
DMI,A,0,6,1,,,4,4
DMI,A,1,1,2.,-1.
DMI,A,2,1,-1.,2.,-1.
DMI,A,3,2,-1.,2.,-1.
DMI,A,4,3,-1.,2.
$
ENDDATA

18
Workshop # 4

Read Matrices Previously Created in


Workshop # 3 and Perform Eigenvalue
Analysis

19
Workshop # 4

Objective:

 Read matrix A created in workshop # 3 and perform an eigenvalue


calculation.

Procedure:

Read matrix A created in workshop # 3 using the following formats:

 INPUTT2 using ascii format.


 INPUTT2 using binary format.
 INPUTT4 using ascii format.
 INPUTT4 using binary format.

Use the matrix A read by INPUTT2 with the binary format to perform the
following eigenvalue calculation.

[ A –I ] {U} = 0

Print the eigenvalue tables and corresponding eigenvectors.

20
PARTIAL F06 RESULTS

E I G E N V A L U E A N A L Y S I S S U M M A R Y (READ MODULE)

BLOCK SIZE USED ...................... 2

NUMBER OF DECOMPOSITIONS ............. 1

NUMBER OF ROOTS FOUND ................ 4

NUMBER OF SOLVES REQUIRED ............ 4

1 USE INPUTT2 AND INPUTT4 TO READ IN MATRIX A WRITTEN OUT IN WORKS MARCH 19,
2000 MSC.NASTRAN 12/14/99 PAGE 12

R E A L E I G E N V A L U E S
MODE EXTRACTION EIGENVALUE RADIANS CYCLES
GENERALIZED GENERALIZED
NO. ORDER
MASS STIFFNESS
1 1 3.819660E-01 6.180340E-01 9.836316E-02
1.000000E+00 3.819660E-01
2 2 1.381966E+00 1.175570E+00 1.870978E-01
1.000000E+00 1.381966E+00
3 3 2.618034E+00 1.618034E+00 2.575181E-01
1.000000E+00 2.618034E+00
4 4 3.618034E+00 1.902113E+00 3.027307E-01
1.000000E+00 3.618034E+00
1 USE INPUTT2 AND INPUTT4 TO READ IN MATRIX A WRITTEN OUT IN WORKS MARCH 19,
2000 MSC.NASTRAN 12/14/99 PAGE 13

0
1 USE INPUTT2 AND INPUTT4 TO READ IN MATRIX A WRITTEN OUT IN WORKS MARCH 19,
2000 MSC.NASTRAN 12/14/99 PAGE 14

0
0 MATRIX MYPHI (GINO NAME 101 ) IS A DB PREC 4 COLUMN X 4 ROW
SQUARE MATRIX.
0COLUMN 1 ROWS 1 THRU 4
--------------------------------------------------
ROW
1) 3.7175D-01 6.0150D-01 6.0150D-01 3.7175D-01
0COLUMN 2 ROWS 1 THRU 4
--------------------------------------------------
ROW
1) -6.0150D-01 -3.7175D-01 3.7175D-01 6.0150D-01
0COLUMN 3 ROWS 1 THRU 4
--------------------------------------------------
ROW
1) -6.0150D-01 3.7175D-01 3.7175D-01 -6.0150D-01
0COLUMN 4 ROWS 1 THRU 4
--------------------------------------------------
ROW
1) -3.7175D-01 6.0150D-01 -6.0150D-01 3.7175D-01
0THE NUMBER OF NON-ZERO TERMS IN THE DENSEST COLUMN = 4
0THE DENSITY OF THIS MATRIX IS 100.00 PERCENT.

21
Solution Input File for Workshop # 4

$ soln4.dat
$
assign inputt2='soln3.opa2',unit=41,form=formatted $
assign inputt2='soln3.opb2',unit=42 $
assign inputt4='soln3.opa4',unit=51, form=formatted $
assign inputt4='soln3.opb4',unit=52 $
$
SOL 100 $
COMPILE USERDMAP $
ALTER 2
$
message //'reading matrices using inputt2 and inputt4' $
$
inputt2 /A2a,,,,//41 $ ascii format
inputt2 /A2b,,,,//42 $ binary format
inputt4 /A4a,,,,/1/51//-1 $ ascii format
inputt4 /A4b,,,,/1/52//1 $ binary format
$
matprn a2a,a2b,a4a,a4b// $
$
diagonal a2b/ident/'square'/0. $
read a2b,ident,,,dynamics,,casecc,,,,,,/
mylama,myphi,modemass,eigmat,lammat,/
'modes'/s,n,nmodes $
if ( nmodes > 0) then $
ofp mylama// $
matprn myphi// $
else $
message //'NO EIGENVALUES FOUND' $
endif $ nmodes > 0
$
END $
CEND
TITLE = USE INPUTT2 AND INPUTT4 TO READ IN MATRIX A WRITTEN OUT IN WORKSHOP # 3
method = 100
BEGIN BULK
$
eigrl,100,,,4
$
ENDDATA

22
Workshop # 5

Solve Linear Equation Using An Iterative


Scheme

23
Workshop # 5

Objective:

 Solve the equation [ B ] [ X ] + [ C ] = [ X ] using an iterative


scheme.

Procedure:

Solve for [ X ] in the following equation:

[B][X]+[C]=[X]

where,

0. 0.1 0.1
B 0.1 0. 0.1
0.1 0.1 0.

1.2
C 1.2
1.2

Define [ Xn+1 ] = [ B ] [ Xn ] + [ C ]. Then [ Xn+1 ] is a solution if


[ Xn+1 ] – [ Xn ] ~ [ 0 ].

Solve for [ Xn ] until the error is less than or equal to 1. E-5 or nine
iterations are performed.

Hint:

Use an initial guess of [ Xo ] = 0. Use a do loop to perform the iteration


calculation. The module EQUIVX is needed to perform the [ Xn ] =
[ Xn+1 ] operation. The format of this operation is as follows:

24
EQUIVX XNP1/XN/ALWAYS $
Partial Output for Workshop # 5

0
0 MATRIX X (GINO NAME 101 ) IS A DB PREC 1 COLUMN X 3 ROW RECTANG MATRIX.
0COLUMN 1 ROWS 1 THRU 3 --------------------------------------------------
ROW
1) 1.0000D+00 1.0000D+00 1.0000D+00
0THE NUMBER OF NON-ZERO TERMS IN THE DENSEST COLUMN = 3
0THE DENSITY OF THIS MATRIX IS 100.00 PERCENT.

25
Solution Input File for Workshop # 5
$
$ soln5.dat
$
diag 8
sol 100
compile userdmap $
alter 2 $
type parm,,rs,n,xnorm=1. $
type parm,,i,n,knt=1 $
dmiin dmi,dmindx/b,x,c,,,,,,,/ $
matprn b,x,c// $
do while (knt<=9 and xnorm > 1.E-5 ) $
mpyad b,x,c/xx/ $ [B]*[X] + [C] $
add x,xx/dif/(-1.,0.) $
matprn dif// $
norm dif/difn///s,n,xnorm $
message //' iteration no. = '/knt/' error = '/xnorm $
equivx xx/x/always $
knt = knt + 1 $
enddo $
matprn x// $ final answer
cend
$
begin bulk
$
dmi,b,0,1,1,0,,3,3
dmi,b,1,2,-.1,-.1
dmi,b,2,1,-.1,3,-.1
dmi,b,3,1,-.1,-.1
$
dmi,c,0,2,1,0,,3,1
dmi,c,1,1,1.2,1.2,1.2
$
dmi,x,0,2,1,0,,3,1
$
enddata

26
Workshop # 6

Create Reduced Stiffness Matrix and


Punch It Out in DMIG Format

27
Workshop # 6A

Create Reduced Stiffness Matrix

Objective:

 Create a reduced stiffness matrix (Ktt) for the substructure—


consisting of elements 4, 5, and 6 in this case.

Procedure:

1. Run the model input file consisting of elements 4, 5, and 6


(wkshp6a.dat) in SOL 101 and write out the boundary stiffness
matrix in DMIG using static condensation.

4 5 6
4 5 6 7

3 7

3 8
2
8

2 9 y
1 9
x
1 10

Hints:

 Find out where static condensation is being performed.


 The reduced stiffness matrix must be expanded to g-size.
 Convert from internal to external sequence.
 Create DMIG punch file.

28
Input File for Modification (wkshp6a.dat):

$
$ wkshp6a.dat
$
$
SOL 101 $
TIME 5
$
$ PUT DMAP HERE
$
CEND
TITLE = STATIC CONDENSATION OF HORIZONTAL BARS
DISP = ALL
$
SUBCASE 1
LABEL = STATIC LOAD CASE
LOAD = 1
$
BEGIN BULK
$
ASET1,123456,4,7
$
GRID 4 0 0.0 30. 0.0
GRID 5 0 10. 30. 0.0
GRID 6 0 20. 30. 0.0
GRID 7 0 30. 30. 0.0
$
GRID 100 0 50. 50. 0.0 123456
$
CBAR 4 1 4 5 100
CBAR 5 1 5 6 100
CBAR 6 1 6 7 100
$
PBAR 1 1 3.461. 1. 2.
MAT1 1 1.+7 .3
$
ENDDATA

29
Solution File for Writing Out Boundary Stiffness
Matrices:

$
$ soln6a.dat
$
SOL 101 $
TIME 5
$
compile sekr $
alter 'mpyad.*got.*ktt' $
type parm,nddl,i,n,lusets $
umerge1 uset,ktt,,,/kttg/'g'/'t'/'comp' $
MATGEN EQEXINS/INTEXT/9/0/LUSETS
SMPYAD INTEXT,kttg,INTEXT,,,/KTTGEXT/3////1////6 $
matprn kttgext// $
MATMOD KTTGEXT,EQEXINS,,,,/KTTOUT,/16/1 $
exit $
$
CEND
TITLE = STATIC CONDENSATION OF HORIZONTAL BARS
DISP = ALL
$
SUBCASE 1
LABEL = STATIC LOAD CASE
LOAD = 1
$
BEGIN BULK
$
ASET1,123456,4,7
$
GRID 4 0 0.0 30. 0.0
GRID 5 0 10. 30. 0.0
GRID 6 0 20. 30. 0.0
GRID 7 0 30. 30. 0.0
$
GRID 100 0 50. 50. 0.0 123456
$
CBAR 4 1 4 5 100
CBAR 5 1 5 6 100
CBAR 6 1 6 7 100
$
PBAR 1 1 3.461. 1. 2.
MAT1 1 1.+7 .3
$
ENDDATA

30
DMIG Punch File Generated from soln6a.dat:

DMIG KTTGEXT 0 6 2 0 30
DMIG* KTTGEXT 4 1
* 4 1 1.153333346D+06
DMIG* KTTGEXT 4 2
* 4 2 4.444444444D+03
DMIG* KTTGEXT 4 3
* 4 3 4.444444444D+03
DMIG* KTTGEXT 4 4
* 4 4 2.564102500D+05
DMIG* KTTGEXT 4 5
* 4 3-6.666666667D+04
* 4 5 1.333333333D+06
DMIG* KTTGEXT 4 6
* 4 2 6.666666667D+04
* 4 6 1.333333333D+06
DMIG* KTTGEXT 7 1
* 4 1-1.153333346D+06
* 7 1 1.153333346D+06
DMIG* KTTGEXT 7 2
* 4 2-4.444444444D+03
* 4 6-6.666666667D+04
* 7 2 4.444444444D+03
DMIG* KTTGEXT 7 3
* 4 3-4.444444444D+03
* 4 5 6.666666667D+04
* 7 3 4.444444444D+03
DMIG* KTTGEXT 7 4
* 4 4-2.564102500D+05
* 7 4 2.564102500D+05
DMIG* KTTGEXT 7 5
* 4 3-6.666666667D+04
* 4 5 6.666666667D+05
* 7 3 6.666666667D+04
* 7 5 1.333333333D+06
DMIG* KTTGEXT 7 6
* 4 2 6.666666667D+04
* 4 6 6.666666667D+05
* 7 2-6.666666667D+04
* 7 6 1.333333333D+06

31
Workshop # 6B

Comparison of Results by Reading in the Boundary


Stiffness with the Full Model

Objective:

 Bring in the reduced stiffness and analyze the equivalent


model. Compare the results with the full model.

Procedure:

1. Bring in the DMIG punch file generated in workshop # 6A.

2. Attach the reduced stiffness matrix to the vertical members of


the frame structure (elements 1, 2, 3, 7, 8, and 9.)

Note that the stiffness matrices for elements 4, 5, and 6


are represented by the DMIG generated in the previous
workshop

4 5 6
4 5 6 7

3 7

3 8
2
8

2 9 y
1 9
1 x
10

2. Compare the results with the full model where all 9 elements are
directly defined by CBAR entries.

32
Model Input File for Modification:

$
$ wkshp6b.dat
$
SOL 101 $
TIME 5
CEND
TITLE = bring in the cross bar using dmig
DISP = ALL
SPC = 1
$
$ (Case Control Command to Bring in DMIG Entries)
$
SUBCASE 1
LABEL = STATIC LOAD CASE
LOAD = 1
$
BEGIN BULK
$
$ Include DMIG Entries
$
GRID 1 0 0.0 0.0 0.0
GRID 2 0 0.0 10. 0.0
GRID 3 0 0.0 20. 0.0
GRID 4 0 0.0 30. 0.0
$
GRID 7 0 30. 30. 0.0
GRID 8 0 30. 20. 0.0
GRID 9 0 30. 10. 0.0
GRID 10 0 30. 0.0 0.0
$
GRID 100 0 50. 50. 0.0 123456
$
CBAR 1 1 1 2 100
CBAR 2 1 2 3 100
CBAR 3 1 3 4 100
CBAR 7 1 7 8 100
CBAR 8 1 8 9 100
CBAR 9 1 9 10 100
$
FORCE 1 4 0 1000. 1.
$
$ CONSTRAINTS BULK DATA ENTRIES
$
SPC1 1 123456 1 10
$
$ PROPERTY AND MATERIAL BULK DATA ENTRIES
$
PBAR 1 1 3.46 1. 1. 2.
MAT1 1 1.+7 .3
$
ENDDATA

33
Solution File for Bringing in Reduced
Stiffness Matrix:

$
$ soln6b.dat
$
SOL 101 $
TIME 5
CEND
TITLE = bring in the cross bar using dmig
DISP = ALL
SPC = 1
$
k2gg = kttgext
$
SUBCASE 1
LABEL = STATIC LOAD CASE
LOAD = 1
$
BEGIN BULK
$
include 'soln6a.pch'
$
GRID 1 0 0.0 0.0 0.0
GRID 2 0 0.0 10. 0.0
GRID 3 0 0.0 20. 0.0
GRID 4 0 0.0 30. 0.0
$
GRID 7 0 30. 30. 0.0
GRID 8 0 30. 20. 0.0
GRID 9 0 30. 10. 0.0
GRID 10 0 30. 0.0 0.0
$
GRID 100 0 50. 50. 0.0 123456
$
CBAR 1 1 1 2 100
CBAR 2 1 2 3 100
CBAR 3 1 3 4 100
CBAR 7 1 7 8 100
CBAR 8 1 8 9 100
CBAR 9 1 9 10 100
$
FORCE 1 4 0 1000. 1.
$
$ CONSTRAINTS BULK DATA ENTRIES
$
SPC1 1 123456 1 10
$
$ PROPERTY AND MATERIAL BULK DATA ENTRIES
$
PBAR 1 1 3.46 1. 1. 2.
MAT1 1 1.+7 .3
$

34
ENDDATA

35
Solution File for Full Model:

$
$ soln6c.dat
$
SOL 101 $
TIME 5
CEND
TITLE = FULL MODEL
DISP = ALL
SPC = 1
$
SUBCASE 1
LABEL = STATIC LOAD CASE
LOAD = 1
$
BEGIN BULK
$
GRID 1 0 0.0 0.0 0.0
GRID 2 0 0.0 10. 0.0
GRID 3 0 0.0 20. 0.0
GRID 4 0 0.0 30. 0.0
$
GRID 5 0 10. 30. 0.0
GRID 6 0 20. 30. 0.0
GRID 7 0 30. 30. 0.0
$
GRID 8 0 30. 20. 0.0
GRID 9 0 30. 10. 0.0
GRID 10 0 30. 0.0 0.0
$
GRID 100 0 50. 50. 0.0 123456
$
CBAR 1 1 1 2 100
CBAR 2 1 2 3 100
CBAR 3 1 3 4 100
CBAR 4 1 4 5 100
CBAR 5 1 5 6 100
CBAR 6 1 6 7 100
CBAR 7 1 7 8 100
CBAR 8 1 8 9 100
CBAR 9 1 9 10 100
$
FORCE 1 4 0 1000. 1.
$
$ CONSTRAINTS BULK DATA ENTRIES
$
SPC1 1 123456 1 10
$
$ PROPERTY AND MATERIAL BULK DATA ENTRIES
$
PBAR 1 1 3.46 1. 1. 2.
MAT1 1 1.+7 .3
$

36
ENDDATA

37
PARTIAL OUTPUT FROM FULL MODEL RUN
1 FULL MODEL

0 STATIC LOAD CASE

D I S P L A C E M E N T V E C T O R

POINT ID. TYPE T1 T2 T3 R1


1 G 0.0 0.0 0.0 0.0 ...
2 G 3.459926E-02 1.237283E-04 0.0 0.0 ...
3 G 1.050316E-01 2.474567E-04 0.0 0.0 ...
4 G 1.612490E-01 3.711850E-04 0.0 0.0 ...
5 G 1.611046E-01 -7.059396E-03 0.0 0.0 ...
6 G 1.609603E-01 6.963150E-03 0.0 0.0 ...
7 G 1.608159E-01 -3.711850E-04 0.0 0.0 ...
8 G 1.047750E-01 -2.474567E-04 0.0 0.0 ...
9 G 3.451906E-02 -1.237283E-04 0.0 0.0 ...
10 G 0.0 0.0 0.0 0.0 ...
100 G 0.0 0.0 0.0 0.0 ...

38
Workshop # 7

Calculate the Element Strain Energy Due


to the DMIG Entries

39
Workshop # 7

Objective:

 Calculate the element strain energy per mode due to element


stiffness from the DMIG input.

Procedure:

1. Submit the following cantilever beam model (soln7a.dat)


consisting of two Bar elements. This is a planar problem retaining
only the 2 and 6 degrees of freedom. Request and review the strain
energy output for the BAR elements.

1 2 3
x
11 12

L L

A = 1.0, I1 = I2 = .0833,
J = .1667, E = 3.E7, L = 10.

Py1 6 3L -6 3L y1

Mz1 2EI 3L 2L2 -3L L2 z1


= --------
Py2 L3 -6 -3L 6 -3L y2

Mz2 3L L -3L 2L2 z

40
Workshop # 7 (cont.)

2. Make a copy of problem from item 1 and comment out


“cbar,11” from the input file and replace the stiffness with the
following equivalent DMIG matrix. A K2GG=STIFF Case
Control command is required. A copy of these DMIG entries
are available in the file dmig8.dat.

dmig stiff 0 6 1 0
$
$DMIG NAME GJ CJ G1 C1 A1
$
dmig stiff 1 2 1 2 29988.
1 6 149940. 2 2 -29988.
2 6 149940.
dmig stiff 1 6 1 6 999600.
2 2 -149940. 2 6 499800.
dmig stiff 2 2 2 2 29988.
2 6 -149940.
dmig stiff 2 6 2 6 999600.

3. Write a dmap to calculate the strain energy generated by the


DMIG entries.

4. Put the strain energy calculation inside a subdmap

5. Use the MESSAGE module to format the strain energy output,


mode by mode.

Hints:

 The DMIG stiffness matrix is saved as k2jj. This datablock needs


to be saved inside the SEMG1 module and to be retrieved later on.

 The strain energy datablock is called ONRGY1 and is printed


inside the SEDRCVR module.

 Other possible useful modules:


 DBSTORE
 DBFETCH
 SMPYAD
 PARAML

41
PARTIAL OUTPUT FOR WORKSHOP # 7

0THE DENSITY OF THIS MATRIX IS 100.00 PERCENT.


^^^-------------------------------------------------------
^^^MODE NUMBER 1
^^^STRAIN ENERGY OF DMIG 9.833312E+04
^^^
^^^-------------------------------------------------------
^^^-------------------------------------------------------
^^^MODE NUMBER 2
^^^STRAIN ENERGY OF DMIG 2.579659E+06
^^^
^^^-------------------------------------------------------

42
Input File for Baseline Model with Both CBARs
Defined

$
$ soln7a.dat - baseline bar model
$
id bar stiff
sol 103
time 10
cend
title = two bar example
spc = 100
disp = all
method = 100
ese = all
$
begin bulk
cbar 11 1 1 2 99
cbar 12 1 2 3 99
conm2 21 2 1.5
conm2 22 3 1.5
eigrl 100 2
grdset 1345
grid 1 0. 0. 0.
grid 2 10. 0. 0.
grid 3 20. 0. 0.
grid 99 10. 0. 100.
mat1 1 3.+7 .32
param wtmass .00259
pbar 1 1 1.0 .0833 .0833 .1667
spc1 100 123456 1
enddata

43
Input File for Model with CBAR 11 Defined Using
DMIGs

$
$ soln7b.dat
$ replace bar # 11 using dmig
$
id dmig stiff
sol 103
diag 8
COMPILE SEMG1
ALTER 'add.*k2jj' $
CALL DBSTORE K2JJ,,,,//0/0/' '/0 $
COMPILE SEDRCVR
ALTER 'OFP.*ONRGY1.*cardno'(1,-1) $
CALL STRNENRG UG // $
$
COMPILE STRNENRG
SUBDMAP STRNENRG UG // $
$
TYPE PARM,,I,N,NUMMODES,NVALS $
TYPE PARM,,RS,N,REX$
TYPE PARM,,RS,Y,TINY
$
$ DMIG Processing
$
CALL DBFETCH /K2JJ,,,,/0/0/0/0/0 $
PARAML K2JJ//'PRESENCE'////S,N,NOK2JJ $
$
IF (NOK2JJ <> -1) THEN
matprn k2jj // $
SMPYAD UG,K2JJ,UG,,,/ESEK2JJ/3////1/0/0/ $
$
matprn esek2jj// $
PARAML ESEK2JJ//'trailer'/1/S,N,NVALS $
$
NUMMODES = 1 $
DO WHILE (NUMMODES <= NVALS) $
PARAML ESEK2JJ//'DMI'/NUMMODES/NUMMODES/S,N,REX $
REX = 0.5 * REX $
MESSAGE //'-------------------------------------------------------' $
MESSAGE //'MODE Number '/NUMMODES $
MESSAGE //'Strain Energy of DMIG'/REX $
MESSAGE //' ' $
MESSAGE //'-------------------------------------------------------' $
NUMMODES = NUMMODES + 1 $
ENDDO
ENDIF $ NOK2JJ
RETURN
END $
cend
title = two bar example

44
subtitle = replace one bar with dmig
Model with CBAR 11 Defined Using DMIGs (cont.)

spc = 100
disp = all
method = 100
k2gg = stiff
ese = all
$
begin bulk
cbar 12 1 2 3 99
conm2 21 2 1.5
conm2 22 3 1.5
dmig stiff 0 6 1 0
$
$DMIG NAME GJ CJ G1 C1 A1
$
dmig stiff 1 2 1 2 29988.
1 6 149940. 2 2 -29988.
2 6 149940.
dmig stiff 1 6 1 6 999600.
2 2 -149940. 2 6 499800.
dmig stiff 2 2 2 2 29988.
2 6 -149940.
dmig stiff 2 6 2 6 999600.
eigrl 100 3
grdset 1345
grid 1 0. 0. 0.
grid 2 10. 0. 0.
grid 3 20. 0. 0.
grid 99 10. 0. 100.
mat1 1 3.+7 .32
param wtmass .00259
pbar 1 1 1.0 .0833 .0833 .1667
spc1 100 123456 1
enddata

45
Workshop # 8

Write a DMAP for Rigid Body Check

46
Workshop # 8

Objective:

 Perform rigid body check on the g-set, n-set, and f-set

Procedure:

 Write a DMAP to perform strain free rigid body check on the g-set
level, n-set level, and f-set level.

 The reaction = [K] * [Ur], where [Ur] is the rigid body vector.

 Strain = 0.5 * [Ur]T * [K] * [Ur].

 Use the example in the seminar note (wkshp8.dat) as a starting


point.

 For this workshop, use the ZUZR-type operation to save the


desired datablocks.

47
Partial Input File for Workshop # 8
$
$ wkshp8.dat
$
SOL 101
DIAG 8
COMPILE semg, LIST
alter 'ema.*kjjz'
VECPLOT ,,BGPDTS,EQEXINS,CSTMS,,,,/RBGT1/GRDPNT//4 $ generate rigid-body matrix
TRNSP RBGT1/RBG $
TYPE PARM,NDDL,I,N,ZUZR1,ZUZR2,ZUZR3 $ qualifiers have to be defined
TYPE PARM,NDDL,CHAR8,N,ZNAME
TYPE DB,ZUZR12
ZUZR1 = SEID $ set first qualifier as the current superelement id
ZNAME = 'RBG ' $ set zname as datablock name
COPY RBG/ZUZR12 $ copy and store RBG
DBDICT DATABLK=(ZUZR12), SELECT=(NAME,SIZE,ZNAME,ZUZR1,ZUZR2,ZUZR3) $
MPYAD KJJZ,RBG,/REACG $ reactions to rigid-body motion
MPYAD RBGT1,REACG,/strain2 $ 2.* strain energy
DIAGONAL strain2/strain2d/'column' $ get diagonal terms
ADD strain2d,/strain/(.5,0.) $ divide by 2
NORM strain/tempx///s,n,largest $
type parm,,rs,n,tol= .000001 $ default tolerance
if(largest>tol) then $
message //'kgg failed rigid body test - strain energy follows' $
matprn strain// $
norm reacg/reacgn $
matgpr GPLS,USET0,SILS,REACGN//'H'/'G'//.01 $ print filtered reactions
else $
message //' matrix kgg passed rigid body test' $
endif $
$
compile sekr0
alter 'mce2.*knn'
type db,zuzr12
type parm,nddl,char8,n,zname $
zname='rbg '
type parm,nddl,i,n,zuzr1,zuzr2,zuzr3
upartn uset0,zuzr12/rbn,,,/'g'/'n'/'m'/1 $
mpyad rbn,knn,/reacn/1 $
mpyad reacn,rbn,/strainn2 $
diagonal strainn2/straind2/'column' $
add straind2,/straind/(.05,0.) $
norm straind/tempn///s,n,largestn $
type parm,,rs,n,tol= .000001 $ default tolerance
if(largestn>tol)then $
message //' knn failed rigid-body test'
norm reacn/reacnn $
matgpr gpls,uset0,sils,reacnn//'h'/'n'//.01 $
else $
message //' knn passed rigid-body test'
endif $

48
Partial Input File for Workshop # 8 (cont.)

endalter
cend
title = rigid-body test on kgg
load = 1
spc = 1
disp = all
begin bulk
grid,1,,1.
grid,2,,2.
grid,3,,3.
rbar,99,2,3,123456
celas2,99,10.,1,1,2,1
force,1,1,,1.,1.,0.,0.
spc1,1,123456,2
enddata

49
Solution File for Workshop # 8
$
$ soln8.dat
$
SOL 101
DIAG 8,5,6
COMPILE semg $
alter 'ema.*kjjz'
VECPLOT ,,BGPDTS,EQEXINS,CSTMS,,,,/RBGT1,,/GRDPNT//4 $ generate rigid-body matrix
TRNSP RBGT1/RBG $
TYPE PARM,NDDL,I,N,ZUZR1,ZUZR2,ZUZR3 $ qualifiers have to be defined
TYPE PARM,NDDL,CHAR8,N,ZNAME
TYPE DB,ZUZR12
ZUZR1 = SEID $ set first qualifier as the current superelement id
ZNAME = 'RBG ' $ set zname as datablock name
COPY RBG/ZUZR12 $ copy and store RBG
DBDICT DATABLK=(ZUZR12), SELECT=(NAME,SIZE,ZNAME,ZUZR1,ZUZR2,ZUZR3) $
MPYAD KJJZ,RBG,/REACG $ reactions to rigid-body motion
MPYAD RBGT1,REACG,/strain2 $ 2.* strain energy
DIAGONAL strain2/strain2d/'column' $ get diagonal terms
ADD strain2d,/strain/(.5,0.) $ divide by 2
NORM strain/tempx///s,n,largest $
type parm,,rs,n,tol= .000001 $ default tolerance
if(largest>tol) then $
message //'kgg failed rigid body test - strain energy follows' $
matprn strain// $
norm reacg/reacgn $
matgpr GPLS,USET0,SILS,REACGN//'H'/'G'//.01 $ print filtered reactions
else $
message //' matrix kgg passed rigid body test' $
endif $
$
compile sekr0
alter 'mce2.*knn'
type db,zuzr12
type parm,nddl,char8,n,zname $
ZNAME = 'RBG ' $ set zname as datablock name
type parm,nddl,i,n,zuzr1,zuzr2,zuzr3
DBDICT DATABLK=(ZUZR12), SELECT=(NAME,SIZE,ZNAME,ZUZR1,ZUZR2,ZUZR3) $
upartn uset0,zuzr12/rbn,,,/'g'/'n'/'m'/1 $
mpyad rbn,knn,/reacn/1 $
mpyad reacn,rbn,/strainn2 $
diagonal strainn2/straind2/'column' $
add straind2,/straind/(.5,0.) $
norm straind/tempn///s,n,largestn $
type parm,,rs,n,tol= .000001 $ default tolerance
if(largestn>tol)then $
message //' knn failed rigid-body test'
norm reacn/reacnn $
matgpr gpls,uset0,sils,reacnn//'h'/'n'//.01 $
else $
message //' knn passed rigid-body test'
endif $

50
$
Solution File for Workshop # 8 (cont.)

compile sekr $
alter 'upartn.*knn.*kff' $
type db,zuzr12
type parm,nddl,char8,n,zname $
ZNAME = 'RBG ' $ set zname as datablock name
type parm,nddl,i,n,zuzr1,zuzr2,zuzr3
DBDICT DATABLK=(ZUZR12), SELECT=(NAME,SIZE,ZNAME,ZUZR1,ZUZR2,ZUZR3) $
upartn uset,zuzr12/rbf,,,/'g'/'f'/'comp'/1 $
mpyad rbf,kff,/reacf/1 $
matprn rbf,kff// $
matprn reacf// $
mpyad reacf,rbf,/strainf2 $
diagonal strainf2/straind2/'column' $
add straind2,/straind/(.5,0.) $
norm straind/tempf///s,n,largestf $
type parm,,rs,n,tol= .000001 $ default tolerance
if(largestf>tol)then $
message //' kff failed rigid-body test'
norm reacf/reacff $
matgpr gpls,uset,sils,reacff//'h'/'f'//.01 $
else $
message //' kff passed rigid-body test'
endif $
$
endalter
cend
title = rigid-body test on kgg, knn, and kff
load = 1
spc = 1
disp = all
begin bulk
grid,1,,1.
grid,2,,2.
grid,3,,3.
rbar,99,2,3,123456
celas2,99,10.,1,1,2,1
force,1,1,,1.,1.,0.,0.
spc1,1,123456,2
enddata

51