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

Function TclCommand_addElement

SRC/runtime/commands/modeling/element.cpp:114–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112
113
114int
115TclCommand_addElement(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char ** const argv)
116{
117 G3_Runtime *rt = G3_getRuntime(interp);
118 TclBasicBuilder *theTclBuilder = (TclBasicBuilder*)G3_getSafeBuilder(rt);
119
120 assert(clientData != nullptr);
121 BasicModelBuilder *builder = static_cast<BasicModelBuilder*>(clientData);
122 Domain *theTclDomain = builder->getDomain();
123
124 OPS_ResetInputNoBuilder(clientData, interp, 2, argc, argv, theTclDomain);
125
126 if (argc < 2) {
127 opserr << OpenSees::PromptValueError
128 << "Missing element type"
129 << OpenSees::SignalMessageEnd;
130 return TCL_ERROR;
131 }
132
133 void* theEle = nullptr;
134 Element *theElement = nullptr;
135 int ndm = builder->getNDM();
136
137 auto cmd = element_dispatch.find(std::string(argv[1]));
138 if (cmd != element_dispatch.end()) {
139 theEle = (*cmd->second)(rt, argc, &argv[0]);
140 }
141
142 // Try Tcl element library
143 auto tcl_cmd = element_dispatch_tcl.find(std::string(argv[1]));
144 if (tcl_cmd != element_dispatch_tcl.end()) {
145 return (*tcl_cmd->second)(clientData, interp, argc, &argv[0]);
146 }
147
148 else if ((strcasecmp(argv[1], "elasticBeamColumn") == 0) ||
149 (strcasecmp(argv[1], "elasticBeam") == 0) ||
150 (strcasecmp(argv[1], "PrismFrame") == 0)) {
151
152 return TclBasicBuilder_addElasticBeam(clientData, interp, argc, argv);
153 }
154
155 else if (strcasecmp(argv[1], "PML") == 0) {
156 if (ndm == 2)
157 theEle = OPS_PML2D(rt, argc, argv);
158 else
159 theEle = OPS_PML3D(rt, argc, argv);
160 }
161
162#if defined(_HAVE_LHNMYS) || defined(OPSDEF_ELEMENT_LHNMYS)
163 else if (strcmp(argv[1], "beamColumn2DwLHNMYS") == 0) {
164 theEle = OPS_BeamColumn2DwLHNMYS(rt, argc, argv);
165
166 } else if (strcmp(argv[1], "beamColumn2dDamage") == 0) {
167 theEle = OPS_Beam2dDamage(rt, argc, argv);
168
169 } else if (strcmp(argv[1], "beamColumn2DwLHNMYS_Damage") == 0) {
170 theEle = OPS_BeamColumn2DwLHNMYS_Damage(rt, argc, argv);
171

Callers

nothing calls this directly

Calls 15

G3_getRuntimeFunction · 0.85
G3_getSafeBuilderFunction · 0.85
OPS_PML2DFunction · 0.85
OPS_PML3DFunction · 0.85
OPS_PY_Macro2DFunction · 0.85
OPS_TFP_BearingFunction · 0.85
OPS_MultiFP2dFunction · 0.85
OPS_CoupledZeroLengthFunction · 0.85

Tested by

no test coverage detected