Commit Graph

34 Commits

Author SHA1 Message Date
Arne Morten Kvarving
1be072adf2 add serialization support to Evaluation 2023-02-08 10:20:30 +01:00
Arne Morten Kvarving
76892ccd73 EvaluationXXX.hpp: do not include Evaluation.hpp
creates weird circular includes. users should always include
Evaluation.hpp
2022-12-23 13:30:34 +01:00
Arne Morten Kvarving
59d46bbf7e Evaluation: do not include Math.hpp 2022-12-23 13:15:53 +01:00
Arne Morten Kvarving
b487819384 Evaluation: remove unnecessary includes 2022-12-23 13:09:40 +01:00
Arne Morten Kvarving
e9ba866305 Evaluation: do not include valgrind if NDEBUG 2022-12-23 13:02:36 +01:00
Arne Morten Kvarving
9d92514157 Evaluation: move stream operator support to compile unit 2022-12-23 12:58:47 +01:00
Arne Morten Kvarving
fd6e793b6a don't include dune traits for Evaluation
unused and it creates an unnecessary dune-common dependency
now test_EvaluationFormat no longer depends on dune-common
2022-12-23 08:49:19 +01:00
Arne Morten Kvarving
93543e5f7d changed: use python3 2021-10-27 07:23:24 +02:00
Arne Morten Kvarving
24dba01e99 changed: get rid of OPM_UNUSED macro usage
prefer anonymous parameters and c++17 [[maybe_unused]]
2021-08-03 09:32:02 +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
a9e1551e79 Silence unused argument warning for DynamicEvaluation. 2019-07-05 10:09:23 +02:00
Arne Morten Kvarving
51bf76a061 mark unused parameters as OPM_UNUSED 2019-06-26 10:55: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
Andreas Lauser
819ee5bbf2 Evaluation code generator: add a missing OPM_UNUSED
thanks to [at]GitPaean for the catch!
2019-06-12 15:10:17 +02:00
Andreas Lauser
3b933ae42a unify the creation of evalutions
to create a constant, there are now always the three functions

Opm::constant<Eval>(value);
Opm::constant<Eval>(numDeriv, value);
Opm::constant<Eval>(x, value); // with 'x' being the 'template' of the returned value

If a given call does not make sense, an exception is thrown:

- Plain floating point objects like `float`, `double` or `quad`
  complain if the specified number of derivatives is not zero.
- Statically sized evaluations throw if the specified number of
  derivatives of passed to the function is not equal to their static
  size.
- Dynamically sized evaluations complain if the number of derivatives
  cannot be determined.

The third variant of `Opm::constant()` works unconditionally. The
`Opm::variable()` helpers are modified analogously.
2019-06-12 11:50:37 +02:00
Kai Bao
0c005595c4 adding createConstantOne and createConstantZero to Evaluations 2019-06-11 09:48:44 +02:00
Kai Bao
0ce7a779da updating genEvalSpecializations.py 2019-03-21 13:16:49 +01:00
Andreas Lauser
1e7d566a93 clean up the new FastSmallVector class
also, this fixes some potential memory leaks if vectors of different
sizes are assigned and it fixes the assignment-to-self (`x = x`) case.
2019-03-20 12:41:57 +01:00
Kai Bao
a8f5501e15 update genEvalSpecializations.py 2019-03-15 14:16:14 +01:00
Kai Bao
120410e468 fixing genEvalSpecializations.py instead of editing Evaluationn directly 2018-12-18 11:51:00 +01:00
Andreas Lauser
b91f198747 update Evaluation-code generator to get rid of a few warnings in the generated code
these warnings require -Wextra or above but do not occur with -Wall.
2018-07-05 12:50:54 +02: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
fec2428c3e evaluation code gen: add a dynamically-sized variant of evaluation
this works by passing -1 as the template argument for the number of
derivatives. most of the code is identical, but creation of such
objects requires the number of derivatives passed to the constructor
or the copy constructor must be used.

Finally `DynamicEvaluation<Scalar>` is provided as a more expressive
alias for `Evaluation<Scalar, -1>`.
2018-06-28 17:27:47 +02:00
Andreas Lauser
8a0de34ad0 Evaluation: use the trivial copy constructor and copy operator
this potentially allows the compiler to do better optimizations.
2017-07-27 18:02:55 +02:00
Andreas Lauser
ee5ee215bd explicitly include all Evaluations in the file for each specialization
indirectly this was already the case: Math.hpp includes
Evaluation.hpp, but this change should make it more explicit.
2017-06-07 15:20:01 +02:00
Andreas Lauser
1a1b17a5c8 revert optimizing the division code for evaluations 2017-06-07 15:20:01 +02:00
Andreas Lauser
19fb18dc20 clean up the code generator script for Evaluations a bit
this mainly removes superfluous newlines in the generated files, but
also makes them bit more consistent.
2017-06-07 15:20:01 +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
49ff83d140 [cleanup] Avoid creation of empty lines and make work with python3. 2017-03-20 14:51:15 +01:00
Andreas Lauser
2f44918a2b dense AD: fix a few stupid bugs
e.g., looping over the wrong range or an infinite loop. also, the
dense-AD unit test is shortend to test one specialization and the
unspecialized class.
2017-03-17 20:48:39 +01:00
Andreas Lauser
bf771b09b4 auto-generate and specialize the whole Evaluation class
older compilers (-> GCC < 5) seem to have trouble with inlining here
which leads to sub-optimal performance. since it is not a big problem
to also generate the unspecialized Evaluation class, let's do that
instead. (for hand-written code, this would be a huge
consistency/maintainance problem, though.)
2017-03-17 17:25:49 +01:00
Andreas Lauser
dff851951e add description to the code generator for the Evaluation specializations
and make the maximum number of variables for which specializations
should be generated settable via a command line argument.
2017-03-16 11:51:24 +01:00
Andreas Lauser
72b9830b6c move the script that generates the specializations for Evaluation to bin/ 2017-03-16 11:17:33 +01:00