mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
fix some clang 3.3 warnings
The most severe change probably is the removal of the AutoDiff debugging helper functions which were useful from within a debugger but unfortunately had to rely on a presumed linker bug in order not to be removed in the final binary. Also, some private attributes were unused. These have been removed and the constructors of their respective classes have been adapted. Once their intended functionality is actually implemented, they should be brought back on an as-needed basis. Thanks to @bska for the review!
This commit is contained in:
committed by
Andreas Lauser
parent
ecd2fb8382
commit
1c62934034
@@ -25,6 +25,7 @@
|
||||
#include <opm/core/utility/ErrorMacros.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
@@ -116,86 +117,6 @@ struct HelperOps
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
// -------------------- debugger output helpers --------------------
|
||||
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
|
||||
namespace {
|
||||
void
|
||||
printSparseMatrix(const Eigen::SparseMatrix<double>& A,
|
||||
std::FILE* fp)
|
||||
{
|
||||
typedef Eigen::SparseMatrix<double>::Index Index;
|
||||
|
||||
const Index osize = A.outerSize();
|
||||
|
||||
for (Index k = 0; k < osize; ++k) {
|
||||
for (Eigen::SparseMatrix<double>::InnerIterator
|
||||
i(A, k); i ; ++i) {
|
||||
std::fprintf(fp, "%lu %lu %26.18e\n",
|
||||
static_cast<unsigned long>(i.row() + 1),
|
||||
static_cast<unsigned long>(i.col() + 1),
|
||||
i.value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
printSparseMatrix(const Eigen::SparseMatrix<double>& A ,
|
||||
const char* const fn)
|
||||
{
|
||||
std::FILE* fp;
|
||||
|
||||
fp = std::fopen(fn, "w");
|
||||
if (fp != 0) {
|
||||
printSparseMatrix(A, fp);
|
||||
}
|
||||
|
||||
std::fclose(fp);
|
||||
}
|
||||
|
||||
void
|
||||
writeAsMATLAB(const std::vector< Eigen::SparseMatrix<double> >& vA,
|
||||
std::FILE* fp ,
|
||||
const char* const vname)
|
||||
{
|
||||
const int n = static_cast<int>(vA.size());
|
||||
|
||||
fprintf(fp, "%s = cell([1, %d]);\n\n", vname, n);
|
||||
|
||||
for (int i = 0; i < n; ++i) {
|
||||
fprintf(fp, "%s{%d} = spconvert([\n", vname, i + 1);
|
||||
printSparseMatrix(vA[i], fp);
|
||||
const int rows = vA[i].rows();
|
||||
const int cols = vA[i].cols();
|
||||
fprintf(fp, "%d %d 0.0]);\n\n", rows, cols);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
writeAsMATLAB(const std::vector< Eigen::SparseMatrix<double> >& vA,
|
||||
const char* const fn ,
|
||||
const char* const vname)
|
||||
{
|
||||
std::FILE* fp;
|
||||
|
||||
fp = std::fopen(fn, "w");
|
||||
if (fp != 0) {
|
||||
writeAsMATLAB(vA, fp, vname);
|
||||
}
|
||||
|
||||
std::fclose(fp);
|
||||
}
|
||||
} // anonymous namespace
|
||||
#endif // !defined(NDEBUG)
|
||||
|
||||
|
||||
|
||||
// -------------------- upwinding helper class --------------------
|
||||
|
||||
|
||||
@@ -587,7 +508,6 @@ inline Eigen::ArrayXd sign (const Eigen::ArrayXd& x)
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
#endif // OPM_AUTODIFFHELPERS_HEADER_INCLUDED
|
||||
|
||||
Reference in New Issue
Block a user