TclTemplate3DepCommand.cpp

Go to the documentation of this file.
00001 //===============================================================================
00002 //# COPYRIGHT (C):     :-))
00003 //# PROJECT:           Object Oriented Finite Element Program
00004 //# PURPOSE:           Tcl based Parser
00005 //# CLASS:
00006 //#
00007 //# VERSION:
00008 //# LANGUAGE:          C++
00009 //# TARGET OS:         DOS || UNIX || . . .
00010 //# PROGRAMMER(S):     Zhao Cheng, Boris Jeremic
00011 //#
00012 //#
00013 //# DATE:              19Feb2003
00014 //# UPDATE HISTORY:    18May2004 ZHao fixed Armstrong-Frederick command
00015 //#                    May2004 Zhao Cheng splitted elastic part 
00016 //#
00017 //#
00018 //#
00019 //===============================================================================
00020 
00021 #include <stdlib.h>
00022 #include <string.h>
00023 
00024 #include <Domain.h>
00025 
00026 #include <ErrorHandler.h>
00027 #include <TclModelBuilder.h>
00028 
00029 #include <Template3Dep.h>
00030 #include <straint.h>
00031 #include <stresst.h>
00032 
00033 #include <YS.h>
00034 #include <DP_YS.h>
00035 #include <VM_YS.h>
00036 #include <CAM_YS.h>
00037 #include <RMC01_YS.h>
00038 #include <MD_YS.h>
00039 
00040 #include <PS.h>
00041 #include <DP_PS.h>
00042 #include <VM_PS.h>
00043 #include <CAM_PS.h>
00044 #include <RMC01_PS.h>
00045 #include <MD_PS.h>
00046 
00047 #include <EPState.h>
00048 
00049 #include <EL_S.h>
00050 #include <EL_LEeq.h>
00051 #include <EL_NLEp.h>
00052 
00053 #include <EL_T.h>
00054 #include <EL_LEij.h>
00055 #include <EL_NLEij.h>
00056 #include <EL_NLEijMD.h>
00057 
00058 
00059 
00060 
00061 
00062 // the functions to create the component objects (defined at eof)
00063 YieldSurface     *EvaluateYieldSurfaceArgs(ClientData, Tcl_Interp *, TCL_Char *tclString);
00064 PotentialSurface *EvaluatePotentialSurfaceArgs(ClientData, Tcl_Interp *, TCL_Char *tclString);
00065 EPState          *EvaluateEPStateArgs(ClientData, Tcl_Interp *, TCL_Char *tclString);
00066 EvolutionLaw_S   *EvaluateEvolutionLawSArgs(ClientData, Tcl_Interp *, TCL_Char *tclString);
00067 EvolutionLaw_T   *EvaluateEvolutionLawTArgs(ClientData, Tcl_Interp *, TCL_Char *tclString);
00068 
00069 
00070 // little function to free memory after invoke Tcl_SplitList
00071 //   note Tcl_Split list stores the array of pointers and the strings in
00072 //   one array, which is why Tcl_Free needs only be called on the array.
00073 
00074 static void cleanup(TCL_Char **argv) {
00075     Tcl_Free((char *) argv);
00076 }
00077 
00078 Template3Dep *
00079 TclModelBuilder_addTemplate3Dep(ClientData clientData, Tcl_Interp *interp,  int argc,
00080           TCL_Char **argv, TclModelBuilder *theTclBuilder, int eleArgStart)
00081 {
00082   // create some empty pointers which we fill in as parse the command line
00083   int tag =0;
00084   YieldSurface     *YS =0;
00085   PotentialSurface *PS =0;
00086   EPState          *EPS =0;
00087   EvolutionLaw_S   *ELS1 =0;
00088   EvolutionLaw_S   *ELS2 =0;
00089   EvolutionLaw_S   *ELS3 =0;
00090   EvolutionLaw_S   *ELS4 =0;
00091   EvolutionLaw_T   *ELT1 =0;
00092   EvolutionLaw_T   *ELT2 =0;
00093   EvolutionLaw_T   *ELT3 =0;
00094   EvolutionLaw_T   *ELT4 =0;
00095   int ElMattag;
00096 
00097   int loc = eleArgStart;
00098   if (Tcl_GetInt(interp, argv[loc++], &tag) != TCL_OK) {
00099     opserr << "nDMaterial Templated3Dep - invalid tag " << argv[loc] << endln;
00100     return 0;
00101   }
00102 
00103   if (Tcl_GetInt(interp, argv[loc++], &ElMattag) != TCL_OK) {
00104     opserr << "nDMaterial Templated3Dep - invalid elastic material tag " << argv[loc] << endln;
00105     return 0;           
00106   }
00107 
00108   if (ElMattag == tag) {
00109     opserr << "nDMaterial Templated3Dep - error: the elastic matTag is the same with Templated3Dep matTag" << argv[loc] << endln;
00110     return 0;           
00111   }
00112 
00113   NDMaterial *theElMat = theTclBuilder->getNDMaterial(ElMattag);
00114   
00115   if (theElMat == 0) {
00116             opserr << "WARNING nD elastic material does not exist\n";
00117             opserr << "nD material: " << ElMattag; 
00118             opserr << "\nTamplate3Dep nDMaterial: " << tag << endln;
00119             return 0;
00120         }
00121 
00122   // parse rest of command, switching on the flags -YS, -PS, -EPS, -ELS, -ELT, ...
00123   while (loc < argc) {
00124     if ((strcmp(argv[loc],"-YS") == 0) || (strcmp(argv[loc],"-ys") == 0)) {
00125       YS = EvaluateYieldSurfaceArgs(clientData, interp, argv[loc+1]);
00126       if (YS == 0) {
00127   opserr << "nDMaterial Templated3Dep - could not create a YS from" << argv[loc+1] << endln;
00128   return 0;
00129       }
00130     }
00131 
00132     else if ((strcmp(argv[loc],"-PS") == 0) || (strcmp(argv[loc],"-ps") == 0)) {
00133       PS = EvaluatePotentialSurfaceArgs(clientData, interp, argv[loc+1]);
00134       if (PS == 0) {
00135   opserr << "nDMaterial Templated3Dep - could not create a PS from" << argv[loc+1] << endln;
00136   return 0;
00137       }
00138     }
00139 
00140    else if ((strcmp(argv[loc],"-EPS") == 0) || (strcmp(argv[loc],"-eps") == 0)) {
00141       EPS = EvaluateEPStateArgs(clientData, interp, argv[loc+1]);
00142       if (EPS == 0) {
00143   opserr << "nDMaterial Templated3Dep - could not create an EPS from" << argv[loc+1] << endln;
00144   return 0;
00145       }
00146     }
00147 
00148     else if ((strcmp(argv[loc],"-ELS1") == 0) || (strcmp(argv[loc],"-els1") == 0)) {
00149       ELS1 = EvaluateEvolutionLawSArgs(clientData, interp, argv[loc+1]);
00150       if (ELS1 == 0) {
00151   opserr << "nDMaterial Templated3Dep - could not create an ELS1 from" << argv[loc+1] << endln;
00152   return 0;
00153       }
00154     }
00155 
00156     else if ((strcmp(argv[loc],"-ELS2") == 0) || (strcmp(argv[loc],"-els2") == 0)) {
00157       ELS2 = EvaluateEvolutionLawSArgs(clientData, interp, argv[loc+1]);
00158       if (ELS2 == 0) {
00159   opserr << "nDMaterial Templated3Dep - could not create an ELS2 from" << argv[loc+1] << endln;
00160   return 0;
00161       }
00162     }
00163 
00164     else if ((strcmp(argv[loc],"-ELS3") == 0) || (strcmp(argv[loc],"-els3") == 0)) {
00165       ELS3 = EvaluateEvolutionLawSArgs(clientData, interp, argv[loc+1]);
00166       if (ELS3 == 0) {
00167   opserr << "nDMaterial Templated3Dep - could not create an ELS3 from" << argv[loc+1] << endln;
00168   return 0;
00169       }
00170     }
00171 
00172     else if ((strcmp(argv[loc],"-ELS4") == 0) || (strcmp(argv[loc],"-els4") == 0)) {
00173       ELS4 = EvaluateEvolutionLawSArgs(clientData, interp, argv[loc+1]);
00174       if (ELS4 == 0) {
00175   opserr << "nDMaterial Templated3Dep - could not create an ELS4 from" << argv[loc+1] << endln;
00176   return 0;
00177       }
00178     }
00179 
00180     else if ((strcmp(argv[loc],"-ELT1") == 0) || (strcmp(argv[loc],"-elt1") == 0)) {
00181       ELT1 = EvaluateEvolutionLawTArgs(clientData, interp, argv[loc+1]);
00182       if (ELT1 == 0) {
00183   opserr << "nDMaterial Templated3Dep - could not create an ELT1 from" << argv[loc+1] << endln;
00184   return 0;
00185       }
00186     }
00187 
00188     else if ((strcmp(argv[loc],"-ELT2") == 0) || (strcmp(argv[loc],"-elt2") == 0)) {
00189       ELT2 = EvaluateEvolutionLawTArgs(clientData, interp, argv[loc+1]);
00190       if (ELT2 == 0) {
00191   opserr << "nDMaterial Templated3Dep - could not create an ELT2 from" << argv[loc+1] << endln;
00192   return 0;
00193       }
00194     }
00195 
00196     else if ((strcmp(argv[loc],"-ELT3") == 0) || (strcmp(argv[loc],"-elt3") == 0)) {
00197       ELT3 = EvaluateEvolutionLawTArgs(clientData, interp, argv[loc+1]);
00198       if (ELT3 == 0) {
00199   opserr << "nDMaterial Templated3Dep - could not create an ELT3 from" << argv[loc+1] << endln;
00200   return 0;
00201       }
00202     }
00203 
00204     else if ((strcmp(argv[loc],"-ELT4") == 0) || (strcmp(argv[loc],"-elt4") == 0)) {
00205       ELT4 = EvaluateEvolutionLawTArgs(clientData, interp, argv[loc+1]);
00206       if (ELT4 == 0) {
00207   opserr << "nDMaterial Templated3Dep - could not create an ELT4 from" << argv[loc+1] << endln;
00208   return 0;
00209       }
00210     }
00211 
00212     else {
00213       opserr << "nDMaterial Templated3Dep - don't understand %s\n";
00214   return 0;
00215     }
00216 
00217     // increment locator by 2 and do next one
00218     loc += 2;
00219   }
00220 
00221   // now depending on the objects types that are not NULL we use the appropriate
00222   // constructor to construct or Template3Dep material object
00223   Template3Dep *theMaterial = 0;
00224   if ( (YS != 0) && (PS != 0) && (EPS != 0) &&
00225        (ELS1 != 0) && (ELS2 != 0) && (ELS3 != 0) && (ELS4 != 0) &&
00226        (ELT1 != 0) && (ELT2 != 0) && (ELT3 != 0) && (ELT4 != 0) )
00227     theMaterial = new Template3Dep(tag, *theElMat, YS, PS, EPS, ELS1, ELS2, ELS3, ELS4,
00228            ELT1, ELT2, ELT3, ELT4);
00229 
00230   // constructor 0
00231   else if ( (YS != 0) && (PS != 0) && (EPS != 0) &&
00232        (ELS1 == 0) && (ELS2 == 0) && (ELS3 == 0) && (ELS4 == 0) &&
00233        (ELT1 == 0) && (ELT2 == 0) && (ELT3 == 0) && (ELT4 == 0) )
00234     theMaterial = new Template3Dep(tag, *theElMat, YS, PS, EPS);
00235 
00236   // constructor 1
00237   else if ( (YS != 0) && (PS != 0) && (EPS != 0) &&
00238        (ELS1 != 0) && (ELS2 == 0) && (ELS3 == 0) && (ELS4 == 0) &&
00239        (ELT1 == 0) && (ELT2 == 0) && (ELT3 == 0) && (ELT4 == 0) )
00240     theMaterial = new Template3Dep(tag, *theElMat, YS, PS, EPS, ELS1);
00241 
00242   // constructor 2
00243   else if ( (YS != 0) && (PS != 0) && (EPS != 0) &&
00244        (ELS1 == 0) && (ELS2 == 0) && (ELS3 == 0) && (ELS4 == 0) &&
00245        (ELT1 != 0) && (ELT2 == 0) && (ELT3 == 0) && (ELT4 == 0) )
00246     theMaterial = new Template3Dep(tag, *theElMat, YS, PS, EPS, ELT1);
00247 
00248   // constructor 3
00249   else if ( (YS != 0) && (PS != 0) && (EPS != 0) &&
00250        (ELS1 != 0) && (ELS2 == 0) && (ELS3 == 0) && (ELS4 == 0) &&
00251        (ELT1 != 0) && (ELT2 == 0) && (ELT3 == 0) && (ELT4 == 0) )
00252     theMaterial = new Template3Dep(tag, *theElMat, YS, PS, EPS, ELS1, ELT1);
00253 
00254   // constructor 4
00255   else if ( (YS != 0) && (PS != 0) && (EPS != 0) &&
00256        (ELS1 != 0) && (ELS2 != 0) && (ELS3 == 0) && (ELS4 == 0) &&
00257        (ELT1 != 0) && (ELT2 == 0) && (ELT3 == 0) && (ELT4 == 0) )
00258     theMaterial = new Template3Dep(tag, *theElMat, YS, PS, EPS, ELS1, ELS2, ELT1);
00259 
00260   // constructor 5
00261   else if ( (YS != 0) && (PS != 0) && (EPS != 0) &&
00262        (ELS1 != 0) && (ELS2 != 0) && (ELS3 == 0) && (ELS4 == 0) &&
00263        (ELT1 != 0) && (ELT2 != 0) && (ELT3 == 0) && (ELT4 == 0) )
00264     theMaterial = new Template3Dep(tag, *theElMat, YS, PS, EPS, ELS1, ELS2, ELT1, ELT2);
00265 
00266   else
00267     opserr << "invalid number of args used to create a Template3Dep material\n";
00268 
00269     return theMaterial;
00270 }
00271 
00272 
00273 // Function - to create a YieldSurface
00274 YieldSurface *EvaluateYieldSurfaceArgs(ClientData clientData, Tcl_Interp *interp, TCL_Char *tclString)
00275 {
00276   int argc;
00277   TCL_Char **argv;
00278 
00279   // split the list
00280   if (Tcl_SplitList(interp, tclString, &argc, &argv) != TCL_OK) {
00281     return 0;
00282   }
00283 
00284   if (argc == 0)
00285     return 0;
00286 
00287   // now parse the list & construct the required object
00288   YieldSurface *YS = 0;
00289 
00290   // 1. Drucker-Prager Yield Surface
00291   if ((strcmp(argv[0],"-DP") == 0) || (strcmp(argv[0],"-dp") == 0)) {
00292     YS = new DPYieldSurface();
00293   }
00294 
00295   // 2. von Mises Yield Surface
00296   else if ( (strcmp(argv[0],"-VM") == 0) || (strcmp(argv[0],"-vM") == 0) || (strcmp(argv[0],"-vm") == 0)) {
00297     YS = new VMYieldSurface();
00298   }
00299 
00300   // 3. Cam Clay yield surface
00301   else if ((strcmp(argv[0],"-CC") == 0) || (strcmp(argv[0],"-cc") == 0)) {
00302     double mp = 1.2;
00303     if (argc > 1) {
00304       if (Tcl_GetDouble(interp, argv[1], &mp) != TCL_OK) {
00305        opserr << "invalid M: argv[1] for -PS CamClay M\n";
00306        return 0;
00307       }
00308     }
00309     YS = new CAMYieldSurface(mp);
00310   }
00311 
00312    // 4. Rounded Mohr-Conlomb 01 Yield Surface
00313   else if ( (strcmp(argv[0],"-RMC01") == 0) || (strcmp(argv[0],"-rmc01") == 0) || (strcmp(argv[0],"-rmc01") == 0)) {
00314     YS = new RMC01YieldSurface();
00315   }
00316 
00317   // 5. Manzari-Dafalias (conic-shaped) Yield Surface
00318   else if ( (strcmp(argv[0],"-MD") == 0) || (strcmp(argv[0],"-md") == 0) ) {
00319     YS = new MDYieldSurface();
00320   }
00321 
00322   else {
00323     opserr << "invalid yield function: " << argv[0] << endln;
00324     return 0;
00325   }
00326 
00327   cleanup(argv);
00328   return YS;
00329 }
00330 
00331 // Function - to create a PotentialSurface object
00332 PotentialSurface *EvaluatePotentialSurfaceArgs(ClientData clientData, Tcl_Interp *interp, TCL_Char *tclString)
00333 {
00334   int argc;
00335   TCL_Char **argv;
00336 
00337   // split the list
00338   if (Tcl_SplitList(interp, tclString, &argc, &argv) != TCL_OK) {
00339     return 0;
00340   }
00341 
00342   if (argc == 0)
00343     return 0;
00344 
00345   // now parse the list & construct the required object
00346   PotentialSurface *PS = 0;
00347 
00348   //1. Drucker-Prager Potential Surface
00349   if ((strcmp(argv[0],"-DP") == 0) || (strcmp(argv[0],"-dp") == 0)) {
00350     double alpha = 0.2;
00351     if (argc == 2)
00352       {
00353         if (Tcl_GetDouble(interp, argv[1], &alpha) != TCL_OK) 
00354           {
00355             opserr << "nDMaterial Templated3Dep PS.Drucker-Prager - invalid or missing alpha " << argv[1] << endln;
00356             cleanup(argv);
00357             return 0;
00358           }
00359       }
00360     else
00361       {
00362         opserr << "nDMaterial Templated3Dep PS.Drucker-Prager - missing alpha " << endln;
00363         cleanup(argv);
00364         return 0;
00365       }
00366     PS = new DPPotentialSurface(alpha);
00367   }
00368 
00369   //2. von-Mises Potential Surface
00370   else if ((strcmp(argv[0],"-VM") == 0) || (strcmp(argv[0],"-vm") == 0)) {
00371     PS = new VMPotentialSurface();
00372   }
00373 
00374   // 3. CamClay potential surface
00375   else if ((strcmp(argv[0],"-CC") == 0) || (strcmp(argv[0],"-cc") == 0)) {
00376     double mp = 1.2;
00377 //    if (argc == 2) 
00378 //      {
00379         if (Tcl_GetDouble(interp, argv[1], &mp) != TCL_OK) 
00380           {
00381             opserr << "nDMaterial Templated3Dep PS.CamClay - invalid or missing M " << argv[1] << endln;
00382             return 0;
00383           }
00384 //      }
00385     PS = new CAMPotentialSurface(mp);
00386   }
00387 
00388  //4. RMC01 Potential Surface
00389   else if ((strcmp(argv[0],"-RMC01") == 0) || (strcmp(argv[0],"-rmc01") == 0))
00390     {
00391       PS = new RMC01PotentialSurface();
00392     }
00393 
00394  //5. Manzari-Dafalias Potential Surface
00395   else if ((strcmp(argv[0],"-MD") == 0) || (strcmp(argv[0],"-md") == 0))
00396     {
00397       PS = new MDPotentialSurface();
00398     }
00399 
00400   else {
00401     opserr << "invalid potential function: " << argv[0] << endln;
00402     return 0;
00403   }
00404 
00405   cleanup(argv);
00406   return PS;
00407 }
00408 
00409 //ZCMay04 // Function - to read in a stress tensor
00410 //ZCMay04 
00411 //ZCMay04 int EvaluateStressTensor(ClientData clientData, Tcl_Interp *interp, TCL_Char *tclString,
00412 //ZCMay04        stresstensor &stress)
00413 //ZCMay04 {
00414 //ZCMay04   int argc;
00415 //ZCMay04   TCL_Char **argv;
00416 //ZCMay04 
00417 //ZCMay04   // split the list
00418 //ZCMay04   if (Tcl_SplitList(interp, tclString, &argc, &argv) != TCL_OK) {
00419 //ZCMay04     return 0;
00420 //ZCMay04   }
00421 //ZCMay04 
00422 //ZCMay04   double *values = new double[9];
00423 //ZCMay04   if (values == 0) {
00424 //ZCMay04     opserr << "nDMaterial Template3DEp -ESP stresstenor - out of memory for size: " << argc << endln;
00425 //ZCMay04     cleanup(argv);
00426 //ZCMay04     return -1;
00427 //ZCMay04   }
00428 //ZCMay04 
00429 //ZCMay04   int i;
00430 //ZCMay04   for (i=0; i<arc; i++) {
00431 //ZCMay04     if (Tcl_GetDouble(interp, argv[i], &values[i]) != TCL_OK) {
00432 //ZCMay04       opserr << "nDMaterial Templated3Dep -ESP stresstensor - invalid value: " << argv[i] << endln;
00433 //ZCMay04       cleanup(argv);
00434 //ZCMay04       //delete [] values;
00435 //ZCMay04       return -1;
00436 //ZCMay04     }
00437 //ZCMay04 
00438 //ZCMay04 
00439 //ZCMay04   }
00440 //ZCMay04 
00441 //ZCMay04   for (i=1; i<9; i++) {
00442 //ZCMay04      values[i] = 0;
00443 //ZCMay04      if ((i == 4)|| (i==8))
00444 //ZCMay04         values[i] = -1.0 * values[0];
00445 //ZCMay04   }
00446 //ZCMay04   values[0] = -1.0 * values[0];
00447 //ZCMay04   stresstensor newStress(values);
00448 //ZCMay04 
00449 //ZCMay04   //newStress.printshort("tcl:");
00450 //ZCMay04 
00451 //ZCMay04   stress = newStress;
00452 //ZCMay04   cleanup(argv);
00453 //ZCMay04   delete [] values;
00454 //ZCMay04   return 0;
00455 //ZCMay04 }
00456 
00457 //ZCMay04 // Function - to read in a strain tensor
00458 //ZCMay04 int EvaluateStrainTensor(ClientData clientData, Tcl_Interp *interp, TCL_Char *tclString,
00459 //ZCMay04        straintensor &strain)
00460 //ZCMay04 {
00461 //ZCMay04   int argc;
00462 //ZCMay04   TCL_Char **argv;
00463 //ZCMay04 
00464 //ZCMay04   // split the list
00465 //ZCMay04   if (Tcl_SplitList(interp, tclString, &argc, &argv) != TCL_OK) {
00466 //ZCMay04     return 0;
00467 //ZCMay04   }
00468 //ZCMay04 
00469 //ZCMay04   double *values = new double[argc];
00470 //ZCMay04   if (values == 0) {
00471 //ZCMay04     opserr << "nDMaterial Template3DEp -ESP straintensor - out of memory for size: " << argc << endln;
00472 //ZCMay04     cleanup(argv);
00473 //ZCMay04     return -1;
00474 //ZCMay04   }
00475 //ZCMay04 
00476 //ZCMay04   for (int i=0; i<argc; i++) {
00477 //ZCMay04     if (Tcl_GetDouble(interp, argv[i], &values[i]) != TCL_OK) {
00478 //ZCMay04       opserr << "nDMaterial Templated3Dep -ESP straintensor - invalid value: " << argv[i] << endln;
00479 //ZCMay04       cleanup(argv);
00480 //ZCMay04       //delete [] values;
00481 //ZCMay04       return -1;
00482 //ZCMay04     }
00483 //ZCMay04   }
00484 //ZCMay04 
00485 //ZCMay04   straintensor newStrain(values);
00486 //ZCMay04   strain = newStrain;
00487 //ZCMay04   cleanup(argv);
00488 //ZCMay04   delete [] values;
00489 //ZCMay04   return 0;
00490 //ZCMay04 }
00491 
00492 // Function - to create an EPState object
00493 EPState *EvaluateEPStateArgs(ClientData clientData, Tcl_Interp *interp, TCL_Char *tclString)
00494 {
00495   int argc;
00496   TCL_Char **argv;
00497 
00498   // split the list
00499   if (Tcl_SplitList(interp, tclString, &argc, &argv) != TCL_OK) {
00500     return 0;
00501   }
00502   EPState *EPS = 0;
00503 
00504 //ZCMay04  double Eod = 0.0;
00505 //ZCMay04  double Ed = 0.0;
00506 //ZCMay04  double nu = 0.0;
00507 //ZCMay04  double rho = 0.0; 
00508 //ZCMay04  
00509 //ZCMay04  if (argc < 5) {
00510 //ZCMay04 
00511 //ZCMay04    cleanup(argv);
00512 //ZCMay04    return 0;
00513 //ZCMay04  }
00514 //ZCMay04 
00515 //ZCMay04  if (Tcl_GetDouble(interp, argv[0], &Eod) != TCL_OK) {
00516 //ZCMay04    opserr << "nDMaterial Templated3Dep -EPS - invalid Eod " << argv[1] << endln;
00517 //ZCMay04    cleanup(argv);
00518 //ZCMay04    return 0;
00519 //ZCMay04  }
00520 //ZCMay04  if (Tcl_GetDouble(interp, argv[1], &Ed) != TCL_OK) {
00521 //ZCMay04    opserr << "nDMaterial Templated3Dep -EPS - invalid Ed " << argv[1] << endln;
00522 //ZCMay04    cleanup(argv);
00523 //ZCMay04    return 0;
00524 //ZCMay04  }
00525 //ZCMay04  if (Tcl_GetDouble(interp, argv[2], &nu) != TCL_OK) {
00526 //ZCMay04    opserr << "nDMaterial Templated3Dep -EPS - invalid nu " << argv[1] << endln;
00527 //ZCMay04    cleanup(argv);
00528 //ZCMay04    return 0;
00529 //ZCMay04  }
00530 //ZCMay04  if (Tcl_GetDouble(interp, argv[3], &rho) != TCL_OK) {
00531 //ZCMay04    opserr << "nDMaterial Templated3Dep -EPS - invalid rho " << argv[1] << endln;
00532 //ZCMay04  }
00533 //ZCMay04 
00534 //ZCMay04  int loc = 4;
00535   int loc = 0;
00536   stresstensor stressp(0.0);
00537   straintensor strainp(0.0);
00538   straintensor Estrainp(0.0);
00539   straintensor Pstrainp(0.0);
00540 
00541   int NoS = 0;
00542   int NoD = 0;
00543   double *scalars = 0;
00544   stresstensor *tensors = 0;
00545   double ep = 0.85;
00546   double psip = 0.05;
00547   int integratorFlag = 0; //Guanzhou
00548 //ZCMay04   int     Elasticflagp = 0;
00549 //ZCMay04   double  Evp   = 0.0;
00550 //ZCMay04   double  nuhvp = 0.0;
00551 //ZCMay04   double  Ghvp = 0.0;  
00552 //ZCMay04   double  eod = 0.80;
00553 //ZCMay04   double  ecd = 0.75;
00554 //ZCMay04   double  lamd=0.025;
00555 //ZCMay04   double  p_refd= 100.0;
00556 //ZCMay04   double  ad=0.5;
00557 
00558   // switch on remaining args;
00559   //double *values_stp = new double[9];
00560   double values_stp[9]= {-0.00010, 0.0, 0.0, 0.0, -0.00010, 0.0, 0.0, 0.0, -0.00010};
00561 
00562   while (loc < argc) {
00563 
00564     if ((strcmp(argv[loc],"-stressP") == 0) || (strcmp(argv[loc],"-stressp") == 0)) {
00565       int loc_i = loc;
00566       for (int i=0; i<9; i++) {
00567         if (Tcl_GetDouble(interp, argv[loc+1], &values_stp[i]) != TCL_OK) {
00568           opserr << "nDMaterial Templated3Dep -EPS - invalid stress tensor: need nine components " << argv[loc_i] << endln;
00569           return 0;
00570         }
00571         loc++;
00572       }
00573       stressp.val(1,1) = values_stp[0]; stressp.val(1,2) = values_stp[1]; stressp.val(1,3) = values_stp[2]; 
00574       stressp.val(2,1) = values_stp[3]; stressp.val(2,2) = values_stp[4]; stressp.val(2,3) = values_stp[5];
00575       stressp.val(3,1) = values_stp[6]; stressp.val(3,2) = values_stp[7]; stressp.val(3,3) = values_stp[8]; 
00576       loc++;
00577     }
00578 
00579     else if ((strcmp(argv[loc],"-strainP") == 0) || (strcmp(argv[loc],"-strainp") == 0)) {
00580       int loc_i = loc;
00581       for (int i=0; i<9; i++) {
00582         if (Tcl_GetDouble(interp, argv[loc+1], &values_stp[i]) != TCL_OK) {
00583           opserr << "nDMaterial Templated3Dep -EPS - invalid strain tensor: need nine components " << argv[loc_i] << endln;
00584           return 0;
00585         }
00586         loc++;
00587       }
00588       strainp.val(1,1) = values_stp[0]; strainp.val(1,2) = values_stp[1]; strainp.val(1,3) = values_stp[2]; 
00589       strainp.val(2,1) = values_stp[3]; strainp.val(2,2) = values_stp[4]; strainp.val(2,3) = values_stp[5];
00590       strainp.val(3,1) = values_stp[6]; strainp.val(3,2) = values_stp[7]; strainp.val(3,3) = values_stp[8]; 
00591       loc++;
00592     }
00593 
00594     else if ((strcmp(argv[loc],"-EstrainP") == 0) || (strcmp(argv[loc],"-Estrainp") == 0)) {
00595       int loc_i = loc;
00596       for (int i=0; i<9; i++) {
00597         if (Tcl_GetDouble(interp, argv[loc+1], &values_stp[i]) != TCL_OK) {
00598           opserr << "nDMaterial Templated3Dep -EPS - invalid Estrain tensor: need nine components " << argv[loc_i] << endln;
00599           return 0;
00600         }
00601         loc++;
00602       }
00603       Estrainp.val(1,1) = values_stp[0]; Estrainp.val(1,2) = values_stp[1]; Estrainp.val(1,3) = values_stp[2]; 
00604       Estrainp.val(2,1) = values_stp[3]; Estrainp.val(2,2) = values_stp[4]; Estrainp.val(2,3) = values_stp[5];
00605       Estrainp.val(3,1) = values_stp[6]; Estrainp.val(3,2) = values_stp[7]; Estrainp.val(3,3) = values_stp[8]; 
00606       loc++;
00607     }
00608 
00609     else if ((strcmp(argv[loc],"-PstrainP") == 0) || (strcmp(argv[loc],"-Pstrainp") == 0)) {
00610       int loc_i = loc;
00611       for (int i=0; i<9; i++) {
00612         if (Tcl_GetDouble(interp, argv[loc+1], &values_stp[i]) != TCL_OK) {
00613           opserr << "nDMaterial Templated3Dep -EPS - invalid Pstrain tensor: need nine components " << argv[loc_i] << endln;
00614           return 0;
00615         }
00616         loc++;
00617       }
00618       Pstrainp.val(1,1) = values_stp[0]; Pstrainp.val(1,2) = values_stp[1]; Pstrainp.val(1,3) = values_stp[2]; 
00619       Pstrainp.val(2,1) = values_stp[3]; Pstrainp.val(2,2) = values_stp[4]; Pstrainp.val(2,3) = values_stp[5];
00620       Pstrainp.val(3,1) = values_stp[6]; Pstrainp.val(3,2) = values_stp[7]; Pstrainp.val(3,3) = values_stp[8]; 
00621       loc++;
00622     }
00623 
00624 
00625 //ZCMay04     else if ((strcmp(argv[loc],"-strainP") == 0) || (strcmp(argv[loc],"-strainp") == 0)) {
00626 //ZCMay04       if (EvaluateStrainTensor(clientData, interp, argv[loc+1], strainp) < 0) {
00627 //ZCMay04     opserr << "nDMaterial Templated3Dep -EPS - invalid strainp " << argv[loc+1] << endln;
00628 //ZCMay04     cleanup(argv);
00629 //ZCMay04     return 0;
00630 //ZCMay04       }
00631 //ZCMay04     }
00632 //ZCMay04     else if ((strcmp(argv[loc],"-EstrainP") == 0) || (strcmp(argv[loc],"-Estrainp") == 0)) {
00633 //ZCMay04       if (EvaluateStrainTensor(clientData, interp, argv[loc+1], Estrainp) < 0)
00634 //ZCMay04     opserr << "nDMaterial Templated3Dep -EPS - invalid Estrainp " << argv[loc+1] << endln;
00635 //ZCMay04     cleanup(argv);
00636 //ZCMay04     return 0;
00637 //ZCMay04       loc+=2;
00638 //ZCMay04     }
00639 //ZCMay04     else if ((strcmp(argv[loc],"-PstrainP") == 0) || (strcmp(argv[loc],"-Estrainp") == 0)) {
00640 //ZCMay04       if (EvaluateStrainTensor(clientData, interp, argv[loc+1], Pstrainp) < 0) {
00641 //ZCMay04     opserr << "nDMaterial Templated3Dep -EPS - invalid Pstrainp " << argv[loc+1] << endln;
00642 //ZCMay04     cleanup(argv);
00643 //ZCMay04     return 0;
00644 //ZCMay04       }
00645 //ZCMay04       loc+=2;
00646 //ZCMay04     }
00647 
00648     else if ((strcmp(argv[loc],"-NOS") == 0) || (strcmp(argv[loc],"-nos") == 0)) {
00649       if (Tcl_GetInt(interp, argv[loc+1], &NoS) != TCL_OK) {
00650         opserr << "nDMaterial Templated3Dep -EPS - invalid NOS " << argv[loc+1] << endln;
00651         return 0;  
00652       }
00653       loc+= 2;
00654 
00655       if (NoS > 0) {
00656         scalars = new double[NoS];
00657         for (int i=0; i<NoS; i++) {
00658           if (Tcl_GetDouble(interp, argv[loc++], &scalars[i]) != TCL_OK) {
00659             opserr << "nDMaterial Templated3Dep -EPS - invalid scalar: " << argv[loc-1] << endln;
00660             return 0;      
00661           }
00662         } 
00663       } 
00664       else 
00665         NoS = 0;
00666     }
00667     
00668     else if ((strcmp(argv[loc],"-NOD") == 0) || (strcmp(argv[loc],"-nod") == 0)) {
00669       if (Tcl_GetInt(interp, argv[loc+1], &NoD) != TCL_OK) {
00670         opserr << "nDMaterial Templated3Dep -EPS - invalid NOD: " << argv[loc+1] << endln;
00671         return 0;
00672       }
00673       loc += 2;
00674       
00675       if (NoD > 0) {
00676          tensors = new stresstensor[NoD];
00677          if (tensors == 0) {
00678            opserr << "nDMaterial Templated3Dep -EPS - invalid NOD " << argv[loc+1] << endln;
00679            return 0;
00680         }
00681       }
00682       else 
00683         NoD = 0;
00684     }
00685 
00686 //ZCMay04     else if  (strcmp(argv[loc],"-ElasticFlag") == 0 || strcmp(argv[loc],"-elasticflag") == 0) {
00687 //ZCMay04       if (Tcl_GetInt(interp, argv[loc+1], &Elasticflagp) != TCL_OK) {
00688 //ZCMay04       opserr << "nDMaterial Templated3Dep -EPS - invalid e " << argv[loc+1] << endln;
00689 //ZCMay04       cleanup(argv);
00690 //ZCMay04       return 0;
00691 //ZCMay04       }
00692 //ZCMay04       loc+=2;
00693 //ZCMay04     }
00694 //ZCMay04     else if  (strcmp(argv[loc],"-Ev") == 0) {
00695 //ZCMay04       if (Tcl_GetDouble(interp, argv[loc+1], &Evp) != TCL_OK) {
00696 //ZCMay04       opserr << "nDMaterial Templated3Dep -EPS - invalid Ev " << argv[loc+1] << endln;
00697 //ZCMay04       cleanup(argv);
00698 //ZCMay04       return 0;
00699 //ZCMay04       }
00700 //ZCMay04       loc+=2;
00701 //ZCMay04     }
00702 //ZCMay04     else if  (strcmp(argv[loc],"-nuhv") == 0) {
00703 //ZCMay04       if (Tcl_GetDouble(interp, argv[loc+1], &nuhvp) != TCL_OK) {
00704 //ZCMay04       opserr << "nDMaterial Templated3Dep -EPS - invalid nuhv " << argv[loc+1] << endln;
00705 //ZCMay04       cleanup(argv);
00706 //ZCMay04       return 0;
00707 //ZCMay04       }
00708 //ZCMay04       loc+=2;
00709 //ZCMay04     }
00710 //ZCMay04     else if  (strcmp(argv[loc],"-Ghv") == 0) {
00711 //ZCMay04       if (Tcl_GetDouble(interp, argv[loc+1], &Ghvp) != TCL_OK) {
00712 //ZCMay04       opserr << "nDMaterial Templated3Dep -EPS - invalid Ghv " << argv[loc+1] << endln;
00713 //ZCMay04       cleanup(argv);
00714 //ZCMay04       return 0;
00715 //ZCMay04       }
00716 //ZCMay04       loc+=2;
00717 //ZCMay04     }    
00718 //ZCMay04     else if  (strcmp(argv[loc],"-eo") == 0) {
00719 //ZCMay04       if (Tcl_GetDouble(interp, argv[loc+1], &eod) != TCL_OK) {
00720 //ZCMay04       opserr << "nDMaterial Templated3Dep -EPS - invalid e " << argv[loc+1] << endln;
00721 //ZCMay04       cleanup(argv);
00722 //ZCMay04       return 0;
00723 //ZCMay04       }
00724 //ZCMay04       loc+=2;
00725 //ZCMay04     }
00726 //ZCMay04     else if  (strcmp(argv[loc],"-ec") == 0) {
00727 //ZCMay04       if (Tcl_GetDouble(interp, argv[loc+1], &ecd) != TCL_OK) {
00728 //ZCMay04       opserr << "nDMaterial Templated3Dep -EPS - invalid ec " << argv[loc+1] << endln;
00729 //ZCMay04       cleanup(argv);
00730 //ZCMay04       return 0;
00731 //ZCMay04       }
00732 //ZCMay04       loc+=2;
00733 //ZCMay04     }
00734 //ZCMay04     else if  (strcmp(argv[loc],"-lambda") == 0) {
00735 //ZCMay04       if (Tcl_GetDouble(interp, argv[loc+1], &lamd) != TCL_OK) {
00736 //ZCMay04       opserr << "nDMaterial Templated3Dep -EPS - invalid lambda " << argv[loc+1] << endln;
00737 //ZCMay04       cleanup(argv);
00738 //ZCMay04       return 0;
00739 //ZCMay04       }
00740 //ZCMay04       loc+=2;
00741 //ZCMay04     }
00742 //ZCMay04     else if  (strcmp(argv[loc],"-p_ref") == 0) {
00743 //ZCMay04       if (Tcl_GetDouble(interp, argv[loc+1], &p_refd) != TCL_OK) {
00744 //ZCMay04       opserr << "nDMaterial Templated3Dep -EPS - invalid p_ref " << argv[loc+1] << endln;
00745 //ZCMay04       cleanup(argv);
00746 //ZCMay04       return 0;
00747 //ZCMay04       }
00748 //ZCMay04       loc+=2;
00749 //ZCMay04     }
00750 //ZCMay04     else if  (strcmp(argv[loc],"-a") == 0) {
00751 //ZCMay04       if (Tcl_GetDouble(interp, argv[loc+1], &ad) != TCL_OK) {
00752 //ZCMay04       opserr << "nDMaterial Templated3Dep -EPS - invalid a " << argv[loc+1] << endln;
00753 //ZCMay04       cleanup(argv);
00754 //ZCMay04       return 0;
00755 //ZCMay04       }
00756 //ZCMay04       loc+=2;
00757 //ZCMay04     }
00758 
00759    else if  (strcmp(argv[loc],"-e") == 0) {
00760       if (Tcl_GetDouble(interp, argv[loc+1], &ep) != TCL_OK) {
00761         opserr << "nDMaterial Templated3Dep -EPS - invalid e " << argv[loc+1] << endln;
00762         cleanup(argv);
00763         return 0;
00764       }
00765       loc+=2;
00766     }
00767     else if  (strcmp(argv[loc],"-psi") == 0) {
00768       if (Tcl_GetDouble(interp, argv[loc+1], &psip) != TCL_OK) {
00769         opserr << "nDMaterial Templated3Dep -EPS - invalid psip " << argv[loc+1] << endln;
00770         cleanup(argv);
00771         return 0;
00772       }
00773       loc+=2;
00774     }
00775     //Guanzhou Mar2005
00776     else if  (strcmp(argv[loc],"-integrator") == 0) {
00777       if ( strcmp(argv[loc+1], "BackwardEuler") ==0 ) integratorFlag = 1;
00778       else if ( strcmp(argv[loc+1], "ForwardEuler") ==0 ) integratorFlag = 0;
00779       else {
00780         opserr << "nDMaterial Templated3Dep -EPS - invalid integrator " << argv[loc+1] << endln;
00781         cleanup(argv);
00782         return 0;
00783       }
00784       loc+=2;
00785     }
00786   } //end of while
00787 
00788 
00789   //stresstensor stressp(values_stp);
00790   //delete [] values_stp;
00791 //  cout << " Tcl check e " << ed << " ec " << ecd << " lambda " << lamd << " p_ref " << p_refd << " a " << ad << "\n";
00792 
00793 
00794 //   int                 Elasticflagp = 1;
00795 //   double              Evp   = 0.0;
00796 //   double              nuhvp = 0.0;
00797 //   double              Ghvp = 0.0;
00798 
00799 
00800 
00801 //ZCMay04   EPS = new EPState(Eod,            //      PState(double              Eod,
00802 //ZCMay04                     Ed,             //             double              Ed,
00803 //ZCMay04                     nu,             //             double              nu,
00804 //ZCMay04                     rho,            //             double              rho,
00805 //ZCMay04                     stressp,        //             const stresstensor  stressp,
00806 //ZCMay04                     strainp,        //             const straintensor  strainp,
00807 //ZCMay04                     Estrainp,       //             const straintensor  Estrainp,
00808 //ZCMay04                     Pstrainp,       //             const straintensor  Pstrainp,
00809 //ZCMay04                     NoS,            //       int                 NScalarp,
00810 //ZCMay04                     scalars,        //       const double       *Scalarp,
00811 //ZCMay04                     NoD,            //       int                 NTensorp,
00812 //ZCMay04                     tensors,        //       const stresstensor *Tensorp,
00813 //ZCMay04                     Elasticflagp,   //       int                 Elasticflagp = 1,
00814 //ZCMay04                     Evp,            //       double              Evp   = 0.0,
00815 //ZCMay04                     nuhvp,          //       double              nuhvp = 0.0,
00816 //ZCMay04                     Ghvp,           //       double              Ghvp = 0.0,
00817 //ZCMay04                     eod,            //       double              eop = 0.85,
00818 //ZCMay04                     ecd,            //       double              ecp = 0.80,
00819 //ZCMay04                     lamd,           //       double              Lam = 0.025,
00820 //ZCMay04                     p_refd,         //       double              pop = 100.0,
00821 //ZCMay04                     ad);            //       double              ap = 0.5
00822 
00823   EPS = new EPState(stressp,        //             const stresstensor  stressp,
00824                     strainp,        //             const straintensor  strainp,
00825                     Estrainp,       //             const straintensor  Estrainp,
00826                     Pstrainp,       //             const straintensor  Pstrainp,
00827                     NoS,            //       int                 NScalarp,
00828                     scalars,        //       const double       *Scalarp,
00829                     NoD,            //       int                 NTensorp,
00830                     tensors,        //       const stresstensor *Tensorp,
00831                     ep,
00832                     psip,
00833                     integratorFlag);
00834   if (EPS == 0) {
00835     opserr << "nDMaterial Templated3Dep -EPS - out of memory\n";
00836   }
00837 
00838   cleanup(argv);
00839 
00840   //if (NoD > 0)
00841   //   for (int i=0; i<=NoD; i++) {
00842   //     delete tensors;
00843   //   }
00844   if (NoS > 0)
00845      delete [] scalars;
00846 
00847   return EPS;
00848 }
00849 
00850 
00851 
00852 // Function - to create an EvolutionLaw_S object
00853 EvolutionLaw_S *EvaluateEvolutionLawSArgs(ClientData clientData, Tcl_Interp *interp, TCL_Char *tclString)
00854 {
00855   int argc;
00856   TCL_Char **argv;
00857 
00858   // split the list
00859   if (Tcl_SplitList(interp, tclString, &argc, &argv) != TCL_OK) {
00860     return 0;
00861   }
00862 
00863   //1. Linear scalar evolution law: eq
00864   EvolutionLaw_S *ELS = 0;
00865 
00866   if ((strcmp(argv[0],"-Leq") == 0) || (strcmp(argv[0],"-leq") == 0)) {
00867     double alpha = 0.0;
00868     if (argc > 1)
00869       if (Tcl_GetDouble(interp, argv[1], &alpha) != TCL_OK) {
00870   opserr << "nDMaterial Templated3Dep - invalid alpha " << argv[1] << endln;
00871   cleanup(argv);
00872   return 0;
00873       }
00874     ELS = new EvolutionLaw_L_Eeq(alpha);
00875   }
00876 
00877   //2. Nonlinear scalar evolution law: p for Cam clay
00878   //EvolutionLaw_S *ELS = 0;
00879   if ((strcmp(argv[0],"-NLp") == 0) || (strcmp(argv[0],"-nlp") == 0)) {
00880     double eod = 0.65, lambdad=0.19, kappad=0.06;
00881     if (argc ==3 ) {
00882       if (Tcl_GetDouble(interp, argv[1], &eod) != TCL_OK) {
00883   opserr << "nDMaterial Templated3Dep - invalid eo " << argv[1] << endln;
00884 
00885   //cleanup(argv);
00886   return 0;
00887       }
00888       if (Tcl_GetDouble(interp, argv[2], &lambdad) != TCL_OK) {
00889   opserr << "nDMaterial Templated3Dep - invalid lambda " << argv[2] << endln;
00890 
00891   //cleanup(argv);
00892   return 0;
00893       }
00894       if (Tcl_GetDouble(interp, argv[3], &kappad) != TCL_OK) {
00895   opserr << "nDMaterial Templated3Dep - invalid kappa " << argv[3] << endln;
00896 
00897   cleanup(argv);
00898   return 0;
00899       }
00900 
00901     }
00902     ELS = new EvolutionLaw_NL_Ep(eod, lambdad, kappad);
00903   }
00904 
00905   cleanup(argv);
00906   return ELS;
00907 }
00908 
00909 // Function - to create an EvolutionLaw_T object
00910 EvolutionLaw_T *EvaluateEvolutionLawTArgs(ClientData clientData, Tcl_Interp *interp, TCL_Char *tclString)
00911 {
00912   int argc;
00913   TCL_Char **argv;
00914 
00915   // split the list
00916   if (Tcl_SplitList(interp, tclString, &argc, &argv) != TCL_OK) {
00917     return 0;
00918   }
00919 
00920   EvolutionLaw_T *ELT = 0;
00921   
00922   // Linear Tensorial      
00923   if ((strcmp(argv[0],"-Linear") == 0) || (strcmp(argv[0],"-linear") == 0)) {
00924     double alpha = 0.0;
00925     if (argc > 1)
00926       if (Tcl_GetDouble(interp, argv[1], &alpha) != TCL_OK) {
00927     opserr << "nDMaterial Templated3Dep - invalid alpha " << argv[1] << endln;
00928     cleanup(argv);
00929     return 0;
00930       }
00931     ELT = new EvolutionLaw_L_Eij(alpha);
00932   }
00933   
00934   // Armstrong-Freederick Nolinear Tensorial Evolution Law 
00935   else if ((strcmp(argv[0],"-NLEij") == 0) || (strcmp(argv[0],"-AF") == 0)) {
00936     double had = 0.0;
00937     double Crd = 0.0;    
00938     
00939       if (Tcl_GetDouble(interp, argv[1], &had) != TCL_OK) {
00940     opserr << "nDMaterial Templated3Dep - invalid ha " << argv[1] << endln;
00941     cleanup(argv);
00942     return 0;
00943       }
00944       
00945       if (Tcl_GetDouble(interp, argv[2], &Crd) != TCL_OK) {
00946     opserr << "nDMaterial Templated3Dep - invalid Cr " << argv[2] << endln;
00947     cleanup(argv);
00948     return 0;
00949       }      
00950     
00951     ELT = new EvolutionLaw_NL_Eij(had, Crd);
00952 
00953   }
00954   
00955   //Manzari-Dafalias Two Surface model
00956   else if ((strcmp(argv[0],"-NLEijMD") == 0) || (strcmp(argv[0],"-MD") == 0 )) {
00957     double eod = 0.85, ad = 0.5, Lambdad = 0.025, ec_refd = 0.8, p_refd = 160.0;
00958     double Mcd = 1.14, Med = 1.14, kc_bd = 3.975, kc_dd = 4.200;
00959     double ke_bd = 2.000, ke_dd = 0.07, hod = 1200, Cmd = 0.00, Aod = 2.64, Fmaxd = 100, Cfd = 100;
00960 
00961     int loc = 1;
00962     // switch on remaining args;
00963     while (loc < argc) {
00964 
00965       if  (strcmp(argv[loc],"-eo") == 0) {
00966         if (Tcl_GetDouble(interp, argv[loc+1], &eod) != TCL_OK) {
00967         opserr << "nDMaterial Templated3Dep -EPS - invalid eo " << argv[loc+1] << endln;
00968         cleanup(argv);
00969         return 0;
00970         }
00971         loc+=2;
00972       }
00973       else if  (strcmp(argv[loc],"-a") == 0) {
00974         if (Tcl_GetDouble(interp, argv[loc+1], &ad) != TCL_OK) {
00975         opserr << "nDMaterial Templated3Dep -EPS - invalid a " << argv[loc+1] << endln;
00976         cleanup(argv);
00977         return 0;
00978         }
00979         loc+=2;
00980       }
00981       else if  (strcmp(argv[loc],"-Mc") == 0) {
00982         if (Tcl_GetDouble(interp, argv[loc+1], &Mcd) != TCL_OK) {
00983         opserr << "nDMaterial Templated3Dep -EPS - invalid Mc " << argv[loc+1] << endln;
00984         cleanup(argv);
00985         return 0;
00986         }
00987         loc+=2;
00988       }
00989       else if  (strcmp(argv[loc],"-Me") == 0) {
00990         if (Tcl_GetDouble(interp, argv[loc+1], &Med) != TCL_OK) {
00991         opserr << "nDMaterial Templated3Dep -EPS - invalid ec " << argv[loc+1] << endln;
00992         cleanup(argv);
00993         return 0;
00994         }
00995         loc+=2;
00996       }
00997       else if  (strcmp(argv[loc],"-Lambda") == 0) {
00998         if (Tcl_GetDouble(interp, argv[loc+1], &Lambdad) != TCL_OK) {
00999         opserr << "nDMaterial Templated3Dep -EPS - invalid lambdad " << argv[loc+1] << endln;
01000         cleanup(argv);
01001         return 0;
01002         }
01003         loc+=2;
01004       }
01005       else if  (strcmp(argv[loc],"-ec_ref") == 0) {
01006         if (Tcl_GetDouble(interp, argv[loc+1], &ec_refd) != TCL_OK) {
01007         opserr << "nDMaterial Templated3Dep -EPS - invalid ec_ref " << argv[loc+1] << endln;
01008         cleanup(argv);
01009         return 0;
01010         }
01011         loc+=2;
01012       }
01013       else if  (strcmp(argv[loc],"-p_ref") == 0) {
01014         if (Tcl_GetDouble(interp, argv[loc+1], &p_refd) != TCL_OK) {
01015         opserr << "nDMaterial Templated3Dep -EPS - invalid p_ref " << argv[loc+1] << endln;
01016         cleanup(argv);
01017         return 0;
01018         }
01019         loc+=2;
01020       }
01021 
01022       else if  (strcmp(argv[loc],"-kc_b") == 0) {
01023         if (Tcl_GetDouble(interp, argv[loc+1], &kc_bd) != TCL_OK) {
01024         opserr << "nDMaterial Templated3Dep -EPS - invalid kc_b " << argv[loc+1] << endln;
01025         cleanup(argv);
01026         return 0;
01027         }
01028         loc+=2;
01029       }
01030       else if  (strcmp(argv[loc],"-kc_d") == 0) {
01031         if (Tcl_GetDouble(interp, argv[loc+1], &kc_dd) != TCL_OK) {
01032         opserr << "nDMaterial Templated3Dep -EPS - invalid kc_d " << argv[loc+1] << endln;
01033         cleanup(argv);
01034         return 0;
01035         }
01036         loc+=2;
01037       }
01038       else if  (strcmp(argv[loc],"-ke_b") == 0) {
01039         if (Tcl_GetDouble(interp, argv[loc+1], &ke_bd) != TCL_OK) {
01040         opserr << "nDMaterial Templated3Dep -EPS - invalid ke_b " << argv[loc+1] << endln;
01041         cleanup(argv);
01042         return 0;
01043         }
01044         loc+=2;
01045       }
01046       else if  (strcmp(argv[loc],"-ke_d") == 0) {
01047         if (Tcl_GetDouble(interp, argv[loc+1], &ke_dd) != TCL_OK) {
01048         opserr << "nDMaterial Templated3Dep -EPS - invalid ke_d " << argv[loc+1] << endln;
01049         cleanup(argv);
01050         return 0;
01051         }
01052         loc+=2;
01053       }
01054       else if  (strcmp(argv[loc],"-ho") == 0) {
01055         if (Tcl_GetDouble(interp, argv[loc+1], &hod) != TCL_OK) {
01056         opserr << "nDMaterial Templated3Dep -EPS - invalid a " << argv[loc+1] << endln;
01057         cleanup(argv);
01058         return 0;
01059         }
01060         loc+=2;
01061       }
01062       else if  (strcmp(argv[loc],"-Cm") == 0) {
01063         if (Tcl_GetDouble(interp, argv[loc+1], &Cmd) != TCL_OK) {
01064         opserr << "nDMaterial Templated3Dep -EPS - invalid a " << argv[loc+1] << endln;
01065         cleanup(argv);
01066         return 0;
01067         }
01068         loc+=2;
01069       }
01070       else if  (strcmp(argv[loc],"-Ao") == 0) {
01071         if (Tcl_GetDouble(interp, argv[loc+1], &Aod) != TCL_OK) {
01072         opserr << "nDMaterial Templated3Dep -EPS - invalid a " << argv[loc+1] << endln;
01073         cleanup(argv);
01074         return 0;
01075         }
01076         loc+=2;
01077       }
01078       else if  (strcmp(argv[loc],"-Fmax") == 0) {
01079         if (Tcl_GetDouble(interp, argv[loc+1], &Fmaxd) != TCL_OK) {
01080         opserr << "nDMaterial Templated3Dep -EPS - invalid a " << argv[loc+1] << endln;
01081         cleanup(argv);
01082         return 0;
01083         }
01084         loc+=2;
01085       }
01086       else if  (strcmp(argv[loc],"-Cf") == 0) {
01087         if (Tcl_GetDouble(interp, argv[loc+1], &Cfd) != TCL_OK) {
01088         opserr << "nDMaterial Templated3Dep -EPS - invalid a " << argv[loc+1] << endln;
01089         cleanup(argv);
01090         return 0;
01091         }
01092         loc+=2;
01093       }
01094 
01095     }//end of while
01096 
01097     ELT = new EvolutionLaw_NL_EijMD(eod, ad, Mcd, Med, Lambdad, ec_refd, p_refd, kc_bd, kc_dd, ke_bd, ke_dd, hod, Cmd, Aod, Fmaxd, Cfd);
01098   }
01099 
01100   cleanup(argv);
01101   return ELT;
01102 }
01103 
01104 

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