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

Method setParameter

SRC/material/section/LayeredShellFiberSection.cpp:372–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372int LayeredShellFiberSection::setParameter(const char** argv, int argc, Parameter& param)
373{
374 // if the user explicitly wants to update a material in this section...
375 if (argc > 1) {
376 // case 1: fiber value (all fibers)
377 // case 2: fiber id value (one specific fiber)
378 if (strcmp(argv[0], "fiber") == 0 || strcmp(argv[0], "Fiber") == 0) {
379 // test case 2 (one specific fiber) ...
380 if (argc > 2) {
381 int pointNum = atoi(argv[1]);
382 if (pointNum > 0 && pointNum <= nLayers) {
383 return theFibers[pointNum - 1]->setParameter(&argv[2], argc - 2, param);
384 }
385 }
386 // ... otherwise case 1 (all fibers), if the argv[1] is not a valid id
387 int mixed_result = -1;
388 for (int i = 0; i < nLayers; ++i) {
389 if (theFibers[i]->setParameter(&argv[1], argc - 1, param) == 0)
390 mixed_result = 0; // if at least one fiber handles the param, make it successful
391 }
392 return mixed_result;
393 }
394 }
395 // if we are here, the first keyword is not "fiber", so we can check for parameters
396 // specific to this section (if any) or forward the request to all fibers.
397 if (argc > 0) {
398 // we don't have parameters for this section, so we directly forward it to all fibers.
399 // placeholder for future implementations: if we will have parameters for this class, check them here
400 // before forwarding to all fibers
401 int mixed_result = -1;
402 for (int i = 0; i < nLayers; ++i) {
403 if (theFibers[i]->setParameter(argv, argc, param) == 0)
404 mixed_result = 0; // if at least one fiber handles the param, make it successful
405 }
406 return mixed_result;
407 }
408 // fallback to base class implementation
409 return SectionForceDeformation::setParameter(argv, argc, param);
410}
411
412int LayeredShellFiberSection::updateParameter(int parameterID, Information& info)
413{

Callers

nothing calls this directly

Calls 1

setParameterFunction · 0.85

Tested by

no test coverage detected