From: Roy Stogner <roystgnr@ic...>  20061214 05:10:46

On Wed, 13 Dec 2006, Shun Wang wrote: > I am using libMesh to develop a multilevel solver. I understand the > adaptive mesh in libMesh is hierarchical and embeded, which is good for > multilevel/multigrid type of solvers. But I am wondering if there is an easy > way to construct linear systems on meshes at different levels and represent > vectors on those levels. That is essential for multilevel/multigrid methods. > If the current implementation of libMesh is not easy for this, could you > shed some light on what extension I can make to keep things easy? For a multigrid solver you basically need a smoother operator at every level, plus restriction and interpolation operators, yes? I assume you'll want to let application code fiddle with different smoother possibilities, so the goal with libMesh would be to just provide the whole linear system at every level. Getting the hierarchy of linear systems would be the easiest part  save a copy of the original mesh and vectors, then repeatedly uniform_coarsen() while calling assemble() and saving a copy of the linear system at every level, then restore everything. See the UniformRefinementEstimator for an example of a similar process that goes in the other direction (although because uniform refinement never destroys information, in that code we save the vectors but not the mesh). Getting the transfer operators is a bit harder. System::project_vector() does the operations you need, but it's not nearly efficient enough to use in a multigrid solver. You can probably start from a copy of that code, but instead of using the elementbyelement operations to project each vector, you'd express them as matrices to insert into global sparse interpolation/projection matrices. And, of course, the last tricky bit is hooking all this into PETSc. They've got a nice multigrid framework for you to use, but you'll have to figure out the APIs first. If you're willing to LGPL the code, let me know (ideally via the libmeshdevel list) if you need any help. This is the sort of project that I think everyone would like distributed with the library.  Roy 