MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / setParameter

Function setParameter

SRC/tcl/commands.cpp:10344–10435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10342
10343
10344int
10345setParameter(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char **argv)
10346{
10347 int argLoc = 1;
10348 double newValue = 0.0;
10349 ID eleIDs(0, 32);
10350 int numEle = 0;
10351 int flag = 0;
10352
10353 if (strstr(argv[argLoc],"-val") != 0) {
10354 if (Tcl_GetDouble(interp, argv[argLoc+1], &newValue) != TCL_OK) {
10355 opserr << "WARNING setParameter: invalid parameter value\n";
10356 return TCL_ERROR;
10357 }
10358 } else {
10359 opserr << "WARNING setParameter: -val not found " << endln;
10360 return TCL_ERROR;
10361 }
10362
10363 argLoc += 2;
10364
10365 if (strstr(argv[argLoc],"-ele") != 0) {
10366
10367 if ((strcmp(argv[argLoc],"-ele") == 0) ||
10368 (strcmp(argv[argLoc],"-eles") == 0) ||
10369 (strcmp(argv[argLoc],"-element") == 0)) {
10370
10371 //
10372 // read in a list of ele until end of command or other flag
10373 //
10374
10375 argLoc++;
10376 int eleTag;
10377
10378 while (argLoc < argc && Tcl_GetInt(interp, argv[argLoc], &eleTag) == TCL_OK) {
10379 eleIDs[numEle] = eleTag;
10380 numEle++;
10381 argLoc++;
10382 }
10383
10384 if (numEle > 0)
10385 flag = 1;
10386
10387 } else if (strcmp(argv[argLoc],"-eleRange") == 0) {
10388
10389 flag = 2;
10390
10391 // ensure no segmentation fault if user messes up
10392 if (argc < argLoc+3) {
10393 opserr << "WARNING recorder Element .. -eleRange start? end? .. - no ele tags specified\n";
10394 return TCL_ERROR;
10395 }
10396
10397 //
10398 // read in start and end tags of two elements & add set [start,end]
10399 //
10400
10401 int start, end;

Callers 5

setParameterMethod · 0.85
setParameterMethod · 0.85
setParameterMethod · 0.85
setParameterMethod · 0.85
setParameterMethod · 0.85

Calls 4

getParametersMethod · 0.80
getTagMethod · 0.45
addParameterMethod · 0.45
removeParameterMethod · 0.45

Tested by

no test coverage detected