Commit Graph
2019 Commits
Author SHA1 Message Date
Joakim Hove d06028cb49 Merged master into ert branch 2012-06-27 08:22:26 +02:00
Joakim Hove 3e789272fd Added configure.ac + Makefile.am support for including ert 2012-06-27 08:06:22 +02:00
Alf Birger Rustad 90f26cc883 Merge pull request #1 from bska/master
Bring in more resilient grid processing and geometry calculation
2012-06-26 23:02:58 -07:00
Bård Skaflestad 8f0637b090 Merge branch 'master' of git@github.com:bska/opm-core.git 2012-06-26 21:34:23 +02:00
Bård Skaflestad f2a2811325 Merge branch 'silence-geom-calc'
Conflicts:
	opm/core/grid/cpgpreprocess/geometry.c

Defer printing diagnostic message concerning negative cell volumes
until we're absolutely sure that the volume actually *is*
negative.  Since we're now accumulating signed volumes, some of
the initial contributions might be negative but the end result
likely won̈́'t be.

This merge also brings feature parity with the MATLAB Reservoir
Simulation Toolbox.
2012-06-26 21:04:08 +02:00
Bård Skaflestad 619ce07938 Insert white-space for readability.
git-svn-id: http://svn.sintef.no/simmatlab/branches/mrst-reorg/mex/libgeometry@9312 ea62cf4e-aff8-4dd6-bb37-af94872dbd4c

Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 21:01:20 +02:00
Bård Skaflestad 37d7f4d8e2 Negate quantity by unary minus rather than multiplication by "-1".
git-svn-id: http://svn.sintef.no/simmatlab/branches/mrst-reorg/mex/libgeometry@9311 ea62cf4e-aff8-4dd6-bb37-af94872dbd4c

Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 21:01:20 +02:00
Bård Skaflestad 4e4666a2de Use more traditional comparison: "a!=b" rather than "!(a==b)"
git-svn-id: http://svn.sintef.no/simmatlab/branches/mrst-reorg/mex/libgeometry@9310 ea62cf4e-aff8-4dd6-bb37-af94872dbd4c

Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 21:01:20 +02:00
Bård Skaflestad 5d5404aebf Lower constant tet_volume multiplication below
accumulation loop.
2012-06-26 20:59:19 +02:00
Bård Skaflestad 0e308c3be1 Remove some long-disabled code that only served to
confuse the reader.
2012-06-26 20:57:00 +02:00
Bård Skaflestad f6a7a48831 Compute_cell_geometry(): Don't print misleading
diagnostic message.   We don't know if we should emit a
diagnostic concerning non-positive   cell volumes until
we have accumulated all tetrahedral   contributions.

While here, amend the diagnostic message to also report the cell in
which non-positive volumes are detected.
2012-06-26 20:54:37 +02:00
Bård Skaflestad 7d7f62ebc3 Merge branch 'preprocess-svn-reintegrate'
Conflicts:
	Makefile.am
	opm/core/grid/cpgpreprocess/facetopology.c
	opm/core/grid/cpgpreprocess/mxgrdecl.c
	opm/core/grid/cpgpreprocess/preprocess.c
	opm/core/grid/cpgpreprocess/sparsetable.c
	opm/core/grid/cpgpreprocess/sparsetable.h
	opm/core/grid/cpgpreprocess/uniquepoints.c

This merge brings a new, more resilient and feature-complete
corner-point processing.  In particular, the new code features
exact, in-plane vertex coordinates for face nodes that arise as a
result of fault processing and which are not located on pillars.
Secondly, the resulting grid's cells are ordered lexicographically
with the I index cycling the most rapidly, followed by J and
finally K.

Finally, this merge also brings automatic handling of left-handed
coordinate systems which, until now, have produced negative cell
volumes as a result of face vertices being ordered such that
interface normals point from cell 2 to cell 1 in this case.
Left-handed coordinate systems are recognised using a simplistic
triple-product characterisation akin to the implementation of
function "processGRDECL" of MRST.

This code is now an (almost) exact replica of revision 1001 of
https://public.ict.sintef.no/viewvc/openrs/trunk/dune-cornerpoint/grid/preprocess/

The merge also removes opm/core/grid/cpgpreprocess/readvector*, so
remove tests/test_readvector.cpp (and accompanying Make rule) to
maintain a buildable tree.
2012-06-26 19:52:21 +02:00
Bård Skaflestad 71a1f93bf9 Reformat computeFaceTopology() declaration. No functional changes.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad 8ca2ecbbda Make special provisions to guarantee positive cell volumes in models featuring a left-handed coordinate system. Implementation modelled on the "processGRDECL" function of MRST.
Specifically:
    * Use a simple triple-product characterisation of left-handed
      coordinate systems.
    * Reflect Y coordinates about XZ plane to guarantee right-handed
      systems during facetopology() processing.
    * Restore original Y coordinates upon completion of
      process_grdecl() lest subsequent geometry processing fail to
      produce correct results.
    * Reverse face-node order if an odd number of sign changes have
      been applied to the node coordinates (i.e., if *either* the Y
      *or* the Z--but not both--coordinates have been flipped).

Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad e72cc0d600 process_vertical_faces(): Insert a bit of white-space in loop-condition for readability purposes.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad 18930081ce process_vertical_faces(): Explicitly assert that "direction" is zero or one only.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad a3dd542ea4 checkmemory(): Use integer-only operations when calculating array sizes.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad e4b24a3262 Remove trailing white-space.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad 7ebf14e299 Document the (slightly opaque) "number_of_nodes_on_pillars" field of the "processed_grid".
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad ddb1ae57e0 Document the (internal) role of the "m" and "n" fields of the "processed_grid".
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad 2062789678 checkmemory(): Expand on the role of "r" size estimate for the number of additional connections (faces) along a faulted stack.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad 5cac732131 process_vertical_faces(): Hoist invariant assignments above loop.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad 1d1bf4b4f7 Fix misprint in diagnostic message and split two long lines.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad a606cd1e76 Up-case macros (min->MIN, max->MAX).
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad 40848dc0b0 checkmemory(): Group (re)allocations according to the size-parameter used to effect the allocations.
Furthermore: Capture all allocations that succeed even if some other
  allocation fails.

Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad adf266f077 linearindex(): Assert component indices in range.
While here, split a long line and sort includes.

Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad 736b623d4b findconnections(): Insert white-space for readability.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad 406016998b Continue reorganisation to promote readability.
Specifically:
    * Move linearindex() ahead of all existing functions and use it in
      compute_cell_index().
    * compute_cell_index(): Insert white-space and comments.
    * process_vertical_faces(): Add comments to describe stages in the
      process of computing new connections (faces).

Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad 0d84dad30c Fully parenthesise the MEANINGFUL_FACE macro.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad 7d68712136 Up-case all macro names.
While here, insert white-space for readability.

Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad 1ee27a4484 Up-case "min" and "max" macros to provide visual cues that there's macro expansion afoot. While here, remove unused "overlap" macro.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad eaaad64242 ?getvectors(): Re-factor field offset calculations out to new helper, vector_positions().
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad fd3b5783fc Sort includes.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad ce073c0318 Fix unmatched parentheses.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad 2864de1ddb Sort and group includes.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad fbc19e6d0c process_grdecl(): Prefer "size_t" when defining allocation sizes.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad 37351d2adb Initialise all "intersect" elements to -1 to avoid confusion surrounding ={-1} syntax.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad e9931d8c9c Make 'coord' a pointer-to-const rather than a pointer-to-modifiable. We don't need to change the coord array.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad 140d4ade25 Make a few concessions to readability by inserting some white-space around binary operators where appropriate.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad 7dfb478e2e Remove dependency on C99's isinf() and isnan() functions.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad b21134fede Remove dependency on C99's isinf() and isnan().
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:02 +02:00
Bård Skaflestad 16169c57c5 Sort includes.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:01 +02:00
Bård Skaflestad 52c322047b Staticise several internal functions to reduce impact on libraries embedding this software.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:01 +02:00
Bård Skaflestad 8884e4fc59 computeFaceTopology(): Initialise all elements of the mask array to -1. The ={-1} syntax just sets mask[0], leaving [1..7] at the default value (zero).
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:01 +02:00
Bård Skaflestad de91035e3a Replace comparison function with one that honours qsort() requirements.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:01 +02:00
Bård Skaflestad ee9db9493c Remove code that was disabled in -r967.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:01 +02:00
Bård Skaflestad e5ecded0a8 Add convenience: Interpret ACTNUM==NULL as "all cells active".
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:01 +02:00
Jostein R. Natvig ea6c01dd95 Remove references to old intersection implementation.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:01 +02:00
Jostein R. Natvig 08f1e2e3e6 Change code that computes new node coordinates on bilinear surfaces defined by pillar pairs. Old code computes *rough* approximation, new code computes exact value.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:01 +02:00
Jostein R. Natvig 2be1ecf16c Re-indent to four-spaces. While at it, do whitespace-cleanup.
Signed-off-by: Bård Skaflestad <Bard.Skaflestad@sintef.no>
2012-06-26 18:43:01 +02:00