TclSeriesCommand.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.13 $
00022 // $Date: 2005/12/15 00:36:19 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/domain/pattern/TclSeriesCommand.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 <Domain.h>
00038 #include <LinearSeries.h>
00039 #include <ConstantSeries.h>
00040 #include <RectangularSeries.h>
00041 #include <TrigSeries.h>
00042 #include <PulseSeries.h>
00043 #include <TriangleSeries.h>
00044 #include <PathTimeSeries.h>
00045 #include <PathSeries.h>
00046 #include <string.h>
00047 
00048 
00049 #ifdef _RELIABILITY
00050 #include <DiscretizedRandomProcessSeries.h>
00051 #include <SimulatedRandomProcessSeries.h>
00052 #include <Spectrum.h>
00053 #include <RandomNumberGenerator.h>
00054 #include <ReliabilityDomain.h>
00055 extern ReliabilityDomain *theReliabilityDomain;
00056 extern RandomNumberGenerator *theRandomNumberGenerator;
00057 #endif
00058 
00059 // little function to free memory after invoke Tcl_SplitList
00060 //   note Tcl_Split list stores the array of pointers and the strings in 
00061 //   one array, which is why Tcl_Free needs only be called on the array.
00062 static void cleanup(TCL_Char **argv) {
00063           Tcl_Free((char *) argv);
00064 }
00065 
00066 
00067 TimeSeries *
00068 TclSeriesCommand(ClientData clientData, Tcl_Interp *interp, TCL_Char *arg)
00069 {
00070 
00071   int argc;
00072   TCL_Char **argv;
00073 
00074   // split the list
00075   if (Tcl_SplitList(interp, arg, &argc, &argv) != TCL_OK) {
00076     opserr << "WARNING could not split series list " << arg << endln;
00077     return 0;
00078   }
00079                             
00080   TimeSeries *theSeries = 0;
00081 
00082   if (strcmp(argv[0],"Constant") == 0) {
00083     // LoadPattern and ConstantSeries - read args & create LinearSeries object
00084     double cFactor = 1.0;
00085         
00086     int endMarker = 1;
00087     if ((endMarker != argc) && (strcmp(argv[endMarker],"-factor") == 0)) {
00088       // allow user to specify the factor
00089       endMarker++;
00090       if (endMarker == argc || 
00091           Tcl_GetDouble(interp, argv[endMarker], &cFactor) != TCL_OK) {
00092             
00093         opserr << "WARNING invalid cFactor " << argv[endMarker] << " - ";
00094         opserr << " Constant -factor cFactor\n";
00095         cleanup(argv);
00096         return 0;
00097       }
00098       endMarker++;
00099     }
00100 
00101     theSeries = new ConstantSeries(cFactor);            
00102     
00103   } else if (strcmp(argv[0],"Trig") == 0 || 
00104              strcmp(argv[0],"Sine") == 0) {
00105     // LoadPattern and TrigSeries - read args & create TrigSeries object
00106     double cFactor = 1.0;
00107     double tStart, tFinish, period;
00108     double shift = 0.0;
00109       
00110     if (argc < 4) {
00111       opserr << "WARNING not enough TimeSeries args - ";
00112       opserr << " Trig tStart tFinish period <-shift shift> <-factor cFactor>\n";
00113       cleanup(argv);
00114       return 0; 
00115     }   
00116     if (Tcl_GetDouble(interp, argv[1], &tStart) != TCL_OK) {
00117       opserr << "WARNING invalid tStart " << argv[1] << " - ";
00118       opserr << " Trig tStart tFinish period <-shift shift> <-factor cFactor>\n";
00119       cleanup(argv);
00120       return 0;                         
00121     }
00122     if (Tcl_GetDouble(interp, argv[2], &tFinish) != TCL_OK) {
00123       opserr << "WARNING invalid tFinish " << argv[2] << " - ";
00124       opserr << " Trig tStart tFinish period <-shift shift> <-factor cFactor>\n";
00125       cleanup(argv);
00126       return 0; 
00127     }     
00128     if (Tcl_GetDouble(interp, argv[3], &period) != TCL_OK) {
00129       opserr << "WARNING invalid period " << argv[3] << " - ";
00130       opserr << " Trig tStart tFinish period <-shift shift> <-factor cFactor>\n";
00131       cleanup(argv);
00132       return 0; 
00133     }     
00134     
00135     int endMarker = 4;
00136     
00137     while (endMarker < argc && endMarker < argc) {
00138       if (strcmp(argv[endMarker],"-factor") == 0) {
00139         // allow user to specify the factor
00140         endMarker++;
00141         if (endMarker == argc || 
00142             Tcl_GetDouble(interp, argv[endMarker], &cFactor) != TCL_OK) {
00143           
00144           opserr << "WARNING invalid cFactor " << argv[endMarker] << " -";
00145           opserr << " Trig  tStart tFinish period -factor cFactor\n";
00146           cleanup(argv);
00147           return 0;
00148         }
00149       }
00150 
00151       else if (strcmp(argv[endMarker],"-shift") == 0) {
00152         // allow user to specify phase shift
00153         endMarker++;
00154         if (endMarker == argc || 
00155             Tcl_GetDouble(interp, argv[endMarker], &shift) != TCL_OK) {
00156             
00157           opserr << "WARNING invalid phase shift " << argv[endMarker] << " - ";
00158           opserr << " Trig tStart tFinish period -shift shift\n";
00159           cleanup(argv);
00160           return 0;
00161         }
00162       }
00163       endMarker++;
00164     }
00165 
00166     theSeries = new TrigSeries(tStart, tFinish, period, shift, cFactor);
00167         
00168   }     
00169 
00170   else if (strcmp(argv[0],"Linear") == 0) {
00171     // LoadPattern and LinearSeries - read args & create LinearSeries object
00172     double cFactor = 1.0;
00173       
00174     int endMarker = 1;
00175     
00176     if ((endMarker < argc) && (strcmp(argv[endMarker],"-factor") == 0)) {
00177       // allow user to specify the factor
00178       endMarker++;
00179       if (endMarker == argc || 
00180           Tcl_GetDouble(interp, argv[endMarker], &cFactor) != TCL_OK) {
00181         
00182         opserr << "WARNING invalid cFactor " << argv[endMarker] << " - ";
00183         opserr << " Linear  -factor cFactor\n";
00184         cleanup(argv);
00185         return 0;
00186       } 
00187       endMarker++;
00188     }
00189 
00190     theSeries = new LinearSeries(cFactor);              
00191   }
00192 
00193 
00194 #ifdef _RELIABILITY
00195 
00196   else if (strcmp(argv[0],"DiscretizedRandomProcess") == 0) {
00197     
00198     double mean, maxStdv;
00199     ModulatingFunction *theModFunc;
00200     
00201     if (Tcl_GetDouble(interp, argv[1], &mean) != TCL_OK) {
00202       opserr << "WARNING invalid input: random process mean \n";
00203       cleanup(argv);
00204       return 0;
00205     }
00206     
00207     if (Tcl_GetDouble(interp, argv[2], &maxStdv) != TCL_OK) {
00208       opserr << "WARNING invalid input: random process max stdv \n";
00209       cleanup(argv);
00210       return 0;
00211     }
00212     
00213     // Number of modulating functions
00214     int argsBeforeModList = 3;
00215     int numModFuncs = argc-argsBeforeModList;
00216     
00217     // Create an array to hold pointers to modulating functions
00218     ModulatingFunction **theModFUNCS = new ModulatingFunction *[numModFuncs];
00219     
00220     // For each modulating function, get the tag and ensure it exists
00221     int tagI;
00222     for (int i=0; i<numModFuncs; i++) {
00223       if (Tcl_GetInt(interp, argv[i+argsBeforeModList], &tagI) != TCL_OK) {
00224         opserr << "WARNING invalid modulating function tag. " << endln;
00225         cleanup(argv);
00226         return 0;
00227       }
00228       
00229       theModFunc = 0;
00230       theModFunc = theReliabilityDomain->getModulatingFunction(tagI);
00231       
00232       if (theModFunc == 0) {
00233         opserr << "WARNING modulating function number "<< argv[i+argsBeforeModList] << "does not exist...\n";
00234         delete [] theModFUNCS;
00235         cleanup(argv);
00236         return 0;
00237       }
00238       else {
00239         theModFUNCS[i] = theModFunc;
00240       }
00241     }   
00242     
00243     // Parsing was successful, create the random process series object
00244     theSeries = new DiscretizedRandomProcessSeries(numModFuncs,theModFUNCS,mean,maxStdv);               
00245   }
00246   
00247   else if (strcmp(argv[0],"SimulatedRandomProcess") == 0) {
00248     
00249     int spectrumTag, numFreqIntervals;
00250     double mean;
00251     
00252     if (Tcl_GetInt(interp, argv[1], &spectrumTag) != TCL_OK) {
00253       opserr << "WARNING invalid input to SimulatedRandomProcess: spectrumTag" << endln;
00254       cleanup(argv);
00255       return 0;
00256     }
00257     
00258     if (Tcl_GetDouble(interp, argv[2], &mean) != TCL_OK) {
00259       opserr << "WARNING invalid input to SimulatedRandomProcess: mean" << endln;
00260       cleanup(argv);
00261       return 0;
00262     }
00263     
00264     if (Tcl_GetInt(interp, argv[3], &numFreqIntervals) != TCL_OK) {
00265       opserr << "WARNING invalid input to SimulatedRandomProcess: numFreqIntervals" << endln;
00266       cleanup(argv);
00267       return 0;
00268     }
00269     
00270     // Check that the random number generator exists
00271     if (theRandomNumberGenerator == 0) {
00272       opserr << "WARNING: A random number generator must be instantiated before SimulatedRandomProcess." << endln;
00273       cleanup(argv);
00274       return 0;
00275     }
00276     
00277     // Check that the spectrum exists
00278     Spectrum *theSpectrum = 0;
00279     theSpectrum = theReliabilityDomain->getSpectrum(spectrumTag);
00280     if (theSpectrum == 0) {
00281       opserr << "WARNING: Could not find the spectrum for the SimulatedRandomProcess." << endln;
00282       cleanup(argv);
00283       return 0;
00284     }
00285     
00286     
00287     // Parsing was successful, create the random process series object
00288     theSeries = new SimulatedRandomProcessSeries(theRandomNumberGenerator,theSpectrum,numFreqIntervals,mean);
00289   }
00290 
00291 #endif
00292 
00293 
00294   else if (strcmp(argv[0],"Rectangular") == 0) {
00295     // LoadPattern and RectangularSeries - read args and create RectangularSeries object
00296     double tStart, tFinish;
00297     double cFactor = 1.0;
00298     if (argc < 3) {
00299       opserr << "WARNING not enogh args - ";
00300       opserr << " Rectangular tStart tFinish <-factor cFactor>\n";
00301       cleanup(argv);
00302       return 0; 
00303     }   
00304     if (Tcl_GetDouble(interp, argv[1], &tStart) != TCL_OK) {
00305       opserr << "WARNING invalid tStart " << argv[1] << " - ";
00306       opserr << " Rectangular tStart tFinish <-factor factor>\n";
00307       cleanup(argv);
00308       return 0;
00309     }
00310     if (Tcl_GetDouble(interp, argv[2], &tFinish) != TCL_OK) {
00311       opserr << "WARNING invalid tStart " << argv[2] << " - ";
00312       opserr << " Rectangular tStart tFinish <-factor fcator>\n";
00313       cleanup(argv);
00314       return 0; 
00315     }     
00316 
00317     int endMarker =  3;
00318     
00319     if ((endMarker != argc) && (strcmp(argv[endMarker],"-factor") == 0)) {
00320       // allow user to specify the factor
00321       endMarker++;
00322       if (endMarker == argc || 
00323           Tcl_GetDouble(interp, argv[endMarker], &cFactor) != TCL_OK) {
00324         
00325         opserr << "WARNING invalid cFactor " << argv[endMarker] << " - ";
00326         opserr << " Rectangular tStart tFinish -factor cFactor\n";
00327         cleanup(argv);
00328         return 0;
00329       }
00330       endMarker++;
00331     }  
00332 
00333     theSeries = new RectangularSeries(tStart, tFinish, cFactor); 
00334   }
00335 
00336   else if (strcmp(argv[0],"Pulse") == 0)  {
00337     // LoadPattern and PulseSeries - read args & create PulseSeries object
00338     double cFactor = 1.0;
00339     double tStart, tFinish, period;
00340     double width = 0.5;
00341     double shift = 0.0;
00342       
00343     if (argc < 4) {
00344       opserr << "WARNING not enough PulseSeries args - ";
00345       opserr << " Pulse tStart tFinish period <-width pulseWidth> <-shift shift> <-factor cFactor>\n";
00346       cleanup(argv);
00347       return 0; 
00348     }   
00349     if (Tcl_GetDouble(interp, argv[1], &tStart) != TCL_OK) {
00350       opserr << "WARNING invalid tStart " << argv[1] << " - ";
00351       opserr << " Pulse tStart tFinish period <-width pulseWidth> <-shift shift> <-factor cFactor>\n";
00352       cleanup(argv);
00353       return 0;                         
00354     }
00355     if (Tcl_GetDouble(interp, argv[2], &tFinish) != TCL_OK) {
00356       opserr << "WARNING invalid tFinish " << argv[2] << " - ";
00357       opserr << " Pulse tStart tFinish period <-width pulseWidth> <-shift shift> <-factor cFactor>\n";
00358       cleanup(argv);
00359       return 0; 
00360     }     
00361     if (Tcl_GetDouble(interp, argv[3], &period) != TCL_OK) {
00362       opserr << "WARNING invalid period " << argv[3] << " - ";
00363       opserr << " Pulse tStart tFinish period <-width pulseWidth> <-shift shift> <-factor cFactor>\n";
00364       cleanup(argv);
00365       return 0; 
00366     }     
00367     
00368     int endMarker = 4;
00369     
00370     while (endMarker < argc && endMarker < argc) {
00371       if (strcmp(argv[endMarker],"-factor") == 0) {
00372         // allow user to specify the factor
00373         endMarker++;
00374         if (endMarker == argc || 
00375             Tcl_GetDouble(interp, argv[endMarker], &cFactor) != TCL_OK) {
00376           
00377           opserr << "WARNING invalid cFactor " << argv[endMarker] << " -";
00378           opserr << " Pulse tStart tFinish period <-width pulseWidth> <-shift shift> <-factor cFactor>\n";
00379           cleanup(argv);
00380           return 0;
00381         }
00382       }
00383 
00384       else if (strcmp(argv[endMarker],"-width") == 0) {
00385         // allow user to specify pulse width
00386         endMarker++;
00387         if (endMarker == argc || 
00388             Tcl_GetDouble(interp, argv[endMarker], &width) != TCL_OK) {
00389             
00390           opserr << "WARNING invalid pulse width " << argv[endMarker] << " - ";
00391           opserr << " Pulse tStart tFinish period <-width pulseWidth> <-shift shift> <-factor cFactor>\n";
00392           cleanup(argv);
00393           return 0;
00394         }
00395       }
00396 
00397       else if (strcmp(argv[endMarker],"-shift") == 0) {
00398         // allow user to specify phase shift
00399         endMarker++;
00400         if (endMarker == argc || 
00401             Tcl_GetDouble(interp, argv[endMarker], &shift) != TCL_OK) {
00402             
00403           opserr << "WARNING invalid phase shift " << argv[endMarker] << " - ";
00404           opserr << " Pulse tStart tFinish period <-width pulseWidth> <-shift shift> <-factor cFactor>\n";
00405           cleanup(argv);
00406           return 0;
00407         }
00408       }
00409       endMarker++;
00410     }
00411 
00412     theSeries = new PulseSeries(tStart, tFinish, period, width, shift, cFactor);
00413   }     
00414 
00415   else if (strcmp(argv[0],"Triangle") == 0)  {
00416     // LoadPattern and TriangleSeries - read args & create TriangleSeries object
00417     double cFactor = 1.0;
00418     double tStart, tFinish, period;
00419     double shift = 0.0;
00420       
00421     if (argc < 4) {
00422       opserr << "WARNING not enough TriangleSeries args - ";
00423       opserr << " Triangle tStart tFinish period <-shift shift> <-factor cFactor>\n";
00424       cleanup(argv);
00425       return 0; 
00426     }   
00427     if (Tcl_GetDouble(interp, argv[1], &tStart) != TCL_OK) {
00428       opserr << "WARNING invalid tStart " << argv[1] << " - ";
00429       opserr << " Triangle tStart tFinish period <-shift shift> <-factor cFactor>\n";
00430       cleanup(argv);
00431       return 0;                         
00432     }
00433     if (Tcl_GetDouble(interp, argv[2], &tFinish) != TCL_OK) {
00434       opserr << "WARNING invalid tFinish " << argv[2] << " - ";
00435       opserr << " Triangle tStart tFinish period <-shift shift> <-factor cFactor>\n";
00436       cleanup(argv);
00437       return 0; 
00438     }     
00439     if (Tcl_GetDouble(interp, argv[3], &period) != TCL_OK) {
00440       opserr << "WARNING invalid period " << argv[3] << " - ";
00441       opserr << " Triangle tStart tFinish period <-shift shift> <-factor cFactor>\n";
00442       cleanup(argv);
00443       return 0; 
00444     }     
00445     
00446     int endMarker = 4;
00447     
00448     while (endMarker < argc && endMarker < argc) {
00449       if (strcmp(argv[endMarker],"-factor") == 0) {
00450         // allow user to specify the factor
00451         endMarker++;
00452         if (endMarker == argc || 
00453             Tcl_GetDouble(interp, argv[endMarker], &cFactor) != TCL_OK) {
00454           
00455           opserr << "WARNING invalid cFactor " << argv[endMarker] << " -";
00456           opserr << " Triangle tStart tFinish period <-shift shift> <-factor cFactor>\n";
00457           cleanup(argv);
00458           return 0;
00459         }
00460       }
00461 
00462       else if (strcmp(argv[endMarker],"-shift") == 0) {
00463         // allow user to specify phase shift
00464         endMarker++;
00465         if (endMarker == argc || 
00466             Tcl_GetDouble(interp, argv[endMarker], &shift) != TCL_OK) {
00467             
00468           opserr << "WARNING invalid phase shift " << argv[endMarker] << " - ";
00469           opserr << " Triangle tStart tFinish period <-shift shift> <-factor cFactor>\n";
00470           cleanup(argv);
00471           return 0;
00472         }
00473       }
00474       endMarker++;
00475     }
00476 
00477     theSeries = new TriangleSeries(tStart, tFinish, period, shift, cFactor);    
00478   }
00479   
00480   else if ((strcmp(argv[0],"Series") == 0) ||
00481            (strcmp(argv[0],"Path") == 0)) {
00482 
00483     // LoadPattern and PathSeries - read args and create RectangularSeries object
00484     double cFactor = 1.0;
00485     if (argc < 3) {
00486 
00487       opserr << "WARNING not enough args - ";
00488       opserr << " Series -dt timeIncr -values {list of points }\n"; 
00489       cleanup(argv);
00490       return 0; 
00491     }
00492 
00493     double timeIncr = 0.0;
00494     int endMarker =  1;
00495     bool done = false;
00496     int fileName = 0;
00497     int fileTimeName = 0;
00498     int filePathName = 0;
00499     Vector *dataPath = 0;
00500     Vector *dataTime = 0;
00501 
00502     while (endMarker < argc && done == false) {
00503         
00504       if (strcmp(argv[endMarker],"-dt") == 0) {
00505         // allow user to specify the time increment
00506         endMarker++;
00507         if (endMarker == argc || 
00508             Tcl_GetDouble(interp, argv[endMarker], &timeIncr) != TCL_OK) {
00509           
00510           opserr << "WARNING invalid dt " << argv[endMarker] << " - ";
00511           opserr << " Series -dt dt ... \n";
00512           cleanup(argv);
00513           return 0;
00514         }
00515       } 
00516 
00517       else if (strcmp(argv[endMarker],"-factor") == 0) {
00518         // allow user to specify the factor
00519         endMarker++;
00520         if (endMarker == argc || 
00521             Tcl_GetDouble(interp, argv[endMarker], &cFactor) != TCL_OK) {
00522           
00523           opserr << "WARNING invalid cFactor " << argv[endMarker] << " - ";
00524           opserr << " Series -factor ... \n";
00525           cleanup(argv);
00526           return 0;
00527         }
00528       } 
00529 
00530       else if (strcmp(argv[endMarker],"-file") == 0) {
00531         // allow user to specify the file name containg time and data points
00532         endMarker++;
00533         if (endMarker != argc) {
00534           fileName = endMarker; // argv[endMarker];
00535         }
00536       }
00537 
00538       else if (strcmp(argv[endMarker],"-filePath") == 0) {
00539         // allow user to specify the file name containg the data points
00540         endMarker++;
00541         if (endMarker != argc) {
00542           filePathName = endMarker; // argv[endMarker];
00543         }
00544       }
00545 
00546       else if (strcmp(argv[endMarker],"-fileTime") == 0) {
00547         // allow user to specify the file name containg the data points
00548         endMarker++;
00549         if (endMarker != argc) {
00550           fileTimeName = endMarker; // argv[endMarker];
00551         }
00552       }
00553 
00554       else if (strcmp(argv[endMarker],"-values") == 0) {
00555         // allow user to specify the data points in tcl list
00556         endMarker++;
00557         if (endMarker != argc) {
00558           int pathSize;
00559           TCL_Char **pathStrings;
00560           
00561           if (Tcl_SplitList(interp, argv[endMarker], 
00562                             &pathSize, &pathStrings) != TCL_OK) {
00563                       
00564             opserr << "WARNING problem splitting path list " << argv[endMarker] << " - ";
00565             opserr << " Series -values {path} ... \n";
00566             cleanup(argv);
00567             return 0;
00568           }
00569           
00570           dataPath = new Vector(pathSize);
00571           for (int i=0; i<pathSize; i++) {
00572             double value;
00573             if ( Tcl_GetDouble(interp, pathStrings[i], &value) != TCL_OK) {
00574               opserr << "WARNING problem reading path data value " << pathStrings[i] << " - ";
00575               opserr << " Series -values {path} ... \n";
00576               cleanup(argv);
00577               cleanup(pathStrings);
00578               return 0;
00579             }
00580             (*dataPath)(i) = value;
00581           }
00582           // free up the array of pathsStrings .. see tcl man pages as to why
00583           cleanup(pathStrings);
00584         }
00585       }
00586 
00587       else if (strcmp(argv[endMarker],"-time") == 0) {
00588         // allow user to specify the data points in tcl list
00589         endMarker++;
00590         if (endMarker != argc) {
00591           int pathSize;
00592           TCL_Char **pathStrings;
00593           
00594           if (Tcl_SplitList(interp, argv[endMarker], 
00595                             &pathSize, &pathStrings) != TCL_OK) {
00596                         
00597             opserr << "WARNING problem spltting time path " << argv[endMarker] << " - ";
00598             opserr << " Series -time {times} ... \n";
00599             cleanup(argv);
00600             return 0;
00601           }
00602           
00603           dataTime = new Vector(pathSize);
00604           for (int i=0; i<pathSize; i++) {
00605             double value;
00606             if ( Tcl_GetDouble(interp, pathStrings[i], &value) != TCL_OK) {
00607               opserr << "WARNING problem reading time path value " << pathStrings[i] << " - ";
00608               opserr << " Series -values {path} ... \n";
00609 
00610               cleanup(argv);
00611               cleanup(pathStrings);
00612               return 0;
00613             }
00614             (*dataTime)(i) = value;
00615           }
00616           // free up the array of pathsStrings .. see tcl man pages as to why
00617           cleanup(pathStrings);
00618         }
00619       }
00620       
00621       endMarker++;
00622     }
00623     
00624 
00625     if (filePathName != 0 && fileTimeName == 0 && timeIncr != 0.0) {
00626       theSeries = new PathSeries(argv[filePathName], timeIncr, cFactor);
00627     }
00628 
00629     else if (fileName != 0) {
00630       theSeries = new PathTimeSeries(argv[fileName], cFactor);
00631 
00632     } else if (filePathName != 0 && fileTimeName != 0)
00633       theSeries = new PathTimeSeries(argv[filePathName], argv[fileTimeName], cFactor); 
00634 
00635     else if (dataPath != 0 && dataTime == 0 && timeIncr != 0.0) {
00636       theSeries = new PathSeries(*dataPath, timeIncr, cFactor); 
00637       delete dataPath;
00638 
00639     } else if (dataPath != 0 && dataTime != 0) {
00640       theSeries = new PathTimeSeries(*dataPath, *dataTime, cFactor);  
00641       delete dataPath;      
00642       delete dataTime;      
00643 
00644     } else {
00645       opserr << "WARNING choice of options for Path Series invalid - valid options for ";
00646       opserr << " Path are\n";
00647       opserr << " \t -fileT fileTimeName -fileP filePathName \n";
00648       opserr << " \t -dt constTimeIncr -file filePathName\n";
00649       opserr << " \t -dt constTimeIncr -values {list of points on path}\n";
00650       opserr << " \t -time {list of time points} -values {list of points on path}\n";
00651       cleanup(argv);
00652       return 0;
00653     }      
00654         
00655   } 
00656         
00657   else {
00658     // type of load pattern type unknown
00659     opserr << "WARNING unknown Series type " << argv[0] << " - ";
00660     opserr << " valid types: Linear, Rectangular, Path, Constant, Trig, Sine\n";
00661     cleanup(argv);
00662     return 0;
00663   }
00664 
00665   // clean up after ourselves and return the series
00666   cleanup(argv);
00667   return theSeries;
00668 }
00669 
00670 
00671 
00672 

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