ProductsAbaqus/StandardAbaqus/Explicit Reading floating point and integer variablesTo read both floating point and integer variables in the records, the following coding can be used in the postprocessing program: INCLUDE 'aba_param.inc' DIMENSION ARRAY(513), JRRAY(NPRECD,513) EQUIVALENCE (ARRAY(1),JRRAY(1,1)) With this technique, for example, the record key is available after each call to DBFILE with LOP=0 as KEY = JRRAY (1,2) The use of aba_param.inc eliminates the need to have different versions of the code for single and double precision. The file aba_param.inc defines an appropriate IMPLICIT REAL statement and sets the value of NPRECD to 1 or 2, depending upon whether the machine uses single or double precision. The file aba_param.inc is referenced from the site subdirectory of the Abaqus installation when the postprocessing program is compiled and linked using the abaqus make utility (explained below). Linking the postprocessing programThe postprocessing program must be linked using the make parameter when running the Abaqus execution procedure (see Making user-defined executables and subroutines). To link properly, the postprocessing program cannot contain a Fortran PROGRAM statement. Instead, the program must begin with a Fortran SUBROUTINE with the name ABQMAIN. Compiling, linking, and running a postprocessing program consists of two steps. For example, if the name of the postprocessing program is postproc.f, use the following command to compile and link postproc.f: abaqus make job=postproc The program must then be run using the command: abaqus postproc Calling the utility subroutines for reading the results fileSubroutine INITPF must be called before any results file is accessed. This subroutine contains Fortran OPEN statements for all Fortran units assigned to results files through the call to INITPF; therefore, your code must not contain any OPEN statements for these units. Abaqus constructs a file name for a given unit based on information supplied as LRUNIT(1,K1) and FNAME, as discussed in Utility routines for accessing the results file. Subroutine DBRNU must also be called before reading the first results file and then again each time you need to change to reading another results file. This subroutine simply establishes the Fortran unit number of the results file being read; no information is returned. DBRNU can be called before or after INITPF but must be called before DBFILE. Subroutine DBFILE is used to read each record from the results file. This subroutine will return one record at a time in the format described in Results file. ExampleThe following program reads all the von Mises stresses in the results file and obtains the maximum value. Then, it prints this value along with the element, section point, and integration point numbers where it occurred. In this example Fortran unit 8 is used to read the results file, and the name of the results file is assumed to be TEST.fil. The results file is assumed to be a binary file, and only one results file will be read. Thus, LRUNIT is dimensioned as LRUNIT(2,1); and in the call to the INITPF routine NRU is set to 1, LRUNIT(1,1) is set to 8, and LRUNIT(2,1) is set to 2. A new results file will not be written, so LOUTF is set to zero. SUBROUTINE ABQMAIN C Calculate the maximum von Mises stress and its location C INCLUDE 'aba_param.inc' CHARACTER*80 FNAME DIMENSION ARRAY(513),JRRAY(NPRECD,513),LRUNIT(2,1) EQUIVALENCE (ARRAY(1),JRRAY(1,1)) C C File initialization C FNAME='TEST' NRU=1 LRUNIT(1,1)=8 LRUNIT(2,1)=2 LOUTF=0 CALL INITPF(FNAME,NRU,LRUNIT,LOUTF) JUNIT=8 CALL DBRNU(JUNIT) C C Loop on all records in results file C STRESS=0. DO 100 K1=1,99999 C CALL DBFILE(0,ARRAY,JRCD) IF(JRCD.NE.0)GO TO 110 KEY=JRRAY(1,2) C IF(KEY.EQ.1) THEN C C Element header record: C extract element, sec pt, int pt numbers C JEL=JRRAY(1,3) JPNT=JRRAY(1,4) JSPNT=JRRAY(1,5) C C Stress invariant record for Abaqus/Standard ELSE IF(KEY.EQ.12)THEN C Stress invariant record for Abaqus/Explicit ELSE IF(KEY.EQ.75)THEN C C Extract von Mises stress C IF(ARRAY(3).GT.STRESS)THEN STRESS=ARRAY(3) KEL=JEL KPNT=JPNT KSPNT=JSPNT END IF END IF C 100 CONTINUE 110 CONTINUE C WRITE(6,120) KEL,KPNT,KSPNT,STRESS 120 FORMAT(5X,'ELEMENT',I5,5X,'POINT',I4,5X,'SECTION POINT', 1 I4,5X,'STRESS',1PG12.3) STOP END See Postprocessing of Abaqus Results for additional examples. Writing a file in the results file formatSubroutine DBFILW can be used to write a file in the format of the Abaqus results file to modify the file information or to add additional information before postprocessing. Subroutine INITPF must be called before DBFILW. The file will be written to Fortran unit 9 with the extension .fin. Unit 9 is opened by Abaqus when DBFILW is first called; your coding must not open or redefine unit 9, but you must ensure that Fortran unit 9 is saved following the job. Joining data from multiple results files and converting file format: FJOIN contains an example of the use of subroutine DBFILW to merge specific records of discontinuous results files. Continuous results files are required for postprocessing purposes; if you have written a results file during an analysis and a new results file on the restart of the analysis without making the files continuous, they must be made continuous before postprocessing. Analysis of a cantilever subject to earthquake motion also shows the use of DBFILW for merging results files. Alternatively, results files can be merged using the abaqus append utility as described in Joining results (.fil) files. The DBFILW subroutine can also be used to convert the Abaqus results file from binary to ASCII format to transfer it from one computer system to another. Alternatively, this conversion can be done automatically by using the abaqus ascfil execution procedure, as described in ASCII translation of results (.fil) files. |