2.2. Demonstration Routines

The demonstration routines demonstrate several ways to use the binary file access routines provided with ANSYS. The programs described below (all available on your distribution media; see Accessing ANSYS Binary Files for their location) demonstrate other tasks that the binary access routines can do.

2.2.1. Program bintst (Demonstrates Dumping a Binary File and Copying It for Comparison Purposes)

The bintst program dumps a binary file with the name file.rst to the screen. It then takes that file, copies it to a new file, file2.rst, and dumps the new file to the screen for comparison purposes.

2.2.1.1. Common Variables:

VariableType, Size, IntentDescription
ioutint, sc, commThe output unit number
intpdpint, sc, commThe number of integers per double precision word
lenfrmint, sc, commThe number of characters in the filename
reclngint, sc, commThe system record length

Note:  The bintst program is not part of the binlib.a library. It is included here only to aid you.


2.2.2. Subroutine bintrd (Demonstrates Printing a Dump of File Contents)

*deck,bintrd
      subroutine bintrd (pname)
c *** primary function: bin file dump utility
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c Copyright ANSYS.  All Rights Reserved.
c *** ansys, inc.
c
c     typ=int,dp,log,chr,dcp   siz=sc,ar(n)   intent=in,out,inout
c
c  input arguments:
c     variable  (typ,siz,intent)    description
c     pname     (chr,sc,in)       - name of binary file which is to
c                                   be dumped to the screen
c
c  output arguments:
c     none.
c
c  common variables:
c     iout      (int,sc,comm)     - output unit number
c     intpdp    (int,sc,comm)     - number of integers per double precision word
c     lenfnm    (int,sc,comm)     - number of characters in the filename
c     reclng    (int,sc,comm)     - system record length
c
c                           NOTE: bintrd is not part of binlib.a.  it is 
c                                 included only as an aid to users.
c


Note:  The bintrd routine and the bintwr routine described below are not part of binlib.a. This chapter includes it only to aid you. You can find the source for this routine on the ANSYS distribution media.


Both subroutines require the following common:

COMMON/BINTCM/ IOUT,INTPDP,LENFNM,RECLNG
  • Iout is the output unit number.

  • Intpdp is the number of integers per double precision word.

  • Lenfnm is the number of characters in the filename.

  • Reclng is the system record length.

2.2.3. Subroutine bintwr (Demonstrates Copying Binary File Contents)

*deck,bintwr
      subroutine bintwr (pname,nname)
c *** primary function: bin file copy utility
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c Copyright ANSYS.  All Rights Reserved.
c *** ansys, inc.
c
c     typ=int,dp,log,chr,dcp   siz=sc,ar(n)   intent=in,out,inout
c
c  input arguments:
c     variable  (typ,siz,intent)    description
c     pname     (chr,sc,in)       - name of binary file which is to be copied
c
c  output arguments:
c     variable  (typ,siz,intent)    description
c     nname     (chr,sc,out)      - name of new binary file which is a copy
c                                   of pname
c  common variables:
c     iout      (int,sc,comm)     - output unit number
c     intpdp    (int,sc,comm)     - number of integers per double precision word
c     lenfnm    (int,sc,comm)     - number of characters in the filename
c     reclng    (int,sc,comm)     - system record length
c
c                           NOTE: bintwr is not part of binlib.a.  it is 
c                                 included only as an aid to users.
c

2.2.4. Program wrtsub (Demonstrates Writing an ANSYS Substructure File)

*deck,wrtsub
      program wrtsub

c primary function:    demonstrates use of binary access routines
c secondary function:  write an ANSYS substructure file 
                                       
c *** Notice - This file contains ANSYS Confidential information ***
c
c *** Copyright ANSYS.  All Rights Reserved.
c *** ansys, inc.
c                                                                     
c  *********************************************************************
c  *  Program to write ANSYS substructure file with usrsub.  To be     *
c  *  used as a base for 3rd party companies to create their routines  *
c  *  for writing the file.                                            *
c  *********************************************************************


2.2.5. Program rdsubs (Demonstrates Reading a Substructure File)

Subroutine rdsubs demonstrates how you read an ANSYS substructure file. This demonstration program can handle up to MAXNODE nodes and MAXDOF degrees of freedom.

*deck,rdsubs
      program rdsubs
c primary function:    demonstrates use of binary access routines
c secondary function:  read an ANSYS substructure file
                                       
c *** Notice - This file contains ANSYS Confidential information ***
c
c *** Copyright ANSYS.  All Rights Reserved.
c *** ansys, inc.
c
c  *********************************************************************
c  *  Reads a substructure file.  To be used as base for 3rd party     *
c  *  development of routines for reading ANSYS substructure files.    *
c  *  This demonstration program can handle up to:                     *
c  *   MAXNODE Nodes and MAXDOF DOFs                                   *
c  *********************************************************************


2.2.6. Program rdfull (Demonstrates Reading and Reformatting the .FULL File)

Program rdfull demonstrates how to read and reformat the .FULL file. ANSYS writes the full file for most analysis types that use the sparse solver. You can also use the WRFULL command.

If you want to use the free stiffness and mass matrices, make sure that there are no constraints on your model.

*deck,rdfull
      program  rdfull 
c *** primary function:    demonstrates use of binary access routines
c *** secondary function:  Read and reformat full file 
c
c *** Copyright ANSYS.  All Rights Reserved.
c *** ansys, inc.
c
c
c  **************************************************************
c  *  Reads a FULL file.  To be used as base for 3rd party      *
c  *  development of routines for reading ANSYS FULL files.     *
c  *  This demonstration program can handle up to:              *
c  *   MAXNODE nodes and MAXEQN equations                       *
c  **************************************************************
c
c
c  ****************************************************************
c  ****************************************************************
c  NOTICE - This program demonstrates how to read a .FULL file.

c      If the free-free stiffness and mass matrices are desired, 
c        make sure there are no constraints on the model.
c  ****************************************************************
c  ****************************************************************


2.2.7. Program ResRdDemo (Demonstrates Reading a Results File)

Program ResRdDemo demonstrates how to read a results file using the results file access routines. The file must be named test.rst and the file contents are written to the screen.

This file resides in the subdirectory \Program Files\ANSYS Inc\V182\ANSYS\customize\user (on Windows systems) or /ansys_inc/v182/ansys/customize/misc (on Linux systems).

2.2.8. Program ResWrDemo (Demonstrates Writing a Results File)

Program ResWrDemo demonstrates how to write an ANSYS-readable results file. This file resides in the subdirectory \Program Files\ANSYS Inc\V182\ANSYS\customize\user (on Windows systems) or /ansys_inc/v182/ansys/customize/misc (on Linux systems).


Release 18.2 - © ANSYS, Inc. All rights reserved.