Inhomogeneous boundary values


jsbeeckm
02-12-2003, 04:34 AM
I want to solve a nonlinear partial differential equation in two dimensions. I want to have fixed boundary values (inhomogeneous boundary values) and I use the multigrid algorithm for nonlinear problems (numerical recipes in C).
I have done several things to get rid of the zero boundary values in the solution, but it doesn't work. I always get zero's at the border. How can I solve this??????
Which functions do I have to adapt in order to get nonzero boundary values?????

Saul Teukolsky
02-12-2003, 09:02 AM
The code in NR assumes homogeneous boundary conditions. Usually you can treat inhomogeneous boundary conditions by modifying the rhs. Look at the examples in eqs. 19.4.16 - 19.4.27. If you can't do this in your example, you need to add the boundary condition equations explicitly to the multigrid code, solving the differential equation on the interior only. You'll need to consult the references at the end of the section, and rewrite the code.

hernlund
06-12-2003, 04:04 AM
It is worth noting that FAS handles more complex boundary conditions naturally. It is the Correction Scheme (CS) that assumes homogeneous boundary conditions, and it is therefore diffucult/impossible to relax residuals near the boundary of the domain on coarse grids...this is the source of your problem. Because non-homogeneous boundary conditions can be thought of as a type of non-linearity, FAS is definitely the way to go for more general problems.