| 446 | } |
| 447 | |
| 448 | bool DomainModalProperties::compute(Domain* domain) |
| 449 | { |
| 450 | /* |
| 451 | Notes: |
| 452 | 1 - we assemble the global mass matrix and eigenvectors with our own (plain) numbering |
| 453 | 2 - we make room for rotational DOFs even if some nodes are translational only, because we |
| 454 | also include the rotational effect given by the translational masses gyrating about the |
| 455 | center of mass |
| 456 | 3 - the mass matrix may be consistent. however we need also a diagonalized version of it |
| 457 | to compute the center of mass, the total mass of the structure, and the rotational masses |
| 458 | due to the translational masses gyrating about the center of mass |
| 459 | */ |
| 460 | |
| 461 | // number of eigen-modes |
| 462 | int num_eigen = domain->getEigenvalues().Size(); |
| 463 | if (num_eigen < 1) |
| 464 | DMP_ERR("No Eigenvalue provided.\n"); |
| 465 | // eigenvalues |
| 466 | m_eigenvalues = domain->getEigenvalues(); |
| 467 | // number of dimensions |
| 468 | int ndm = domainSize(domain); |
| 469 | // max number of DOFs per node, translational and rotational only |
| 470 | int ndf; |
| 471 | switch (ndm) |
| 472 | { |
| 473 | case 1: ndf = 1; break; |
| 474 | case 2: ndf = 3; break; |
| 475 | case 3: ndf = 6; break; |
| 476 | default: ndf = 0; break; |
| 477 | } |
| 478 | // number of nodes |
| 479 | int num_nodes = domain->getNumNodes(); |
| 480 | // number of equations (not the real one, include rotational dofs even if not present) |
| 481 | int num_eq = num_nodes * ndf; |
| 482 | |
| 483 | // initialize members |
| 484 | m_center_of_mass.resize(ndm); |
| 485 | m_total_mass.resize(ndf); |
| 486 | m_total_free_mass.resize(ndf); |
| 487 | m_generalized_mass_matrix.resize(num_eigen); |
| 488 | m_modal_participation_factors.resize(num_eigen, ndf); |
| 489 | m_modal_participation_masses.resize(num_eigen, ndf); |
| 490 | m_modal_participation_masses_cumulative.resize(num_eigen, ndf); |
| 491 | m_modal_participation_mass_ratios.resize(num_eigen, ndf); |
| 492 | m_modal_participation_mass_ratios_cumulative.resize(num_eigen, ndf); |
| 493 | |
| 494 | // map all nodes |
| 495 | node_map_t nodemap(domain, ndm, ndf); |
| 496 | |
| 497 | // map all elements |
| 498 | ele_map_t elemap(domain, nodemap); |
| 499 | |
| 500 | // the sparse mass matrix |
| 501 | sparse_matrix_t M; |
| 502 | // the equivalent diagonalized masses for each node (total) |
| 503 | Matrix ML(num_nodes, ndf); |
| 504 | // the equivalent diagonalized masses for each node (only at free DOFs) |
| 505 | Matrix MLfree(num_nodes, ndf); |
no test coverage detected