I want to step-monitor at each time step of a spatio-temporal NDSolve (using the finite element method) the maximum bending of the function sampled over the curent mesh. For this I first need access to all u[xi,t] over the mesh {xi}. (Note here that I let NDSolve define the mesh)
reg = Line[{{0}, {1}}];
shape = D[0.125 Erf[(x - 0.5)/0.125], x];
op = D[u[t, x], {x, 2}] - D[u[t, x], {t, 2}];
ics = {u[0, x] == shape, Derivative[1, 0][u][0, x] == 0};
sol = NDSolveValue[{op == 0, ics}, u, {t, 0, 2}, {x} ∈ reg,
StepMonitor :> Print["xis,uis=" <> ToString["???"]]]
1) Is it possible?
2) How to access (from inside NDSolve) the mesh that has been created?
3) How to access the ui's function at each timestep (replacement of "???")?
Thank you for your help.
Denis

sol["ElementMesh"]. For 3) I suggest that you take a look atNDSolveValuedocumentation for optionStepMonitor. – Pinti Feb 18 '19 at 16:56ToElementMesh[Line[{{0}, {1}}]]and pass that toNDSolveValue. For 3) you can try something likeStepMonitor :> Print["t=", t, " u=", u[t, x]]. – Pinti Feb 18 '19 at 17:38