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

Function OPS_Node

DEVELOPER/core/Node.cpp:65–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 15

OPS_GetDomainFunction · 0.70
OPS_GetNDMFunction · 0.70
OPS_GetNDFFunction · 0.70
OPS_GetIntInputFunction · 0.70
OPS_GetDoubleInputFunction · 0.70
OPS_GetStringFunction · 0.70
resizeMethod · 0.45
ZeroMethod · 0.45
SizeMethod · 0.45
setTrialDispMethod · 0.45
setTrialVelMethod · 0.45

Tested by

no test coverage detected