示例#1
0
def test_rdeigen2():
    # hand-crafted example to trip an old error:
    data = """
1    SYSTEM MODES                                                              JUNE  10, 2015  NX NASTRAN  5/ 1/14   PAGE    72
                                                                                                        SUPERELEMENT 20
0

                                              R E A L   E I G E N V A L U E S
                                         (BEFORE AUGMENTATION OF RESIDUAL VECTORS)
   MODE    EXTRACTION      EIGENVALUE            RADIANS             CYCLES            GENERALIZED         GENERALIZED
    NO.       ORDER                                                                       MASS              STIFFNESS
        1         1       -3.043520E-08        1.744569E-04        2.776567E-05        1.000000E+00       -3.043520E-08
        2         2       -1.214641E-08        1.102107E-04        1.754059E-05        1.000000E+00       -1.214641E-08
        3         3        5.526609E-09        7.434117E-05        1.183176E-05        1.000000E+00        5.526609E-09
        4         4        1.151707E-08        1.073176E-04        1.708013E-05        1.000000E+00        1.151707E-08
        5         5        2.087500E-08        1.444818E-04        2.299500E-05        1.000000E+00        2.087500E-08
        6         6        8.327270E-08        2.885701E-04        4.592735E-05        1.000000E+00        8.327270E-08
1    SYSTEM MODES                                                              JUNE  10, 2015  NX NASTRAN  5/ 1/14   PAGE    73
                                                                                                        SUPERELEMENT 20
0
1    SYSTEM MODES                                                              JUNE  10, 2015  NX NASTRAN  5/ 1/14   PAGE    74
                                                                                                        SUPERELEMENT 0
0

                                              R E A L   E I G E N V A L U E S
                                         (AFTER AUGMENTATION OF RESIDUAL VECTORS)
   MODE    EXTRACTION      EIGENVALUE            RADIANS             CYCLES            GENERALIZED         GENERALIZED
    NO.       ORDER                                                                       MASS              STIFFNESS
        1         1        5.440398E+04        2.332466E+02        3.712235E+01        1.000000E+00        5.440398E+04
        2         2        5.579406E+04        2.362077E+02        3.759362E+01        1.000000E+00        5.579406E+04
        3         3        4.037157E+05        6.353862E+02        1.011249E+02        1.000000E+00        4.037157E+05
        4         4        3.110918E+06        1.763780E+03        2.807142E+02        1.000000E+00        3.110918E+06
        5         5        4.394972E+06        2.096419E+03        3.336554E+02        1.000000E+00        4.394972E+06
        6         6        5.312899E+06        2.304973E+03        3.668478E+02        1.000000E+00        5.312899E+06
        7         7        5.829790E+06        2.414496E+03        3.842789E+02        1.000000E+00        5.829790E+06
        8         8        6.409046E+06        2.531609E+03        4.029181E+02        1.000000E+00        6.409046E+06
"""
    with StringIO(data) as f:
        e = nastran.rdeigen(f)

    cyc20 = [
        2.776567e-05,
        1.754059e-05,
        1.183176e-05,
        1.708013e-05,
        2.299500e-05,
        4.592735e-05,
    ]
    cyc0 = [
        3.712235e01,
        3.759362e01,
        1.011249e02,
        2.807142e02,
        3.336554e02,
        3.668478e02,
        3.842789e02,
        4.029181e02,
    ]
    assert np.allclose(e[20]["cycles"].values, cyc20)
    assert np.allclose(e[0]["cycles"].values, cyc0)
示例#2
0
def test_rdeigen():
    e1 = nastran.rdeigen("tests/nas2cam_csuper/assemble.out")
    e2 = nastran.rdeigen("tests/nas2cam_csuper/assemble.out", use_pandas=False)

    sbe = np.array(
        [
            2.776567e-05,
            1.754059e-05,
            1.183176e-05,
            1.708013e-05,
            2.299500e-05,
            4.592735e-05,
            1.699652e00,
            1.768612e00,
            1.857731e00,
            3.439703e00,
            7.024192e00,
            7.025385e00,
            1.072738e01,
            1.098313e01,
            1.389833e01,
            1.448323e01,
            1.466003e01,
            1.526510e01,
            2.519912e01,
            2.530912e01,
            2.925036e01,
            4.243738e01,
            4.311826e01,
            4.689425e01,
            4.780881e01,
            6.915960e01,
            8.182875e01,
            9.652563e01,
            9.655103e01,
            9.999950e01,
            1.746837e02,
            1.889342e02,
            1.996603e02,
            2.436533e02,
            2.839537e02,
            3.144806e02,
            4.254619e02,
            4.504501e02,
            5.460081e02,
            6.784015e02,
            7.837016e02,
            8.376910e02,
            8.747553e02,
            8.875936e02,
            9.451668e02,
            9.907786e02,
            1.020666e03,
            1.065056e03,
            1.360919e03,
            1.407037e03,
            1.675989e03,
            1.837844e03,
            1.970020e03,
            5.281664e03,
        ]
    )
    assert np.allclose(sbe, e1[0].cycles)
    assert np.allclose(e2[0], e1[0].values)