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

Function OPS_CrdTransf

SRC/interpreter/OpenSeesCrdTransfCommands.cpp:72–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72int OPS_CrdTransf()
73{
74 if (OPS_GetNumRemainingInputArgs() < 2) {
75 opserr<<"WARNING too few arguments: geomTransf type? tag? ...\n";
76 return -1;
77 }
78
79 const char* type = OPS_GetString();
80
81 // create it
82 CrdTransf* transf = 0;
83 if (strcmp(type, "Linear") == 0) {
84 transf = (CrdTransf*)OPS_LinearCrdTransf();
85 } else if(strcmp(type, "PDelta") == 0) {
86 transf = (CrdTransf*)OPS_PDeltaCrdTransf();
87 } else if(strcmp(type, "Corotational") == 0) {
88 transf = (CrdTransf*)OPS_CorotCrdTransf();
89 } else {
90 opserr << "WARNING geomTransf type "<< type <<" is unknown\n";
91 return -1;
92 }
93
94 // check
95 if (transf == 0) {
96 opserr << "WARNING failed to create geomTransf object\n";
97 return -1;
98 }
99
100 // add it
101 if (OPS_addCrdTransf(transf) == false) {
102 opserr << "WARNING failed to add CrdTransf\n";
103 delete transf;
104 return -1;
105 }
106
107 return 0;
108}

Callers 2

Tcl_ops_geomTransfFunction · 0.85
Py_ops_geomTransfFunction · 0.85

Calls 6

OPS_LinearCrdTransfFunction · 0.85
OPS_PDeltaCrdTransfFunction · 0.85
OPS_CorotCrdTransfFunction · 0.85
OPS_addCrdTransfFunction · 0.85
OPS_GetStringFunction · 0.70

Tested by

no test coverage detected