mirror of
https://github.com/OPM/opm-upscaling.git
synced 2026-08-27 05:27:10 -05:00
Replace the ASSERT and ASSERT2 macros by assert
This commit is contained in:
+1
-1
@@ -121,7 +121,7 @@ int main(int argc, char** argv)
|
||||
}
|
||||
int num_rocks = -1;
|
||||
rl >> num_rocks;
|
||||
ASSERT(num_rocks >= 1);
|
||||
assert(num_rocks >= 1);
|
||||
rocksatendpoints_.resize(num_rocks);
|
||||
jfuncendpoints_.resize(num_rocks);
|
||||
// Loop through rock files defined in rock_list and store the data we need
|
||||
|
||||
@@ -130,7 +130,7 @@ void usageandexit() {
|
||||
// Assumes that permtensor_t use C ordering.
|
||||
double getVoigtValue(const SinglePhaseUpscaler::permtensor_t& K, int voigt_idx)
|
||||
{
|
||||
ASSERT(K.numRows() == 3 && K.numCols() == 3);
|
||||
assert(K.numRows() == 3 && K.numCols() == 3);
|
||||
switch (voigt_idx) {
|
||||
case 0: return K.data()[0];
|
||||
case 1: return K.data()[4];
|
||||
@@ -151,7 +151,7 @@ double getVoigtValue(const SinglePhaseUpscaler::permtensor_t& K, int voigt_idx)
|
||||
// Assumes that permtensor_t use C ordering.
|
||||
void setVoigtValue(SinglePhaseUpscaler::permtensor_t& K, int voigt_idx, double val)
|
||||
{
|
||||
ASSERT(K.numRows() == 3 && K.numCols() == 3);
|
||||
assert(K.numRows() == 3 && K.numCols() == 3);
|
||||
switch (voigt_idx) {
|
||||
case 0: K.data()[0] = val; break;
|
||||
case 1: K.data()[4] = val; break;
|
||||
|
||||
@@ -156,7 +156,7 @@ void usageandexit() {
|
||||
// Assumes that permtensor_t use C ordering.
|
||||
double getVoigtValue(const SinglePhaseUpscaler::permtensor_t& K, int voigt_idx)
|
||||
{
|
||||
ASSERT(K.numRows() == 3 && K.numCols() == 3);
|
||||
assert(K.numRows() == 3 && K.numCols() == 3);
|
||||
switch (voigt_idx) {
|
||||
case 0: return K.data()[0];
|
||||
case 1: return K.data()[4];
|
||||
@@ -177,7 +177,7 @@ double getVoigtValue(const SinglePhaseUpscaler::permtensor_t& K, int voigt_idx)
|
||||
// Assumes that permtensor_t use C ordering.
|
||||
void setVoigtValue(SinglePhaseUpscaler::permtensor_t& K, int voigt_idx, double val)
|
||||
{
|
||||
ASSERT(K.numRows() == 3 && K.numCols() == 3);
|
||||
assert(K.numRows() == 3 && K.numCols() == 3);
|
||||
switch (voigt_idx) {
|
||||
case 0: K.data()[0] = val; break;
|
||||
case 1: K.data()[4] = val; break;
|
||||
|
||||
@@ -147,7 +147,7 @@ void usageandexit() {
|
||||
// Assumes that permtensor_t use C ordering.
|
||||
double getVoigtValue(const SinglePhaseUpscaler::permtensor_t& K, int voigt_idx)
|
||||
{
|
||||
ASSERT(K.numRows() == 3 && K.numCols() == 3);
|
||||
assert(K.numRows() == 3 && K.numCols() == 3);
|
||||
switch (voigt_idx) {
|
||||
case 0: return K.data()[0];
|
||||
case 1: return K.data()[4];
|
||||
@@ -168,7 +168,7 @@ double getVoigtValue(const SinglePhaseUpscaler::permtensor_t& K, int voigt_idx)
|
||||
// Assumes that permtensor_t use C ordering.
|
||||
void setVoigtValue(SinglePhaseUpscaler::permtensor_t& K, int voigt_idx, double val)
|
||||
{
|
||||
ASSERT(K.numRows() == 3 && K.numCols() == 3);
|
||||
assert(K.numRows() == 3 && K.numCols() == 3);
|
||||
switch (voigt_idx) {
|
||||
case 0: K.data()[0] = val; break;
|
||||
case 1: K.data()[4] = val; break;
|
||||
|
||||
@@ -79,7 +79,7 @@ void usageandexit() {
|
||||
// Assumes that permtensor_t use C ordering.
|
||||
double getVoigtValue(const SinglePhaseUpscaler::permtensor_t& K, int voigt_idx)
|
||||
{
|
||||
ASSERT(K.numRows() == 3 && K.numCols() == 3);
|
||||
assert(K.numRows() == 3 && K.numCols() == 3);
|
||||
switch (voigt_idx) {
|
||||
case 0: return K.data()[0];
|
||||
case 1: return K.data()[4];
|
||||
@@ -107,7 +107,7 @@ std::vector<std::vector<double> > getExtremeSats(std::string rock_list, std::vec
|
||||
}
|
||||
int num_rocks = -1;
|
||||
rl >> num_rocks;
|
||||
ASSERT(num_rocks >= 1);
|
||||
assert(num_rocks >= 1);
|
||||
std::vector<std::vector<double> > rocksatendp;
|
||||
rocksatendp.resize(num_rocks);
|
||||
for (int i = 0; i < num_rocks; ++i) {
|
||||
|
||||
@@ -447,7 +447,7 @@ namespace Opm
|
||||
// This is an inflow face.
|
||||
double frac_flow = 0.0;
|
||||
if (sc.isPeriodic()) {
|
||||
ASSERT(sc.saturationDifference() == 0.0);
|
||||
assert(sc.saturationDifference() == 0.0);
|
||||
int partner_bid = this->bcond_.getPeriodicPartner(f->boundaryId());
|
||||
std::map<int, double>::const_iterator it = frac_flow_by_bid.find(partner_bid);
|
||||
if (it == frac_flow_by_bid.end()) {
|
||||
@@ -456,7 +456,7 @@ namespace Opm
|
||||
}
|
||||
frac_flow = it->second;
|
||||
} else {
|
||||
ASSERT(sc.isDirichlet());
|
||||
assert(sc.isDirichlet());
|
||||
frac_flow = this->res_prop_.fractionalFlow(c->index(), sc.saturation());
|
||||
}
|
||||
cell_inflows_w[c->index()] += flux*frac_flow;
|
||||
|
||||
@@ -347,7 +347,7 @@ namespace Opm
|
||||
// This is an inflow face.
|
||||
double frac_flow = 0.0;
|
||||
if (sc.isPeriodic()) {
|
||||
ASSERT(sc.saturationDifference() == 0.0);
|
||||
assert(sc.saturationDifference() == 0.0);
|
||||
int partner_bid = this->bcond_.getPeriodicPartner(f->boundaryId());
|
||||
std::map<int, double>::const_iterator it = frac_flow_by_bid.find(partner_bid);
|
||||
if (it == frac_flow_by_bid.end()) {
|
||||
@@ -356,7 +356,7 @@ namespace Opm
|
||||
}
|
||||
frac_flow = it->second;
|
||||
} else {
|
||||
ASSERT(sc.isDirichlet());
|
||||
assert(sc.isDirichlet());
|
||||
frac_flow = this->res_prop_.fractionalFlow(c->index(), sc.saturation());
|
||||
}
|
||||
cell_inflows_w[c->index()] += flux*frac_flow;
|
||||
|
||||
@@ -315,7 +315,7 @@ namespace Opm
|
||||
side1_flux += flux*norm_comp;
|
||||
side1_area += area;
|
||||
} else {
|
||||
ASSERT(canon_bid - 1 == 2*flow_dir + 1);
|
||||
assert(canon_bid - 1 == 2*flow_dir + 1);
|
||||
++num_side2;
|
||||
if (flow_dir == pdrop_dir && flux < 0.0) {
|
||||
#ifdef VERBOSE
|
||||
|
||||
@@ -97,8 +97,8 @@ Matrix readResultFile(const char* filename, int rows, int cols) {
|
||||
/// Absolute tolerance
|
||||
bool matrixAlmostEqual(Matrix refSoln, Matrix newSoln, double tol) {
|
||||
|
||||
ASSERT(refSoln.numRows() == newSoln.numRows());
|
||||
ASSERT(refSoln.numCols() == newSoln.numCols());
|
||||
assert(refSoln.numRows() == newSoln.numRows());
|
||||
assert(refSoln.numCols() == newSoln.numCols());
|
||||
// Test element by element
|
||||
for (int row=0; row<refSoln.numRows(); ++row) {
|
||||
for (int col=0; col<refSoln.numCols(); ++col) {
|
||||
|
||||
Reference in New Issue
Block a user