Skip to content

Commit 6c8665e

Browse files
committed
fix issue with cppcheck and macro
1 parent e65443d commit 6c8665e

File tree

4 files changed

+65
-4
lines changed

4 files changed

+65
-4
lines changed

src/common/macros.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,6 @@
6161
__pragma(warning(pop))
6262
#else
6363
#define HPCREACT_NO_MISSING_BRACES( ... ) __VA_ARGS__ // No-op for unknown compilers
64+
#define HPCREACT_NO_MISSING_BRACES_OPEN
65+
#define HPCREACT_NO_MISSING_BRACES_CLOSE
6466
#endif

src/common/symmetricMatrix.hpp

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,69 @@
11
#pragma once
22

3+
/**
4+
* @file
5+
* @brief This file contains the definition of a symmetric matrix.
6+
* It is used to store the symmetric part of a matrix in a
7+
* compact way.
8+
*/
9+
10+
/**
11+
* @brief A symmetric matrix is a matrix that is equal to its transpose.
12+
* This class stores the symmetric part of a matrix in a compact way.
13+
* @tparam T The type of the elements of the matrix.
14+
* @tparam INDEX_TYPE The type of the indices of the matrix.
15+
* @tparam N The size of the matrix.
16+
* @details
17+
* The matrix is stored in a 1D array, where the elements are
18+
* stored in a compact way.
19+
*
20+
* The linear index is calculated using
21+
* the formula (i*(i+1))/2 + j, where i and j are the indices of
22+
* the matrix. This corrosponds to filling the lower triangular
23+
* part of the matrix row by row. So each row i has i+1 elements.
24+
*
25+
* The size of the matrix is calculated using the
26+
* formula (N*(N+1))/2, where N is the size of the matrix.
27+
*/
328
template< typename T, typename INDEX_TYPE, int N >
429
struct symmetricMatrix
530
{
31+
/**
32+
* @brief the storage size of the matrix
33+
*/
634
static constexpr INDEX_TYPE size() { return ( N*(N+1) ) / 2; }
735

8-
static inline INDEX_TYPE linearIndex( INDEX_TYPE const i, INDEX_TYPE const j )
36+
/**
37+
* @brief calculates the linear index of the element at (i,j)
38+
*/
39+
static inline INDEX_TYPE linearIndex( INDEX_TYPE const i, INDEX_TYPE const j ) const
940
{
1041
return (( i*(i+1) ) >> 1) + j;
1142
}
1243

44+
/**
45+
* @brief non-const access operator
46+
* @param i the row index
47+
* @param j the column index
48+
* @return reference to the element at (i,j)
49+
*/
1350
inline T & operator()( INDEX_TYPE const i, INDEX_TYPE const j )
1451
{
1552
return m_data[linearIndex( i, j )];
1653
}
1754

55+
/**
56+
* @brief const access operator
57+
* @param i the row index
58+
* @param j the column index
59+
* @return reference to the element at (i,j)
60+
*/
1861
inline T const & operator()( INDEX_TYPE const i, INDEX_TYPE const j ) const
1962
{
2063
return m_data[linearIndex( i, j )];
2164
}
2265

66+
/// Matrix is stored in a 1D c-array.
2367
T m_data[ size() ];
2468

2569
};

src/docs/doxygen/Doxyfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ EXCLUDE_SYMLINKS = NO
10401040
# Note that the wildcards are matched against the file with absolute path, so to
10411041
# exclude all test directories for example use the pattern */test/*
10421042

1043-
EXCLUDE_PATTERNS = */cmake/* **/unitTests/*.cpp
1043+
EXCLUDE_PATTERNS = */cmake/* **/unitTests/*.cpp */Parameters.hpp
10441044

10451045
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
10461046
# (namespaces, classes, functions, etc.) that should be excluded from the

src/reactions/bulkGeneric/EquilibriumReactions.hpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,29 @@ namespace hpcReact
1313
namespace bulkGeneric
1414
{
1515

16+
/**
17+
* @brief This class implements components required to calculate equilibrium
18+
* reactions for a given set of species. The class also proovides
19+
* device callable methods to enforce equilibrium pointwise and also
20+
* provides methods to launch batch processing of material points.
21+
* @tparam REAL_TYPE The type of the real numbers used in the class.
22+
* @tparam INT_TYPE The type of the integers used in the class.
23+
* @tparam INDEX_TYPE The type of the indices used in the class.
24+
*/
1625
template< typename REAL_TYPE,
1726
typename INT_TYPE,
1827
typename INDEX_TYPE >
1928
class EquilibriumReactions
2029
{
2130
public:
31+
/// alias for type of the real numbers used in the class.
2232
using RealType = REAL_TYPE;
33+
34+
/// alias for type of the integers used in the class.
2335
using IntType = INT_TYPE;
36+
37+
/// alias for type of the indices used in the class.
2438
using IndexType = INDEX_TYPE;
25-
// constexpr static int formulation = FORMULATION;
2639

2740
template< typename PARAMS_DATA,
2841
typename ARRAY_1D,
@@ -37,7 +50,9 @@ class EquilibriumReactions
3750
ARRAY_1D & residual,
3851
ARRAY_2D & jacobian );
3952

40-
53+
/**
54+
* @brief This method enforces equilibrium for a given set of species using
55+
* reaction extents.
4156
template< typename PARAMS_DATA,
4257
typename ARRAY_1D,
4358
typename ARRAY_1D_TO_CONST >

0 commit comments

Comments
 (0)