2

First OP's implementation with timing on my machine: First@AbsoluteTiming[ u1 = input; Do[f = SparseArray[{{i_} :> If[MemberQ[lll, i], 0, -2.0*u1[[i - 1]] - 2.0*u1[[i + 1]] - 2.0*u1[[i + dos]] - 2.0*u1[[i - dos]] + (1. + I)*u1[[i]]]}, {dos*dos}]; u1 = LinearSolve[s, f];, {j, 1, steps, 1}]; result0 = u1; ] 17.1247 The ...


1

The following (and my comment) overlooks the fact that u1 and f are dependent. Copy code, don't rewrite it -- also don't over edit once copied! When I look at Normal@f for various values of dos, I find the "edge" elements of f (considered as a dos by dos 2d grid) are 0 and the "inner" elements of f are 1.0I-7.0. Here, then, is a ...


Only top voted, non community-wiki answers of a minimum length are eligible