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

Function OPS_InvokeMaterialObject

SRC/api/elementAPI_Dummy.cpp:84–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82//std::map<int, UniaxialMaterial *>theUniaxialMaterials; // map for UniaxialMaterial objects needed by user added ele functions'
83
84static
85void OPS_InvokeMaterialObject(struct matObject *theMat, modelState *theModel,double *strain, double *tang, double *stress, int *isw, int *result)
86{
87 int matType = theMat->theParam[0];
88
89 if (matType == 1) {
90 // UniaxialMaterial *theMaterial = theUniaxialMaterials[matCount];
91 UniaxialMaterial *theMaterial = (UniaxialMaterial *)theMat->matObjectPtr;
92 if (theMaterial == 0) {
93 *result = -1;
94 return;
95 }
96
97 if (*isw == ISW_COMMIT) {
98 *result = theMaterial->commitState();
99 return;
100 } else if (*isw == ISW_REVERT) {
101 *result = theMaterial->revertToLastCommit();
102 return;
103 } else if (*isw == ISW_REVERT_TO_START) {
104 *result = theMaterial->revertToStart();
105 return;
106 } else if (*isw == ISW_FORM_TANG_AND_RESID) {
107 double matStress = 0.0;
108 double matTangent = 0.0;
109 int res = theMaterial->setTrial(strain[0], matStress, matTangent);
110 stress[0] = matStress;
111 tang[0] = matTangent;
112 *result = res;
113 return;
114 }
115 }
116
117 return;
118}
119
120extern "C"
121int OPS_Error(char *errorMessage, int length)

Callers

nothing calls this directly

Calls 4

commitStateMethod · 0.45
revertToLastCommitMethod · 0.45
revertToStartMethod · 0.45
setTrialMethod · 0.45

Tested by

no test coverage detected