From 518904652891aff4fb39ec177355896e1f971625 Mon Sep 17 00:00:00 2001 From: "Jostein R. Natvig" Date: Wed, 18 May 2011 08:10:43 +0000 Subject: [PATCH] Separate build script and calling interface for processgrid. This enables simple Matlab postprocessing of output from C-code. This revision adds the 'griddim' field. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bård Skaflestad --- processgrid.m | 9 ++------- processgrid_mex.m | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 processgrid_mex.m diff --git a/processgrid.m b/processgrid.m index af3a1bcf..67ad1790 100644 --- a/processgrid.m +++ b/processgrid.m @@ -32,10 +32,5 @@ function varargout = processgrid(varargin) % $Date$ % $Revision$ -% Build MEX edition of same. -% -buildmex CFLAGS='$CFLAGS -Wall -fPIC' processgrid.c preprocess.c ... - uniquepoints.c facetopology.c sparsetable.c mxgrdecl.c - -% Call MEX edition. -[varargout{1:nargout}] = processgrid(varargin{:}); +[varargout{1:nargout}] = processgrid_mex(varargin{:}); +varargout{1}.griddim = 3; diff --git a/processgrid_mex.m b/processgrid_mex.m new file mode 100644 index 00000000..1becfb7a --- /dev/null +++ b/processgrid_mex.m @@ -0,0 +1,42 @@ +function varargout = processgrid_mex(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# +%} + +% $Date$ +% $Revision$ + +% Copyright 2009 SINTEF ICT, Applied Mathematics. +% Mex gateway by Jostein R. Natvig, SINTEF ICT. + +% $Date$ +% $Revision$ + +% Build MEX edition of same. +% +buildmex CFLAGS='$CFLAGS -Wall -fPIC' processgrid.c preprocess.c ... + uniquepoints.c facetopology.c sparsetable.c mxgrdecl.c ... + -output processgrid_mex.mexa64 + +% Call MEX edition. +[varargout{1:nargout}] = processgrid_mex(varargin{:});