TclSeriesIntegratorCommand.cpp

Go to the documentation of this file.
00001 /* ****************************************************************** **
00002 **    OpenSees - Open System for Earthquake Engineering Simulation    **
00003 **          Pacific Earthquake Engineering Research Center            **
00004 **                                                                    **
00005 **                                                                    **
00006 ** (C) Copyright 1999, The Regents of the University of California    **
00007 ** All Rights Reserved.                                               **
00008 **                                                                    **
00009 ** Commercial use of this program without express permission of the   **
00010 ** University of California, Berkeley, is strictly prohibited.  See   **
00011 ** file 'COPYRIGHT'  in main directory for information on usage and   **
00012 ** redistribution,  and for a DISCLAIMER OF ALL WARRANTIES.           **
00013 **                                                                    **
00014 ** Developed by:                                                      **
00015 **   Frank McKenna (fmckenna@ce.berkeley.edu)                         **
00016 **   Gregory L. Fenves (fenves@ce.berkeley.edu)                       **
00017 **   Filip C. Filippou (filippou@ce.berkeley.edu)                     **
00018 **                                                                    **
00019 ** ****************************************************************** */
00020                                                                         
00021 // $Revision: 1.4 $
00022 // $Date: 2003/02/25 23:32:42 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/domain/pattern/TclSeriesIntegratorCommand.cpp,v $
00024 
00025 // Written: fmk 
00026 // Created: 11/00
00027 // Revision: A
00028 //
00029 // Description: This file contains the function invoked when the user invokes
00030 // the Pattern command in the interpreter. It is invoked by the 
00031 // TclModelBuilder_addPattern function in the TclModelBuilder.C file. Current 
00032 // valid Pattern types are:
00033 
00034 // What: "@(#) TclPatternCommand.C, revA"
00035 
00036 #include <tcl.h>
00037 #include <string.h>
00038 
00039 #include <TrapezoidalTimeSeriesIntegrator.h>
00040 
00041 // little function to free memory after invoke Tcl_SplitList
00042 //   note Tcl_Split list stores the array of pointers and the strings in 
00043 //   one array, which is why Tcl_Free needs only be called on the array.
00044 static void cleanup(TCL_Char **argv) {
00045           Tcl_Free((char *) argv);
00046 }
00047 
00048 TimeSeriesIntegrator *
00049 TclSeriesIntegratorCommand(ClientData clientData, Tcl_Interp *interp, TCL_Char *arg)
00050 {
00051   int argc;
00052   TCL_Char **argv;
00053 
00054   // split the list
00055   if (Tcl_SplitList(interp, arg, &argc, &argv) != TCL_OK) {
00056     opserr << "WARNING could not split series integrator list " << arg << endln;
00057     return 0;
00058   }
00059 
00060   TimeSeriesIntegrator *theSeriesIntegrator = 0;
00061 
00062   if (strcmp(argv[0],"Trapezoidal") == 0) {
00063 
00064     theSeriesIntegrator = new TrapezoidalTimeSeriesIntegrator();
00065   }
00066   else {
00067         // type of load pattern type unknown
00068     opserr << "WARNING unknown TimeSeriesINtegrator type " << argv[0] << " - ";
00069     opserr << " SeriesIntegratorType <type args>\n\tvalid types: Trapezoidal\n";
00070     cleanup(argv);
00071     return 0;
00072   }
00073 
00074   cleanup(argv);
00075   return theSeriesIntegrator;
00076 }
00077 
00078 
00079 
00080 

Generated on Mon Oct 23 15:05:02 2006 for OpenSees by doxygen 1.5.0