| 82 | //std::map<int, UniaxialMaterial *>theUniaxialMaterials; // map for UniaxialMaterial objects needed by user added ele functions' |
| 83 | |
| 84 | static |
| 85 | void 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 | |
| 120 | extern "C" |
| 121 | int OPS_Error(char *errorMessage, int length) |
nothing calls this directly
no test coverage detected