Parent classes:
- dolfin::Variable
This class is utilized by the solver and contains all information that is needed for multigrid.
Methods:
- MultigridProblem(dolfin::LinearVariationalProblem& problem, uint nrefine=0, bool symmetric=true, bool uniform=true, bool interpolate_coef=false, bool interpolate_solution=false)¶
Construct from given linear problem (adaptively refined). If nrefine is greater zero, the problem will be refined uniformly nrefine times. For non-symmetric problems set symmetric explicitly to false. The uniform flag indicates if problem (and its children) was uniformly refined or not.
- MultigridProblem(dolfin::NonlinearVariationalProblem& problem, uint nrefine=0, bool symmetric=false, bool uniform=true, bool interpolate_coef=false, bool interpolate_solution=false)¶
Construct from given nonlinear problem (adaptively refined). If nrefine is greater zero, the problem will be refined uniformly nrefine times. The uniform flag indicates if problem (and its children) was uniformly refined or not. For symmetric problems set symmetric explicitly to true.
- void adapt(bool interpolate_coef=false, bool interpolate_solution=false)¶
Refine problem uniformly. If interpolate_coef is set to true also discrete form coefficients (Functions) are interpolated to the new mesh. This is disabled by default since it does not make much sense to interpolate these values from a coarse grid. If interpolate_solution is set to true also the solution is interpolated to the new mesh. This is also disabled by default since it does not make much sense.
- void adapt(const dolfin::MeshFunction<bool>& cell_markers, bool interpolate_coef=false, bool interpolate_solution=false)¶
Refine problem based on cell markers.
- void adapt(const dolfin::Mesh& refined_mesh, bool uniform=false, bool interpolate_coef=false, bool interpolate_solution=false)¶
Refine problem based on refined mesh. The uniform flag indicates if the refined_mesh is a uniform refinement of the mesh of the finest_level().
Refine problem based on refined mesh (shared_ptr version).
- const boost::shared_ptr<dolfin::Function> solution() const¶
Return solution u of the problem.
- MultigridLevel& level(uint i) const¶
Return i-th level of the problem.
- MultigridLevel& finest_level() const¶
Return finest level of the problem.
- uint num_levels() const¶
Return number of levels.
- const std::vector<boost::shared_ptr<MultigridLevel>> levels() const¶
Return vector of levels.
- bool is_linear() const¶
Indicates whether the problem is linear or not.
- bool is_symmetric() const¶
Indicates whether the problem is symmetric or not.
- bool is_uniform() const¶
Indicates whether the problem is uniformly refined or not.
- MultigridLevel* create_level() const¶
User may return a new instance of a custom subclass of MultigridLevel.