bFull = basis.T * MFull * f
        uFulltrue, _ = lod_periodic.solvePeriodic(world, KFulltrue, bFull,
                                                  faverage, boundaryConditions)
        uLodCoarsetrue = basis * uFulltrue
        uLodFinetrue = modbasistrue * uFulltrue

        #combined LOD
        if p == 0.1:
            tic = time.perf_counter()
            _, _, _ = algorithms.compute_combined_MsStiffness(
                world,
                Nepsilon,
                aPert,
                aRefList,
                KmsijList,
                muTPrimeList,
                k,
                model,
                compute_indicator=False,
                correctorsList=None,
                compute_correc=False)
            toc = time.perf_counter()
            mean_time_combined += (toc - tic)
            KFullcomb, _, correctorsBasiscomb = algorithms.compute_combined_MsStiffness(
                world,
                Nepsilon,
                aPert,
                aRefList,
                KmsijList,
                muTPrimeList,
                k,
Ejemplo n.º 2
0
                                                               patchT,
                                                               KmsijTtrue,
                                                               periodic=True)

            bFull = basis.T * MFull * f
            uFulltrue, _ = lod_periodic.solvePeriodic(world, KFulltrue, bFull,
                                                      faverage,
                                                      boundaryConditions)
            uLodCoarsetrue = basis * uFulltrue

            #combined LOD
            KFullcomb, _, _ = algorithms.compute_combined_MsStiffness(
                world,
                Nepsilon,
                aPert,
                aRefList,
                KmsijList,
                muTPrimeList,
                k,
                model,
                compute_indicator=False)
            bFull = basis.T * MFull * f
            uFullcomb, _ = lod_periodic.solvePeriodic(world, KFullcomb, bFull,
                                                      faverage,
                                                      boundaryConditions)
            uLodCoarsecomb = basis * uFullcomb

            L2norm = np.sqrt(np.dot(uLodCoarsetrue, MFull * uLodCoarsetrue))
            abserror_combined = np.sqrt(
                np.dot(uLodCoarsetrue - uLodCoarsecomb,
                       MFull * (uLodCoarsetrue - uLodCoarsecomb)))
Ejemplo n.º 3
0
        modbasistrue = basis - lod_periodic.assembleBasisCorrectors(
            world, patchT, correctorsTtrue, periodic=True)

        bFull = basis.T * MFull * f
        uFulltrue, _ = lod_periodic.solvePeriodic(world, KFulltrue, bFull,
                                                  faverage, boundaryConditions)
        uLodCoarsetrue = basis * uFulltrue
        uLodFinetrue = modbasistrue * uFulltrue

        # combined LOD
        KFullcomb, indic, correctorsBasiscomb = algorithms.compute_combined_MsStiffness(
            world,
            Nepsilon,
            aPert,
            aRefList,
            KmsijList,
            muTPrimeList,
            k,
            model,
            True,
            correctorsList,
            compute_correc=True)
        ETs = [indic[ii][0] for ii in range(len(indic))]
        ETs = np.array(ETs)
        ETList.append(ETs)
        ETListmiddle.append(ETs[middle])

        bFull = basis.T * MFull * f
        uFullcomb, _ = lod_periodic.solvePeriodic(world, KFullcomb, bFull,
                                                  faverage, boundaryConditions)
        uLodCoarsecomb = basis * uFullcomb
        modbasiscomb = basis - correctorsBasiscomb