| 111 | */ |
| 112 | |
| 113 | int UnivariateDecomposition::fitCurve() { // Lagrange interpolation . refer "Decomposition methods for structural reliability analysis" H. Xu, etc. 2005 |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | ofstream tt("point_shape_coeff_uni.out"); |
| 119 | |
| 120 | |
| 121 | |
| 122 | int ii; |
| 123 | for(ii =0; ii<numAxes; ii++){ |
| 124 | tt << "ii="<<ii<<endln; |
| 125 | if (coefficients[ii] !=0) delete coefficients[ii]; |
| 126 | |
| 127 | int m = thePrincipalAxes[ii]->getExperimentalPointRule()->getNumberOfPoints(); |
| 128 | coefficients[ii] = new Vector(m); |
| 129 | coefficients[ii]->Zero(); |
| 130 | |
| 131 | |
| 132 | if (isTimeVariant){ //--- |
| 133 | |
| 134 | if (coefficients_2[ii] !=0) delete coefficients_2[ii]; |
| 135 | coefficients_2[ii] = new Vector(m); |
| 136 | coefficients_2[ii]->Zero(); |
| 137 | |
| 138 | |
| 139 | } //--- |
| 140 | |
| 141 | for ( int point=0; point < m; point++){ |
| 142 | Vector * theCoeff = thePrincipalAxes[ii]->getShapeFuncCoeff(point); |
| 143 | coefficients[ii]->addVector(1.0, *theCoeff, thePrincipalAxes[ii]->getValueOnAxis(point)); |
| 144 | |
| 145 | if (isTimeVariant){ |
| 146 | coefficients_2[ii]->addVector(1.0, *theCoeff, thePrincipalAxes[ii]->getValueG2OnAxis(point)); |
| 147 | } |
| 148 | tt<<"point num="<<point<<", shape_coeff:"<<endln; |
| 149 | for(int i =0; i<theCoeff->Size(); i++) |
| 150 | tt<<(*theCoeff)(i)<<endln; |
| 151 | |
| 152 | } // for each point |
| 153 | |
| 154 | } // for ii |
| 155 | tt.close(); |
| 156 | |
| 157 | |
| 158 | |
| 159 | |
| 160 | //* -- debug |
| 161 | ofstream file_coeff("univariate_coefficient_recorder.out"); |
| 162 | for( ii=0; ii<numAxes; ii++){ |
| 163 | opserr<<"\n\ncoefficients["<<ii<<"]"<<endln; |
| 164 | file_coeff<<"coefficients["<<ii<<"]"<<endln; |
| 165 | |
| 166 | for (int m=0; m<(*coefficients[ii]).Size(); m++){ |
| 167 | opserr<<(*coefficients[ii])(m)<<endln; |
| 168 | file_coeff<<(*coefficients[ii])(m)<<endln; |
| 169 | } |
| 170 | } |
nothing calls this directly
no test coverage detected