GEOS
KrylovUtils.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 Total, S.A
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
19 #ifndef GEOS_LINEARALGEBRA_SOLVERS_KRYLOVUTILS_HPP_
20 #define GEOS_LINEARALGEBRA_SOLVERS_KRYLOVUTILS_HPP_
21 
22 #include "codingUtilities/Utilities.hpp"
23 
28 #define GEOS_KRYLOV_BREAKDOWN_IF_ZERO( VAR ) \
29  if( isZero( VAR, 0.0 ) ) \
30  { \
31  if( m_params.logLevel >= 1 ) \
32  { \
33  GEOS_LOG_RANK_0( "Breakdown in " << methodName() << ": " << #VAR << " = " << VAR ); \
34  } \
35  m_result.status = LinearSolverResult::Status::Breakdown; \
36  break; \
37  } \
38 
39 #endif //GEOS_LINEARALGEBRA_SOLVERS_KRYLOVUTILS_HPP_