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

Function OPS_Node

SRC/domain/node/Node.cpp:66–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64int Node::numMatrices = 0;
65
66int OPS_Node()
67{
68 Domain* theDomain = OPS_GetDomain();
69 int ndm = OPS_GetNDM();
70 int ndf = OPS_GetNDF();
71
72 if(theDomain == 0) {
73 opserr<<"WARNING: domain is not defined\n";
74 return -1;
75 }
76 if(ndm<=0 || ndf<=0) {
77 opserr<<"WARNING: system ndm and ndf are zero\n";
78 return -1;
79 }
80
81 if(OPS_GetNumRemainingInputArgs() < 1+ndm) {
82 opserr<<"insufficient number of arguments\n";
83 return -1;
84 }
85
86 // get tag
87 int tag = 0;
88 int numData = 1;
89 if(OPS_GetIntInput(&numData, &tag) < 0) {
90 opserr<<"WARNING tag is not integer\n";
91 return -1;
92 }
93
94 // get crds
95 Vector crds(ndm);
96 if(OPS_GetDoubleInput(&ndm, &crds(0)) < 0) {
97 opserr<<"WARNING noda coord are not double\n";
98 return -1;
99 }
100
101 // check options
102 Vector disp,vel,mass,dispLoc;
103 Matrix ndmass;
104 double T = 0.0;
105 while(OPS_GetNumRemainingInputArgs() > 0) {
106 const char* type = OPS_GetString();
107
108 if(strcmp(type,"-disp")==0 || strcmp(type,"-Disp")==0) {
109 if(OPS_GetNumRemainingInputArgs() < ndf) {
110 opserr<<"incorrect number of nodal disp terms\n";
111 return -1;
112 }
113 disp.resize(ndf);
114 if(OPS_GetDoubleInput(&ndf, &disp(0)) < 0) {
115 opserr << "WARNING: failed to read disp\n";
116 return -1;
117 }
118
119 } else if(strcmp(type,"-vel")==0 || strcmp(type,"-Vel")==0) {
120 if(OPS_GetNumRemainingInputArgs() < ndf) {
121 opserr<<"incorrect number of nodal vel terms\n";
122 return -1;
123 }

Callers 3

Tcl_ops_nodeFunction · 0.50
ops_addNodeFunction · 0.50
Py_ops_nodeFunction · 0.50

Calls 15

setTempMethod · 0.80
OPS_GetDomainFunction · 0.50
OPS_GetNDMFunction · 0.50
OPS_GetNDFFunction · 0.50
OPS_GetIntInputFunction · 0.50
OPS_GetDoubleInputFunction · 0.50
OPS_GetStringFunction · 0.50
resizeMethod · 0.45
ZeroMethod · 0.45
SizeMethod · 0.45
setTrialDispMethod · 0.45

Tested by

no test coverage detected