Added column extraction for a vertically aligned grid
This commit is contained in:
parent
cea5324e4e
commit
e8543adddc
@ -80,12 +80,13 @@ opm/core/pressure/mimetic/mimetic.c \
|
||||
opm/core/pressure/mimetic/hybsys_global.c \
|
||||
opm/core/pressure/mimetic/hybsys.c \
|
||||
opm/core/transport/spu_explicit.c \
|
||||
opm/core/transport/spu_implicit.c \
|
||||
opm/core/transport/transport_source.c \
|
||||
opm/core/transport/spu_implicit.c \
|
||||
opm/core/transport/GravitySolver.cpp \
|
||||
opm/core/transport/transport_source.c \
|
||||
opm/core/transport/reorder/TransportModelInterface.cpp \
|
||||
opm/core/transport/reorder/TransportModelTwophase.cpp \
|
||||
opm/core/transport/reorder/reordersequence.cpp \
|
||||
opm/core/transport/reorder/nlsolvers.c \
|
||||
opm/core/transport/reorder/reordersequence.cpp \
|
||||
opm/core/transport/reorder/nlsolvers.c \
|
||||
opm/core/transport/reorder/tarjan.c
|
||||
|
||||
nobase_include_HEADERS = \
|
||||
|
29
opm/core/ColumnExtract.hpp
Normal file
29
opm/core/ColumnExtract.hpp
Normal file
@ -0,0 +1,29 @@
|
||||
#include <opm/core/grid.h>
|
||||
#include <vector>
|
||||
|
||||
/**
|
||||
* Extract each column of the grid.
|
||||
* \note Assumes the pillars of the grid are all vertically aligned.
|
||||
* \param grid The grid from which to extract the columns.
|
||||
* \param columns will for each i + cartgrim[0]*j contain the k values contained in the column
|
||||
* centered at (i, j).
|
||||
*/
|
||||
void extractColumn( const UnstructuredGrid& grid, std::vector<std::vector<int> >& columns ) {
|
||||
|
||||
columns.resize(grid.cartdims[0]*grid.cartdims[1]);
|
||||
|
||||
// This is used for sorting (and discarded afterwards)
|
||||
std::vector<std::vector<double> > z_values;
|
||||
z_values.resize(columns.size());
|
||||
for(int i = 0; i < grid.cartdims[0]; i++) {
|
||||
for(int j = 0; j < grid.cartdims[1]; j++) {
|
||||
int plane_index = i + j*grid.cartdims[0];
|
||||
for(int k = 0; k < grid.cartdims[2]; k++) {
|
||||
columns[plane_index].push_back(plane_index + k*grid.cartdims[0]*grid.cartdims[1]);
|
||||
z_values[plane_index].push_back(grid.cell_volumes[3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
1
opm/core/transport/GravitySolver.cpp
Normal file
1
opm/core/transport/GravitySolver.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include <opm/core/ColumnExtract.hpp>
|
0
opm/core/transport/GravitySolver.hpp
Normal file
0
opm/core/transport/GravitySolver.hpp
Normal file
Loading…
Reference in New Issue
Block a user