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

Function OPS_BFGS

SRC/analysis/algorithm/equiSolnAlgo/BFGS.cpp:41–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39#include <elementAPI.h>
40
41void* OPS_BFGS()
42{
43 int formTangent = CURRENT_TANGENT;
44 int count = -1;
45
46 while (OPS_GetNumRemainingInputArgs() > 0) {
47 const char* flag = OPS_GetString();
48
49 if (strcmp(flag,"-secant") == 0) {
50 formTangent = CURRENT_SECANT;
51
52 } else if (strcmp(flag,"-initial") == 0) {
53 formTangent = INITIAL_TANGENT;
54
55 } else if (strcmp(flag,"-count") == 0 && OPS_GetNumRemainingInputArgs()>0) {
56 int numdata = 1;
57 if (OPS_GetIntInput(&numdata, &count) < 0) {
58 opserr << "WARNING Broyden failed to read count\n";
59 return 0;
60 }
61 }
62 }
63
64 if (count == -1)
65 return new BFGS(formTangent);
66 else
67 return new BFGS(formTangent, count);
68}
69
70// Constructor
71BFGS::BFGS(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