next up previous contents
Next: Example External Interface Program Up: Supplementary Routines Previous: Supplementary Routines

Overview

The following routines are not strictly FEMGEN User Routines but were developed as general utilities for use in FEMSYS's in-house pre-interface programs. The functionality which they provide is likely to prove useful to external interface programmers; hence their inclusion here.

These routines form part of a standard release of FEMGV.

ENVIRNSubroutineGet the contents of an Environment Variable

CALL ENVIRN(ENVVAR,VALUE)


\begin{parameters}
\param{ENVVAR}{Character String}{In}{Null terminated characte...
 ...cter string giving
 the value of the {\em environment variable}}\end{parameters}

The input string is compared against a table of environment variables, which is normally maintained by the operating system. If a match is found then the value associated with this environment variable is returned in the output string, which is blank terminated. If no match is found, or if the system does not support environment variables, then a blank string is returned.

This routine is a useful way in which the interface writer can allow the user to set site-dependent defaults for a pre-interface. Example uses might be analysis package version number options or error message output options (see MSPRE).

Note that an environment variable called 'FG_PRE_INT' is now available in the FEMGV main program. This environment variable can be used to set the default analysis environment and thus make the selection of command 'PROPERTY FE-PROG ANALYSIS' automatic for any new FEMGEN model.

For more information see the FEMGV Installation & Customisation Guide, and the FEMGV User Manual.

Example Program

      CHARACTER*80 CSTRNG
      IOPT = 0
      CALL ENVIRN('FG_OPTION'//CHAR(0),CSTRNG)                      
      IF( CSTRNG(1:3).EQ.'YES' ) IOPT = 1

JAPRESubroutineCheck and correct an element Jacobian

CALL JAPRE(IFGELT,IELEM,NNODE,I2D3D,IELEM1,IFFLIP)


\begin{parameters}
\param{IFGELT}{Integer}{In}{FEMGEN element type}
\param{IELEM...
 ...re-ordered \\  1 & Nodes have been re-ordered \\ \end{tabular}} \end{parameters}

Most analysis packages insist that the nodes for 2D elements should be ordered anti-clockwise and that 3D elements should have a positive jacobian. This routine tests an element 'sense' as supplied by FEMGEN and corrects it by re-ordering the node list. The routine will not re-order the nodes on 2D elements in models which have non-zero Z coordinates (in this case the sense of clockwise/anticlockwise is meaningless). Note also that for shell element variants it is not sensible to change the orientation of the elements, even when the model is 2D

KFVOPNInteger FunctionOpen a file and return channel number

ICHAN = KFVOPN(NAME,ITYPE,MODE,IRECL,IEXIT)


\begin{parameters}
\param{NAME}{Character*(*)}{In}{File name terminated by blank...
 ...ailable \\  n & Fortran channel number to use \\ \end{tabular}} \end{parameters}

Given details of a file this routine will open the file and return a channel number to use. This routine should be used when an internal pre-interface needs to open a file because the use of this routine prevents channel number conflicts with FEMGV.

MSPRESubroutineGeneral Error/Warning/Information Message Utility

CALL MSPRE(ITYPE,TEXT,ISUPP,CNAME,IEINT)


\begin{parameters}
\param{ITYPE}{Integer}{In}{Message Type Indicator} 
\param{}{...
 ...r*8}{In}{Supplementary Text}
\param{IEINT}{Integer}{In}{Integer}\end{parameters}

This routine is used to output messages to the screen, log, history, and analysis files. Parameter ISUPP is used to control the addition of supplementary information to the end of TEXT and might be used to output part names for example. The message destination is controlled via the following common block which should be included in the interface program and initialised prior to calling MSPRE.

COMMON /CMSPRE/IMI,IMW,IME,LUOPT,LUPRE,ICOMEN(6),NCOMEN


\begin{parameters}
\param{IMI}{Integer}{}{Information message counter} 
\param{I...
 ...{NCOMEN}{Integer}{}{Number of analysis file comment characters} \end{parameters}

This routine will always write messages to the screen, log, and history files. When LUOPT is set to 1 it will also write messages to the analysis file and under such circumstances the comment characters for the analysis package (e.g ** or C) should be supplied. The message counters are provided to enable a summary of the job to be printed at the end of execution if required. These counters should be initialised to zero at the beginning of the translator.

VRPRESubroutineProvide Date, Time, and Version Number Information

CALL VRPRE(IDAY,IMONTH,IYEAR,IHOUR,IMIN,ISEC,RFVVER,IP)


\begin{parameters}
\param{IDAY}{Integer}{Out}{Day} 
\param{IMONTH}{Integer}{Out}...
 ...ber}
\param{IP}{Integer}{Out}{Patch Letter ID (eg. A, B) as A1} \end{parameters}

Parameter RFVVER should be output in 'F5.3' format, parameter IP should be output in 'A1' format.


next up previous contents
Next: Example External Interface Program Up: Supplementary Routines Previous: Supplementary Routines

Femsys Limited
8/18/1999