Commit b0931cb1 authored by GILLES Sebastien's avatar GILLES Sebastien

#1536 Remove MatrixOperations that were half baked and not used (to my knowledge).

parent e69bf7cb
......@@ -475,107 +475,7 @@ namespace MoReFEM
DoReuseMatrix do_reuse_matrix = DoReuseMatrix::no);
/*!
* \brief Wrapper over MatGetOrdering, gets a reordering for a matrix to reduce fill or to improve numerical stability of LU factorization.
*
* \see http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/MatOrderings/MatGetOrdering.html#MatGetOrdering
* for more details.
*
* \param[in] A Matrix to get the ordering.
* \param[in] type Type of the ordering.
* \param[in] rperm Row permutation for the ordering.
* \param[in] cperm Column permutation for the ordering.
* \copydetails doxygen_hide_invoking_file_and_line
*
*/
template<class MatrixT>
std::enable_if_t<std::is_base_of<Internal::Wrappers::Petsc::BaseMatrix, MatrixT>::value, void>
GetOrdering(MatrixT& A,
MatOrderingType type,
IS *rperm,
IS *cperm,
const char* invoking_file, int invoking_line);
/*!
* \brief Wrapper over MatLUFactor, that performs in-place LU factorization of matrix.
*
* \see http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatLUFactor.html#MatLUFactor
* for more details.
*
* \param[in] A Matrix to factor.
* \param[in] row Result of the GetOrdering.
* \param[in] col Result of the GetOrdering.
* \param[in] info Info of LUFactor.
* \copydetails doxygen_hide_invoking_file_and_line
*
*/
template<class MatrixT>
std::enable_if_t<std::is_base_of<Internal::Wrappers::Petsc::BaseMatrix, MatrixT>::value, void>
LUFactor(MatrixT& A,
IS row, IS col,
const MatFactorInfo *info,
const char* invoking_file, int invoking_line);
/*!
* \brief Wrapper over MatMatSolve, solves A X = B, given a factored matrix.
*
* \see http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMatSolve.html
* for more details.
*
* \param[in] A See formula above.
* \param[in] B See formula above.
* \param[in] X See formula above.
* \copydetails doxygen_hide_invoking_file_and_line
*
*/
template
<
class MatrixT,
class MatrixU,
class MatrixV
>
std::enable_if_t
<
std::is_base_of<Internal::Wrappers::Petsc::BaseMatrix, MatrixT>::value
&& std::is_base_of<Internal::Wrappers::Petsc::BaseMatrix, MatrixU>::value
&& std::is_base_of<Internal::Wrappers::Petsc::BaseMatrix, MatrixV>::value,
void
>
MatMatSolve(const MatrixT& A,
const MatrixU& B,
MatrixV& X,
const char* invoking_file, int invoking_line);
/*!
* \brief Wrapper over MatCholeskyFactor, that performs in-place Cholesky factorization of a symmetric matrix.
*
* \see http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCholeskyFactor.html
* for more details.
*
* \attention Not used yet, but might be useful in midterm developments. If finally too unwieldy for our
* purposes it will be removed.
*
* \param[in] mat Matrix to factor.
* \param[in] perm Result of the GetOrdering, row and column permutations.
* \param[in] info Info of CholeskyFactor.
* \copydetails doxygen_hide_invoking_file_and_line
*
*/
template<class MatrixT>
std::enable_if_t<std::is_base_of<Internal::Wrappers::Petsc::BaseMatrix, MatrixT>::value, void>
CholeskyFactor(MatrixT& mat,
IS perm,
const MatFactorInfo *info,
const char* invoking_file, int invoking_line);
} //namespace Petsc
} // namespace Petsc
} // namespace Wrappers
......
......@@ -528,85 +528,7 @@ namespace MoReFEM
}
template<class MatrixT>
std::enable_if_t<std::is_base_of<Internal::Wrappers::Petsc::BaseMatrix, MatrixT>::value, void>
GetOrdering(MatrixT& A,
MatOrderingType type,
IS *rperm,
IS *cperm,
const char* invoking_file, int invoking_line)
{
int error_code = ::MatGetOrdering(A.InternalForReadOnly(),
type,
rperm,
cperm);
if (error_code)
throw ExceptionNS::Exception(error_code, "MatGetOrdering", invoking_file, invoking_line);
}
template<class MatrixT>
std::enable_if_t<std::is_base_of<Internal::Wrappers::Petsc::BaseMatrix, MatrixT>::value, void>
LUFactor(MatrixT& A,
IS row, IS col,
const MatFactorInfo *info,
const char* invoking_file, int invoking_line)
{
int error_code = ::MatLUFactor(A.Internal(),
row,
col,
info);
if (error_code)
throw ExceptionNS::Exception(error_code, "MatLUFactor", invoking_file, invoking_line);
}
template
<
class MatrixT,
class MatrixU,
class MatrixV
>
std::enable_if_t
<
std::is_base_of<Internal::Wrappers::Petsc::BaseMatrix, MatrixT>::value
&& std::is_base_of<Internal::Wrappers::Petsc::BaseMatrix, MatrixU>::value
&& std::is_base_of<Internal::Wrappers::Petsc::BaseMatrix, MatrixV>::value,
void
>
MatMatSolve(const MatrixT& A,
const MatrixU& B,
MatrixV& X,
const char* invoking_file, int invoking_line)
{
int error_code = ::MatMatSolve(A.InternalForReadOnly(),
B.InternalForReadOnly(),
X.Internal());
if (error_code)
throw ExceptionNS::Exception(error_code, "MatMatSolve", invoking_file, invoking_line);
}
template<class MatrixT>
std::enable_if_t<std::is_base_of<Internal::Wrappers::Petsc::BaseMatrix, MatrixT>::value, void>
CholeskyFactor(MatrixT& mat,
IS perm,
const MatFactorInfo *info,
const char* invoking_file, int invoking_line)
{
int error_code = ::MatCholeskyFactor(mat.Internal(),
perm,
info);
if (error_code)
throw ExceptionNS::Exception(error_code, "MatCholeskyFactor", invoking_file, invoking_line);
}
} //namespace Petsc
} // namespace Petsc
} // namespace Wrappers
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment