| 164 | */ |
| 165 | |
| 166 | int BivariateDecomposition::fitCurve() { // Lagrange interpolation . refer "Decomposition methods for structural reliability analysis" H. Xu, etc. 2005 |
| 167 | |
| 168 | int ii; |
| 169 | for(ii=0; ii<numAxes; ii++){ // for a special axis |
| 170 | thePrincipalAxes[ii]->computeShapeFuncCoeff(); |
| 171 | } |
| 172 | |
| 173 | //* --- deal with axes -------- |
| 174 | |
| 175 | ofstream tt("point_shape_coeff.out"); |
| 176 | |
| 177 | |
| 178 | |
| 179 | |
| 180 | for( ii =0; ii<numAxes; ii++){ |
| 181 | // tt << "ii="<<ii<<endln; |
| 182 | if (axisCoeff[ii] !=0) delete axisCoeff[ii]; |
| 183 | |
| 184 | int m = thePrincipalAxes[ii]->getExperimentalPointRule()->getNumberOfPoints(); |
| 185 | axisCoeff[ii] = new Vector(m); |
| 186 | axisCoeff[ii]->Zero(); |
| 187 | |
| 188 | |
| 189 | if (isTimeVariant){ //--- |
| 190 | |
| 191 | if (axisCoeff_2[ii] !=0) delete axisCoeff_2[ii]; |
| 192 | axisCoeff_2[ii] = new Vector(m); |
| 193 | axisCoeff_2[ii]->Zero(); |
| 194 | |
| 195 | |
| 196 | } //--- |
| 197 | |
| 198 | for ( int point=0; point < m; point++){ |
| 199 | Vector * theCoeff = thePrincipalAxes[ii]->getShapeFuncCoeff(point); |
| 200 | axisCoeff[ii]->addVector(1.0, *theCoeff, thePrincipalAxes[ii]->getValueOnAxis(point)); |
| 201 | |
| 202 | if (isTimeVariant){ |
| 203 | axisCoeff_2[ii]->addVector(1.0, *theCoeff, thePrincipalAxes[ii]->getValueG2OnAxis(point)); |
| 204 | } |
| 205 | tt<<"point num="<<point<<", shape_coeff:"<<endln; |
| 206 | for(int i =0; i<theCoeff->Size(); i++) |
| 207 | tt<<(*theCoeff)(i)<<endln; |
| 208 | |
| 209 | } // for each point |
| 210 | |
| 211 | } // for ii |
| 212 | tt.close(); |
| 213 | |
| 214 | //* -- debug |
| 215 | ofstream file_coeff("Bivariate_coefficient_recorder.out"); |
| 216 | for( ii=0; ii<numAxes; ii++){ |
| 217 | opserr<<"\n\axisCoeff["<<ii<<"]"<<endln; |
| 218 | file_coeff<<"axisCoeff["<<ii<<"]"<<endln; |
| 219 | |
| 220 | for (int m=0; m<(*axisCoeff[ii]).Size(); m++){ |
| 221 | opserr<<(*axisCoeff[ii])(m)<<endln; |
| 222 | file_coeff<<(*axisCoeff[ii])(m)<<endln; |
| 223 | } |
nothing calls this directly
no test coverage detected