34 #ifndef NEW_MUMPS_SOLVER_HEADER 35 #define NEW_MUMPS_SOLVER_HEADER 40 #include <oomph-lib-config.h> 50 #include <mumps_c_types.h> 290 oomph_info <<
"Setting up Mumps (exact) preconditioner" 295 if (dist_matrix_pt!=0)
299 Solver.factorise(matrix_pt());
303 std::ostringstream error_message_stream;
305 <<
"NewMumpsPreconditioner can only be applied to matrices derived \n" 306 <<
"DistributableLinearAlgebraObject.\n";
308 OOMPH_CURRENT_FUNCTION,
309 OOMPH_EXCEPTION_LOCATION);
317 Solver.resolve(r, z);
325 Solver.clean_up_memory();
void setup()
Function to set up a preconditioner for the linear system defined by matrix_pt. This function must be...
NewMumpsPreconditioner(const NewMumpsPreconditioner &)
Broken copy constructor.
double Solution_time
Solution time.
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
virtual double linear_solver_solution_time()
Return the time taken to solve the linear system (needs to be overloaded for each linear solver) ...
unsigned Workspace_scaling_factor
void disable_suppress_mumps_info_during_solve()
Don't suppress info being printed to screen during MUMPS solve.
bool Doc_stats
Set to true for MumpsSolver to output statistics (false by default).
void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Function applies Mumps to vector r for (exact) preconditioning, this requires a call to setup(...
void enable_doc_stats()
Enable documentation of statistics.
static bool Suppress_incorrect_rhs_distribution_warning_in_resolve
Static flag that determines whether the warning about incorrect distribution of RHSs will be printed ...
static int Default_workspace_scaling_factor
Default factor for workspace – static so it can be overwritten globally.
void enable_doc_time()
Enable documentation of timings.
void disable_resolve()
Overload disable resolve so that it cleans up memory too.
void initialise_mumps()
Initialise instance of mumps data structure.
MumpsSolver Solver
the Mumps solver emplyed by this preconditioner
void disable_suppress_solve()
Unset the flag so that the system is actually solved again This is the default (obviously) ...
~NewMumpsPreconditioner()
Destructor.
MumpsSolver(const MumpsSolver &dummy)
Broken copy constructor.
void clean_up_memory()
Clean up memory – forward the call to the version in Mumps in its LinearSolver incarnation.
MumpsSolver()
Constructor: Call setup.
double Jacobian_setup_time
Jacobian setup time.
void enable_delete_matrix_data()
Set Delete_matrix_data flag. MumpsSolver needs its own copy of the input matrix, therefore a copy mus...
bool Delete_matrix_data
Delete_matrix_data flag. MumpsSolver needs its own copy of the input matrix, therefore a copy must be...
void backsub(const DoubleVector &rhs, DoubleVector &result)
Do the backsubstitution for mumps solver Note: returns the global result Vector.
DMUMPS_STRUC_C * Mumps_struc_pt
Pointer to MUMPS struct that contains the solver data.
Vector< int > Irn_loc
Vector for row numbers.
bool Mumps_is_initialised
Has mumps been initialised?
void resolve(const DoubleVector &rhs, DoubleVector &result)
Resolve the system defined by the last assembled Jacobian and the specified rhs vector if resolve has...
An interface to allow Mumps to be used as an (exact) Preconditioner.
Describes the distribution of a distributable linear algebra type object. Typically this is a contain...
Base class for any linear algebra object that is distributable. Just contains storage for the LinearA...
void disable_delete_matrix_data()
Unset Delete_matrix_data flag. MumpsSolver needs its own copy of the input matrix, therefore a copy must be made if any matrix used with this solver is to be preserved. If the input matrix can be deleted the flag can be set to true to reduce the amount of memory required, and the matrix data will be wiped using its clean_up_memory() function. Default value is false.
void factorise(DoubleMatrixBase *const &matrix_pt)
Do the factorisation stage Note: if Delete_matrix_data is true the function matrix_pt->clean_up_memor...
bool Suppress_mumps_info_during_solve
Boolean to suppress info being printed to screen during MUMPS solve.
bool Suppress_warning_about_MPI_COMM_WORLD
Boolean to suppress warning about communicator not equal to MPI_COMM_WORLD.
NewMumpsPreconditioner()
Constructor.
void clean_up_memory()
Clean up the memory allocated by the mumps solver.
virtual void disable_resolve()
Disable resolve (i.e. store matrix and/or LU decomposition, say) This function simply resets an inter...
~MumpsSolver()
Destructor: Cleanup.
double jacobian_setup_time()
Returns the time taken to assemble the Jacobian matrix and residual vector.
Preconditioner base class. Gives an interface to call all other preconditioners through and stores th...
void solve(Problem *const &problem_pt, DoubleVector &result)
Solver: Takes pointer to problem and returns the results Vector which contains the solution of the li...
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
void enable_suppress_solve()
Set the flag to avoid solution of the system, so just assemble the Jacobian and the rhs...
void disable_suppress_warning_about_MPI_COMM_WORLD()
Don't suppress warning about communicator not equal to MPI_COMM_WORLD.
void operator=(const MumpsSolver &)
Broken assignment operator.
void disable_doc_stats()
Disable documentation of statistics.
void build_distribution(const LinearAlgebraDistribution *const dist_pt)
setup the distribution of this distributable linear algebra object
void enable_suppress_warning_about_MPI_COMM_WORLD()
Set boolean to suppress warning about communicator not equal to MPI_COMM_WORLD.
A vector in the mathematical sense, initially developed for linear algebra type applications. If MPI then this vector can be distributed - its distribution is described by the LinearAlgebraDistribution object at Distribution_pt. Data is stored in a C-style pointer vector (double*)
Abstract base class for matrices of doubles – adds abstract interfaces for solving, LU decomposition and multiplication by vectors.
void enable_suppress_mumps_info_during_solve()
Set boolean to suppress info being printed to screen during MUMPS solve.
LinearAlgebraDistribution * distribution_pt() const
access to the LinearAlgebraDistribution
bool Suppress_solve
Suppress solve?
void operator=(const NewMumpsPreconditioner &)
Broken assignment operator.
void disable_doc_time()
Disable the documentation of timings.
void shutdown_mumps()
Shutdown mumps.