This class provides a method to assemble a linear mapping between a space
and
a refined space
used as prolongation operator within the multigrid solver.
Methods:
- static boost::shared_ptr<dolfin::GenericMatrix> assemble_matrix(const dolfin::FunctionSpace& space, const dolfin::FunctionSpace& refined_space, const dolfin::GenericLinearAlgebraFactory& factory, AssemblyMethod asm_method=AssemblyMethods::cellwise, DirichletProjectionMethod dbc_method=DirichletProjectionMethods::keep, BoostFlag boost_flags=BoostFlags::space_grouping, const std::vector<int>* global_to_reduced_dofs=NULL, const std::vector<uint>* reduced_to_global_dofs=NULL, const std::vector<int>* refined_global_to_reduced_dofs=NULL, const std::vector<uint>* refined_reduced_to_global_dofs=NULL, double eps=1e-13)¶
Assembles the prolongation operator from space to refined_space.
- Note that the following conditions must hold to work properly:
- space.element() == refined_space.element()
- space.mesh() and refined_space.mesh() share the same domain
- every cell of the refined mesh is contained in a cell of the original mesh (i.e. only (recursive) subdivison of cells allowed)
- The asm_method parameter affects performance of the assembly process only:
- “uniform”: assumes a uniform mesh refinement (i.e. every cell is split in n cells and refined_mesh.cell(n*i+j) is contained in mesh.cell(i) for 0 <= j < n and all i)
- “cellwise”: allows adaptive mesh refinement (with cell_markers)
- “dofwise”: allows to drop condition 3 (computationally expensive therefore not implemented)
- The dbc_method specifies the treatment of Dirichlet boundary conditions:
- “remove”: Removes rows/columns which are set to -1 in the mappings refined_global_to_reduced_dofs/global_to_reduced_dofs.
- “zero”: Zeroes rows/columns which are set to -1 in the mappings refined_global_to_reduced_dofs/global_to_reduced_dofs.
- “keep”: Does not change the original prolongation operator. In this case the mapping parameters are not used.
Also the space_grouping parameter should affect the performance of the assembly process only. If set to true, subspaces with the same signature will be grouped together (components of a vector space for example) and dofs will only be evaluated on the first space. For the other spaces the same values are assumed. If you encounter problems with the prolongation operator you should try to disable this feature.