| 889 | } |
| 890 | |
| 891 | PyObject *ops_addNodalMass(PyObject *self, PyObject *args) |
| 892 | { |
| 893 | // check model builder |
| 894 | if(pBuilder.isSet() == false) { |
| 895 | PyErr_SetString(PyExc_RuntimeError,"ERROR builder has not been set"); |
| 896 | return NULL; |
| 897 | } |
| 898 | |
| 899 | OPS_ResetCommandLine(PyTuple_Size(args), 0, args); |
| 900 | |
| 901 | // check input |
| 902 | int ndf = OPS_GetNDF(); |
| 903 | if(OPS_GetNumRemainingInputArgs() < ndf+1) { |
| 904 | PyErr_SetString(PyExc_RuntimeError,"insufficient arguments"); |
| 905 | return NULL; |
| 906 | } |
| 907 | |
| 908 | // get node tag |
| 909 | int nodeTag; |
| 910 | int numData = 1; |
| 911 | if(OPS_GetIntInput(&numData,&nodeTag) < 0) return NULL; |
| 912 | |
| 913 | // mass terms |
| 914 | Matrix mass(ndf,ndf); |
| 915 | Vector massvec(ndf); |
| 916 | if(OPS_GetDoubleInput(&ndf,&massvec[0]) < 0) return NULL; |
| 917 | for(int i=0; i<ndf; i++) { |
| 918 | mass(i,i) = massvec[i]; |
| 919 | } |
| 920 | |
| 921 | // set mass |
| 922 | Domain *theDomain = OPS_GetDomain(); |
| 923 | if(theDomain->setMass(mass,nodeTag) < 0) { |
| 924 | PyErr_SetString(PyExc_RuntimeError,"ERROR failed to set mass"); |
| 925 | return NULL; |
| 926 | } |
| 927 | |
| 928 | return Py_BuildValue("i", nodeTag); |
| 929 | } |
| 930 | |
| 931 | PyObject *ops_addGroundMotion(PyObject *self, PyObject *args) |
| 932 | { |
nothing calls this directly
no test coverage detected