| 263 | } |
| 264 | |
| 265 | int PFEMElement3DBubble::updateMatrix() |
| 266 | { |
| 267 | int ndf = this->getNumDOF(); |
| 268 | M.resize(ndf, ndf); |
| 269 | M.Zero(); |
| 270 | D.resize(ndf, ndf); |
| 271 | D.Zero(); |
| 272 | F.resize(12); |
| 273 | F.Zero(); |
| 274 | Fp.resize(4); |
| 275 | Fp.Zero(); |
| 276 | |
| 277 | double m = getM(); |
| 278 | double mp = getMp(); |
| 279 | |
| 280 | // mass |
| 281 | for(int a=0; a<(int)thePCs.size(); a++) { |
| 282 | M(numDOFs(2*a), numDOFs(2*a)) = m; // Mxd |
| 283 | M(numDOFs(2*a)+1, numDOFs(2*a)+1) = m; // Myd |
| 284 | M(numDOFs(2*a)+2, numDOFs(2*a)+2) = m; // Mzd |
| 285 | M(numDOFs(2*a+1), numDOFs(2*a+1)) = mp; // Mpd |
| 286 | } |
| 287 | |
| 288 | // damp |
| 289 | Matrix G,L; |
| 290 | getG(G); |
| 291 | getL(L); |
| 292 | |
| 293 | // other matrices |
| 294 | for(int a=0; a<(int)thePCs.size(); ++a) { |
| 295 | for(int b=0; b<(int)thePCs.size(); ++b) { |
| 296 | |
| 297 | // Gt |
| 298 | D(numDOFs(2*a+1), numDOFs(2*b)) = G(3*b,a); // GxT |
| 299 | D(numDOFs(2*a+1), numDOFs(2*b)+1) = G(3*b+1,a); // GyT |
| 300 | D(numDOFs(2*a+1), numDOFs(2*b)+2) = G(3*b+2,a); // GzT |
| 301 | |
| 302 | // G |
| 303 | D(numDOFs(2*a), numDOFs(2*b+1)) = -G(3*a,b); // -Gx |
| 304 | D(numDOFs(2*a)+1, numDOFs(2*b+1)) = -G(3*a+1,b); // -Gy |
| 305 | D(numDOFs(2*a)+2, numDOFs(2*b+1)) = -G(3*a+2,b); // -Gz |
| 306 | |
| 307 | // L |
| 308 | D(numDOFs(2*a+1), numDOFs(2*b+1)) = L(a,b); // bubble |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | // force |
| 313 | getFp(Fp); |
| 314 | getF(F); |
| 315 | |
| 316 | return 0; |
| 317 | } |
| 318 | |
| 319 | int |
| 320 | PFEMElement3DBubble::update() |