| 64 | int Node::numMatrices = 0; |
| 65 | |
| 66 | int 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 | } |
no test coverage detected