Skip to content

Commit

Permalink
Debug semeio ots error
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Jul 11, 2024
1 parent 7da2029 commit fab5a80
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions lib/resdata/rd_subsidence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define _USE_MATH_DEFINES // for C WINDOWS
#include <math.h>
#include <stdbool.h>
#include <iostream>

#include <ert/util/hash.hpp>
#include <ert/util/util.h>
Expand Down Expand Up @@ -170,6 +171,14 @@ static double rd_subsidence_survey_eval_geertsma(
const rd_subsidence_survey_type *monitor_survey, rd_region_type *region,
double utm_x, double utm_y, double depth, double youngs_modulus,
double poisson_ratio, double seabed) {
std::cout << "Debug base_survey: " << base_survey << std::endl;
std::cout << "Debug monitor_survey: " << monitor_survey << std::endl;
std::cout << "Debug region: " << region << std::endl;
std::cout << "Debug utm_x: " << utm_x << std::endl;
std::cout << "Debug utm_y: " << utm_y << std::endl;
std::cout << "Debug depth: " << depth << std::endl;
std::cout << "Debug youngs_modulus: " << youngs_modulus << std::endl;


const rd::rd_grid_cache &grid_cache = *(base_survey->grid_cache);
const auto &cell_volume = grid_cache.volume();
Expand All @@ -179,6 +188,18 @@ static double rd_subsidence_survey_eval_geertsma(
double *weight = (double *)util_calloc(size, sizeof *weight);
double deltaz;

std::cout << "Debug cell_volume: " << &cell_volume << std::endl;
std::cout << "Debug scale_factor: " << scale_factor << std::endl;
std::cout << "Debug size: " << size << std::endl;

if (monitor_survey) {
std::cout << "Yes for monitor survey" << std::endl;
}

if (region) {
std::cout << "Yes for region" << std::endl;
}

for (int index = 0; index < size; index++) {
if (monitor_survey) {
weight[index] = scale_factor * cell_volume[index] *
Expand All @@ -190,10 +211,25 @@ static double rd_subsidence_survey_eval_geertsma(
}
}

std::cout << "DEBUG weight values (showing first 5 and last 5 elements):" << std::endl;
int num_elements_to_show = 5; // Number of elements to show from the start and end
for (int index = 0; index < std::min(size, num_elements_to_show); index++) {
std::cout << "weight[" << index << "]: " << weight[index] << std::endl;
std::cout << "base survey pressure" << index << " : " << base_survey->pressure[index] << std::endl;
}
if (size > 2 * num_elements_to_show) {
std::cout << "... (skipping " << size - 2 * num_elements_to_show << " elements) ..." << std::endl;
}
for (int index = std::max(num_elements_to_show, size - num_elements_to_show); index < size; index++) {
std::cout << "weight[" << index << "]: " << weight[index] << std::endl;
}

deltaz = rd_grav_common_eval_geertsma(
grid_cache, region, base_survey->aquifer_cell, weight, utm_x, utm_y,
depth, poisson_ratio, seabed);

std::cout << "DEBUG deltaz: " << deltaz << std::endl;

free(weight);
return deltaz;
}
Expand Down

0 comments on commit fab5a80

Please sign in to comment.