aFine_ref = aFine_ref, f_trans = f_trans, epsCoarse = epsCoarse, KmsijT = KmsijT, correctorsListT = correctorsListT, patchT = patchT, RmsijT=RmsiT, correctorsRhsT = correctorRhsT, MFull = MFull, uFineFull_trans = uFineFull_trans, AFine_trans = AFine_trans) #,StartingTolerance=100) to_be_updatedT, energy_errorT, tmp_errorT, rel_energy_errorT, TOLt, uFineFull_trans_LOD = Algorithm.StartAlgorithm() store_all_data(ROOT, k, N, epsCoarse, to_be_updatedT, energy_errorT, tmp_errorT, rel_energy_errorT, TOLt, uFineFull_trans, uFineFull_trans_LOD, NFine, NWorldCoarse, aFine_ref, aFine_pert, f_ref, aFine_trans, f_trans) ''' Plot solutions ''' fig = plt.figure('Solutions') ax = fig.add_subplot(121) ax.set_title('Fem Solution to transformed problem',fontsize=6) ax.imshow(np.reshape(uFineFull_trans, NFine+1), origin='lower_left') ax = fig.add_subplot(122) ax.set_title('PGLOD Solution to transformed problem',fontsize=6) ax.imshow(np.reshape(uFineFull_trans_LOD, NFine+1), origin='lower_left') ''' Errors
E_vh = E_vh, KmsijT = KmsijT, correctorsListT = correctorsListT, patchT = patchT, RmsijT=RmsiT, correctorsRhsT = correctorRhsT, MFull = MFull, uFineFull_trans = uFineFull_trans, AFine_trans = AFine_trans, compare_with_best_LOD=True, u_best_LOD=u_best_LOD) to_be_updatedT, energy_errorT, tmp_errorT, rel_errorT, TOLt, uFineFull_trans_LOD = Algorithm.StartAlgorithm() if store: store_all_data(ROOT, k, N, E_vh, np_eft, np_eRft, norm_of_f, to_be_updatedT, energy_errorT, tmp_errorT, rel_errorT, TOLt, uFineFull_trans, uFineFull_trans_LOD, NFine, NWorldCoarse, aFine_ref, aFine_trans, f_ref, aFine_trans, f_trans, name=name) energy_error = np.sqrt(np.dot((uFineFull_trans_LOD - u_best_LOD), AFine_trans * (uFineFull_trans_LOD - u_best_LOD))) print("Energy norm {}, error {}, rel. error {}".format(energy_norm, energy_error, energy_error/energy_norm)) ''' Plot solutions ''' fig = plt.figure('Solutions') ax = fig.add_subplot(121) ax.set_title('Fem Solution to transformed problem',fontsize=6) ax.imshow(np.reshape(uFineFull_trans, NFine+1), origin='lower_left') ax = fig.add_subplot(122) ax.set_title('PGLOD Solution to transformed problem',fontsize=6)