| 63 | int Node::numMatrices = 0; |
| 64 | |
| 65 | int 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); |
nothing calls this directly
no test coverage detected