I am trying to implement my own multigrid method in fenics. Is there any "smart/ fenics" way how to assemble subdomains and obtain restriction/ prolongation operators ?
Computational Science Stack Exchange is a question and answer site for scientists using computers to solve scientific problems. It only takes a minute to sign up.Sign up to join this community
There is currently no documented 'FEniCS way' to do this. However, since FEniCS is a pretty standard finite element code behind all the UFL and code generation magic, you can implement things like transfer operators by yourself. The only difficulty is that they have no built-in mechanism to deal with the inter-level mappings in hierarchically refined meshes and this surely complicates things when you want to efficiently implement geometric multigrid. This is not a limitation of the concept but rather of the current implementation. There is FMG, which works around some of these difficulties. However, I have no idea if this package is still actively maintained or if the implementation is good for production use. Given that the FEniCS core is rapidly evolving I would not bet that codes which need to assume certain things about the interior workings have a long lifetime. You can however always use older versions of FEniCS which are compatible if you decide to go this way. If you need this for more than a quick hack it might however be better to implement everything in a feature branch and convince the developers to merge your changes in the development branch once you reach a certain level of stability.