TclElement2dYS.cpp

Go to the documentation of this file.
00001 #include <stdlib.h>
00002 #include <string.h>
00003 #include <OPS_Stream.h>
00004 
00005 #include <Domain.h>
00006 #include <Node.h>
00007 #include <Matrix.h>
00008 
00009 #include <CyclicModel.h>
00010 #include <Inelastic2DYS01.h>
00011 #include <Inelastic2DYS02.h>
00012 #include <Inelastic2DYS03.h>
00013 //#include <Inelastic2DYS04.h>
00014 //#include <Inelastic2DYS05.h>
00015 
00016 #include <YieldSurface_BC.h>
00017 #include <TclModelBuilder.h>
00018 
00019 #define  tcl_debug 0
00020 
00021 // Element2dGNL(int tag, double A, double E, double I, int Nd1, int Nd2,
00022 //             double rho = 0.0, bool islinear = false);
00023 
00024 int
00025 TclModelBuilder_addElement2dYS01 (ClientData clientData, Tcl_Interp *interp,
00026                                                                    int argc, TCL_Char **argv,
00027                                                                    Domain *theDomain, TclModelBuilder *theBuilder)
00028 {
00029         //cerr << "Press key to continue...\n";
00030         //cin.get();
00031 
00032     if(tcl_debug)
00033         opserr << " TclModelBuilder_addElement2dGNL \n";
00034 
00035         if (argc < 11)
00036         {
00037                 opserr << "WARNING insufficient arguments\n";
00038                 opserr << "element element2dYS tag? Nd1? Nd2? A? E? Iz? ysID1? ysID2? algo?";
00039 
00040                 return TCL_ERROR;
00041         }
00042 
00043         int tag, ndI, ndJ;
00044         double E, A, I;
00045 //      double massDens = 0.0;
00046         int ysID1, ysID2;
00047         int rf_algo;
00048 
00049         if (Tcl_GetInt(interp, argv[2], &tag) != TCL_OK)
00050         {
00051                 opserr << "WARNING invalid element2dYS tag" << endln;
00052                 return TCL_ERROR;
00053         }
00054     if(tcl_debug) opserr << "\tElement tag = " << tag << "\n";
00055 
00056     if (Tcl_GetInt (interp, argv[3], &ndI) != TCL_OK)
00057         {
00058                 opserr << "WARNING invalid node I\n";
00059                 opserr << "element2dYS: " << tag << endln;
00060                 return TCL_ERROR;
00061         }
00062 
00063         if (Tcl_GetInt (interp, argv[4], &ndJ) != TCL_OK)
00064         {
00065                 opserr << "WARNING invalid node J\n";
00066                 opserr << "element2dYS: " << tag << endln;
00067                 return TCL_ERROR;
00068         }
00069 
00070 
00071         if (Tcl_GetDouble(interp, argv[5], &A) != TCL_OK)
00072         {
00073                 opserr << "WARNING invalid A\n";
00074                 opserr << "element2dYS: " << tag << endln;
00075                 return TCL_ERROR;
00076         }
00077 
00078         if (Tcl_GetDouble(interp, argv[6], &E) != TCL_OK)
00079         {
00080                 opserr << "WARNING invalid E\n";
00081                 opserr << "element2dYS: " << tag << endln;
00082                 return TCL_ERROR;
00083         }
00084 
00085         if (Tcl_GetDouble(interp, argv[7], &I) != TCL_OK)
00086         {
00087                 opserr << "WARNING invalid I\n";
00088                 opserr << "element2dYS: " << tag << endln;
00089                 return TCL_ERROR;
00090         }
00091 
00092         if (Tcl_GetInt (interp, argv[8], &ysID1) != TCL_OK)
00093         {
00094                 opserr << "WARNING invalid ysID1\n";
00095                 opserr << "element2dYS: " << tag << endln;
00096                 return TCL_ERROR;
00097         }
00098 
00099         if (Tcl_GetInt (interp, argv[9], &ysID2) != TCL_OK)
00100         {
00101                 opserr << "WARNING invalid ysID2\n";
00102                 opserr << "element2dYS: " << tag << endln;
00103                 return TCL_ERROR;
00104         }
00105 
00106         if (Tcl_GetInt (interp, argv[10], &rf_algo) != TCL_OK)
00107         {
00108                 opserr << "WARNING invalid ysID1\n";
00109                 opserr << "element2dYS: " << tag << endln;
00110                 return TCL_ERROR;
00111         }
00112 
00113         YieldSurface_BC *theYS1 = theBuilder->getYieldSurface_BC(ysID1);
00114         if(theYS1 == 0)
00115         {
00116                 opserr << "WARNING element2dYS: " << tag << "\n";
00117                 opserr <<  " no yield surface exists with tag: " << ysID1 << endln;
00118                 return TCL_ERROR;
00119         }
00120 
00121         YieldSurface_BC *theYS2 = theBuilder->getYieldSurface_BC(ysID2);
00122         if(theYS2 == 0)
00123         {
00124                 opserr << "WARNING element2dYS: " << tag << "\n";
00125                 opserr <<  " no yield surface exists with tag: " << ysID2 << endln;
00126                 return TCL_ERROR;
00127         }
00128 
00129 //              Inelastic2DYS(  int tag, double A, double E, double I, int Nd1, int Nd2,
00130 //                                              YieldSurface_BC *ysEnd1, YieldSurface_BC *ysEnd2,
00131 //                                              int rf_algo = -1, // updated
00132         Element *theElement = new Inelastic2DYS01(tag, A, E, I, ndI, ndJ, theYS1, theYS2, rf_algo);
00133 
00134         if(tcl_debug) opserr << "\tElement created\n";
00135 
00136         // Ensure we have created the element, out of memory if got here and no element
00137         if (theElement == 0)
00138         {
00139                 opserr << "WARNING ran out of memory creating element\n";
00140                 opserr << "element2dYS: " << tag << endln;
00141                 opserr << "\a";
00142                 return TCL_ERROR;
00143         }
00144 
00145         if (theDomain->addElement(theElement) == false)
00146         {
00147                 opserr << "WARNING TclElmtBuilder - addelement2dYS - could not add element to domain ";
00148                 opserr << tag << endln;
00149                 opserr << "\a";
00150                 return TCL_ERROR;
00151         }
00152 
00153         if(tcl_debug) opserr << "\tElement number " << tag << " added to domain - returning\n";
00154 
00155         return TCL_OK;
00156 }
00157 
00158 
00159 int
00160 TclModelBuilder_addElement2dYS02 (ClientData clientData, Tcl_Interp *interp,
00161                                                                    int argc, TCL_Char **argv,
00162                                                                    Domain *theDomain, TclModelBuilder *theBuilder)
00163 {
00164         //cerr << "Press key to continue...\n";
00165         //cin.get();
00166 
00167     if(tcl_debug)
00168         opserr << " TclModelBuilder_addElement2dGNL \n";
00169 
00170         if (argc < 14)
00171         {
00172                 opserr << "WARNING insufficient arguments\n";
00173                 opserr << "element element2dYS tag? Nd1? Nd2? A? E? Iz? ysID1? ysID2? cycType? wt? power? algo?";
00174 
00175                 return TCL_ERROR;
00176         }
00177 
00178         int tag, ndI, ndJ;
00179         double E, A, I;
00180 //      double massDens = 0.0;
00181         int ysID1, ysID2;
00182         int cyc_type;
00183 //      double wt;
00184 
00185         int rf_algo=-1;
00186 
00187         if (Tcl_GetInt(interp, argv[2], &tag) != TCL_OK)
00188         {
00189                 opserr << "WARNING invalid element2dYS tag" << endln;
00190                 return TCL_ERROR;
00191         }
00192     if(tcl_debug) opserr << "\tElement tag = " << tag << "\n";
00193 
00194     if (Tcl_GetInt (interp, argv[3], &ndI) != TCL_OK)
00195         {
00196                 opserr << "WARNING invalid node I\n";
00197                 opserr << "element2dYS: " << tag << endln;
00198                 return TCL_ERROR;
00199         }
00200 
00201         if (Tcl_GetInt (interp, argv[4], &ndJ) != TCL_OK)
00202         {
00203                 opserr << "WARNING invalid node J\n";
00204                 opserr << "element2dYS: " << tag << endln;
00205                 return TCL_ERROR;
00206         }
00207 
00208 
00209         if (Tcl_GetDouble(interp, argv[5], &A) != TCL_OK)
00210         {
00211                 opserr << "WARNING invalid A\n";
00212                 opserr << "element2dYS: " << tag << endln;
00213                 return TCL_ERROR;
00214         }
00215 
00216         if (Tcl_GetDouble(interp, argv[6], &E) != TCL_OK)
00217         {
00218                 opserr << "WARNING invalid E\n";
00219                 opserr << "element2dYS: " << tag << endln;
00220                 return TCL_ERROR;
00221         }
00222 
00223         if (Tcl_GetDouble(interp, argv[7], &I) != TCL_OK)
00224         {
00225                 opserr << "WARNING invalid I\n";
00226                 opserr << "element2dYS: " << tag << endln;
00227                 return TCL_ERROR;
00228         }
00229 
00230         if (Tcl_GetInt (interp, argv[8], &ysID1) != TCL_OK)
00231         {
00232                 opserr << "WARNING invalid ysID1\n";
00233                 opserr << "element2dYS: " << tag << endln;
00234                 return TCL_ERROR;
00235         }
00236 
00237         if (Tcl_GetInt (interp, argv[9], &ysID2) != TCL_OK)
00238         {
00239                 opserr << "WARNING invalid ysID2\n";
00240                 opserr << "element2dYS: " << tag << endln;
00241                 return TCL_ERROR;
00242         }
00243 
00244                 if (Tcl_GetInt(interp, argv[10], &cyc_type) != TCL_OK)
00245         {
00246                 opserr << "WARNING invalid cyc_type\n";
00247                 opserr << "element2dYS: " << tag << endln;
00248                 return TCL_ERROR;
00249         }
00250 
00251         /*if (Tcl_GetDouble (interp, argv[11], &wt) != TCL_OK)
00252         {
00253                 opserr << "WARNING invalid wt\n";
00254                 opserr << "element2dYS: " << tag << endln;
00255                 return TCL_ERROR;
00256         }*/
00257 
00258         double delpmax, alfa, beta;
00259         if (Tcl_GetDouble (interp, argv[11], &delpmax) != TCL_OK)
00260         {
00261                 opserr << "WARNING invalid power\n";
00262                 opserr << "element2dYS: " << tag << endln;
00263                 return TCL_ERROR;
00264         }
00265         
00266         if (Tcl_GetDouble (interp, argv[12], &alfa) != TCL_OK)
00267         {
00268                 opserr << "WARNING invalid power\n";
00269                 opserr << "element2dYS: " << tag << endln;
00270                 return TCL_ERROR;
00271         }
00272 
00273         if (Tcl_GetDouble (interp, argv[13], &beta) != TCL_OK)
00274         {
00275                 opserr << "WARNING invalid rfalgo\n";
00276                 opserr << "element2dYS: " << tag << endln;
00277                 return TCL_ERROR;
00278         }
00279 
00280         YieldSurface_BC *theYS1 = theBuilder->getYieldSurface_BC(ysID1);
00281         if(theYS1 == 0)
00282         {
00283                 opserr << "WARNING element2dYS: " << tag << "\n";
00284                 opserr <<  " no yield surface exists with tag: " << ysID1 << endln;
00285                 return TCL_ERROR;
00286         }
00287 
00288         YieldSurface_BC *theYS2 = theBuilder->getYieldSurface_BC(ysID2);
00289         if(theYS2 == 0)
00290         {
00291                 opserr << "WARNING element2dYS: " << tag << "\n";
00292                 opserr <<  " no yield surface exists with tag: " << ysID2 << endln;
00293                 return TCL_ERROR;
00294         }
00295 
00296 //Inelastic2DYS02(int tag, double a, double e, double i, int Nd1, int Nd2,
00297 //                              YieldSurface_BC *ysEnd1,  YieldSurface_BC *ysEnd2,
00298 //                              int rf_algo, bool islinear, double rho)
00299 
00300         CyclicModel *theModel = theBuilder->getCyclicModel(cyc_type);
00301 //Element *theElement = new Inelastic2DYS02(tag, A, E, I, ndI, ndJ, theYS1, theYS2, cyc_type, wt, delpmax, alfa, beta, rf_algo);
00302 Element *theElement = new Inelastic2DYS02(tag, A, E, I, ndI, ndJ, theYS1, theYS2, theModel, delpmax, alfa, beta, rf_algo);
00303     opserr << "Inelastic2DYS02 created\n";
00304 
00305         if(tcl_debug) opserr << "\tElement created\n";
00306 
00307         // Ensure we have created the element, out of memory if got here and no element
00308         if (theElement == 0)
00309         {
00310                 opserr << "WARNING ran out of memory creating element\n";
00311                 opserr << "element2dYS: " << tag << endln;
00312                 opserr << "\a";
00313                 return TCL_ERROR;
00314         }
00315 
00316         opserr << "Inelastic2DYS02 adding to domain\n";
00317 
00318         if (theDomain->addElement(theElement) == false)
00319         {
00320                 opserr << "WARNING TclElmtBuilder - addelement2dYS - could not add element to domain ";
00321                 opserr << tag << endln;
00322                 opserr << "\a";
00323                 return TCL_ERROR;
00324         }
00325 
00326         //if(tcl_debug)
00327                 opserr << "Inelastic2DYS02 #" << tag << " added to domain - returning\n";
00328 
00329         return TCL_OK;
00330 }
00331 
00332 
00333 int
00334 TclModelBuilder_addElement2dYS03 (ClientData clientData, Tcl_Interp *interp,
00335                                                                    int argc, TCL_Char **argv,
00336                                                                    Domain *theDomain, TclModelBuilder *theBuilder)
00337 {
00338         //cerr << "Press key to continue...\n";
00339         //cin.get();
00340 
00341     if(tcl_debug)
00342         opserr << " TclModelBuilder_addElement2dGNL \n";
00343 
00344         if (argc < 11)
00345         {
00346                 opserr << "WARNING insufficient arguments\n";
00347                 opserr << "element element2dYS03 tag? Nd1? Nd2? A_ten? A_com? E? IzPos? IzNeg? ysID1? ysID2? algo?";
00348 
00349                 return TCL_ERROR;
00350         }
00351 
00352         int tag, ndI, ndJ;
00353         double E, aTens, aComp, Ipos, Ineg;
00354 //      double massDens = 0.0;
00355         int ysID1, ysID2;
00356 
00357         int rf_algo;
00358 
00359         if (Tcl_GetInt(interp, argv[2], &tag) != TCL_OK)
00360         {
00361                 opserr << "WARNING invalid element2dYS tag" << endln;
00362                 return TCL_ERROR;
00363         }
00364     if(tcl_debug) opserr << "\tElement tag = " << tag << "\n";
00365 
00366     if (Tcl_GetInt (interp, argv[3], &ndI) != TCL_OK)
00367         {
00368                 opserr << "WARNING invalid node I\n";
00369                 opserr << "element2dYS: " << tag << endln;
00370                 return TCL_ERROR;
00371         }
00372 
00373         if (Tcl_GetInt (interp, argv[4], &ndJ) != TCL_OK)
00374         {
00375                 opserr << "WARNING invalid node J\n";
00376                 opserr << "element2dYS: " << tag << endln;
00377                 return TCL_ERROR;
00378         }
00379 
00380 
00381         if (Tcl_GetDouble(interp, argv[5], &aTens) != TCL_OK)
00382         {
00383                 opserr << "WARNING invalid A\n";
00384                 opserr << "element2dYS: " << tag << endln;
00385                 return TCL_ERROR;
00386         }
00387 
00388         if (Tcl_GetDouble(interp, argv[6], &aComp) != TCL_OK)
00389         {
00390                 opserr << "WARNING invalid A\n";
00391                 opserr << "element2dYS: " << tag << endln;
00392                 return TCL_ERROR;
00393         }
00394 
00395         if (Tcl_GetDouble(interp, argv[7], &E) != TCL_OK)
00396         {
00397                 opserr << "WARNING invalid E\n";
00398                 opserr << "element2dYS: " << tag << endln;
00399                 return TCL_ERROR;
00400         }
00401 
00402         if (Tcl_GetDouble(interp, argv[8], &Ipos) != TCL_OK)
00403         {
00404                 opserr << "WARNING invalid I\n";
00405                 opserr << "element2dYS: " << tag << endln;
00406                 return TCL_ERROR;
00407         }
00408 
00409         if (Tcl_GetDouble(interp, argv[9], &Ineg) != TCL_OK)
00410         {
00411                 opserr << "WARNING invalid I\n";
00412                 opserr << "element2dYS: " << tag << endln;
00413                 return TCL_ERROR;
00414         }
00415 
00416         if (Tcl_GetInt (interp, argv[10], &ysID1) != TCL_OK)
00417         {
00418                 opserr << "WARNING invalid ysID1\n";
00419                 opserr << "element2dYS: " << tag << endln;
00420                 return TCL_ERROR;
00421         }
00422 
00423         if (Tcl_GetInt (interp, argv[11], &ysID2) != TCL_OK)
00424         {
00425                 opserr << "WARNING invalid ysID2\n";
00426                 opserr << "element2dYS: " << tag << endln;
00427                 return TCL_ERROR;
00428         }
00429 
00430         if (Tcl_GetInt (interp, argv[12], &rf_algo) != TCL_OK)
00431         {
00432                 opserr << "WARNING invalid ysID1\n";
00433                 opserr << "element2dYS: " << tag << endln;
00434                 return TCL_ERROR;
00435         }
00436 
00437         YieldSurface_BC *theYS1 = theBuilder->getYieldSurface_BC(ysID1);
00438         if(theYS1 == 0)
00439         {
00440                 opserr << "WARNING element2dYS: " << tag << "\n";
00441                 opserr <<  " no yield surface exists with tag: " << ysID1 << endln;
00442                 return TCL_ERROR;
00443         }
00444 
00445         YieldSurface_BC *theYS2 = theBuilder->getYieldSurface_BC(ysID2);
00446         if(theYS2 == 0)
00447         {
00448                 opserr << "WARNING element2dYS: " << tag << "\n";
00449                 opserr <<  " no yield surface exists with tag: " << ysID2 << endln;
00450                 return TCL_ERROR;
00451         }
00452 
00453 //      Inelastic2DYS03(int tag, double a_ten, double a_com, double e,
00454 //                      double iz_pos, double iz_neg, int Nd1, int Nd2,
00455 //                    YieldSurface_BC *ysEnd1,  YieldSurface_BC *ysEnd2,
00456 //                    int rf_algo, bool islinear, double rho);
00457 
00458 Element *theElement = new Inelastic2DYS03(tag, aTens, aComp, E,
00459                                           Ipos, Ineg, ndI, ndJ,
00460                                           theYS1, theYS2, rf_algo);
00461 
00462     opserr << "Inelastic2DYS03 created\n";
00463 
00464         if(tcl_debug) opserr << "\tElement created\n";
00465 
00466         // Ensure we have created the element, out of memory if got here and no element
00467         if (theElement == 0)
00468         {
00469                 opserr << "WARNING ran out of memory creating element\n";
00470                 opserr << "element2dYS: " << tag << endln;
00471                 opserr << "\a";
00472                 return TCL_ERROR;
00473         }
00474 
00475         opserr << "Inelastic2DYS03 adding to domain\n";
00476 
00477         if (theDomain->addElement(theElement) == false)
00478         {
00479                 opserr << "WARNING TclElmtBuilder - addelement2dYS - could not add element to domain ";
00480                 opserr << tag << endln;
00481                 opserr << "\a";
00482                 return TCL_ERROR;
00483         }
00484 
00485         if(tcl_debug)
00486                 opserr << "Inelastic2DYS03 #" << tag << " added to domain - returning\n";
00487 
00488         return TCL_OK;
00489 }
00490 
00491 
00492 /*
00493 int
00494 TclModelBuilder_addElement2dYS04 (ClientData clientData, Tcl_Interp *interp,
00495                                                                    int argc, char **argv,
00496                                                                    Domain *theDomain, TclModelBuilder *theBuilder)
00497 {
00498         //cerr << "Press key to continue...\n";
00499         //cin.get();
00500 
00501         if (argc < 11)
00502         {
00503                 opserr << "WARNING insufficient arguments\n";
00504                 opserr << "element element2dYS04 tag? Nd1? Nd2? A? E? Iz? ysID1? ysID2? algo?";
00505 
00506                 return TCL_ERROR;
00507         }
00508 
00509         int tag, ndI, ndJ;
00510         double E, A, I;
00511 //      double massDens = 0.0;
00512         int ysID1, ysID2;
00513         int rf_algo;
00514 
00515         if (Tcl_GetInt(interp, argv[2], &tag) != TCL_OK)
00516         {
00517                 opserr << "WARNING invalid element2dYS04 tag" << endln;
00518                 return TCL_ERROR;
00519         }
00520     if(tcl_debug) opserr << "\tElement tag = " << tag << "\n";
00521 
00522     if (Tcl_GetInt (interp, argv[3], &ndI) != TCL_OK)
00523         {
00524                 opserr << "WARNING invalid node I\n";
00525                 opserr << "element2dYS04: " << tag << endln;
00526                 return TCL_ERROR;
00527         }
00528 
00529         if (Tcl_GetInt (interp, argv[4], &ndJ) != TCL_OK)
00530         {
00531                 opserr << "WARNING invalid node J\n";
00532                 opserr << "element2dYS04: " << tag << endln;
00533                 return TCL_ERROR;
00534         }
00535 
00536 
00537         if (Tcl_GetDouble(interp, argv[5], &A) != TCL_OK)
00538         {
00539                 opserr << "WARNING invalid A\n";
00540                 opserr << "element2dYS04: " << tag << endln;
00541                 return TCL_ERROR;
00542         }
00543 
00544         if (Tcl_GetDouble(interp, argv[6], &E) != TCL_OK)
00545         {
00546                 opserr << "WARNING invalid E\n";
00547                 opserr << "element2dYS04: " << tag << endln;
00548                 return TCL_ERROR;
00549         }
00550 
00551         if (Tcl_GetDouble(interp, argv[7], &I) != TCL_OK)
00552         {
00553                 opserr << "WARNING invalid I\n";
00554                 opserr << "element2dYS04: " << tag << endln;
00555                 return TCL_ERROR;
00556         }
00557 
00558         if (Tcl_GetInt (interp, argv[8], &ysID1) != TCL_OK)
00559         {
00560                 opserr << "WARNING invalid ysID1\n";
00561                 opserr << "element2dYS04: " << tag << endln;
00562                 return TCL_ERROR;
00563         }
00564 
00565         if (Tcl_GetInt (interp, argv[9], &ysID2) != TCL_OK)
00566         {
00567                 opserr << "WARNING invalid ysID2\n";
00568                 opserr << "element2dYS04: " << tag << endln;
00569                 return TCL_ERROR;
00570         }
00571 
00572         if (Tcl_GetInt (interp, argv[10], &rf_algo) != TCL_OK)
00573         {
00574                 opserr << "WARNING invalid ysID1\n";
00575                 opserr << "element2dYS04: " << tag << endln;
00576                 return TCL_ERROR;
00577         }
00578 
00579                 YieldSurface_BC *theYS1 = theBuilder->getYieldSurface_BC(ysID1);
00580         if(theYS1 == 0)
00581         {
00582                 opserr << "WARNING element2dYS: " << tag << "\n";
00583                 opserr <<  " no yield surface exists with tag: " << ysID1 << endln;
00584                 return TCL_ERROR;
00585         }
00586 
00587         YieldSurface_BC *theYS2 = theBuilder->getYieldSurface_BC(ysID2);
00588         if(theYS2 == 0)
00589         {
00590                 opserr << "WARNING element2dYS: " << tag << "\n";
00591                 opserr <<  " no yield surface exists with tag: " << ysID2 << endln;
00592                 return TCL_ERROR;
00593         }
00594 
00595 //              Inelastic2DYS(  int tag, double A, double E, double I, int Nd1, int Nd2,
00596 //                                              YieldSurface_BC *ysEnd1, YieldSurface_BC *ysEnd2,
00597 //                                              int rf_algo = -1, // updated
00598 
00599         Element *theElement = new Inelastic2DYS04(tag, A, E, I, ndI, ndJ, theYS1, theYS2, rf_algo);
00600 
00601         if(tcl_debug) opserr << "\tElement created\n";
00602 
00603         // Ensure we have created the element, out of memory if got here and no element
00604         if (theElement == 0)
00605         {
00606                 opserr << "WARNING ran out of memory creating element\n";
00607                 opserr << "element2dYS04: " << tag << endln;
00608                 opserr << "\a";
00609                 return TCL_ERROR;
00610         }
00611 
00612         if (theDomain->addElement(theElement) == false)
00613         {
00614                 opserr << "WARNING TclElmtBuilder - addelement2dYS - could not add element to domain ";
00615                 opserr << tag << endln;
00616                 opserr << "\a";
00617                 return TCL_ERROR;
00618         }
00619 
00620         if(tcl_debug) opserr << "\tElement number " << tag << " added to domain - returning\n";
00621 
00622         return TCL_OK;
00623 }
00624 */
00625 
00626 /*
00627 int
00628 TclModelBuilder_addElement2dYS05 (ClientData clientData, Tcl_Interp *interp,
00629                                                                    int argc, char **argv,
00630                                                                    Domain *theDomain, TclModelBuilder *theBuilder)
00631 {
00632         //cerr << "Press key to continue...\n";
00633         //cin.get();
00634 
00635         if (argc < 11)
00636         {
00637                 opserr << "WARNING insufficient arguments\n";
00638                 opserr << "element element2dYS04 tag? Nd1? Nd2? A? E? Iz? ysID1? ysID2? algo?";
00639 
00640                 return TCL_ERROR;
00641         }
00642 
00643         int tag, ndI, ndJ;
00644         double E, A, I;
00645 //      double massDens = 0.0;
00646         int ysID1, ysID2;
00647         int rf_algo;
00648 
00649         if (Tcl_GetInt(interp, argv[2], &tag) != TCL_OK)
00650         {
00651                 opserr << "WARNING invalid element2dYS05 tag" << endln;
00652                 return TCL_ERROR;
00653         }
00654     if(tcl_debug) opserr << "\tElement tag = " << tag << "\n";
00655 
00656     if (Tcl_GetInt (interp, argv[3], &ndI) != TCL_OK)
00657         {
00658                 opserr << "WARNING invalid node I\n";
00659                 opserr << "element2dYS05: " << tag << endln;
00660                 return TCL_ERROR;
00661         }
00662 
00663         if (Tcl_GetInt (interp, argv[4], &ndJ) != TCL_OK)
00664         {
00665                 opserr << "WARNING invalid node J\n";
00666                 opserr << "element2dYS05: " << tag << endln;
00667                 return TCL_ERROR;
00668         }
00669 
00670 
00671         if (Tcl_GetDouble(interp, argv[5], &A) != TCL_OK)
00672         {
00673                 opserr << "WARNING invalid A\n";
00674                 opserr << "element2dYS05: " << tag << endln;
00675                 return TCL_ERROR;
00676         }
00677 
00678         if (Tcl_GetDouble(interp, argv[6], &E) != TCL_OK)
00679         {
00680                 opserr << "WARNING invalid E\n";
00681                 opserr << "element2dYS05: " << tag << endln;
00682                 return TCL_ERROR;
00683         }
00684 
00685         if (Tcl_GetDouble(interp, argv[7], &I) != TCL_OK)
00686         {
00687                 opserr << "WARNING invalid I\n";
00688                 opserr << "element2dYS05: " << tag << endln;
00689                 return TCL_ERROR;
00690         }
00691 
00692         if (Tcl_GetInt (interp, argv[8], &ysID1) != TCL_OK)
00693         {
00694                 opserr << "WARNING invalid ysID1\n";
00695                 opserr << "element2dYS05: " << tag << endln;
00696                 return TCL_ERROR;
00697         }
00698 
00699         if (Tcl_GetInt (interp, argv[9], &ysID2) != TCL_OK)
00700         {
00701                 opserr << "WARNING invalid ysID2\n";
00702                 opserr << "element2dYS05: " << tag << endln;
00703                 return TCL_ERROR;
00704         }
00705 
00706         if (Tcl_GetInt (interp, argv[10], &rf_algo) != TCL_OK)
00707         {
00708                 opserr << "WARNING invalid ysID1\n";
00709                 opserr << "element2dYS05: " << tag << endln;
00710                 return TCL_ERROR;
00711         }
00712 
00713         YieldSurface_BC *theYS1 = theBuilder->getYieldSurface_BC(ysID1);
00714         if(theYS1 == 0)
00715         {
00716                 opserr << "WARNING element2dYS05: " << tag << "\n";
00717                 opserr <<  " no yield surface exists with tag: " << ysID1 << endln;
00718                 return TCL_ERROR;
00719         }
00720 
00721         YieldSurface_BC *theYS2 = theBuilder->getYieldSurface_BC(ysID2);
00722         if(theYS2 == 0)
00723         {
00724                 opserr << "WARNING element2dYS05: " << tag << "\n";
00725                 opserr <<  " no yield surface exists with tag: " << ysID2 << endln;
00726                 return TCL_ERROR;
00727         }
00728 
00729 //              Inelastic2DYS(  int tag, double A, double E, double I, int Nd1, int Nd2,
00730 //                                              YieldSurface_BC *ysEnd1, YieldSurface_BC *ysEnd2,
00731 //                                              int rf_algo = -1, // updated
00732 
00733         Element *theElement = new Inelastic2DYS05(tag, A, E, I, ndI, ndJ, theYS1, theYS2, rf_algo);
00734 
00735         if(tcl_debug) opserr << "\tElement created\n";
00736 
00737         // Ensure we have created the element, out of memory if got here and no element
00738         if (theElement == 0)
00739         {
00740                 opserr << "WARNING ran out of memory creating element\n";
00741                 opserr << "element2dYS05: " << tag << endln;
00742                 opserr << "\a";
00743                 return TCL_ERROR;
00744         }
00745 
00746         if (theDomain->addElement(theElement) == false)
00747         {
00748                 opserr << "WARNING TclElmtBuilder - addelement2dYS - could not add element to domain ";
00749                 opserr << tag << endln;
00750                 opserr << "\a";
00751                 return TCL_ERROR;
00752         }
00753 
00754         if(tcl_debug) opserr << "\tElement number " << tag << " added to domain - returning\n";
00755 
00756         return TCL_OK;
00757 }
00758 */
00759 
00760 /*******************************************************************************************/
00761 int
00762 TclModelBuilder_addElement2dYS (ClientData clientData, Tcl_Interp *interp,
00763                                                                    int argc, TCL_Char **argv,
00764                                                                    Domain *theTclDomain, TclModelBuilder *theTclBuilder)
00765 {
00766 
00767   if (strcmp(argv[1],"inelastic2dYS01") == 0) {
00768           int result = TclModelBuilder_addElement2dYS01(clientData, interp, argc, argv,
00769                                                  theTclDomain, theTclBuilder);
00770     return result;
00771   }
00772   else if (strcmp(argv[1],"inelastic2dYS02") == 0) {
00773           int result = TclModelBuilder_addElement2dYS02(clientData, interp, argc, argv,
00774                                                  theTclDomain, theTclBuilder);
00775     return result;
00776   }
00777   
00778    else if (strcmp(argv[1],"inelastic2dYS03") == 0) {
00779           int result = TclModelBuilder_addElement2dYS03(clientData, interp, argc, argv,
00780                                                  theTclDomain, theTclBuilder);
00781     return result;
00782   }
00783 
00784 /*      else if (strcmp(argv[1],"inelastic2dYS04") == 0) {
00785           int result = TclModelBuilder_addElement2dYS04
00786           (clientData, interp, argc, argv,
00787                                                  theTclDomain, theTclBuilder);
00788     return result;
00789   }*/
00790   /*else if (strcmp(argv[1],"inelastic2dYS05") == 0) {
00791           int result = TclModelBuilder_addElement2dYS05
00792           (clientData, interp, argc, argv,
00793                                                  theTclDomain, theTclBuilder);
00794     return result;
00795   }*/
00796   else
00797 
00798         return TCL_ERROR;
00799 
00800 }

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