Example #1
0
def computeRmsi(TInd):
    patch = Patch(world, k, TInd)
    IPatch = lambda: interp.L2ProjectionPatchMatrix(patch, boundaryConditions)
    aPatch = lambda: coef.localizeCoefficient(patch, aFine_ref)
    MRhsList = [f_ref[util.extractElementFine(world.NWorldCoarse,
                                          world.NCoarseElement,
                                          patch.iElementWorldCoarse,
                                          extractElements=False)]];

    correctorRhs = lod.computeElementCorrector(patch, IPatch, aPatch, None, MRhsList)[0]
    Rmsi = lod.computeRhsCoarseQuantities(patch, correctorRhs, aPatch)
    return patch, correctorRhs, Rmsi
Example #2
0
def real_computeRmsi(TInd):
    print('.', end='', flush=True)
    patch = Patch(world, k, TInd)
    IPatch = lambda: interp.L2ProjectionPatchMatrix(patch, boundaryConditions)
    aPatch = lambda: coef.localizeCoefficient(patch, a_Fine_to_be_approximated)
    MRhsList = [f_ref[util.extractElementFine(world.NWorldCoarse,
                                          world.NCoarseElement,
                                          patch.iElementWorldCoarse,
                                          extractElements=False)]];

    correctorRhs = lod.computeElementCorrector(patch, IPatch, aPatch, None, MRhsList)[0]
    Rmsi, cetaTPrime = lod.computeRhsCoarseQuantities(patch, correctorRhs, aPatch, True)

    return patch, correctorRhs, Rmsi, cetaTPrime
def computeRmsi(TInd):
    print('.', end='', flush=True)
    patch = Patch(world, k, TInd)
    IPatch = lambda: interp.L2ProjectionPatchMatrix(patch, boundaryConditions)
    aPatch = lambda: coef.localizeCoefficient(patch, aFine_ref)
    MRhsList = [
        f_ref[util.extractElementFine(world.NWorldCoarse,
                                      world.NCoarseElement,
                                      patch.iElementWorldCoarse,
                                      extractElements=False)]
    ]

    correctorRhs = lod.computeElementCorrector(patch, IPatch, aPatch, None,
                                               MRhsList)[0]
    Rmsi, cetaTPrime = lod.computeRhsCoarseQuantities(patch, correctorRhs,
                                                      aPatch, True)

    eft_patch = Patch(world, 1, TInd)
    a_eft_Patch = lambda: coef.localizeCoefficient(eft_patch, aFine_ref)
    etaT = lod.computeSupremumForEf(eft_patch, a_eft_Patch)
    return patch, correctorRhs, Rmsi, cetaTPrime, etaT
    def UpdateCorrectors(self, TInd):
        # print(" UPDATING {}".format(TInd))
        patch = Patch(self.world, self.k, TInd)
        IPatch = lambda: interp.L2ProjectionPatchMatrix(
            patch, self.boundaryConditions)
        rPatch = lambda: coef.localizeCoefficient(
            patch, self.a_Fine_to_be_approximated)

        MRhsList = [
            self.f_trans[util.extractElementFine(self.world.NWorldCoarse,
                                                 self.world.NCoarseElement,
                                                 patch.iElementWorldCoarse,
                                                 extractElements=False)]
        ]

        correctorsList = lod.computeBasisCorrectors(patch, IPatch, rPatch)
        csi = lod.computeBasisCoarseQuantities(patch, correctorsList, rPatch)

        correctorRhs = lod.computeElementCorrector(patch, IPatch, rPatch, None,
                                                   MRhsList)[0]
        Rmsij = lod.computeRhsCoarseQuantities(patch, correctorRhs, rPatch)

        return patch, correctorsList, csi.Kmsij, Rmsij, correctorRhs