Commit Graph

20 Commits

Author SHA1 Message Date
Trine Mykkeltvedt
f4e6b700a3 added Svenns cubic solver 2022-06-08 08:46:52 +02:00
Arne Morten Kvarving
6689e6d08f fixed: do not use Opm:: prefix within Opm namespace part 2
have to use anchoring to root namespace in some places due
to overlapping namespace and class type names.
2021-05-05 21:58:33 +02:00
Atgeirr Flø Rasmussen
6cfd9b5740 Merge pull request #340 from andlaus/unify_eval_creation
unify the creation of evalutions
2019-06-14 09:16:29 +02:00
Kai Bao
292e84ec08 fixing the compilation problem related to DenseAD 2019-06-12 14:53:54 +02:00
Kai Bao
0c005595c4 adding createConstantOne and createConstantZero to Evaluations 2019-06-11 09:48:44 +02:00
Tor Harald Sandve
a62ea4b0f1 Add log10 AD function 2019-06-03 11:22:42 +02:00
Kai Bao
bf4bf1aa1f adding staticSize to the template parameters for Evaluation and DynamicEvaluation 2019-03-21 11:51:45 +01:00
Andreas Lauser
f316b0699e add an Opm::blank(Evaluation) function
this creates an uninitialized "compatible" evaluation that is
compatible with its argument. For primitive floating point types and
statically-sized Evaluations, this is identical to calling the default
constructor, for dynamically sized ones, it creates an uninitialized
Evaluation object of identical size as the argument.

thanks to [at]GitPaen for the heads up.
2018-06-28 17:27:48 +02:00
Andreas Lauser
7b12d493d7 make the "shrubbery" of dense-AD aware of dynamic evaluations
i.e., adapt the math routines.
2018-06-28 17:27:48 +02:00
Andreas Lauser
2f86c78dd8 Revert "Revert "[WIP] Evaluation: specialize evaluations for used numbers in Blackoil setting""
This reverts commit cfc79fd6d5.
2017-06-07 15:20:01 +02:00
Atgeirr Flø Rasmussen
cfc79fd6d5 Revert "[WIP] Evaluation: specialize evaluations for used numbers in Blackoil setting" 2017-03-28 13:26:10 +02:00
Robert Kloefkorn
db46b907a2 Evaluation: specialize evaluations for used number in Blackoil setting
to increase performance. Also, change from unsigned to int because it's
better supported by compilers.
2017-03-14 14:49:24 +01:00
Andreas Lauser
93fe614558 fix some pedantic compiler warnings
this allows the test suite of eWoms to be compiled on clang++ 3.8
using the following warning flags

```
    -Weverything
    -Wno-documentation
    -Wno-documentation-unknown-command
    -Wno-c++98-compat
    -Wno-c++98-compat-pedantic
    -Wno-undef
    -Wno-padded
    -Wno-global-constructors
    -Wno-exit-time-destructors
    -Wno-weak-vtables
    -Wno-float-equal
```

without triggering warnings in opm-material or eWoms.

Note that the test-suite for opm-material does *not* yet pass without
warnings with these flags because with these flags clang likes to
complain about reducing or increasing floating point precision which
results in a formidable nightmare. I will see what I can do about
these warnings in a separate PR.

v4: properly fix the unused parameter warnings for the valgrind client
requests. thanks to [at]atgeirr for finding the issue.
2016-11-09 12:06:36 +01:00
Andreas Lauser
66ec787438 DenseAD: access the value and derivatives of Evaluations via accessor functions
this allows some flexibility of how an Evaluation object is
represented internally. the main motivation for this is to allow using
SIMD instruction which expect special data types as their operants.
2016-10-30 19:01:06 +01:00
Andreas Lauser
e047e85f54 DenseAD: simplify the min(), max() and abs() functions
note that while this simplifies the source code, the performance of
the binaries should be unaffected.
2016-10-30 19:01:06 +01:00
Andreas Lauser
98898cae1d MathToolbox: add isfinite() and isnan() methods
for primitive floating point objects, these correspond to
std::isfinite() and std::isnan() while for evaluations, they trigger
on the evaluation's value or any of its derivatives being non-finite
or NaN. (i.e., for evaluations they should be better called
containsnonfinite(), containsnan().)
2016-10-19 21:46:23 +02:00
Andreas Lauser
1236009d3e DenseAD: special case the base == 0.0 case
if this is not done the generic code produces NaNs. (either by using
the result of ln(0.0) or by means of a division by zero.)

This seems to fix the linearization of flow_ebos for "Model 2".
2016-09-16 00:09:45 +02:00
Andreas Lauser
9f465784a8 dense AD: introduce convenience functions
this PR was inspired by one of @atgeirr's recent comments. it allows
to get rid if the `MathToolbox<Eval>` detour for the dense AD code in
most cases: e.g. instead of writing

```c++
template <class Eval>
Eval f(const Eval& val)
{ return Opm::MathToolbox<Eval>::sqrt(val); }
```

one can simply write

```c++
template <class Eval>
Eval f(const Eval& val)
{ return Opm::sqrt(val); }
```

and it will work transparently with DenseAD `Evaluation` objects and
primitive floating point values.

one complication of this is that the type of the `Evaluation` object
does not need to be explicitly defined. for functions which take more
than one argument (like e.g. `pow()`, `min()` and `max()`), it is thus
assumed that the type of the result is the same as the type of the
first argument.

another drawback is that when both, the contents of the `Opm::` and
the `std::` namespaces are implicitly available, it is not clear to me
what's used for primitive floating point values. (it seems to compile
but IMO it could lead to surprising behaviour. thus, please only merge
if you consider the benefits of these convenience functions to be
greater than their drawbacks.)
2016-08-11 15:54:03 +02:00
Andreas Lauser
ad253d699f rename MathToolbox::toLhs to MathToolbox::decay
this is because this method is completely analogous to std::decay()...
2016-06-03 21:28:45 +02:00
Andreas Lauser
9bbe67d19f rename "LocalAd" to "DenseAd"
Since "dense automatic differentiation" describes what this code is
all about much better in my opinion. ("Local AD" is just a possible
use case in the context of PDE discretization.)
2016-06-03 21:28:45 +02:00