Beispiel #1
0
def test_simplestru_fem_cache(bm_ipe300):

    model_name = "ParamAssembly"

    start = time.time()
    pfem = Part("ParamModel") / bm_ipe300
    a = Assembly(model_name, clear_cache=True,
                 enable_experimental_cache=True) / pfem

    pfem.fem = pfem.to_fem_obj(0.1)
    time1 = time.time() - start

    a.update_cache()
    start = time.time()
    b = Assembly(model_name, enable_experimental_cache=True)
    time2 = time.time() - start
    cache_validation(a, b)

    print(
        f"Model generation time reduced from {time1:.2f}s to {time2:.2f}s -> {time1 / time2:.2f} x Improvement"
    )
Beispiel #2
0
    def test_simplestru_fem_cache(self):

        model_name = "ParamAssembly"

        start = time.time()
        a = Assembly(model_name,
                     clear_cache=True,
                     enable_experimental_cache=True) / SimpleStru("ParamModel")

        pfem = a.get_by_name("ParamModel")
        pfem.gmsh.mesh()
        time1 = time.time() - start
        print(time1)
        a.update_cache()
        start = time.time()
        b = Assembly(model_name, enable_experimental_cache=True)
        time2 = time.time() - start
        print(time2)
        cache_validation(a, b)

        print(
            f"Model generation time reduced from {time1:.2f}s to {time2:.2f}s -> {time1 / time2:.2f} x Improvement"
        )