| 117 | //std::map<int, UniaxialMaterial *>theUniaxialMaterials; // map for UniaxialMaterial objects needed by user added ele functions' |
| 118 | |
| 119 | static |
| 120 | void OPS_InvokeMaterialObject(struct matObject* theMat, modelState* theModel, double* strain, double* tang, double* stress, int* isw, int* result) |
| 121 | { |
| 122 | int matType = (int)theMat->theParam[0]; |
| 123 | |
| 124 | if (matType == 1) { |
| 125 | // UniaxialMaterial *theMaterial = theUniaxialMaterials[matCount]; |
| 126 | UniaxialMaterial* theMaterial = (UniaxialMaterial*)theMat->matObjectPtr; |
| 127 | if (theMaterial == 0) { |
| 128 | *result = -1; |
| 129 | return; |
| 130 | } |
| 131 | |
| 132 | if (*isw == ISW_COMMIT) { |
| 133 | *result = theMaterial->commitState(); |
| 134 | return; |
| 135 | } |
| 136 | else if (*isw == ISW_REVERT) { |
| 137 | *result = theMaterial->revertToLastCommit(); |
| 138 | return; |
| 139 | } |
| 140 | else if (*isw == ISW_REVERT_TO_START) { |
| 141 | *result = theMaterial->revertToStart(); |
| 142 | return; |
| 143 | } |
| 144 | else if (*isw == ISW_FORM_TANG_AND_RESID) { |
| 145 | double matStress = 0.0; |
| 146 | double matTangent = 0.0; |
| 147 | int res = theMaterial->setTrial(strain[0], matStress, matTangent); |
| 148 | stress[0] = matStress; |
| 149 | tang[0] = matTangent; |
| 150 | *result = res; |
| 151 | return; |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | return; |
| 156 | } |
| 157 | |
| 158 | extern "C" |
| 159 | int OPS_Error(char* errorMessage, int length) |
nothing calls this directly
no test coverage detected