| 2939 | } |
| 2940 | |
| 2941 | int OPS_cbdiDisplacement() |
| 2942 | { |
| 2943 | // make sure at least one other argument to contain type of system |
| 2944 | if (OPS_GetNumRemainingInputArgs() < 2) { |
| 2945 | opserr << "WARNING want - cbdiDisplacement eleTag? x/L? \n"; |
| 2946 | return -1; |
| 2947 | } |
| 2948 | |
| 2949 | //opserr << "sectionWeight: "; |
| 2950 | //for (int i = 0; i < argc; i++) |
| 2951 | // opserr << argv[i] << ' ' ; |
| 2952 | //opserr << endln; |
| 2953 | |
| 2954 | int numdata = 1; |
| 2955 | int data[1]; |
| 2956 | double ddata[1]; |
| 2957 | |
| 2958 | if (OPS_GetIntInput(&numdata, data) < 0) { |
| 2959 | opserr << "WARNING cbdiDisplacement eleTag? x/L? - could not read int input? \n"; |
| 2960 | return -1; |
| 2961 | } |
| 2962 | if (OPS_GetDoubleInput(&numdata, ddata) < 0) { |
| 2963 | opserr << "WARNING cbdiDisplacement eleTag? x/L? - could not read double input? \n"; |
| 2964 | return -1; |
| 2965 | } |
| 2966 | |
| 2967 | int tag = data[0]; |
| 2968 | double xOverL = ddata[0]; |
| 2969 | |
| 2970 | Domain* theDomain = OPS_GetDomain(); |
| 2971 | if (theDomain == 0) return -1; |
| 2972 | |
| 2973 | Element *theElement = theDomain->getElement(tag); |
| 2974 | if (theElement == 0) { |
| 2975 | opserr << "WARNING cbdiDisplacment element with tag " << tag << " not found in domain \n"; |
| 2976 | return -1; |
| 2977 | } |
| 2978 | |
| 2979 | int argcc = 1; |
| 2980 | char a[80] = "cbdiDisplacements"; |
| 2981 | const char *argvv[1]; |
| 2982 | argvv[0] = a; |
| 2983 | |
| 2984 | DummyStream dummy; |
| 2985 | |
| 2986 | Response *theResponse = theElement->setResponse(argvv, argcc, dummy); |
| 2987 | if (theResponse == 0) { |
| 2988 | return 0; |
| 2989 | } |
| 2990 | Information &info = theResponse->getInformation(); |
| 2991 | info.theDouble = xOverL; |
| 2992 | |
| 2993 | theResponse->getResponse(); |
| 2994 | |
| 2995 | const Matrix &theMatrix = *(info.theMatrix); |
| 2996 | if (xOverL < 0.0 || xOverL > 1.0) { |
| 2997 | opserr << "WARNING invalid xOverL\n"; |
| 2998 | delete theResponse; |
no test coverage detected