![]() |
|
#include <geometric_multigrid.h>
Public Types | |
typedef Smoother *(* | PreSmootherFactoryFctPt) () |
typedef Smoother *(* | PostSmootherFactoryFctPt) () |
Public Member Functions | |
void | set_pre_smoother_factory_function (PreSmootherFactoryFctPt pre_smoother_fn) |
Access function to set the pre-smoother creation function. More... | |
void | set_post_smoother_factory_function (PostSmootherFactoryFctPt post_smoother_fn) |
Access function to set the post-smoother creation function. More... | |
MGSolver (MGProblem *mg_problem_pt) | |
~MGSolver () | |
Delete any dynamically allocated data. More... | |
void | clean_up_memory () |
Clean up anything that needs to be cleaned up. More... | |
void | set_self_test_vector () |
void | self_test () |
void | restriction_self_test () |
void | interpolation_self_test () |
void | plot (const unsigned &hierarchy_level, const DoubleVector &input_vector, const std::string &filename) |
void | disable_v_cycle_output () |
void | disable_output () |
void | enable_v_cycle_output () |
Enable the output of the V-cycle timings and other output. More... | |
void | enable_doc_everything () |
Enable the output from anything that could have been suppressed. More... | |
void | enable_output () |
Enable the output from anything that could have been suppressed. More... | |
void | disable_smoother_and_superlu_doc_time () |
Suppress the output of both smoothers and SuperLU. More... | |
unsigned & | npost_smooth () |
Return the number of post-smoothing iterations (lvalue) More... | |
unsigned & | npre_smooth () |
Return the number of pre-smoothing iterations (lvalue) More... | |
void | pre_smooth (const unsigned &level) |
void | post_smooth (const unsigned &level) |
double | residual_norm (const unsigned &level) |
void | direct_solve () |
Call the direct solver (SuperLU) to solve the problem exactly. More... | |
void | interpolation_matrix_set (const unsigned &level, double *value, int *col_index, int *row_st, unsigned &ncol, unsigned &nnz) |
void | interpolation_matrix_set (const unsigned &level, Vector< double > &value, Vector< int > &col_index, Vector< int > &row_st, unsigned &ncol, unsigned &nrow) |
void | set_restriction_matrices_as_interpolation_transposes () |
void | restrict_residual (const unsigned &level) |
void | interpolate_and_correct (const unsigned &level) |
void | level_up_local_coord_of_node (const int &son_type, Vector< double > &s) |
void | setup_interpolation_matrices () |
Setup the interpolation matrix on each level. More... | |
void | setup_interpolation_matrices_unstructured () |
Setup the interpolation matrices. More... | |
void | setup_transfer_matrices () |
Setup the transfer matrices on each level. More... | |
void | full_setup () |
Runs a full setup of the MG solver. More... | |
void | solve (Problem *const &problem_pt, DoubleVector &result) |
unsigned | iterations () const |
Number of iterations. More... | |
unsigned & | max_iter () |
Number of iterations. More... | |
void | level_up_local_coord_of_node (const int &son_type, Vector< double > &s) |
void | level_up_local_coord_of_node (const int &son_type, Vector< double > &s) |
![]() | |
IterativeLinearSolver () | |
IterativeLinearSolver (const IterativeLinearSolver &)=delete | |
Broken copy constructor. More... | |
void | operator= (const IterativeLinearSolver &)=delete |
Broken assignment operator. More... | |
virtual | ~IterativeLinearSolver () |
Destructor (empty) More... | |
Preconditioner *& | preconditioner_pt () |
Access function to preconditioner. More... | |
Preconditioner *const & | preconditioner_pt () const |
Access function to preconditioner (const version) More... | |
double & | tolerance () |
Access to convergence tolerance. More... | |
unsigned & | max_iter () |
Access to max. number of iterations. More... | |
void | enable_doc_convergence_history () |
Enable documentation of the convergence history. More... | |
void | disable_doc_convergence_history () |
Disable documentation of the convergence history. More... | |
void | open_convergence_history_file_stream (const std::string &file_name, const std::string &zone_title="") |
void | close_convergence_history_file_stream () |
Close convergence history output stream. More... | |
double | jacobian_setup_time () const |
double | linear_solver_solution_time () const |
return the time taken to solve the linear system More... | |
virtual double | preconditioner_setup_time () const |
returns the the time taken to setup the preconditioner More... | |
void | enable_setup_preconditioner_before_solve () |
Setup the preconditioner before the solve. More... | |
void | disable_setup_preconditioner_before_solve () |
Don't set up the preconditioner before the solve. More... | |
void | enable_error_after_max_iter () |
Throw an error if we don't converge within max_iter. More... | |
void | disable_error_after_max_iter () |
Don't throw an error if we don't converge within max_iter (default). More... | |
void | enable_iterative_solver_as_preconditioner () |
void | disable_iterative_solver_as_preconditioner () |
![]() | |
LinearSolver () | |
Empty constructor, initialise the member data. More... | |
LinearSolver (const LinearSolver &dummy)=delete | |
Broken copy constructor. More... | |
void | operator= (const LinearSolver &)=delete |
Broken assignment operator. More... | |
virtual | ~LinearSolver () |
Empty virtual destructor. More... | |
void | enable_doc_time () |
Enable documentation of solve times. More... | |
void | disable_doc_time () |
Disable documentation of solve times. More... | |
bool | is_doc_time_enabled () const |
Is documentation of solve times enabled? More... | |
bool | is_resolve_enabled () const |
Boolean flag indicating if resolves are enabled. More... | |
virtual void | enable_resolve () |
virtual void | disable_resolve () |
virtual void | solve (DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &result) |
virtual void | solve (DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result) |
virtual void | solve_transpose (Problem *const &problem_pt, DoubleVector &result) |
virtual void | solve_transpose (DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &result) |
virtual void | solve_transpose (DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result) |
virtual void | resolve (const DoubleVector &rhs, DoubleVector &result) |
virtual void | resolve_transpose (const DoubleVector &rhs, DoubleVector &result) |
virtual void | enable_computation_of_gradient () |
void | disable_computation_of_gradient () |
void | reset_gradient () |
void | get_gradient (DoubleVector &gradient) |
function to access the gradient, provided it has been computed More... | |
![]() | |
DistributableLinearAlgebraObject () | |
Default constructor - create a distribution. More... | |
DistributableLinearAlgebraObject (const DistributableLinearAlgebraObject &matrix)=delete | |
Broken copy constructor. More... | |
void | operator= (const DistributableLinearAlgebraObject &)=delete |
Broken assignment operator. More... | |
virtual | ~DistributableLinearAlgebraObject () |
Destructor. More... | |
LinearAlgebraDistribution * | distribution_pt () const |
access to the LinearAlgebraDistribution More... | |
unsigned | nrow () const |
access function to the number of global rows. More... | |
unsigned | nrow_local () const |
access function for the num of local rows on this processor. More... | |
unsigned | nrow_local (const unsigned &p) const |
access function for the num of local rows on this processor. More... | |
unsigned | first_row () const |
access function for the first row on this processor More... | |
unsigned | first_row (const unsigned &p) const |
access function for the first row on this processor More... | |
bool | distributed () const |
distribution is serial or distributed More... | |
bool | distribution_built () const |
void | build_distribution (const LinearAlgebraDistribution *const dist_pt) |
void | build_distribution (const LinearAlgebraDistribution &dist) |
Protected Member Functions | |
void | mg_solve (DoubleVector &result) |
Linear solver. More... | |
void | modify_restriction_matrices () |
Modify the restriction matrices. More... | |
![]() | |
void | clear_distribution () |
Private Member Functions | |
void | setup_mg_hierarchy () |
Set up the MG hierarchy. More... | |
void | setup_mg_structures () |
Set up the MG hierarchy structures. More... | |
void | setup_smoothers () |
Set up the smoothers on all levels. More... | |
Additional Inherited Members | |
![]() | |
static IdentityPreconditioner | Default_preconditioner |
/////////////////////////////////////////////////////// /////////////////////////////////////////////////////// ///////////////////////////////////////////////////////
typedef Smoother*(* oomph::MGSolver< DIM >::PostSmootherFactoryFctPt) () |
typedef for a function that returns a pointer to an object of the class Smoother to be used as the post-smoother
typedef Smoother*(* oomph::MGSolver< DIM >::PreSmootherFactoryFctPt) () |
typedef for a function that returns a pointer to an object of the class Smoother to be used as the pre-smoother
|
inline |
Constructor: Set up default values for number of V-cycles and pre- and post-smoothing steps.
References oomph::MGSolver< DIM >::Mg_hierarchy, oomph::MGSolver< DIM >::Mg_problem_pt, and oomph::IterativeLinearSolver::Tolerance.
|
inline |
Delete any dynamically allocated data.
References oomph::MGSolver< DIM >::clean_up_memory().
|
inlinevirtual |
Clean up anything that needs to be cleaned up.
Reimplemented from oomph::LinearSolver.
Reimplemented in oomph::MGPreconditioner< DIM >.
References oomph::MGSolver< DIM >::Doc_everything, oomph::MGSolver< DIM >::Has_been_setup, i, oomph::MGSolver< DIM >::Interpolation_matrices_storage_pt, oomph::MGSolver< DIM >::Mg_hierarchy, oomph::MGSolver< DIM >::Mg_matrices_storage_pt, oomph::MGSolver< DIM >::Nlevel, oomph::MGSolver< DIM >::Post_smoothers_storage_pt, oomph::MGSolver< DIM >::Pre_smoothers_storage_pt, and oomph::MGSolver< DIM >::Restriction_matrices_storage_pt.
Referenced by oomph::MGSolver< DIM >::~MGSolver().
|
inline |
Call the direct solver (SuperLU) to solve the problem exactly.
References oomph::MGSolver< DIM >::Mg_matrices_storage_pt, oomph::MGSolver< DIM >::Nlevel, oomph::MGSolver< DIM >::Rhs_mg_vectors_storage, and oomph::MGSolver< DIM >::X_mg_vectors_storage.
|
inline |
Suppress anything that can be suppressed, i.e. any timings. Things like mesh adaptation can not however be silenced using this
References oomph::LinearSolver::Doc_time, oomph::oomph_info, oomph::oomph_nullstream, oomph::MGSolver< DIM >::Stream_pt, oomph::OomphInfo::stream_pt(), oomph::MGSolver< DIM >::Suppress_all_output, and oomph::MGSolver< DIM >::Suppress_v_cycle_output.
|
inline |
Suppress the output of both smoothers and SuperLU.
References i, oomph::MGSolver< DIM >::Mg_matrices_storage_pt, oomph::MGSolver< DIM >::Nlevel, oomph::MGSolver< DIM >::Post_smoothers_storage_pt, and oomph::MGSolver< DIM >::Pre_smoothers_storage_pt.
|
inline |
Disable all output from mg_solve apart from the number of V-cycles used to solve the problem
References oomph::LinearSolver::Doc_time, and oomph::MGSolver< DIM >::Suppress_v_cycle_output.
|
inline |
Enable the output from anything that could have been suppressed.
References oomph::MGSolver< DIM >::Doc_everything.
|
inline |
Enable the output from anything that could have been suppressed.
References oomph::LinearSolver::Doc_time, oomph::MGSolver< DIM >::Suppress_all_output, and oomph::MGSolver< DIM >::Suppress_v_cycle_output.
|
inline |
Enable the output of the V-cycle timings and other output.
References oomph::LinearSolver::Doc_time, and oomph::MGSolver< DIM >::Suppress_v_cycle_output.
void oomph::MGSolver< DIM >::full_setup |
Runs a full setup of the MG solver.
Do a full setup (assumes everything will be setup around the MGProblem pointer given in the constructor)
References oomph::TerminateHelper::clean_up_memory(), oomph::FiniteElement::dim(), DIM, i, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::oomph_info, oomph::self_test(), oomph::Global_string_for_annotation::string(), and oomph::TimingHelpers::timer().
Referenced by oomph::MGPreconditioner< DIM >::setup(), and oomph::MGSolver< DIM >::solve().
void oomph::MGSolver< DIM >::interpolate_and_correct | ( | const unsigned & | level | ) |
Interpolate solution at current level onto next finer mesh and correct the solution x at that level
References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.
|
inline |
Builds a CRDoubleMatrix that is used to interpolate the residual between levels. The transpose can be used as the full weighting restriction.
References oomph::MGSolver< DIM >::Interpolation_matrices_storage_pt, and Eigen::value.
|
inline |
Builds a CRDoubleMatrix that is used to interpolate the residual between levels. The transpose can be used as the full weighting restriction.
References oomph::LinearAlgebraDistribution::communicator_pt(), oomph::MGSolver< DIM >::Interpolation_matrices_storage_pt, oomph::MGSolver< DIM >::Mg_hierarchy, oomph::OomphCommunicator::nproc(), oomph::DistributableLinearAlgebraObject::nrow(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::Global_string_for_annotation::string(), and Eigen::value.
void oomph::MGSolver< DIM >::interpolation_self_test |
Make a self-test to make sure that the interpolation matrices are doing the same thing to interpolate the vectors up.
Function which implements a self-test to interpolate a vector up all of levels of the MG hierarchy and outputs the restricted vectors to file
References MergeRestartFiles::filename, PlanarWave::plot(), and oomph::Global_string_for_annotation::string().
|
inlinevirtual |
Number of iterations.
Implements oomph::IterativeLinearSolver.
References oomph::MGSolver< DIM >::V_cycle_counter.
void oomph::MGSolver< 2 >::level_up_local_coord_of_node | ( | const int & | son_type, |
Vector< double > & | s | ||
) |
Given the son type of the element and the local coordinate s of a given node in the son element, return the local coordinate s in its father element. 2D case.
References oomph::QuadTreeNames::NE, oomph::QuadTreeNames::NW, oomph::Tree::OMEGA, s, oomph::QuadTreeNames::SE, and oomph::QuadTreeNames::SW.
void oomph::MGSolver< 3 >::level_up_local_coord_of_node | ( | const int & | son_type, |
Vector< double > & | s | ||
) |
Given the son type of the element and the local coordinate s of a given node in the son element, return the local coordinate s in its father element. 3D case.
References oomph::OcTreeNames::LDB, oomph::OcTreeNames::LDF, oomph::OcTreeNames::LUB, oomph::OcTreeNames::LUF, oomph::Tree::OMEGA, oomph::OcTreeNames::RDB, oomph::OcTreeNames::RDF, oomph::OcTreeNames::RUB, oomph::OcTreeNames::RUF, and s.
void oomph::MGSolver< DIM >::level_up_local_coord_of_node | ( | const int & | son_type, |
Vector< double > & | s | ||
) |
Given the son_type of an element and a local node number j in that element with nnode_1d nodes per coordinate direction, return the local coordinate s in its father element. Needed in the setup of the interpolation matrices
|
inline |
|
protected |
Linear solver.
Do the actual solve – this is called through the pure virtual solve function in the LinearSolver base class. The function is stored as protected to allow the MGPreconditioner derived class to use the solver
References i, oomph::oomph_info, and oomph::TimingHelpers::timer().
Referenced by oomph::MGPreconditioner< DIM >::preconditioner_solve(), and oomph::MGSolver< DIM >::solve().
|
protected |
Modify the restriction matrices.
Normalise the rows of the restriction matrices to avoid amplifications when projecting to the coarser level
References i, j, oomph::CRDoubleMatrix::nrow(), oomph::CRDoubleMatrix::row_start(), and oomph::CRDoubleMatrix::value().
|
inline |
Return the number of post-smoothing iterations (lvalue)
References oomph::MGSolver< DIM >::Npost_smooth.
|
inline |
Return the number of pre-smoothing iterations (lvalue)
References oomph::MGSolver< DIM >::Npre_smooth.
void oomph::MGSolver< DIM >::plot | ( | const unsigned & | hierarchy_level, |
const DoubleVector & | input_vector, | ||
const std::string & | filename | ||
) |
Given a level in the hierarchy, an input vector and a filename this function will document the given vector according to the structure of the mesh on the given level
Plots the input vector (assuming we're dealing with scalar nodal data, otherwise I don't know how to implement this...)
References e(), oomph::Data::eqn_number(), MergeRestartFiles::filename, oomph::Mesh::finite_element_pt(), oomph::Node::hanging_pt(), i, oomph::Node::is_hanging(), oomph::Node::is_on_boundary(), j, oomph::HangInfo::master_node_pt(), oomph::HangInfo::master_weight(), oomph::Node::ndim(), oomph::Mesh::nelement(), oomph::HangInfo::nmaster(), oomph::FiniteElement::nnode(), oomph::FiniteElement::nnode_1d(), oomph::FiniteElement::node_pt(), oomph::Mesh::node_pt(), oomph::Data::nvalue(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::FiniteElement::tecplot_zone_string(), and oomph::Node::x().
|
inline |
Post-smoother: Perform max_iter smoothing steps on the linear system Ax=b with current RHS vector, b, starting with current solution vector, x. Uses the default smoother (set in the MGProblem constructor) which can be overloaded for specific problem.
References oomph::MGSolver< DIM >::Post_smoothers_storage_pt, oomph::MGSolver< DIM >::Rhs_mg_vectors_storage, and oomph::MGSolver< DIM >::X_mg_vectors_storage.
|
inline |
Pre-smoother: Perform 'max_iter' smoothing steps on the linear system Ax=b with current RHS vector, b, starting with current solution vector, x. Return the residual vector r=b-Ax. Uses the default smoother (set in the MGProblem constructor) which can be overloaded for a specific problem.
References oomph::MGSolver< DIM >::Mg_matrices_storage_pt, oomph::MGSolver< DIM >::Pre_smoothers_storage_pt, oomph::MGSolver< DIM >::Residual_mg_vectors_storage, oomph::MGSolver< DIM >::Rhs_mg_vectors_storage, and oomph::MGSolver< DIM >::X_mg_vectors_storage.
|
inline |
Return norm of residual r=b-Ax and the residual vector itself on the level-th level
References oomph::MGSolver< DIM >::Mg_matrices_storage_pt, oomph::MGSolver< DIM >::Residual_mg_vectors_storage, oomph::MGSolver< DIM >::Rhs_mg_vectors_storage, and oomph::MGSolver< DIM >::X_mg_vectors_storage.
void oomph::MGSolver< DIM >::restrict_residual | ( | const unsigned & | level | ) |
Restrict residual (computed on level-th MG level) to the next coarser mesh and stick it into the coarse mesh RHS vector.
Restrict residual (computed on current MG level) to next coarser mesh and stick it into the coarse mesh RHS vector using the restriction matrix (if restrict_flag=1) or the transpose of the interpolation matrix (if restrict_flag=2)
References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.
void oomph::MGSolver< DIM >::restriction_self_test |
Make a self-test to make sure that the interpolation matrices are doing the same thing to restrict the vectors down through the heirachy.
Function which implements a self-test to restrict the residual vector down all of the coarser grids and output the restricted vectors to file
References MergeRestartFiles::filename, PlanarWave::plot(), and oomph::Global_string_for_annotation::string().
void oomph::MGSolver< DIM >::self_test |
Makes a vector, restricts it down the levels of the hierarchy and documents it at each level. After this is done the vector is interpolated up the levels of the hierarchy with the output being documented at each level
References oomph::LinearAlgebraDistribution::communicator_pt(), oomph::OomphCommunicator::nproc(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::oomph_info, oomph::Global_string_for_annotation::string(), and oomph::TimingHelpers::timer().
|
inline |
Access function to set the post-smoother creation function.
References oomph::MGSolver< DIM >::Post_smoother_factory_function_pt.
Referenced by FluxPoissonMGProblem< ELEMENT, MESH >::set_multigrid_solver(), and UnitCubePoissonMGProblem< ELEMENT, MESH >::set_multigrid_solver().
|
inline |
Access function to set the pre-smoother creation function.
References oomph::MGSolver< DIM >::Pre_smoother_factory_function_pt.
Referenced by FluxPoissonMGProblem< ELEMENT, MESH >::set_multigrid_solver(), and UnitCubePoissonMGProblem< ELEMENT, MESH >::set_multigrid_solver().
|
inline |
Builds a CRDoubleMatrix on each level that is used to restrict the residual between levels. The transpose can be used as the interpolation matrix
References i, oomph::MGSolver< DIM >::Interpolation_matrices_storage_pt, oomph::MGSolver< DIM >::Nlevel, and oomph::MGSolver< DIM >::Restriction_matrices_storage_pt.
void oomph::MGSolver< DIM >::set_self_test_vector |
Makes a vector which will be used in the self-test. Is currently set to make the entries of the vector represent a plane wave propagating at an angle of 45 degrees
Sets the initial vector to be used in the restriction and interpolation self-tests
References e(), oomph::Data::eqn_number(), oomph::Mesh::finite_element_pt(), i, j, oomph::Node::ndim(), oomph::Mesh::nelement(), oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), oomph::Mesh::node_pt(), oomph::Data::nvalue(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, constants::pi, oomph::MathematicalConstants::Pi, sin(), and oomph::Node::x().
void oomph::MGSolver< DIM >::setup_interpolation_matrices |
Setup the interpolation matrix on each level.
Setup the interpolation matrices.
References DIM, oomph::Data::eqn_number(), oomph::Mesh::finite_element_pt(), i, j, k, oomph::HangInfo::master_node_pt(), oomph::HangInfo::master_weight(), oomph::Mesh::nelement(), oomph::HangInfo::nmaster(), oomph::Tree::OMEGA, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, s, and Eigen::value.
void oomph::MGSolver< DIM >::setup_interpolation_matrices_unstructured |
Setup the interpolation matrices.
Setup the interpolation matrix on each level (used for unstructured meshes)
References DIM, oomph::Data::eqn_number(), oomph::Node::hanging_pt(), oomph::Node::is_hanging(), oomph::MeshAsGeomObject::locate_zeta(), oomph::HangInfo::master_node_pt(), oomph::HangInfo::master_weight(), oomph::HangInfo::nmaster(), oomph::FiniteElement::nnode(), oomph::Mesh::nnode(), oomph::FiniteElement::node_pt(), oomph::Mesh::node_pt(), oomph::Node::position(), s, oomph::FiniteElement::shape(), and Eigen::value.
|
private |
Set up the MG hierarchy.
Function to set up the hierachy of levels. Creates a vector of pointers to each MG level
References oomph::Problem::actions_after_adapt(), oomph::Problem::actions_before_adapt(), oomph::Problem::assign_eqn_numbers(), oomph::MGProblem::make_new_problem(), oomph::MGProblem::mg_bulk_mesh_pt(), oomph::oomph_info, oomph::TreeBasedRefineableMeshBase::refine_base_mesh_as_in_reference_mesh_minus_one(), and oomph::TimingHelpers::timer().
|
private |
Set up the MG hierarchy structures.
Function to set up the hierachy of levels. Creates a vector of pointers to each MG level
References oomph::LinearAlgebraDistribution::clear(), oomph::LinearAlgebraDistribution::communicator_pt(), i, oomph::OomphCommunicator::nproc(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::oomph_info, oomph::Global_string_for_annotation::string(), and oomph::TimingHelpers::timer().
|
private |
Set up the smoothers on all levels.
Function to set up all of the smoothers once the system matrices have been set up
References oomph::LinearAlgebraDistribution::communicator_pt(), i, oomph::OomphCommunicator::nproc(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::oomph_info, oomph::Global_string_for_annotation::string(), oomph::TimingHelpers::timer(), and oomph::IterativeLinearSolver::tolerance().
void oomph::MGSolver< DIM >::setup_transfer_matrices |
Setup the transfer matrices on each level.
Set up the transfer matrices. Both the pure injection and full weighting method have been implemented here but it is highly recommended that full weighting is used in general. In both methods the transpose of the transfer matrix is used to transfer a vector back
References oomph::oomph_info, and oomph::TimingHelpers::timer().
|
inlinevirtual |
Virtual function in the base class that needs to be implemented later but for now just leave it empty
Implements oomph::LinearSolver.
References oomph::MGSolver< DIM >::full_setup(), oomph::MGSolver< DIM >::Has_been_solved, oomph::Problem::mesh_pt(), oomph::MGSolver< DIM >::Mg_problem_pt, oomph::MGSolver< DIM >::mg_solve(), oomph::Mesh::node_pt(), oomph::Data::nvalue(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::oomph_info, oomph::MGSolver< DIM >::Stream_pt, oomph::OomphInfo::stream_pt(), oomph::MGSolver< DIM >::Suppress_all_output, oomph::MGSolver< DIM >::Suppress_v_cycle_output, and oomph::MGSolver< DIM >::V_cycle_counter.
|
private |
If this is set to true we document everything. In addition to outputting the information of the setup timings and V-cycle data we document the refinement and unrefinement patterns given by the transfer operators which is done by keeping the coarser MG problem pointers alive
Referenced by oomph::MGSolver< DIM >::clean_up_memory(), and oomph::MGSolver< DIM >::enable_doc_everything().
|
private |
Boolean variable to indicate whether or not the solver has been setup.
Referenced by oomph::MGSolver< DIM >::clean_up_memory().
|
private |
Boolean variable to indicate whether or not the problem was successfully solved
Referenced by oomph::MGSolver< DIM >::solve().
|
private |
Vector to store the interpolation matrices.
Referenced by oomph::MGSolver< DIM >::clean_up_memory(), oomph::MGSolver< DIM >::interpolation_matrix_set(), and oomph::MGSolver< DIM >::set_restriction_matrices_as_interpolation_transposes().
|
private |
Vector to store the result of interpolation on each level (only required if the user wishes to document the output of interpolation and restriction on each level)
|
private |
Vector containing pointers to problems in hierarchy.
Referenced by oomph::MGSolver< DIM >::clean_up_memory(), oomph::MGSolver< DIM >::interpolation_matrix_set(), and oomph::MGSolver< DIM >::MGSolver().
|
private |
Vector to store the system matrices.
Referenced by oomph::MGSolver< DIM >::clean_up_memory(), oomph::MGSolver< DIM >::direct_solve(), oomph::MGSolver< DIM >::disable_smoother_and_superlu_doc_time(), oomph::MGSolver< DIM >::pre_smooth(), and oomph::MGSolver< DIM >::residual_norm().
|
protected |
Pointer to the MG problem (deep copy). This is protected to provide access to the MG preconditioner
Referenced by oomph::MGSolver< DIM >::MGSolver(), oomph::MGPreconditioner< DIM >::preconditioner_solve(), and oomph::MGSolver< DIM >::solve().
|
private |
The number of levels in the multigrid heirachy.
Referenced by oomph::MGSolver< DIM >::clean_up_memory(), oomph::MGSolver< DIM >::direct_solve(), oomph::MGSolver< DIM >::disable_smoother_and_superlu_doc_time(), and oomph::MGSolver< DIM >::set_restriction_matrices_as_interpolation_transposes().
|
private |
Number of post-smoothing steps.
Referenced by oomph::MGSolver< DIM >::npost_smooth().
|
private |
Number of pre-smoothing steps.
Referenced by oomph::MGSolver< DIM >::npre_smooth().
|
protected |
Maximum number of V-cycles (this is set as a protected variable so
Referenced by oomph::MGSolver< DIM >::max_iter(), and oomph::MGPreconditioner< DIM >::MGPreconditioner().
|
private |
Function to create post-smoothers.
Referenced by oomph::MGSolver< DIM >::set_post_smoother_factory_function().
|
private |
Vector to store the post-smoothers.
Referenced by oomph::MGSolver< DIM >::clean_up_memory(), oomph::MGSolver< DIM >::disable_smoother_and_superlu_doc_time(), and oomph::MGSolver< DIM >::post_smooth().
|
private |
Function to create pre-smoothers.
Referenced by oomph::MGSolver< DIM >::set_pre_smoother_factory_function().
|
private |
Vector to store the pre-smoothers.
Referenced by oomph::MGSolver< DIM >::clean_up_memory(), oomph::MGSolver< DIM >::disable_smoother_and_superlu_doc_time(), and oomph::MGSolver< DIM >::pre_smooth().
|
private |
Vector to store the residual vectors.
Referenced by oomph::MGSolver< DIM >::pre_smooth(), and oomph::MGSolver< DIM >::residual_norm().
|
private |
Vector to store the restriction matrices.
Referenced by oomph::MGSolver< DIM >::clean_up_memory(), and oomph::MGSolver< DIM >::set_restriction_matrices_as_interpolation_transposes().
|
private |
Vector to store the result of restriction on each level (only required if the user wishes to document the output of interpolation and restriction on each level)
|
protected |
Vector to store the RHS vectors (Rhs_mg). This is protected to allow the multigrid preconditioner to assign the RHS vector during preconditioner_solve()
Referenced by oomph::MGSolver< DIM >::direct_solve(), oomph::MGSolver< DIM >::post_smooth(), oomph::MGSolver< DIM >::pre_smooth(), oomph::MGPreconditioner< DIM >::preconditioner_solve(), and oomph::MGSolver< DIM >::residual_norm().
|
protected |
Pointer to the output stream – defaults to std::cout. This is protected member data to allow the preconditioner to restore normal output if everything was chosen to be suppressed by the user
Referenced by oomph::MGSolver< DIM >::disable_output(), oomph::MGPreconditioner< DIM >::preconditioner_solve(), oomph::MGPreconditioner< DIM >::setup(), and oomph::MGSolver< DIM >::solve().
|
protected |
If this is set to true then all output from the solver is suppressed. This is protected member data so that the multigrid preconditioner knows whether or not to restore the stream pointer
Referenced by oomph::MGSolver< DIM >::disable_output(), oomph::MGSolver< DIM >::enable_output(), oomph::MGPreconditioner< DIM >::preconditioner_solve(), oomph::MGPreconditioner< DIM >::setup(), and oomph::MGSolver< DIM >::solve().
|
protected |
Indicates whether or not the V-cycle output should be suppressed. Needs to be protected member data for the multigrid preconditioner to know whether or not to output information with each preconditioning step
Referenced by oomph::MGSolver< DIM >::disable_output(), oomph::MGSolver< DIM >::disable_v_cycle_output(), oomph::MGSolver< DIM >::enable_output(), oomph::MGSolver< DIM >::enable_v_cycle_output(), oomph::MGPreconditioner< DIM >::preconditioner_solve(), and oomph::MGSolver< DIM >::solve().
|
private |
Pointer to counter for V-cycles.
Referenced by oomph::MGSolver< DIM >::iterations(), and oomph::MGSolver< DIM >::solve().
|
private |
Vector to store the solution vectors (X_mg)
Referenced by oomph::MGSolver< DIM >::direct_solve(), oomph::MGSolver< DIM >::post_smooth(), oomph::MGSolver< DIM >::pre_smooth(), and oomph::MGSolver< DIM >::residual_norm().