From 6c4f2e525c5d954d998e1f4378448486a8fe29b3 Mon Sep 17 00:00:00 2001 From: "Jostein R. Natvig" Date: Thu, 19 Nov 2009 17:15:09 +0000 Subject: [PATCH] Matlab frontend, documentation and build instruction for processgrid mex script. This interface allows users of the Matlab Reservoir Simulation Toolbox (MRST) to use the OPM corner point grid processing in MRST. This represent a significant speedup over the native Matlab grid processing already avaliable in MRST. --- processgrid.m | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 processgrid.m diff --git a/processgrid.m b/processgrid.m new file mode 100644 index 00000000..9c7553a8 --- /dev/null +++ b/processgrid.m @@ -0,0 +1,40 @@ +function varargout = processgrid(varargin) +%Compute grid topology and geometry from pillar grid description. +% +% SYNOPSIS: +% G = processGRDECL(grdecl) +% +% PARAMETERS: +% grdecl - Raw pillar grid structure, as defined by function +% 'readGRDECL', with fields COORDS, ZCORN and, possibly, ACTNUM. +% +% +% RETURNS: +% G - Valid grid definition containing connectivity, cell +% geometry, face geometry and unique nodes. +% +% EXAMPLE: +% G = processgrid(readGRDECL('small.grdecl')); +% plotGrid(G); view(10,45); +% +% SEE ALSO: +% processGRDECL, readGRDECL, deactivateZeroPoro, removeCells. + +% Copyright 2009 SINTEF ICT, Applied Mathematics. +% Mex gateway by Jostein R. Natvig, SINTEF ICT. + +% Build +disp('building processgrid.mex*') +op = pwd; +p = which('processgrid'); +ix = strfind(p, filesep); +p = p(1:ix(end)); +cd(p); +mex processgrid.c preprocess.c uniquepoints.c facetopology.c ... + sparsetable.c mxgrdecl.c CFLAGS='$CFLAGS -Wall -fPIC' +cd(op) + + + +%run +[varargout{1:nargout}] = processgrid(varargin{:});