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

Method setParameter

SRC/material/section/DoubleMembranePlateFiberSection.cpp:901–939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

899}
900
901int DoubleMembranePlateFiberSection::setParameter(const char** argv, int argc, Parameter& param)
902{
903 // if the user explicitly wants to update a material in this section...
904 if (argc > 1) {
905 // case 1: fiber value (all fibers)
906 // case 2: fiber id value (one specific fiber)
907 if (strcmp(argv[0], "fiber") == 0 || strcmp(argv[0], "Fiber") == 0) {
908 // test case 2 (one specific fiber) ...
909 if (argc > 2) {
910 int pointNum = atoi(argv[1]);
911 if (pointNum > 0 && pointNum <= 2*numFibers) {
912 return theFibers[pointNum - 1]->setParameter(&argv[2], argc - 2, param);
913 }
914 }
915 // ... otherwise case 1 (all fibers), if the argv[1] is not a valid id
916 int mixed_result = -1;
917 for (int i = 0; i < 2*numFibers; ++i) {
918 if (theFibers[i]->setParameter(&argv[1], argc - 1, param) == 0)
919 mixed_result = 0; // if at least one fiber handles the param, make it successful
920 }
921 return mixed_result;
922 }
923 }
924 // if we are here, the first keyword is not "fiber", so we can check for parameters
925 // specific to this section (if any) or forward the request to all fibers.
926 if (argc > 0) {
927 // we don't have parameters for this section, so we directly forward it to all fibers.
928 // placeholder for future implementations: if we will have parameters for this class, check them here
929 // before forwarding to all fibers
930 int mixed_result = -1;
931 for (int i = 0; i < 2*numFibers; ++i) {
932 if (theFibers[i]->setParameter(argv, argc, param) == 0)
933 mixed_result = 0; // if at least one fiber handles the param, make it successful
934 }
935 return mixed_result;
936 }
937 // fallback to base class implementation
938 return SectionForceDeformation::setParameter(argv, argc, param);
939}
940
941int DoubleMembranePlateFiberSection::updateParameter(int parameterID, Information& info)
942{

Callers

nothing calls this directly

Calls 1

setParameterFunction · 0.85

Tested by

no test coverage detected