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

Function OPS_Broyden

SRC/analysis/algorithm/equiSolnAlgo/Broyden.cpp:47–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45#include <elementAPI.h>
46
47void* 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
77Broyden::Broyden(int theTangentToUse, int n )

Callers 1

OPS_AlgorithmFunction · 0.85

Calls 3

OPS_GetStringFunction · 0.50
OPS_GetIntInputFunction · 0.50

Tested by

no test coverage detected