| 45 | #include <elementAPI.h> |
| 46 | |
| 47 | void* OPS_Broyden() |
| 48 | { |
| 49 | int formTangent = CURRENT_TANGENT; |
| 50 | int count = -1; |
| 51 | |
| 52 | while (OPS_GetNumRemainingInputArgs() > 0) { |
| 53 | const char* flag = OPS_GetString(); |
| 54 | |
| 55 | if (strcmp(flag,"-secant") == 0) { |
| 56 | formTangent = CURRENT_SECANT; |
| 57 | |
| 58 | } else if (strcmp(flag,"-initial") == 0) { |
| 59 | formTangent = INITIAL_TANGENT; |
| 60 | |
| 61 | } else if (strcmp(flag,"-count") == 0 && OPS_GetNumRemainingInputArgs()>0) { |
| 62 | int numdata = 1; |
| 63 | if (OPS_GetIntInput(&numdata, &count) < 0) { |
| 64 | opserr << "WARNING Broyden failed to read count\n"; |
| 65 | return 0; |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | if (count == -1) |
| 71 | return new Broyden(formTangent); |
| 72 | else |
| 73 | return new Broyden(formTangent, count); |
| 74 | } |
| 75 | |
| 76 | // Constructor |
| 77 | Broyden::Broyden(int theTangentToUse, int n ) |
no test coverage detected