GEOSX
KrylovUtils.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 Total, S.A
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
18 #ifndef GEOSX_LINEARALGEBRA_SOLVERS_KRYLOVUTILS_HPP_
19 #define GEOSX_LINEARALGEBRA_SOLVERS_KRYLOVUTILS_HPP_
20 
21 #include "codingUtilities/Utilities.hpp"
22 
24 #define GEOSX_KRYLOV_MIN_DIV ::LvArray::NumericLimits< real64 >::epsilon
25 
26 #ifndef GEOSX_KRYLOV_BREAKDOWN_IF_ZERO
27 
31 #define GEOSX_KRYLOV_BREAKDOWN_IF_ZERO( VAR ) \
32  do { \
33  if( isZero( VAR, GEOSX_KRYLOV_MIN_DIV ) ) \
34  { \
35  GEOSX_LOG_LEVEL_RANK_0( 1, "Breakdown in " << methodName() << ": " << #VAR << " = " << VAR ); \
36  m_result.status = LinearSolverResult::Status::Breakdown; \
37  break; \
38  } \
39  } while( false )
40 #endif
41 
42 #endif //GEOSX_LINEARALGEBRA_SOLVERS_KRYLOVUTILS_HPP_