This action might not be possible to undo. Are you sure you want to continue?

BooksAudiobooksComicsSheet Music### Categories

### Categories

### Categories

Editors' Picks Books

Hand-picked favorites from

our editors

our editors

Editors' Picks Audiobooks

Hand-picked favorites from

our editors

our editors

Editors' Picks Comics

Hand-picked favorites from

our editors

our editors

Editors' Picks Sheet Music

Hand-picked favorites from

our editors

our editors

Top Books

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Audiobooks

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Comics

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Sheet Music

What's trending, bestsellers,

award-winners & more

award-winners & more

Welcome to Scribd! Start your free trial and access books, documents and more.Find out more

MARC

MSC

SOFTWARE

simulating reality

Using Subroutines in MSC.MARC

Contents

Introduction Some programming conventions User subroutines and MSC.Mentat; a sample session Workshop 1 Some programming conventions (continued) User subroutines and external ﬁles Special utility routines and useful MSC.MARC common blocks How to run jobs with user subroutines Workshop 2 Appendix A: Some MSC.MARC subroutines for matrix operations Appendix B: Workshop results and user subroutines

Contents 1

MARC Contents 2 .Using Subroutines in MSC.

Using Subroutines in MSC.MARC Introduction Basic ﬂow diagram nonlinear ﬁnite element stress analysis: Input Set up K∆u = ∆ f ˜ ˜ Determine –1 ∆u = K ∆ f ˜ ˜ Calculate strains and stresses No Converged solution? Yes Generate output Last increment? Stop Introduction Next iteration No Last iteration? Yes Generate output Next increment No Yes 3 .

For a large number of problems. the MSC.MARC data ﬁle contains all necessary information to perform a complete nonlinear analysis Introduction 4 .MARC Input or data ﬁle may contain information about: * analysis type * work space allocation * element types * geometry * boundary conditions * contact bodies * material properties * convergence criteria * solution method * selected output quantities * etc.Using Subroutines in MSC.

g. e. -.Using Subroutines in MSC.MARC Sometimes the ﬂexibility offered by user subroutines is advantageous or even necessary.t = t0 2 L to enter user-deﬁned state variables Introduction 5 .: to enter the thickness of a shell structure by means of an analytical formula: t L z y t0 x z 2 1 – 1 -.

Using Subroutines in MSC. C 2.MARC to deﬁne a constitutive relation which is not covered by one of the material laws available in MSC.MARC: c σ ˙ ε = C 1 t + C 2 sinh ----. C 3 : material constants to deﬁne a friction coefﬁcient as a function of the contact stress: µ c σ Introduction 6 . C 3 with: ˙ ε : equivalent creep strain rate t : time σ : equivalent stress C 1.

MARC Classiﬁcation of user subroutines: Modify geometry.g.: * nodal coordinates in UFXORD * connectivity in UFCONN * thickness of shells in USHELL * nodal thickness in UTHICK Deﬁne constitutive equations. e.Using Subroutines in MSC.g. e.: * anisotropic elasticity in HOOKLW * hardening behaviour in WKSLP * creep behaviour in CRPLAW * generalized stress-strain law in GENSTR * hyperelastic stress-strain law in HYPELA * anisotropic thermal conductivity in ANKOND Introduction 7 .

in FORCDT * non-uniform distributed loads in FORCEM * non-uniform ﬂuxes in FLUX * non-uniform convection in FILM Introduction 8 .: * motion of rigid bodies in MOTION * friction coefﬁcient in UFRIC * contact ﬁlm coefﬁcient in UHTCON Deﬁne boundary conditions.: * time dependent nodal loads/displ.g.Using Subroutines in MSC. e. e.g.MARC Deﬁne constraint conditions (UFORMS) Deﬁne properties of contact bodies.

: * user-deﬁned input data via USDATA * routine at beginning of increment UBGINC * routine at end of increment UEDINC * routine at beginning of iteration UBGITR For an exhaustive list of all user subroutines consult: MSC.Using Subroutines in MSC. e.: * user-deﬁned element post variable in PLOTV * user-deﬁned nodal post variable in UPSTNO * user-deﬁned nodal variable in IMPD * user-deﬁned element variable in ELEVAR Some general routines. Introduction 9 .MARC Deﬁne output quantities.MARC Volume D.MARC documentation. User Subroutines and Special Routines of the MSC.g. e.g.

. respectively xx=2.zz c set variables xx.Using Subroutines in MSC.zz.*)’xx.yy. yy and zz to 2.0.zz.sum = ’.res) write out results to standard output in free format write(*. do not exceed column 72.MARC Some programming conventions Example program (FORTRAN): start programming in column 7.0d0 zz=6. yy and zz common /xxyyzz/ xx.xx.res c call function to multiply three variables res=atbtc(xx.zz) Some programming conventions 10 .yy.0d0 c call subroutine to add three variables call apbpc(xx.0 and 6. 4.yy.0.zz.yy. column 6 can be used to enter a continuation character..0d0 yy=4. enter a c in ﬁrst column to use line as a comment line program demo c c. example program c each variable starting with a to h and o to z is of type real*8.yy.o-z) c deﬁne common block xxyyzz to store variables xx. each variable starting with i to n is of type integer implicit real*8 (a-h.

.zz.c output: d (=a+b+c) implicit real*8 (a-h.res c end of program end subroutine apbpc(a. c c subroutine to add three real*8 numbers input: a.o-z) add a.zz... c..yy..yy. c c.b.xx. b and c and store result in d d=a+b+c c use return statement to exit subprogram return c end of subprogram end Some programming conventions 11 .yy.zz.res c call subroutine to subtract three variables call ambmc(res) write(*.c.yy.. c.Using Subroutines in MSC.zz..xx.*)’xx.d) c c..*)’xx.prod = ’.MARC write(*.diff = ’.b.

. c.yy. b and c and store result in atbtc atbtc=a*b*c c return c end subroutine ambmc(d) c c. c c subroutine to subtract three real*8 precision numbers input: xx........ c c.zz c Some programming conventions 12 ..MARC real*8 function atbtc(a... c.o-z) multiply a. c c function to multiply three real*8 numbers input: a..b.zz (via common block!) output: d (=xx-yy-zz) implicit real*8 (a-h.c) c c... c.Using Subroutines in MSC. c.. yy and zz via common block common /xxyyzz/ xx.o-z) get variables xx. c c.yy.c output: atbtc (=a*b*c) implicit real*8 (a-h..b.

Subprograms will be automatically compiled and linked to the MSC. the include statement can be used . If more than one user-deﬁned subprogram is needed.Using Subroutines in MSC.MARC subtract xx. user-deﬁned subprograms will replace MSC. yy and zz and store result in d d=xx-yy-zz c return c end In combination with MSC. only subprograms need to be programmed.MARC main program. When each routine is saved in a separate ﬁle. they must be collected in one ﬁle when use is made of the default user subroutine option.MARC’s default subprograms. The user subroutine ﬁle simply includes all the others. Some programming conventions 13 . If applicable.MARC.

75 14 .0d0 c=a/b d=a/b**2 Some programming conventions now c equals 1.MARC Mathematical operators (in order of evaluation): raising: muliplication: division: addition: subtraction: * Examples: i=3 j=2 k=i/j ** * / + - now k equals 1 a=3.o-z) is recommended in combination with MSC.MARC The Fortran programming language is case-insensitive Variables consist of characters (a to z.Using Subroutines in MSC.5 and d equals 0. 0 to 9) and start with a letter * Use of implicit real*8 (a-h.0d0 b=2.

.gt. * Order of evaluation: ﬁrst mathematical. Mathematical < ≤ > ≥ = ≠ Logical operators: . .ne.ge.lt.and. then relational and ﬁnally logical operators Some programming conventions 15 . . .MARC Symbolic constants are deﬁned by means of the parameter statement.not.1415927d0) Relational expressions: Fortran .Using Subroutines in MSC.or. . . . which occurs before the ﬁrst executable statement * Example: parameter (pi=3.le.eq.

.. end if Some programming conventions 16 .. else statement .Using Subroutines in MSC.... end if or: if (condition 1) then statement . else if (condition 2) then statement ..MARC If-then-else statements: if (condition 1) statement or: if (condition 1) then statement . else statement ....

bb) then cc=aa/bb dd=aa*aa else cc=bb/aa dd=bb*bb end if Go to statement: go to n.lt. which is an executable statement with no effect on the program. occurring in column 1 to 5 The continue statement: continue. where n is the statement label.MARC * Example: if (aa. may be very useful when combined with a label Some programming conventions 17 .Using Subroutines in MSC.

.*)’x+x^2+.*)’x = ’.0d0 do 10 ii=1.+x^10 = ’.y * Many f77-compilers accept enddo to terminate the loop.last.step with: label: statement label of last executable statement in loop . which equals 1 when omitted * Example: x=3.x write(*.Using Subroutines in MSC.. i = ﬁrst.: optional i: do-variable. and no label is required Some programming conventions 18 .0d0 temp=x y=0.10 y=y+temp temp=temp*x 10 continue c write(*. which is not necessarily integer ﬁrst: initial parameter last: ﬁnal parameter step: incrementation parameter.MARC The do statement: do label.

Using Subroutines in MSC. use of adjustable array declarations is allowed * Example: subroutine normv(v1. the array must exist with the same or a greater size * Parameter passing: call by reference * Be careful with array bounds Array storage: colomn oriented Some programming conventions 19 .MARC Declaration of arrays is done using the dimension statement * Examples: dimension xx(3).yy(3) dimension d(6.6) * Do not use more than 7 array indices In a subprogram.n) c implicit real*8 (a-h.o-z) c dimension v1(n) * In the calling program.

. writing data from within user subroutines is often very useful * MSC.) Some programming conventions 20 .log (on HP unit 7)..*)list with: unit: Fortran unit number list: output list * For debugging or evaluation purposes.) minimum function: min(x. arccosine and arctangent: asin(x)...acos(x). cosine and tangent: sin(x).. e... dabs(x)): absolute value: abs(x) square root: sqrt(x) natural logarithm: log(x) common logarithm: log10(x) exponentional function: exp(x) sine.g..tan(x) arcsine.Using Subroutines in MSC.MARC: unit 0: jid. unit 6: jid.cos(x).x) maximum function: max(x.y.MARC Free format write statement: write(unit.y. atan(x) arctangent of y/x: atan2(y..out Some intrinsic functions (real*8 versions usually start with d.

Using Subroutines in MSC. i. no data structures that can grow dynamically in size * Use common statement to store local variables in a routine.3.e. so that they can be used in other routines and in later calls of the same routine.x2(3). Their values are lost as soon as one returns from the routine.i1.o-z) common /my_common/a1.j2(3.10) This common stores 4 real*8 words and 91 integers. like loop counters need not be stored in common blocks.MARC Data storage in FORTRAN: * Static storage (f77). * Local variables. Some programming conventions 21 . Example: implicit real*8 (a-h.

ν = 0.Mentat.1 .28 * Distributed load magnitude: p = 2.0 * Velocity of load along diagonal is 2 5 * A linear elastic analysis will be performed during 10 time units with 20 equally sized increments User subroutines and MSC.Using Subroutines in MSC. which position depends on time: h z y b x L p * Geometry: h = 0.0 ×10 .0 . L = 10. a sample session A clamped square plate is partly loaded by a square distributed load. a sample session 22 .MARC User subroutines and MSC. b = 1.Mentat.0 * Material properties: E = 2.

ROTATE. OK to overwrite? _ User subroutines and MSC.ZOUT Z ELEMENTS ADD SURFACES ADD ALL: EXIST.VISIBLE OUTLINE UNSEL.Mentat.Z. OK to overwrite? y File plate1.Y.X.X.MARC element type 75 will be used): MECHANICAL BC’s PREV NEW clamped NAME REM NEXT EDIT BOUNDARY CONDITION TYPE FIXED DISPLACEMENT FIXED ACCELERATION POINT LOAD EDGE LOAD FACE LOAD GLOBAL LOAD GRAVITY LOAD CENTRIFUGAL LOAD FLUID DRAG MORE <= TABLES NODES EDGES FACES POINTS CURVES TRANSFORMS ADD ADD ADD ADD ADD REM 40 REM 0 REM 0 REM 0 REM 0 REM 0 REM 0 X Y 4 UNDO SAVE DRAW PLOT FILL VIEW RESET VIEW DYN. SELECT RETURN SELECT. INVIS. MAIN SURFACE END LIST (#) UTILS FILES Enter view to show : *apply_name Enter apply name : clamped Command > dump Enter filename for PostScript output : plate1. a sample session 23 .Using Subroutines in MSC.MARC Finite element mesh (10x10) and boundary conditions along the edges (MSC.ps already exists. VIEW TRAN+ X+ Y+ Z+ ROTATE+ X+ Y+ Z+ ZOOM IN BOX TRAN.Y.ps File plate1.ps already exists.

Using Subroutines in MSC.MARC

Deﬁnition of distributed loads by means of the user subroutine forcem option of the face load menu:

MECHANICAL BC’s PREV NEW dist_loads NAME REM NEXT EDIT FACE LOAD METHOD ENTERED VALUES USER SUB. FORCEM <= ON ON ON PRESSURE U SHEAR V SHEAR 0 0 0 TABLE TABLE TABLE OK

BOUNDARY CONDITION TYPE FIXED DISPLACEMENT FIXED ACCELERATION POINT LOAD EDGE LOAD FACE LOAD GLOBAL LOAD GRAVITY LOAD CENTRIFUGAL LOAD FLUID DRAG MORE

CLEAR

TABLES NODES EDGES FACES POINTS CURVES

TRANSFORMS ADD ADD ADD ADD ADD REM 0 REM 0 REM 100 REM 0 REM 0 REM 0 REM 0 X Y 4 UNDO SAVE DRAW PLOT FILL VIEW RESET VIEW DYN. VIEW TRAN+ X+ Y+ Z+ ROTATE+ X+ Y+ Z+ ZOOM IN BOX TRAN- X- Y- Z- ROTATE- X- Y- ZOUT Z

ELEMENTS ADD

SURFACES ADD ALL: EXIST. SELECT RETURN

SELECT.VISIBLE OUTLINE UNSEL. INVIS. MAIN SURFACE END LIST (#)

UTILS FILES Command > *next_apply Command > *apply_type face_load Command > dump Enter filename for PostScript output : plate2.ps File plate2.ps already exists. OK to overwrite? y File plate2.ps already exists. OK to overwrite? _

User subroutines and MSC.Mentat; a sample session

24

Using Subroutines in MSC.MARC

Select the follower force option in order to deﬁne total loads at the end of each increment:

JOBS PROCESSOR PREV NEW clamped_plate NAME REM NEXT EDIT MECHANICAL ANALYSIS CLASS MECHANICAL ANALYSIS OPTIONS LOADCASES ELASTIC ANALYSIS CLEAR SELECT DESELECT

ANALYSIS CLASS MECHANICAL RIGID PLASTIC HEAT TRANSFER COUPLED COUPLED RIGID PLASTIC JOULE HEATING ACOUSTIC BEARING ELECTROSTATIC MAGNETOSTATIC ELECTROMAGNETIC ADAPTIVE MESHING CRITERIA ELEMENT TYPES ADDITIONAL PRINT CHECK DEACTIVATE RUN RENUMBER ALL ACTIVATE <=

MODAL SOLUTION METHOD

SCALE TO FIRST YIELD INVERSE POWER SWEEP SELECTED LCS AVAILABLE LCS LANCZOS LARGE DISPLACEMENT lcase1 UP UP UPDATED LAGRANGE lcase1 PROCEDURE FINITE STRAIN PLASTICITY FOLLOWER FORCE LUMPED MASS TRANSVERSE SHEAR MODAL INCREMENTSON BUCKLE INCREMENTS ON CREEP TYPE DOWN EXPLICIT MAXWELL OFF OFF DYNAMIC OPERATOR MODAL SUPERPOSITION NEWMARK HOUBOLT CENTRAL DIFFERENCE FAST CENTRAL DIFFERENCE DYNAMIC HARMONIC DOWN COMPLEX DAMPING

EXPLICIT VISCOPLASTIC INERTIA EFFECTS ANALYSIS OPTIONS ANALYSIS DIMENSION NON-ASSOCIATIVE FLOW RULE JOB RESULTS 3-D IMPLICIT MAXWELL VISCOELASTICITY INITIAL LOADS AXISYMMETRIC USER SUB. CRPVIS JOB PARAMETERS PLANE STRAIN CONTACT CONTROL SOIL CONTROL RESET OK PLANE STRESS 2-D OK Z

ALL: EXIST. SELECT RETURN

SELECT.VISIBLE OUTLINE UNSEL. INVIS. MAIN SURFACE UNDO SAVE DRAW PLOT FILL VIEW RESET VIEW DYN. VIEW END LIST (#)

X

Y 4

UTILS FILES Command > *loadcase_type static Command > *job_class mechanical Command > dump Enter filename for PostScript output : plate3.ps File plate3.ps already exists. OK to overwrite? y File plate3.ps already exists. OK to overwrite? _

TRAN+ X+ Y+ Z+ ROTATE+ X+ Y+ Z+ ZOOM IN BOX TRAN- X- Y- Z- ROTATE- X- Y- ZOUT

User subroutines and MSC.Mentat; a sample session

25

Using Subroutines in MSC.MARC

Deﬁne the user subroutine ﬁle as plate.f and ask for an overview of currently selected user subroutines:

JOBS PROCESSOR PREV NEW clamped_plate NAME REM NEXT EDIT

RUN JOB TITLE WRITE INPUT <= USER SUBS FILE plate.f CPUS SUBMIT 1 SUBMIT 2 SUBMIT 3 UPDATE 1 EXECUTE 1 EXECUTE 2 EXECUTE 3 MONITOR 0 Complete 20 0 48.66 KILL CHECK SIZES CURRENTLY SELECTED USER SUBROUTINES Boundary Conditions: EDIT INPUT FORCEM USER SUBS

MEMORY ALLOCATION 1000000

ANALYSIS CLASS MECHANICAL RIGID PLASTIC HEAT TRANSFER COUPLED COUPLED RIGID PLASTIC JOULE HEATING ACOUSTIC BEARING ELECTROSTATIC MAGNETOSTATIC ELECTROMAGNETIC ADAPTIVE MESHING CRITERIA ELEMENT TYPES ADDITIONAL PRINT CHECK DEACTIVATE RUN RENUMBER ALL ACTIVATE

SUBMISSION # STATUS INCREMENT SUB-INCREMENT TIME

SINGULAR. RATIO 0.061561 CONVERGE. RATIO7.12e-15 MEGAFLOPS EXIT NUMBER EXIT MESSAGE EDIT OUTPUT 0 3004 EDIT FILE EDIT LOG FILE OK OK X Y 4 UNDO SAVE DRAW PLOT FILL VIEW RESET VIEW DYN. VIEW TRAN+ X+ Y+ Z+ ROTATE+ X+ Y+ Z+ ZOOM IN BOX TRAN- X- Y- Z- ROTATE- X- Y- ZOUT Z

ALL: EXIST. SELECT RETURN

SELECT.VISIBLE OUTLINE UNSEL. INVIS. MAIN SURFACE END LIST (#)

RESET

UTILS FILES File plate3.ps already exists. OK to overwrite? Command > *update_job Command > dump Enter filename for PostScript output : plate4.ps File plate4.ps already exists. OK to overwrite? y File plate4.ps already exists. OK to overwrite? _

User subroutines and MSC.Mentat; a sample session

26

f: JOBS PROCESSOR PREV NEW clamped_plate NAME REM NEXT EDIT RUN JOB TITLE WRITE INPUT <= USER SUBS FILE plate.ps File plate5. OK to overwrite? y File plate5. INVIS.Y.Mentat.ps already exists. RATIO0 MEGAFLOPS EXIT NUMBER EXIT MESSAGE EDIT OUTPUT 0 0 EDIT FILE EDIT LOG FILE OK X Y 4 UNDO SAVE DRAW PLOT FILL VIEW RESET VIEW DYN. Command > dump Enter filename for PostScript output : plate5.f CPUS SUBMIT 1 SUBMIT 2 SUBMIT 3 UPDATE 1 EXECUTE 1 EXECUTE 2 EXECUTE 3 MONITOR 0 Not Submitted 0 0 0 KILL CHECK SIZES EDIT INPUT USER SUBS MEMORY ALLOCATION 1000000 ANALYSIS CLASS MECHANICAL RIGID PLASTIC HEAT TRANSFER COUPLED COUPLED RIGID PLASTIC JOULE HEATING ACOUSTIC BEARING ELECTROSTATIC MAGNETOSTATIC ELECTROMAGNETIC ADAPTIVE MESHING CRITERIA ELEMENT TYPES ADDITIONAL PRINT CHECK DEACTIVATE RUN RENUMBER ALL ACTIVATE SUBMISSION # STATUS INCREMENT SUB-INCREMENT TIME SINGULAR.MARC Use the edit ﬁle option to program user subroutine forcem in ﬁle plate.Y. a sample session 27 . VIEW TRAN+ X+ Y+ Z+ ROTATE+ X+ Y+ Z+ ZOOM IN BOX TRAN.Using Subroutines in MSC.Z.ZOUT Z ALL: EXIST. RATIO 0 CONVERGE.proc closed. SELECT RETURN SELECT.X.X.VISIBLE OUTLINE UNSEL.ROTATE. MAIN SURFACE END LIST (#) RESET UTILS FILES Enter alias string : write_postscript_gray_all Procedure file usersubs. OK to overwrite? _ User subroutines and MSC.ps already exists.

.y)-plane with a constant velocity v along the line x=y Since use will be made of nthe FOLLOW FORCE option together with AUTO LOAD.th1.. c c. c. c. dimension th1(3).....0d0)*distan yc=0.. c....nn. c..0d0 v=sqrt(2.. c c...n) c implicit real*8 (a-h.. The centre of the load is moving in the (x...... c..5d0*sqrt(2. c c. c. c. c..o-z) c c.th2...0d0)*distan Boundaries of loaded area xmin=xc-b/2. c.... User subroutines and MSC. c.. a sample session 28 .0d0) Determine current centre of load distan=v*(cptim+timinc) xc=0./common/creeps’ Define b and v b=1..Mentat.. the total load at the end of the increment must be specified...th2(3)....Using Subroutines in MSC.0d0 ymin=yc-b/2. Define non-uniformdistributed force on an element press th1 th2 nn n(1) n(2) n(3) n(4) n(5) distributed load (increment magnitude (x.0d0 ymax=yc+b/2.n(7) Include common block creeps to obtain total time (cptim) and time increment (timinc) include ’. c c c. c c. The load is assumed to have a square shape with edge lengts b..f: subroutine forcem(press.MARC Listing of ﬁle plate... c..z) position of the integration point vector describing direction of load integration point number element number parameter identifying the type of load not used not used distributed load index Programmed to simulate a moving distributed load....0d0 c c.... c.0d0 xmax=xc+b/2.. c...y. c. c. c.5d0*sqrt(2.

$ th1(2).0d0 return end c c...0d0 th2(3) =-1.0d0 if (th1(1).th1(2)...le.Mentat. a sample session 29 . use the MSC.ge.xmax.th1(1).Using Subroutines in MSC.and.ymax. c. Define non-zero load only if integration point is located within the boundaries of loaded area press=0.ymin) press=2.g.Mentat execute menu’s instead of the submit menu’s User subroutines and MSC.MARC c c.ge.and.0d0 th2(2) = 0. e.: include ’/usr/software/marc2001/common/creeps’ * Submitting the job implies that the following type of command will be executed: marc2001 -jid model1_clamped_plate -u plate -q b -v no * After having changed the MSC.and..xmin.MARC data ﬁle using write input and edit input.le.. c Remarks: * On some computers. the include statement needs a full path name.0d0 Define direction of load th2(1) = 0.

Using Subroutines in MSC.500e+00 FREQ : 0. a sample session 30 .000e-01 -3.500e-01 -5.000e-01 -4.000e-02 -1.500e-01 -2.000e-01 -2.MARC Contour band plot of the external force in z-direction for increment 7: INC : 7 SUB : 0 TIME : 3.000e-01 Z clamped_plate External Force z X Y 4 User subroutines and MSC.000e+00 -5.500e-01 -4.Mentat.000e+00 0.500e-01 -3.000e-01 -1.

Use subroutines ushell. L L with h 0 = 0. include the udump option followed by an empty line in the MSC.25 sin ----.1 Moreover. Note: in order to trigger impd. calculate per increment the sum of the reaction forces along the edge y = 0 .Using Subroutines in MSC.MENTAT: jobs/mechanical/job results/output ﬁle Workshop 1 31 . MSC. ubginc.MARC Workshop 1 Exercise 1: Repeat the analysis of the previous section Exercise 2: Perform the same analysis as in exercise 1.MARC data ﬁle. impd and uedinc for these purposes and verify the results by comparing them with the results mentioned in Appendix B. but include a thickness of the plate which is given by: πx πy h = h 0 1 – 0. sin ----.

and C 1 and C 2 are material constants. Compare the results with Appendix B. Use 1 element of type 9. Workshop 1 32 . both for the loading and the unloading phase. given by: C 1 = 1. Program the material law using user subroutine hypela.Using Subroutines in MSC.01. Activate large displacement and perform relative control checking on displacements with a tolerance of 0.0 and C 2 = 2.MARC Exercise 3: A material is assumed to be governed by the following stress-strain relation: σ = C1ε + C2ε 2 where σ and ε are the equivalent stress and strain. Use 40 equally sized steps.0 ×10 4 Analyze the following tensile test: F where the force F ﬁrst increases linearly from 0 to 20 and then decreases linearly to 0. respectively.

yc.MARC Some programming conventions (continued) Character variables are declared using the character statement.Using Subroutines in MSC. they can be merged using the concatenation operator // * Examples: character*3 xc.zc character*6 tc c xc=’aaa’ yc=’bbb’ tc=xc c tc=xc//yc c zc=tc spaces now tc equals aaa~~~ now tc equals aaabbb now zc equals aaa A substring is a number of consecutive characters of a character variable * Example: character*2 sc character*6 zc c zc=’aaabbb’ sc=zc(3:4) Some programming conventions (continued) now sc equals ab 33 .

MARC Opening and closing external ﬁles is done using the open and close statements * Example: open(unit=250.MARC.status=’new’) now a new ﬁle ’res’ has been opened c * In combination with MSC.file=’res’.file=’res’.status=’delete’) c now ﬁle ’res’ has been deleted open(unit=250.Using Subroutines in MSC.status=’unknown’) now ﬁle ’res’ has been opened close(unit=250. use a unit number greater than 200 for user-deﬁned external ﬁles Edit descriptors for formatted input/output: * the i edit descriptor for integer data * the f edit descriptor for real data * the e edit descriptor for real data in exponential form * the a edit descriptor for character data * the x edit descriptor for skipping spaces * the apostrophe edit descriptor for writing character constants * the / edit descriptor for writing a new line Some programming conventions (continued) 34 .

555)ii.f5.4x.333)evalue write(*.xc c 111 222 333 444 555 format(2i5) format(f10.Using Subroutines in MSC.i5.9~~~~end spaces Some programming conventions (continued) 35 .5d9 xc=’end’ c write(*.5) format(2x.111)ii.2)’)evalue write(*.444)xc write(*.MARC * Examples: implicit real*8(a-h.4x.222)rvalue write(*.13E+11 ~~end~~ result:~~~~25~~~~~~7.9300 -0.rvalue.o-z) c character*3 xc c ii=25 jj=50 rvalue=7.2x) format(’result: ’.a.1.12500E+11 ~~~-0.4) format(e12.jj write(*.93d0 evalue=-12.’(e12.a) output: ~~~25~~~50 ~~~~7.

status=’new’) iopen=1 end if write(iunit.err=100)x(i) 10 continue end and err are optional 100 write(*.file=’res’.status=’unknown’) close(iunit.n1=1. ii /5*1.10000 read(60.*)’error while reading data’ call quit(1234) 200 continue c 444 format(e12.eq.MARC dimension x(10000) c do 10 i=1.status=’delete’) open(iunit.’(10i3)’) (ii(n1).Using Subroutines in MSC.ii(10) data iopen /0/.file=’res’.4) c The data statement is a non-executable statement.444. deﬁning the initial value of a variable * Example: common /private/ iopen.5*2/ c if (iopen.end=200.10) Some programming conventions (continued) 36 .0) then iunit=250 open(iunit.

MARC User subroutines and external ﬁles Writing external result ﬁles: For evaluation purposes. c common /user/ fz c common /check/ iopen. end of each increment c c.Mentat procedure file.. dummy user subroutine that is called at the c... inc increment number c. incsub subincrement number c c.. such as data points for a 2D graph Sometimes a convenient way is to write a MSC.. per increment in a MSC.incsub) c implicit real*8 (a-h...g. Programmed to print the added reaction force fz c. in which e...iunit data iopen/0/ c User subroutines and external ﬁles 37 . it may be useful to write an external ﬁle containing certain results.Mentat procedure ﬁle..o-z) c c. a table will be deﬁned An example of writing such a procedure ﬁle is listed below (referring to Example 2 of Workshop 1): subroutine uedinc(inc..Using Subroutines in MSC..

file=’res. when stored in common block usdacm Specify amount of data in number of REAL*4 words User subroutines and external ﬁles 38 .MARC if (iopen.*) ’*table_add’ write(iunit. reading data from the data ﬁle is done only using standard MSC.eq.*) ’*table_fit’ c return end The usdata option: By default. since a new MSC.proc’.Using Subroutines in MSC.proc’.status=’new’) write(iunit.status=’delete’) open(iunit. as speciﬁed in user subroutine usdata Advantages of the usdata option: * Parameter studies can be done easier.*) inc.0) then iopen=1 iunit=250 open(iunit.file=’res. reading speciﬁc data is done according to the instructions of the user.MARC subroutines Upon the use of the usdata option.fz write(iunit.MARC executable needs to be created only once * User deﬁned variables can be saved on a restart ﬁle.status=’unknown’) close(iunit.*) ’*new_table’ end if c write(iunit.

s11c read(kin. 2 : real reader c common/usdacm/emod..s33c. $ s11t. shear yield stresses read(kin...ic) c implicit real*8 (a-h.eq..s22c read(kin. kin = input unit c. 2000..s11c.. 2000. kou = output unit c.4000. User subroutine for usdata option c c.2309.s31 c if (ic. solver User subroutines and external ﬁles 39 .s33t..s22c.s22t.*) s12. direct yield stresses in tension and compression read(kin.4000. ic = 1 : pre-reader c.3.s31 end if c return end * Corresponding part of the data ﬁle: 11 real*8 words = 22 real*4 words usdata. c c.2) then c. Young’s modulus and Poisson’s ratio read(kin.s23..Using Subroutines in MSC..*) s22t. 2000..4000.pois c.kou. material law.2309...s23.0....*) s33t.... $ s12.MARC An example of the use of usdata is given below: subroutine usdata(kin..0e5. Programmed to read material data for a user-defined c.pois.o-z) c c.*) emod..*) s11t. 2309.s33c c.22 2.

... Dummy user subroutine that is called at the c..status=’delete’) open(unit=5.lt..incsub) c implicit real*8 (a-h..and. incsub subincrement number c c.MARC unit 5 in c.MARC data ﬁle Sometimes the decision about e.g.. step sizes to be applied or continuation of the analysis should be made by the user during the analysis This goal can be achieved by writing user-deﬁned input data in unit 5 similar.status=’unknown’) close(unit=5.. the analysis will be c.. c c.o-z) c c.gt.Using Subroutines in MSC. order to continue the analysis with incremental c.50) then close(unit=5) open(unit=5.. inc increment number c. like in the following example: subroutine uedinc(inc. Programmed to add input to MSC.. data equal to increment 1. c if (inc. the complete loading history is deﬁned directly in the MSC.status=’new’) write(5. end of each increment...file=’newinput’.111) rewind(unit=5) end if c 111 format(’continue’) c return end User subroutines and external ﬁles 40 .o.inc.MARC Deﬁning input: By default. stopped at increment 50.file=’newinput’....

no file will be produced.. c..t08 and restart should be read from increment nnnnn..... c. c...t08... c c.log. User subroutines and external ﬁles 41 .. c. c. a restart ﬁle can be written either for the last converged increment (restart last) or for a previously deﬁned increment sequence (restart) For large jobs. c c.t08.. For increments where no restart file is written.. c....Using Subroutines in MSC..o-z) c c..... c. c c. c... c dummy user subroutine that is called at the end of every increment inc incsub increment number subincrement number Programmed to close the restart file (unit 8) and to rename this file into jidname. When a restart file of this job is being used. c. in this way disk space can be saved A subroutine to be used for this purpose is listed below: subroutine uedinc(inc. the file ridname...MARC Restart ﬁles: By default. c. c.nnnnn should be renamed to ridname. c c...... c... it may be useful to write a separate restart ﬁle for each increment in order to be able to remove manually the restart ﬁles of increments which are no longer of interest. All the files are closed after the end of increment message and could be removed if the use decides they are no longer needed.incsub) c implicit real*8 (a-h...nnnnn where nnnnn is the increment number. but a warning is given in the file jidname.

.. c c.. c c.. c The quit subroutine: When during execution of a user subroutine a certain error condition occurs..MARC include ’./common/machin’ c character*200 text character*80 text1 integer system c c.dum.5)’) inc move jid. an elegant way to stop the run is to call MSC.g.Using Subroutines in MSC.. close restart unit 8 and keep it io=8 call seqwr(io. call quit(12345) User subroutines and external ﬁles 42 ..t08..5) define unit 8 to being closed opflag(io)=1 create name to store current closed restart file text1=cnames(io) ii=index(text1.’(i5.t08 to jid.../common/fname’ include ’../common/prepro’ include ’. with a userdeﬁned exit number e.1.MARC subroutine quit.nnnnn via a system call text=’mv ’//cnames(io)//’ ’//text1 is=system(text) return end c c.’ ii=ii+1 write(text1(ii:ii+4).’t08’)+3 text1(ii:ii)=’.

MARC internal data storage in any user subroutine that is in an element loop element data is at the element.Using Subroutines in MSC.MARC internal storage nodal data is at the nodal point level. e.MARC common blocks 43 .MARC Special utility routines and useful MSC. external forces. stresses.MARC common blocks ELMVAR utility routine allows the user to retrieve element data from the MSC. NODVAR utility routine allows the user to retrieve nodal data from the MSC. integration point and layer level. e.g. and can not be altered by the user * Especially useful when this data is not available through the parameter list Special utility routines and useful MSC. reaction forces * The data is read only. strains etc.g. displacements.

m. the POST model deﬁnition option in MSC.f.Using Subroutines in MSC.MARC element post code to return the desired value(s) to the user (c.var) where.MARC ELMVAR utility routine * To facilitate extraction of element data * Can be called from any user subroutine that is in an element loop * The routine is used in conjunction with the MSC. icode m nn kc var is the element post code is the user element number is the integration point number is the layer number current value(s) of the item(s) requested * If tensor quantities are requested.: dimension var(6) Special utility routines and useful MSC. var must be a local array in the subroutine. e.MARC common blocks 44 .nn.g.MARC manual C) The routine is called with the following header: call elmvar(icode.kc.

nid. e. the POST model deﬁnition option in MSC.g. Special utility routines and useful MSC.Using Subroutines in MSC. icode nid var nqnc nqdt is the nodal post code is the user node number current value(s) of the item(s) requested only relevant when nodvar is used in upstno only relevant when nodvar is used in upstno * If vector quantities are requested.f.var.MARC NODVAR utility routine * To facilitate extraction of nodal data * Can be called from any user subroutine * The routine is used in conjunction with the MSC.MARC manual C) The routine is called with the following header: call nodvar(icode. the nodal coordinates are returned.nqnc.MARC nodal post code to return the desired value(s) to the user (c.: dimension var(3) * For icode=0. var must be a local array in the subroutine.nqdt) where.MARC common blocks 45 .

28) c c..ncrdmx.. lm(*) dimension epten(6. dsxt(ndegmx. this is stored in a local variable: intel=4.intel call elmvar(icode.kc.ndegmx. The post code for the plastic strain tensor is: 321 The plastic strain tensor is stored in a local array: epten The routine could look like: subroutine uadap(m.. It is assumed that there are no shell elements: kc=1 and the number of integration points is 4.dsxt.m.o-z) c dimension xord(ncrdmx. user code to define the task .Using Subroutines in MSC.MARC Example using the ELMVAR utility routine Suppose the plastic strain tensor is needed in subroutine UADAP for a user-deﬁned adaptive meshing criterion.nn.nn)) enddo c .epten(1.*). Get the plastic strain tensorand store it in: epten kc=1 intel=4 icode=321 do nn=1.. c return end $ c Special utility routines and useful MSC.MARC common blocks 46 ...lm.*).xord. nnode.user) implicit real*8 (a-h.

.MARC common blocks MATDAT common block Contains the reference values of the material properties as given in the model deﬁnition input (e. xu(3): the Poisson’s ratios)./common/elmcom’ Special utility routines and useful MSC.g.g.MARC program control variables (e.MARC Useful MSC. CONCOM common block Contains most of the MSC. intel: the number of integration points.g. User Subroutines and Special Routines.g.MARC common blocks 47 . mats: the material id). * These values should not be changed by the user ! * Include a common block with the include statement. e.: include ’. et(3): the Young’s moduli. inc: the increment number). ELMCOM common block Contains information about the current element in the element loop (e. * All variables in these common blocks and their meaning are given in MSC.Using Subroutines in MSC.MARC manual D. jtype: the element type.

How to run jobs with user subroutines 48 .f * One can use the include statement to include other user subroutine ﬁles.: user.Using Subroutines in MSC. * Submit the job from MSC.g.Mentat or * Submit the job from the command line. e.MARC How to run jobs with user subroutines * Gather all subroutines into one ﬁle with a user-deﬁned name.

marc.MARCexecutable is already available How to run jobs with user subroutines 49 .g.f In this menu the user can toggle three possibilities: 1) Use COMPILE / NO SAVE if the routine is used only once 2) Use COMPILE AND SAVE in the ﬁrst run and the user needs to run more than one job with the same user subroutine ﬁle This will create a MSC.MARC Submitting a job with a user subroutine from MSC.: user.Mentat * In mentat select the subroutine(s) in the appropriate menus * Identify the subroutine ﬁle in the RUN JOB menu: e. e.MARC executable in the current working directory with extension .g.Using Subroutines in MSC.: user.marc 3) Use RUN SAVED EXECUTABLE in all following jobs that use the same subroutine ﬁle This requires that a previously created MSC.

..: model1_job1.g.Using Subroutines in MSC....g.." is the path to the MSC."/tools/run_marc -j model1_job1 -u user -save yes This command is executed in the ﬁrst run and the user needs to run more than one job with the same user subroutine ﬁle 3) ".MARC Submitting a job with a user subroutine from the command line * Activate the subroutines through the appropriate options in MSC.f There are three possibilities to run the job: 1) ".Mentat and use WRITE INPUT to create a MSC. e..dat * Gather the subroutines in one ﬁle: e.MARCexecutable is already available "..MARC directory How to run jobs with user subroutines 50 .."/tools/run_marc -j model1_job1 -u user This command is executed when the subroutine is needed only once 2) ".."/tools/run_marc -j model1_job1 -prog user This command is executed in all following jobs that use the same subroutine ﬁle This requires that a previously created MSC.MARC input ﬁle...: user.

MARC Workshop 2 Exercise 1: A cracking problem is simulated using a cracking model based on non-linear springs. with a force-elongation behaviour according to: F Fc α 1 = atan C 1 α 2 = atan C 2 α1 α2 u The non-linear springs are applied between nodes corresponding to the crack path in the direction perpendicular to the crack: Workshop 2 51 .Using Subroutines in MSC.

MARC Analyze the following plane strain model: F double nodes with non-linear springs 1 clamped Y F 10 Z X * Use MSC.Using Subroutines in MSC. linearly increasing from 0 to 75 in 30 equally sized steps Workshop 2 10 52 5 4 3 2 . the behaviour is assumed to 4 be linear elastic.0 ×10 and Poisson’s ratio υ = 0.MARC element type 11 with a thickness of 1 and invoke the assumed strain formulation * Except for the springs.28 * Use user subroutine usprng to deﬁne the spring behaviour. with Young’s modulus E = 2. deﬁne one half of the spring stiffness for spring number 1 * Apply loads F .

but modify usprng and add uedinc to write a MSC.0 ×10 .0 ×10 . F c = 20 and the second one with: C 1 = 1. F c = 20 * Compare the results with Appendix B 5 3 5 1 Exercise 2: Perform the same analysis as in exercise 1.Mentat procedure ﬁle. C 2 = 2.0 ×10 .0 ×10 . which creates a table representing the force-elongation curve of spring number 1 * Compare the results with Appendix B Workshop 2 53 .MARC * Use the usdata option to enter the constants deﬁning the spring behaviour * perform two runs.Using Subroutines in MSC. C 2 = 2. the ﬁrst one with: C 1 = 1.

m*n) * Multiply matrix B[m.n]: call gmadd(A.m*n) * Subtract matrix B[m.n] and B[m.m*n) * Add two matrices A[m.n.n) (C(ijk)=A(ijk)+B(ijk).C.B.n] and store the ﬁnal result in matrix C[m.C.m. such that all entries of A get the same value rp: call scla(A.n] by a scalar s. such that all entries of I get the same value ip: call iscla(I.n) (C(ijk)=A(ijk)+s*B(ijk).C.ijk=1. add the result to matrix A[m.n].n] from matrix A[m.n) (C(ijk)=A(ijk)-B(ijk).B.n] and store the result in matrix C[m.MARC subroutines for matrix operations * Initialize matrix A[m.0) (A(ijk)=rp.ijk=1.m.ijk=1.ijk=1.n]: call gmsub(A.n.m.n] and store the result in matrix C[m.0) (I(ijk)=ip.rp.ijk=1.s.m*n) Appendix A: Some MSC.n]: call gmad(A.MARC Appendix A: Some MSC.B.m.m*n) * Initialize matrix I[m.ip.MARC subroutines for matrix operations 54 .Using Subroutines in MSC.n].m.

l] and store the result in matrix C[m.n) * Copy matrix A[m.n).s.i=1.i)*B(k.n) Appendix A: Some MSC.j)=A(i.n.ijk=1.n]: call mcpy(A.l).n.i=1.0) (C(ijk)=A(ijk).d.l).n] by a scalar s and copy the result into matrix C[m.i=1.m*n) * Multiply matrix A[m.n] and matrix B[n.m]: call gmtra(A.m. store the determinant of A[n.C.n] into matrix C[m.0) (C(ijk)=s*A(ijk).B.MARC subroutines for matrix operations 55 . store A-inverse in A.n] will be performed): call invert(A.l] and store the result in matrix C[n.n).n].n] and store the result in C[n.n.m) * Transpose matrix A[m.i).ijk=1.m. solve A-inverse(n.j=1.k=1.n]: call smpy(A.j).m.C.j)=A(j.n] in d.j=1.n) ((C(i.k=1.B.m.k)*B(k.m).m*n) * Invert matrix A[n.l]: call gmprd(A.n] and matrix B[m.l]: call gtprd(A.l) (((C(i.C.j)=A(k.m.C.m) and put result in B (note that n should be less than or equal to 15 and that if m equals 0 only inversion of A[n.j).l) (((C(i.MARC * Multiply matrix A[m.B.C.Using Subroutines in MSC.n.j=1.m.n.m) * Multiply the transposed of matrix A[m.n)*B(n.

999e-02 8. Exercise 2: Contour band plot of the modiﬁed element thickness: INC : 0 SUB : 0 TIME : 0.Using Subroutines in MSC.769e-02 9.486e-02 8.716e-02 7.460e-02 Z clamped_plate Thickness of Element X Y 4 Appendix B: Workshop results and user subroutines 56 .003e-01 9.000e+00 FREQ : 0.000e+00 1.256e-02 8.973e-02 7.512e-02 9.MARC Appendix B: Workshop results and user subroutines Workshop 1.743e-02 8.229e-02 7.

298e-02 -1.947e-02 -2.000e+00 0.Using Subroutines in MSC.596e-02 -3.894e-02 -4.490e-03 -1.192e-02 -5.543e-02 -5.245e-02 -3.841e-02 -6.490e-02 Z clamped_plate Displacement z X Y 4 Appendix B: Workshop results and user subroutines 57 .500e+00 FREQ : 0.MARC Workshop 1.000e+00 -6. Exercise 2: Contour band plot of the transverse displacement for increment 13: INC : 13 SUB : 0 TIME : 6.

th2(3). c.... Since use will be made of the FOLLOW FORCE option together with AUTO LOAD..141645412466530 time = 36. c. c.th1.. c. c c. c.. c.. c. the total load at the end of the increment must be specified....MARC Workshop 1....y)-plane with a constant velocity v along the line x=y.. c. dimension th1(3).. c. The centre of the load is moving in the (x...... c c..o-z) c c. c.n(7) . c.nn...n) c implicit real*8 (a-h..z) position of the integration point vector describing direction of load integration point number element number parameter identifying the type of load not used not used distributed load index Programmed to simulate a moving distributed load.. c.. c. Exercise 2: Result for increment 13: e n d increment: 13 o f i n c r e m e n t 13 summed reaction force: 0... Exercise 2: Listing of user subroutines: subroutine forcem(press... c. c.Using Subroutines in MSC.....74 Workshop 1. The load is assumed to have a square shape with edge lengths b..y.th2.. c c Appendix B: Workshop results and user subroutines 58 define non-uniform distributed force on an element press th1 th2 nn n(1) n(2) n(3) n(4) n(5) distributed load (increment) magnitude (x.

nn) c implicit real*8 (a-h.0d0 xmax=xc+b/2../common/creeps' define b and v b=1..o-z) c c..ymax. c.MARC c....0d0 define direction of load th2(1)=0.and. to be modified by user (x....5d0*sqrt(2.xmin. $ th1(2).. c c.0d0 if (th1(1)..0d0 th2(3)=-1.ge.. c subroutine ushell(thick..0d0 define non-zero load only if integration point is located within boundaries of loaded area press=0...and.le.0d0) determine current centre of load distan=v*(cptim+timinc) xc=0.0d0 th2(2)=0.. c c. c.0d0)*distan yc=0.th1(2). c.. c c..ymin) press=2.0d0)*distan boundaries of loaded area xmin=xc-b/2.xintp.th1(1)..5d0*sqrt(2.ge. modify thickness of shell elements thick xintp ncrd thickness of shell..xmax. include common block creeps to obtain total time (cptim) and time increment (timinc) include '. c c.0d0 ymin=yc-b/2.z) position of the integration point number of coordinates 59 Appendix B: Workshop results and user subroutines ..0d0 v=sqrt(2.le.y.0d0 ymax=yc+b/2...m.0d0 return end c c.Using Subroutines in MSC..ncrd. c c.and.. c.

.. dummy user subroutine that is called at the beginning of each increment inc incsub increment number subincrement number Programmed to reset added reaction force fz 60 Appendix B: Workshop results and user subroutines ...1415927d0) define thickness only during increment 0 if (inc..0) go to 999 define thickness h0 and length rlen h0=0..0d0-0. c c.25d0*sin(pi*x/rlen)*sin(pi*y/rlen)) c c./common/concom' define pi parameter (pi=3..... c c. m(1) m(2) nn user element number internal element number integration point number Programmed to modify the thickness of a plate according to the formula h=h0(1-sin(pi*x/l)*sin(pi*y/l)).. c c..m(2) include common block concom for increment number (inc) include '. c... c 999 continue return end subroutine ubginc(inc. c c c. c.gt... c..MARC c... c c.. c. c c. c c......incsub) c implicit real*8 (a-h.Using Subroutines in MSC.....o-z) c c. dimension xintp(1). c..1d0 rlen=10..0d0 use analytical formula x=xintp(1) y=xintp(2) thick=h0*(1.

c..ncrd) c implicit real*8 (a-h..td(ndeg).MARC c c.0d-3) fz=fz+f(3) return end c Appendix B: Workshop results and user subroutines 61 ..ndeg.a(ndeg) c common /user/ fz c c. c.xord..1.lt.0d0 c return end subroutine impd(n. c...xord(ncrd)...... c. c user subroutine for output of nodal quantities n dd td xord f v a ndeg ncrd node number incremental displacements total displacements coordinates reaction forces or residual forces velocities accelerations number of degrees of freedom number of coordinates Programmed to add the reaction forces in z-direction per increment along the line y=0. c. c. c define common block to store summed reaction force fz common /user/ fz fz=0... c.Using Subroutines in MSC..f(ndeg)....td.. c.. add reaction force component if y component is almost equal to zero y=xord(2) if (abs(y)... c. dimension dd(ndeg).v..f..o-z) c c..a.. c c..... $ v(ndeg). c.dd.. c c.

Using Subroutines in MSC.*)'summed reaction force:'. c...o-z) c c. c c..fz write(0.MARC subroutine uedinc(inc..incsub) c implicit real*8 (a-h..*)'increment:'. c c c..inc write(0. c c...*)' ' return end c Appendix B: Workshop results and user subroutines 62 .. c.*)' ' write(0.... c.. dummy user subroutine that is called at the end of each increment inc incsub increment number subincrement number Programmed to print the added reaction force fz per increment in the log file common /user/ fz write inc and fz write(0..*)' ' write(0.

o-z) c c. user subroutine to define the stress-strain 63 Appendix B: Workshop results and user subroutines .temp.09 1 Workshop 1.nshear) c implicit real*8 (a-h.kc.941 40 35 45 50 30 55 25 60 20 65 15 70 10 75 5 0..000 0 80 0 Equivalent Elastic Strain (x.g.nn.e.ndi.MARC Workshop 1. Exercise 3: History plot of equivalent stress versus equivalent elastic strain: job1 Node 1 Equivalent Von Mises Stress (x10) 1.01) 3.mats. $ n.Using Subroutines in MSC..s.ngens. Exercise 3: Listing of user subroutine: subroutine hypela(b.dtemp.de.

.gt.... c. calculate strain at end of increment if (ncycle...... c c. c. c. c.... c.. c..ngens)..g(1). c.de(1). c Appendix B: Workshop results and user subroutines 64 . c.temp(1).0) epsend=e(1) if (ncycle. c c.eq./common/concom' dimension e(1)..MARC c... c..0d4 b(1.0d1 c2=2.0) epsend=e(1)+de(1) define b c1=1.0d0*c2*epsend calculate stress corresponding to end of increment s(1)=c1*epsend+c2*epsend*epsend return end c c... c c.... c. c..n(2) c c........ c. c..1)=c1+2....s(1).dtemp(1).... c.Using Subroutines in MSC. $ b(ngens... c c relation for a non-linear elastic material b g e de s temp dtemp ngens n nn kc mats ndi nshear stress-strain law to be formed by user stress change due to temperature effects total strain strain increment stress (should be updated by user) state variables increment of state variables size of stress-strain law element number integration point number layer number material identifier number of direct components number of shear components Programmed for a stress-strain relation given by sig=c1*eps + c2*eps*eps (ndi and nshear are assumed to be 1 and 0) include '... c.

Exercise 1: Deformed conﬁguration with equivalent Von Mises stress for increment 10 (ﬁrst run): INC : 10 SUB : 0 TIME : 5.314e+01 2.Using Subroutines in MSC.142e+00 Y 5.952e+01 2.502e+01 1.167e-01 Z cracking example Equivalent Von Mises Stress X 1 Appendix B: Workshop results and user subroutines 65 .139e+01 7.766e+00 4.000e-01 FREQ : 0.589e+01 2.MARC Workshop 2.676e+01 3.227e+01 1.000e+00 3.864e+01 1.

074e+02 9.Using Subroutines in MSC.114e+01 5.500e+00 FREQ : 0.328e+00 Z cracking example Equivalent Von Mises Stress X 1 Appendix B: Workshop results and user subroutines 66 .530e+01 8.699e+01 3.906e+01 4.000e+00 1.075e+01 Y -1.MARC Workshop 2.283e+01 1. Exercise 1: Deformed conﬁguration with equivalent Von Mises stress for increment 30 (ﬁrst run): INC : 30 SUB : 0 TIME : 1.195e+02 1.491e+01 2.322e+01 7.

600e+01 5.098e+02 9.316e+01 2.505e+01 4.410e+01 3. Exercise 1: Deformed conﬁguration with equivalent Von Mises stress for increment 30 (second run): INC : 30 SUB : 0 TIME : 1.789e+01 7.151e-01 Z cracking example Equivalent Von Mises Stress X 1 Appendix B: Workshop results and user subroutines 67 .Using Subroutines in MSC.884e+01 8.MARC Workshop 2.500e+00 FREQ : 0.694e+01 6.126e+01 Y 3.000e+00 1.221e+01 1.

o-z) c c..Using Subroutines in MSC.03 1 Workshop 2. Exercise 2: Complete listing of user subroutines: subroutine usdata(kin.MARC Workshop 2.ic) c implicit real*8 (a-h.248 11 10 9 8 7 6 5 4 3 2 31 29 30 27 28 25 26 24 22 23 20 21 18 19 16 17 14 15 12 13 0.kou.1) 2. Exercise 2: Force-elongation curve of spring number 1 (ﬁrst run): force(y)_extension(x)_curve_spring_1 Y 9. c user subroutine for usdata option 68 Appendix B: Workshop results and user subroutines ..000 1 0 X (x.

.o-z) c c.. c. c c....nn...... c.. c....c2.*) c1.fc...datak... c. c.u. ratk(1) ratk(2) eforc(1) ratio of present value of spring stiffness to value given in data file ratio of present value of damping coefficient to value given in data file for springs: spring force for elastic foundation: pressure per unit area damping force value of spring constant or foundation stiffness in input file value of damping constant in input file for springs: delta u for elastic foundation: normal displacement for springs/dashpots: delta v total time 69 efroc(2) datak(1) datak(2) u(1) u(2) time(1) Appendix B: Workshop results and user subroutines .2) then constants c1. c.. c....n. c.eforc. c.... c... c. c2 and fc read(kin. c.. Programmed to read in material data for simple cracking model..nsprng) c implicit real*8 (a-h... c.. c.MARC c..Using Subroutines in MSC. c.time.... c... kin kou ic = = = = input unit output unit 1 : pre-reader 2 : real reader common/usdacm/c1. c c......c2...fc end if return end c subroutine usprng(ratk. c c....ispuser if (ic.. user subroutine for non-linear spring and elastic foundation option Programmed to simulate cracking behaviour.. c.eq. c. c c c. c.

c2. c..eq. c c time(2) n(1) n(2) nn nsprng frequency (harmonics) element number (for elastic foundation) face number (for elastic foundation) integration point number (for elastic foundation) spring number common/usdacm/c1.incsub) c implicit real*8 (a-h.u(1). c....time(1). c...Using Subroutines in MSC.gt.disp1 c dimension ratk(1).fc) stiffn=c2 if (nsprng... c. c c. c.eq... Appendix B: Workshop results and user subroutines 70 ...MARC c..Mentat procedure file representing the force-elongation curve of spring 1.1) stiffn=stiffn/2......1) then force1=eforc(1) disp1=disp end if c return end subroutine uedinc(inc.datak(1)... c dummy user subroutine that is called at the end of each increment inc incsub increment number subincrement number Programmed to create a MSC.o-z) c c. c c. c..fc common/springinfo/force1.0d0 ratk(1)=stiffn eforc(1)=stiffn*disp c if (nsprng. c.. c..eforc(2) c stiffn=c1 disp=u(1) force=stiffn*disp if (force.n(1)..

proc'.status='unknown') close(iunit.file='res.eq.0) then iopen=1 iunit=50 open(iunit.proc'.status='delete') open(iunit.*)'*table_name' write(50.file='res.*)'*table_add' write(50.force1 write(50.*)'*new_table' write(50.Using Subroutines in MSC.*)'force(y)_extension(x)_curve_spring_1' end if c write(50.status='new') write(50.*)'*table_fit' c return end Appendix B: Workshop results and user subroutines 71 .*) disp1.disp1 c common /check/ iopen data iopen/0/ c if(iopen.MARC common/springinfo/force1.

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

We've moved you to where you read on your other device.

Get the full title to continue

Get the full title to continue listening from where you left off, or restart the preview.

scribd