I am using the method by Brandt in the FAS Multigrid algorithm to estimate the truncation error in a 1-D flow problem and then use that as the basis for generating a mesh(r-adaptation) in 1-D.
The process is standard, in that, transform the equations to a computational domain $\xi$, perform/run computations and map the solution $u$ and $x$ back to the physical domain $x$.
FLOW PROBLEM in computational domain:
$$ u_{\xi\xi} - \left(5 x_\xi + \frac{x_{\xi\xi}}{x_\xi}\right) u_\xi = 0 \quad\tag{1}$$
with boundary conditions $u(\xi=0)=0$ and $u(\xi=1) =1$
MESH EQUATION in computational domain:
$$ x_{\xi\xi} + \frac{2 e_\xi}{e} x_\xi = 0\qquad\tag{2}$$
with boundary conditions $x(\xi=0)=0$ and $x(\xi=1)=1$
where $e$ is the local truncation error from equation-1 and $e_\xi$ its derivative. I am using a simple second order central finite difference scheme for the linear coupled problem.
Things to know:
Using the FAS methodology, once an accurate truncation error estimate is made(which requires a reasonably fine grid for the flow problem, say N=65), it is then treated as an known input to equation-2.
The analytical solution to equation-1 is : $u(x) = \frac{exp(5 x(\xi)-1)}{exp(5)-1} $ and equation-2 treating the coefficient as known, is smooth that is: $x(\xi)= \frac{1- exp\left[-2\frac{ e_\xi}{e} \xi\right]}{1- exp\left[-2\frac{ e_\xi}{e}\right]}$
3.Truncation error from flow problem:

3.a Coefficient $\frac{e_\xi}{e}$: 
- I have written code in FORTRAN 77
Questions:
I have tried using the thomas algorithm for equation-2 and it never seems to give a reasonable solution other than $x(\xi)=0$ for all interior points. Why is this? Can it be that the system is weakly diagonally dominant?
I then switched the method to solve equation-2 to a simple Seidel iterative scheme, and that seems to work, but the solution to $x(\xi)$ is not smooth like the analytical counterpart. Why ?
- Typically what happens is the mesh points would re-distribute accordingly and the flow problem is well resolved. In my case, the solution I obtain for $x(\xi)$ seems to completely change the behavior of the flow problem implying it is obviously not a valid solution.
Any suggestions relevant to any of the above or any insight will be much appreciated.




To get mesh smoothness you can smooth the monitor function, for example with something like Gaussian convolution, or by applying a few steps of a diffusion operator. I found some theory on this in Adaptive Computing:Theory and Algorithms by Tao Tang and Jinchao Xu (2007, Scientific Press).
Is there possibly a sign error in (2)? I'm trying to get to those equations from the theory I learnt.
– Steve Apr 11 '16 at 11:02