UMACR2.C  - - Stub File



    umacr2.f is a file in the user directory that allows one to create user macro commands.  To set up a user macro command one needs to edit the file
umacr2.f to include the code one wishes to have executed when the user macro is called from inside FEAP.  The interface can be programed in fortran or it can be programed in C.  The C stub is given below


    The main steps in creating a user macro whether in C or Fortran are The macro name is set in the common variable uct in the common block umac1.  When uct is equal to 'mac2' (in umacr2.f or .c) it should be set to whatever you wish.  On subsequent calls with this name the input argument lct is a string parameter for the command and the input arguments ctl(3) is a real*8 array of parameters.

       A  umacr2.c stub is given below.


Source file:

/* $Id: umacr2.c,v 1.2 1999/05/10 08:10:49 sanjay Exp $ */

struct {                 /* C definition for common block umac1.h  (yes it is umac1.h not umac2.h) */
    char uct[4];
} umac1_;
 

void umacr2_(  char (* lct)[15],   double (* ctl)[3],   int *prt  )          /* Use trailing underscore for C routine names; define input types (At least on many machine types) */
{

  /*  F E A P  A Finite Element Analysis Program

      Copyright (c) 1984-1999: Robert L. Taylor

      Purpose:  User interface for adding solution command language
                instructions.  C language interface by Sanjay Govindjee

      Inputs:
         (*lct)         - Pointer to Command character parameter string 15
         (*ctl)[3]    - Command numerical parameters
         *prt         - Flag, output if true

      Outputs:
         N.B.  Users are responsible for command actions.  See
               programmers manual for example.
  */
 
 

       /* Set macro name to xxxx in common block umac1 */       /* Set uct variable to name you desire if uct = mac2 */
       if( strcmp(umac1_.uct,"mac2")==0 ) {
                strcpy(umac1_.uct,"xxxx");                                       /* command will be known to FEAP as xxxx */
                return;
       }

/* From here down is the source that gets executed when one calls XXXX from FEAP. */

     return;

}