Commit Graph

238 Commits

Author SHA1 Message Date
Bård Skaflestad
8a4735efcb Make Self Connection Behaviour Configurable
This commit adds a new class template argument,

    bool PermitSelfConnections

with a default value of 'false', that enables client code to
configure whether or not function

    addConnection(v1, v2)

creates a connection from v1 to v2 if v1 == v2.  The default state
preserves the current behaviour which ignores such connections.

Permitting self connections makes the class slightly more general to
uses cases outside inter-region flow accumulation.
2023-11-16 15:10:59 +01:00
Antonella Ritorto
e89c486c7c Missing header for g++ 12.2.0 2023-10-26 10:17:09 +02:00
Arne Morten Kvarving
9dbee7920a linearInterpolation: add a helper to get slope and index
and reimplement interpolation functions in terms of this helper
2023-10-23 14:41:35 +02:00
Arne Morten Kvarving
29031c6645 linearInterpolation: reimplement tableIndex using stl 2023-10-23 14:31:36 +02:00
Arne Morten Kvarving
568c06192f linearInterpolation.hpp: reformat 2023-10-23 14:31:36 +02:00
Bård Skaflestad
cc4928dfc7 Extract Facility to Form CSR Representations of Graphs
This commit extracts the internal helpers of class

    InterRegFlowMap

out to a new public helper class template, CSRGraphFromCoordinates.
Client code can, at the expense of one additional data member and
some dynamic memory, elect to track the index pairs.  This enables
O(1) assembly per element when used as part of a CSR matrix with a
value array, SA.

Class CSRGraphFromCoordinates does not track values.  It is purely
for the sake of forming the IA and JA structure arrays.  Upon
calling 'compress()', column indices are sorted per row and
duplicate column indices condensed to a single, unique,
representative.
2023-10-18 13:50:31 +02:00
hnil
b6a0821992 added timing on co2store evaluation and new timing macros 2023-09-28 10:42:20 +02:00
Arne Morten Kvarving
89deeea9d5 TimingMacros: add definitions for using tracy 2023-08-15 15:55:03 +02:00
Markus Blatt
0a916c4b73 Rename LinearTimeSteppingBreakdown to TimeSteppingBreakdown
Indeed that is more intuitive. I guess the previous name was due to
copy & paste and forgetting to change things afterwards.
2023-07-25 14:56:47 +02:00
Markus Blatt
7e3eeb34b0 Added exception to mark time step being cut too often.
This is needed for a more user friendly message in the simulator.
2023-07-12 14:17:56 +02:00
Arne Morten Kvarving
e6280fc80d add override qualifier to virtual methods 2023-05-22 20:53:33 +02:00
Bård Skaflestad
53383fd875 Sort headers in alphabetical order 2023-05-08 22:40:24 +02:00
Bård Skaflestad
b17d618c7b Use memcmp() from namespace std
Don't rely on clients using

    #include <string.h>

before including cmp.hpp .
2023-05-08 22:40:14 +02:00
Arne Morten Kvarving
6b71f3d3c2 Merge pull request #3417 from blattms/fix-hdf5-dune-2.6
Do not use FieldVector::data() mehod as it misses from DUNE 2.6.
2023-03-15 21:10:34 +01:00
Arne Morten Kvarving
3fddcc0dd8 split out timing macros to separate header 2023-03-01 13:17:00 +01:00
Markus Blatt
393c42cd4c Do not use FieldVector::data() mehod as it misses from DUNE 2.6.
Instead we use the old fashioned way of checking the size and then
either return the address of the first element or a nullptr.

Closes OPM/opm-simulator#4472
2023-02-28 16:46:06 +01:00
Bård Skaflestad
2171c7afe6 Merge pull request #3389 from hnil/timing_block
Added empty macro which can be used for timing with for example Tracy
2023-02-10 12:22:44 +01:00
hnil
05a7672173 addressed review comments 2023-02-10 11:13:08 +01:00
Bård Skaflestad
e6abb5e3df Don't Index Out of Bounds in Vector
In the admittedly special case that "position" is equal to the
buffer's size() and "n == 0", then the expression

   &buffer[position]

will index out of bounds.  Use the safer expression

   buffer.data() + position

instead since that's valid when position <= size().

Detected by libstdc++'s debug mode (checked iterators).
2023-02-08 12:52:28 +01:00
hnil
9613cdd917 Added empty marco which can be used for timing with forexample Tracy 2023-02-02 14:19:51 +01:00
Arne Morten Kvarving
d04a30592a Serializer: handle Dune::BlockVector as vectors 2023-02-01 14:49:15 +01:00
Arne Morten Kvarving
6ba29b0920 Serializer: allow generic vector classes
needs to adhere to stl's interface
2023-02-01 14:48:39 +01:00
Arne Morten Kvarving
e211a8cbf6 Serializer: handle Dune::FieldVector as arrays 2023-02-01 14:39:32 +01:00
Arne Morten Kvarving
7e6b28317a Serializer.hpp: add missing include 2023-02-01 10:48:48 +01:00
Arne Morten Kvarving
b138598518 changed: rename the packer used in test_Serialization to MemPacker
make it a public header so it can be reused elsewhere.
2023-02-01 10:48:48 +01:00
Arne Morten Kvarving
26f5c770b5 ParameterRequirement: encapsulate sstream usage 2023-01-04 11:03:33 +01:00
Arne Morten Kvarving
5395e29b5f ParameterGroup_impl: avoid use of sstream 2023-01-04 11:03:33 +01:00
Arne Morten Kvarving
f987a3794c Parameter: move more code to compile unit
in particular this allows encapsulating sstream
2023-01-04 11:03:33 +01:00
Arne Morten Kvarving
a154d8baf4 add compile unit for String.hpp
one less <sstream> in header
2023-01-03 19:06:46 +01:00
Arne Morten Kvarving
d1522761f3 add license header 2023-01-03 19:06:13 +01:00
Arne Morten Kvarving
dbf838ab90 ErrorMacros: remove sstream usage 2023-01-03 16:32:56 +01:00
Arne Morten Kvarving
5caa5bf858 ParameterGroup: remove usage of sstream 2023-01-02 15:53:05 +01:00
Arne Morten Kvarving
1c1140b0c6 SparseVector: remove use of sstream 2023-01-02 15:52:44 +01:00
Atgeirr Flø Rasmussen
bb48205767 Add missing <string> include. 2023-01-02 12:12:26 +01:00
Arne Morten Kvarving
b125823f92 added: symbol demangling helper
this is trivial enough to carry ourself instead of
relying on dune-common
2022-12-23 08:49:19 +01:00
Arne Morten Kvarving
f235061ee3 RootFinders: avoid stream usage in header
put logging functions in separate compile unit where we use {fmt}
2022-12-21 13:26:56 +01:00
Arne Morten Kvarving
b529080fb7 TimerLog: avoid sstream in header 2022-12-21 11:26:33 +01:00
Arne Morten Kvarving
913f71557d fixed: zero initialize to avoid compiler warnings 2022-12-02 09:34:54 +01:00
Arne Morten Kvarving
fb0f3c451e changed: rename serializeObject to serializationTestObject
makes it more clear what these members are used for.
2022-10-04 14:10:30 +02:00
Kjetil Olsen Lye
c664a0dfd2 Remove use of reserved identifier in OPM_THROW. 2022-09-26 11:51:37 +02:00
Arne Morten Kvarving
d731cd3775 import serializer code from opm-simulators
add tests using a simple memcpy based packer
2022-09-16 15:34:58 +02:00
Arne Morten Kvarving
6576370c19 changed: only use operator() for the serializer 2022-09-14 10:33:56 +02:00
Arne Morten Kvarving
ada6853a61 changed: remove unused Serialization class 2022-09-07 10:31:47 +02:00
Atgeirr Flø Rasmussen
49262ae96d Add and use portable_timegm().
This function converts a std::tm to a std::time_t, assuming UTC
and not local timezone. This is used instead of relying on
repeated calls to mktime(), which can fail on some system (BSD)
for dates before 1900.
2022-08-18 09:21:52 +02:00
Arne Morten Kvarving
068bff1ebc clean up stream includes 2022-07-27 16:05:01 +02:00
Bård Skaflestad
a79ee15082 Decouple Opm::Box From EclipseGrid
This commit switches to constructing Box instances from a GridDims
and two call-back functions instead of taking an EclipseGrid
directly.  The two call-back functions are a predicate for active
cells and a translation from Cartesian to active cell indices
respectively.

This is intended to simplify working with nested boxes, such as
those that occur for local grid refinement.
2022-07-05 14:27:49 +02:00
Bård Skaflestad
5377ff3442 Streamline GridDims::getIJK()
This commit switches the Cartesian -> IJK decomposition in GridDims
from K->J->I into the I->J->K order.  The latter is simpler.

While here, also consistently use 'std::size_t' instead of 'size_t'.
2022-07-04 15:06:07 +02:00
Joakim Hove
c50eb01bb0 Implement fnmatch() in Opm::shmatch() with std::regex 2022-01-11 11:14:11 +01:00
Joakim Hove
aede532b9a Filesystem rename parser/eclipse/ input/eclipse 2022-01-02 14:32:14 +01:00
Bård Skaflestad
64e8ec3cfd Remove 'Execute' Permission From Source Files
These files just need to have read/write permissions on Linux/Unix.
2021-12-08 15:09:23 +01:00