8from .Solver
import Solver
9from .CollocatedMG
import CollocatedMG
10from .actionsets.CollocatedMGSolver.InitDofs
import InitDofsCollocatedMG
11from .actionsets.CollocatedMGSolver.ResetAndUpdateResidual
import ResetAndUpdateResidual
12from .actionsets.CollocatedMGSolver.Restriction
import Restriction
13from .actionsets.CollocatedMGSolver.Prolongation
import Prolongation
14from .actionsets.PlotVertexDataInPeanoBlockFormat
import PlotVertexDataInPeanoBlockFormat
16from .actionsets.CollocatedMGSingleThreaded.UpdateSolution
import UpdateSolution
18from abc
import abstractmethod
23 We can just inherit everything, except we must rewrite the
26 The important difference here is that we update the residual and the solution all in the same
27 sweep, meaning that we don't need any complicated logic in the abstract solver class.
29 See the documentation of solvers.api.CollocatedMG.CollocatedMG
38 local_assembly_matrix,
39 local_assembly_matrix_scaling,
43 correction_matrix_scaling,
51 smoother_relaxation = 0.6,
54 super( CollocatedMGSingleThreaded, self ).
__init__(
60 local_assembly_matrix,
61 local_assembly_matrix_scaling,
65 correction_matrix_scaling,
79 observer.add_action_set(
Prolongation(self,descend_invocation_order=invocation_order+0) )
81 observer.add_action_set(
UpdateSolution(self,descend_invocation_order=invocation_order+2) )
82 observer.add_action_set(
Restriction(self,descend_invocation_order=invocation_order+3) )
Action set (reactions to events)
We can just inherit everything, except we must rewrite the add_to_solve method.
get_vertex_merge_method(self)
__init__(self, name, unknowns_per_vertex, dimensions, min_h, max_h, local_assembly_matrix, local_assembly_matrix_scaling, mass_matrix, mass_matrix_scaling, correction_matrix, correction_matrix_scaling, solver_tolerance, pre_smoothing_steps, post_smoothing_steps, descend_order, restriction_matrix, prolongation_matrix, coarsest_level=0, smoother_relaxation=0.6, plot_predicate="true")
add_to_solve(self, observer)
A full mathematical description will follow later, but for now we outline some algorithmic steps here...
This should be identical to the original, with the only difference that we do stuff when we touch the...
This also should be called before the solver stuff.
This class comes last in the pecking order so that we restrict the residual after we've finished comp...