I'm applying NDSolveValue to 2-D diffusion equation with "Method of Lines":
eqns = {D[T[t, x, y], t] == D[T[t, x, y], x, x] + D[T[t, x, y], y, y]};
\[CapitalOmega] = Rectangle[{0, 0}, {1, 1}];
init = {T[0, x, y] == If[0.4 < x < 0.6 && 0.4 < y < 0.6, 1, 0]};
bcs = DirichletCondition[T[t, x, y] == 0,x == 1 || x == 0| y == 0 || y == 1];
sol1 = NDSolveValue[{eqns, init, bcs},T, {t, 0, 0.1}, {x, y} \[Element] \[CapitalOmega], MaxStepSize -> 0.0001]
the above code works.
But when I tried to control the spatial discretization grid points:
sol2 = NDSolveValue[{eqns, init, bcs},
T, {t, 0, 0.01}, {x, y} \[Element] \[CapitalOmega],
Method -> {"MethodOfLines", "TemporalVariable" -> t,
"SpatialDiscretization" -> {"TensorProductGrid",
"MinPoints" -> 125}}, MaxStepSize -> 0.0001
]
it failed with an error message (NDSolveValue::moptx):

Unable to identify the problem, I searched the documentation and found an example:
s2 = NDSolve[{\!\(
\*SubscriptBox[\(\[PartialD]\), \(t\)]\(u[t, x]\)\) == 1/1000 \!\(
\*SubscriptBox[\(\[PartialD]\), \(x, x\)]\(u[t, x]\)\) - u[t, x] \!\(
\*SubscriptBox[\(\[PartialD]\), \(x\)]\(u[t, x]\)\),
u[0, x] == Sin[2 \[Pi] x], u[t, 0] == u[t, 1]},
u, {t, 0, 2}, {x, 0, 1},
Method -> {"PDEDiscretization" -> {"MethodOfLines",
"SpatialDiscretization" -> {"TensorProductGrid",
"MinPoints" -> 128}}}]
which works, except that its in 1-D.
So what's wrong with my code?
∈, 2. usedDirichletCondition,NDSolveautomatically turns toFiniteElementmethod, whileMinPointsis a sub-option ofTensorProductGridmethod, so the warning pops up. – xzczd May 22 '19 at 10:29FiniteElementandTensorProductGridare both sub-method ofMethodOfLinesin this case. As already mentioned,NDSolveautomatically usesFiniteElementwhen∈orDirichletConditionis used, at least now. (Well, perhaps a better warning should be given in this case e.g.TensorProductGridcannot handleDirichletCondition, sub-method has been changed toFiniteElement? ) – xzczd May 23 '19 at 05:59