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

Function OPS_GetMaterial

SRC/api/elementAPI_Dummy.cpp:174–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172
173extern "C"
174matObj *OPS_GetMaterial(int *matTag, int *matType)
175{
176
177 if (*matType == OPS_UNIAXIAL_MATERIAL_TYPE) {
178 UniaxialMaterial *theUniaxialMaterial = OPS_getUniaxialMaterial(*matTag);
179
180 if (theUniaxialMaterial != 0) {
181
182 UniaxialMaterial *theCopy = theUniaxialMaterial->getCopy();
183 // uniaxialMaterialObjectCount++;
184 // theUniaxialMaterials[uniaxialMaterialObjectCount] = theCopy;
185
186 matObject *theMatObject = new matObject;
187 theMatObject->tag = *matTag;
188 theMatObject->nParam = 1;
189 theMatObject->nState = 0;
190
191 theMatObject->theParam = new double[1];
192 // theMatObject->theParam[0] = uniaxialMaterialObjectCount;
193 theMatObject->theParam[0] = 1; // code for uniaxial material
194
195 theMatObject->tState = 0;
196 theMatObject->cState = 0;
197 theMatObject->matFunctPtr = OPS_InvokeMaterialObject;
198
199 theMatObject->matObjectPtr = theCopy;
200
201 return theMatObject;
202 }
203
204 fprintf(stderr,"getMaterial - no uniaxial material exists with tag %d\n", *matTag);
205 return 0;
206
207 } else if (*matType == OPS_SECTION_TYPE) {
208 fprintf(stderr,"getMaterial - not yet implemented for Section\n");
209 return 0;
210 } else {
211
212 // NDMaterial *theNDMaterial = theModelBuilder->getNDMaterial(*matTag);
213
214 // if (theNDMaterial != 0)
215 // theNDMaterial = theNDMaterial->getCopy(matType);
216 // else {
217 // fprintf(stderr,"getMaterial - no nd material exists with tag %d\n", *matTag);
218 // return 0;
219 // }
220
221 // if (theNDMaterial == 0) {
222 // fprintf(stderr,"getMaterial - material with tag %d cannot deal with %d\n", *matTag, matType);
223 // return 0;
224 // }
225
226 fprintf(stderr,"getMaterial - not yet implemented for nDMaterial\n");
227 return 0;
228 }
229
230 fprintf(stderr,"getMaterial - unknown material type\n");
231 return 0;

Callers 1

OPS_AllocateElementFunction · 0.70

Calls 2

OPS_getUniaxialMaterialFunction · 0.50
getCopyMethod · 0.45

Tested by

no test coverage detected