Commit 38b2a64a authored by Kirill Terekhov's avatar Kirill Terekhov

few fixes in ecl grid reader

parent 71cb3b50
Pipeline #197 failed with stages
in 10 minutes and 13 seconds
...@@ -1212,7 +1212,9 @@ namespace INMOST ...@@ -1212,7 +1212,9 @@ namespace INMOST
{ {
if (file_options[k].first == "ECL_SPLIT_GLUED") if (file_options[k].first == "ECL_SPLIT_GLUED")
{ {
if (file_options[k].second == "TRUE") if (file_options[k].second == "ALL")
perform_splitting = 2;
else if (file_options[k].second == "TRUE")
perform_splitting = 1; perform_splitting = 1;
else else
perform_splitting = 0; perform_splitting = 0;
...@@ -4369,56 +4371,57 @@ namespace INMOST ...@@ -4369,56 +4371,57 @@ namespace INMOST
//TODO4: crack up the mesh along degenerate active cells //TODO4: crack up the mesh along degenerate active cells
//compute cell centers that lay inside //compute cell centers that lay inside
if (false) //TODO16 if (true) //TODO16
{ {
if( true )
if (verbosity > 0)
{
ttt = Timer();
std::cout << "Compute geometric data for cell centers" << std::endl;
}
GeomParam table;
table[CENTROID] = CELL;
PrepareGeometricData(table);
if (verbosity)
std::cout << "Finished computing geometric data time " << Timer() - ttt << std::endl;
//overwrite centroid info
if (verbosity > 0)
{ {
ttt = Timer(); if (verbosity > 0)
std::cout << "Started rewriting cell centers" << std::endl; {
} ttt = Timer();
std::cout << "Compute geometric data for cell centers" << std::endl;
}
GeomParam table;
table[CENTROID] = CELL;
PrepareGeometricData(table);
if (verbosity)
std::cout << "Finished computing geometric data time " << Timer() - ttt << std::endl;
//overwrite centroid info
if (verbosity > 0)
{
ttt = Timer();
std::cout << "Started rewriting cell centers" << std::endl;
}
#if defined(USE_OMP) #if defined(USE_OMP)
#pragma omp parallel for #pragma omp parallel for
#endif #endif
for (integer it = 0; it < CellLastLocalID(); ++it) if (isValidCell(it)) for (integer it = 0; it < CellLastLocalID(); ++it) if (isValidCell(it))
{
Cell c = CellByLocalID(it);
integer bnum = c->Integer(cell_number) - 1;
if (bnum >= 0) //maybe this cell existed before
{ {
real ctop[3] = { 0.0, 0.0, 0.0 }, cbottom[3] = { 0.0, 0.0, 0.0 }; Cell c = CellByLocalID(it);
for (int l = 0; l < 4; ++l) integer bnum = c->Integer(cell_number) - 1;
if (bnum >= 0) //maybe this cell existed before
{ {
real_array bc = Node(this, block_nodes[bnum * 8 + l + 0]).Coords(); real ctop[3] = { 0.0, 0.0, 0.0 }, cbottom[3] = { 0.0, 0.0, 0.0 };
real_array tc = Node(this, block_nodes[bnum * 8 + l + 4]).Coords(); for (int l = 0; l < 4; ++l)
cbottom[0] += bc[0] * 0.25; {
cbottom[1] += bc[1] * 0.25; real_array bc = Node(this, block_nodes[bnum * 8 + l + 0]).Coords();
cbottom[2] += bc[2] * 0.25; real_array tc = Node(this, block_nodes[bnum * 8 + l + 4]).Coords();
ctop[0] += tc[0] * 0.25; cbottom[0] += bc[0] * 0.25;
ctop[1] += tc[1] * 0.25; cbottom[1] += bc[1] * 0.25;
ctop[2] += tc[2] * 0.25; cbottom[2] += bc[2] * 0.25;
} ctop[0] += tc[0] * 0.25;
real_array cnt = c->RealArray(centroid_tag); ctop[1] += tc[1] * 0.25;
cnt[0] = (cbottom[0] + ctop[0])*0.5; ctop[2] += tc[2] * 0.25;
cnt[1] = (cbottom[1] + ctop[1])*0.5; }
cnt[2] = (cbottom[2] + ctop[2])*0.5; real_array cnt = c->RealArray(centroid_tag);
cnt[0] = (cbottom[0] + ctop[0])*0.5;
cnt[1] = (cbottom[1] + ctop[1])*0.5;
cnt[2] = (cbottom[2] + ctop[2])*0.5;
}
} }
if (verbosity)
std::cout << "Finished rewriting cell centers time " << Timer() - ttt << std::endl;
} }
if (verbosity)
std::cout << "Finished rewriting cell centers time " << Timer() - ttt << std::endl;
if (verbosity > 0) if (verbosity > 0)
{ {
...@@ -4677,8 +4680,34 @@ namespace INMOST ...@@ -4677,8 +4680,34 @@ namespace INMOST
K(0, 0) = perm[3 * q + 0]; K(0, 0) = perm[3 * q + 0];
K(1, 1) = perm[3 * q + 1]; K(1, 1) = perm[3 * q + 1];
K(2, 2) = perm[3 * q + 2]; K(2, 2) = perm[3 * q + 2];
//double norm1 = K.FrobeniusNorm();
K = V*Sinv*U.Transpose()*K*U*Sinv*V.Transpose(); K = V*Sinv*U.Transpose()*K*U*Sinv*V.Transpose();
//double norm2 = K.FrobeniusNorm();
/*
if( norm2/norm1 > 100 )
{
std::cout << "#####" << std::endl;
std::cout << "norm1 " << norm1 << " norm2 " << norm2 << std::endl;
std::cout << "K:" << std::endl;
K.Print();
std::cout << "axis: " << std::endl;
block_axis(c, 3, 3).Print();
std::cout << "Sinv: " << std::endl;
Sinv.Print();
std::cout << "U: " << std::endl;
U.Print();
std::cout << "V: " << std::endl;
V.Print();
K.SVD(U,S,V);
std::cout << "KS:" << std::endl;
S.Print();
std::cout << "kx ky kz: " << std::endl;
std::cout << perm[3*q+0] << " " << perm[3*q+1] << " " << perm[3*q+2] << std::endl;
}
*/
arr_perm[0] = K(0, 0); arr_perm[0] = K(0, 0);
arr_perm[1] = K(0, 1); arr_perm[1] = K(0, 1);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "../Misc/utils.h" #include "../Misc/utils.h"
#include "solver_prototypes.hpp" #include "solver_prototypes.hpp"
#include "solver_bcgsl.hpp" #include "solver_bcgsl.hpp"
#define KSOLVER BCGSL_solver #define KSOLVER BCGS_solver
namespace INMOST { namespace INMOST {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment