Added method saveEGRID() on GridManager

This commit is contained in:
Joakim Hove 2013-07-24 14:43:06 +02:00
parent 8c32146093
commit 59b99f7444
2 changed files with 15 additions and 2 deletions

View File

@ -115,7 +115,19 @@ namespace Opm
}
}
void GridManager::saveEGRID(const std::string& filename , const Opm::EclipseGridParser& deck) {
int global_size = ug_->cartdims[0] * ug_->cartdims[1] * ug_->cartdims[2];
std::vector<int> actnum(global_size);
if (ug_->global_cell) {
actnum.assign( actnum.size() , 0 );
for (int c=0; c < ug_->number_of_cells; c++)
actnum[ug_->global_cell[c]] = 1;
} else
actnum.assign( actnum.size() , 1 );
deck.saveEGRID( "FILE.EGRID" , actnum );
}
/// Destructor.
@ -136,7 +148,6 @@ namespace Opm
}
// Construct corner-point grid from deck.
void GridManager::initFromDeckCornerpoint(const Opm::EclipseGridParser& deck)
{

View File

@ -65,6 +65,8 @@ namespace Opm
/// Destructor.
~GridManager();
void saveEGRID(const std::string& filename , const Opm::EclipseGridParser& deck);
/// Access the managed UnstructuredGrid.
/// The method is named similarly to c_str() in std::string,
/// to make it clear that we are returning a C-compatible struct.