70 : Suppress_solve(
false),
72 Suppress_warning_about_MPI_COMM_WORLD(
false),
73 Suppress_mumps_info_during_solve(
false),
74 Mumps_is_initialised(
false),
75 Workspace_scaling_factor(Default_workspace_scaling_factor),
76 Delete_matrix_data(
false),
224 int n = matrix_pt->
nrow();
225 int m = matrix_pt->
ncol();
230 <<
"N, M " <<
n <<
" " <<
m << std::endl;
244 <<
"Warning: Mumps wrapper assumes that communicator is "
246 <<
" which is not the case, so mumps may die...\n"
247 <<
" If it does initialise oomph-lib's mpi without "
249 <<
" the communicator to be a duplicate of MPI_COMM_WORLD\n"
250 <<
" (done via an optional boolean to "
251 "MPI_Helpers::init(...)\n\n"
252 <<
" (You can suppress this warning by recompiling without\n"
253 <<
" paranoia or calling \n\n"
255 "MumpsSolver::enable_suppress_warning_about_MPI_COMM_WORLD()\n\n"
258 "MumpsSolver::factorise()",
298 "To apply MumpsSolver to a CRDoubleMatrix - it must be built",
311 const int n = matrix_pt->
nrow();
337 oomph_info <<
"Assuming Jacobian matrix is symmetric "
338 <<
"(passing MUMPS the upper triangular part)"
377 oomph_info <<
"Time for copying matrix into MumpsSolver data "
410 <<
"Time for mumps analysis stage in MumpsSolver : "
413 <<
"\n(Ordering generated ";
465 oomph_info <<
"Estimated max. workspace in MB: "
483 oomph_info <<
"Attempting factorisation with workspace estimate: "
485 oomph_info <<
"corresponding to Workspace_scaling_factor = "
498 oomph_info <<
"Error during mumps factorisation!\n";
528 oomph_info <<
"Increasing workspace_scaling_factor to "
554 oomph_info <<
"Time for actual mumps factorisation in MumpsSolver"
566 <<
" distributed CRDoubleMatrix\n";
577 <<
"distributed CRDoubleMatrix. \n";
588 oomph_info <<
"Time for MumpsSolver factorisation : "
617 <<
"Warning: Mumps wrapper assumes that communicator is "
619 <<
" which is not the case, so mumps may die...\n"
620 <<
" If it does initialise oomph-lib's mpi without "
622 <<
" the communicator to be a duplicate of MPI_COMM_WORLD\n"
623 <<
" (done via an optional boolean to "
624 "MPI_Helpers::init(...)\n\n"
625 <<
" (You can suppress this warning by recompiling without\n"
626 <<
" paranoia or calling \n\n"
628 "MumpsSolver::enable_suppress_warning_about_MPI_COMM_WORLD()\n\n"
631 "MumpsSolver::backsub()",
648 if (!
rhs.distribution_pt()->built())
662 if (!(*
rhs.distribution_pt() == *
this->distribution_pt()))
667 warning_stream <<
"The distribution of rhs vector does not match that "
670 <<
"The rhs may have to be redistributed but we're not doing this "
672 <<
"I'm no longer convinced it's necessary. Keep an eye on this...\n";
674 <<
"To remove this warning you can either:\n"
675 <<
" i) Ensure that the rhs vector has the correct distribution\n"
676 <<
" before calling the resolve() function\n"
677 <<
"or ii) Set the flag \n"
678 <<
" MumpsSolver::Suppress_incorrect_rhs_distribution_warning_in_"
680 <<
" to be true\n\n";
683 "MumpsSolver::resolve()",
696 if (
result.distribution_built())
698 if (!(*
result.distribution_pt() == *
rhs.distribution_pt()))
702 <<
"The result vector distribution has been setup; it must have the "
703 <<
"same distribution as the rhs vector.";
746 for (
unsigned j = 0;
j <
n;
j++)
778 oomph_info <<
"Time for MumpsSolver backsub : "
821 <<
"Warning: Mumps wrapper assumes that communicator is "
823 <<
" which is not the case, so mumps may die...\n"
824 <<
" If it does initialise oomph-lib's mpi without "
826 <<
" the communicator to be a duplicate of MPI_COMM_WORLD\n"
827 <<
" (done via an optional boolean to "
828 "MPI_Helpers::init(...)\n\n"
829 <<
" (You can suppress this warning by recompiling without\n"
830 <<
" paranoia or calling \n\n"
832 "MumpsSolver::enable_suppress_warning_about_MPI_COMM_WORLD()\n\n"
835 "MumpsSolver::solve()",
847 if (!
rhs.distribution_pt()->built())
857 if (matrix_pt->
nrow() != matrix_pt->
ncol())
867 if (matrix_pt->
nrow() !=
rhs.nrow())
871 <<
"The matrix and the rhs vector must have the same number of rows.";
888 <<
"The matrix matrix_pt must have the same distribution as the "
899 if (
rhs.distribution_pt()->distributed())
903 <<
"The matrix (matrix_pt) is not distributable and therefore the rhs"
904 <<
" vector must not be distributed";
914 if (!(*
result.distribution_pt() == *
rhs.distribution_pt()))
918 <<
"The result vector distribution has been setup; it must have the "
919 <<
"same distribution as the rhs vector.";
988 <<
"Warning: Mumps wrapper assumes that communicator is "
990 <<
" which is not the case, so mumps may die...\n"
991 <<
" If it does initialise oomph-lib's mpi without "
993 <<
" the communicator to be a duplicate of MPI_COMM_WORLD\n"
994 <<
" (done via an optional boolean to "
995 "MPI_Helpers::init(...)\n\n"
996 <<
" (You can suppress this warning by recompiling without\n"
997 <<
" paranoia or calling \n\n"
999 "MumpsSolver::enable_suppress_warning_about_MPI_COMM_WORLD()\n\n"
1002 "MumpsSolver::solve()",
1040 oomph_info <<
"Time to set up CRDoubleMatrix Jacobian : "
1055 (!(*
result.distribution_pt() == *
this->distribution_pt())))
1078 <<
",N=" << problem_pt->
ndof() <<
") : "
1102 <<
"Warning: Mumps wrapper assumes communicator is MPI_COMM_WORLD\n"
1103 <<
" which is not the case, so mumps may die...\n"
1104 <<
" If it does initialise oomph-lib's mpi without "
1106 <<
" the communicator to be a duplicate of MPI_COMM_WORLD\n"
1107 <<
" (done via an optional boolean to "
1108 "MPI_Helpers::init(...)\n\n"
1109 <<
" (You can suppress this warning by recompiling without\n"
1110 <<
" paranoia or calling\n\n"
1112 "MumpsSolver::enable_suppress_warning_about_MPI_COMM_WORLD()\n\n"
1115 "MumpsSolver::resolve()",
A class for compressed row matrices. This is a distributable object.
Base class for any linear algebra object that is distributable. Just contains storage for the LinearA...
unsigned first_row() const
access function for the first row on this processor
LinearAlgebraDistribution * distribution_pt() const
access to the LinearAlgebraDistribution
void build_distribution(const LinearAlgebraDistribution *const dist_pt)
setup the distribution of this distributable linear algebra object
Abstract base class for matrices of doubles – adds abstract interfaces for solving,...
virtual unsigned long ncol() const =0
Return the number of columns of the matrix.
virtual unsigned long nrow() const =0
Return the number of rows of the matrix.
A vector in the mathematical sense, initially developed for linear algebra type applications....
Describes the distribution of a distributable linear algebra type object. Typically this is a contain...
OomphCommunicator * communicator_pt() const
const access to the communicator pointer
void build(const OomphCommunicator *const comm_pt, const unsigned &first_row, const unsigned &nrow_local, const unsigned &nrow=0)
Sets the distribution. Takes first_row, nrow_local and nrow as arguments. If nrow is not provided or ...
unsigned nrow() const
access function to the number of global rows.
bool Doc_time
Boolean flag that indicates whether the time taken.
bool Enable_resolve
Boolean that indicates whether the matrix (or its factors, in the case of direct solver) should be st...
double Jacobian_setup_time
Jacobian setup time.
DMUMPS_STRUC_C * Mumps_struc_pt
Pointer to MUMPS struct that contains the solver data.
~MumpsSolver()
Destructor: Cleanup.
unsigned Jacobian_ordering_flag
stores an integer from the public enum which specifies which package (PORD, Metis or SCOTCH) is used ...
bool Mumps_is_initialised
Has mumps been initialised?
bool Suppress_warning_about_MPI_COMM_WORLD
Boolean to suppress warning about communicator not equal to MPI_COMM_WORLD.
void shutdown_mumps()
Shutdown mumps.
MumpsJacobianOrderingFlags
ordering library to use for serial analysis; magic numbers as defined by MUMPS documentation
double Solution_time
Solution time.
unsigned Workspace_scaling_factor
void resolve(const DoubleVector &rhs, DoubleVector &result)
Resolve the system defined by the last assembled Jacobian and the specified rhs vector if resolve has...
bool Suppress_solve
Suppress solve?
bool Delete_matrix_data
Delete_matrix_data flag. MumpsSolver needs its own copy of the input matrix, therefore a copy must be...
bool Doc_stats
Set to true for MumpsSolver to output statistics (false by default).
void backsub(const DoubleVector &rhs, DoubleVector &result)
Do the backsubstitution for mumps solver Note: returns the global result Vector.
Vector< int > Irn_loc
Vector for row numbers.
static bool Suppress_incorrect_rhs_distribution_warning_in_resolve
Static flag that determines whether the warning about incorrect distribution of RHSs will be printed ...
unsigned Jacobian_symmetry_flag
symmetry of the Jacobian matrix we're solving; takes one of the enum values above
MumpsSolver()
Constructor: Call setup.
bool Suppress_mumps_info_during_solve
Boolean to suppress info being printed to screen during MUMPS solve.
@ Numerically_singular_jacobian
@ Structurally_singular_jacobian
static int Default_workspace_scaling_factor
Default factor for workspace – static so it can be overwritten globally.
void clean_up_memory()
Clean up the memory allocated by the mumps solver.
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 initialise_mumps()
Initialise instance of mumps data structure.
void factorise(DoubleMatrixBase *const &matrix_pt)
Do the factorisation stage Note: if Delete_matrix_data is true the function matrix_pt->clean_up_memor...
MumpsJacobianSymmetryFlags
values of the SYM variable used by the MUMPS solver which dictates the symmetry properties of the Jac...
An OomphLibError object which should be thrown when an run-time error is encountered....
An OomphLibWarning object which should be created as a temporary object to issue a warning....
////////////////////////////////////////////////////////////////// //////////////////////////////////...
unsigned long ndof() const
Return the number of dofs.
OomphCommunicator * communicator_pt()
access function to the oomph-lib communicator
virtual void get_jacobian(DoubleVector &residuals, DenseDoubleMatrix &jacobian)
Return the fully-assembled Jacobian and residuals for the problem Interface for the case when the Jac...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
double timer()
returns the time in seconds after some point in past
std::string convert_secs_to_formatted_string(const double &time_in_sec)
Returns a nicely formatted string from an input time in seconds; the format depends on the size of ti...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...