From: Denis Davydov Date: Mon, 13 Nov 2017 20:59:12 +0000 (+0100) Subject: fix sundials tests X-Git-Tag: v9.0.0-rc1~772^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abc2d04ada67d1ebf9f78c2b21a1d35f215b0ee7;p=dealii.git fix sundials tests --- diff --git a/tests/sundials/harmonic_oscillator_03.cc b/tests/sundials/harmonic_oscillator_03.cc index eb5a4a4048..50226f15e5 100644 --- a/tests/sundials/harmonic_oscillator_03.cc +++ b/tests/sundials/harmonic_oscillator_03.cc @@ -85,8 +85,11 @@ int main (int argc, char **argv) const VectorType &sol, const unsigned int step_number) -> int { - out << t << " " - << sol[0] << " " << sol[1] << std::endl; + // limit the output to every 10th step and increase the precision to make + // the test more robust + if (step_number % 10 == 0) + out << t << " " << std::setprecision(7) + << sol[0] << " " << sol[1] << std::endl; return 0; }; diff --git a/tests/sundials/harmonic_oscillator_03.output b/tests/sundials/harmonic_oscillator_03.output index 194df9f75d..2b90296f5a 100644 --- a/tests/sundials/harmonic_oscillator_03.output +++ b/tests/sundials/harmonic_oscillator_03.output @@ -1,127 +1,13 @@ 0 0 1 -0.05 0.0499792 0.99875 -0.1 0.0998334 0.995004 -0.15 0.149437 0.988766 -0.2 0.198666 0.980053 -0.25 0.2474 0.968896 -0.3 0.295517 0.955325 -0.35 0.342897 0.93937 -0.4 0.389417 0.921059 -0.45 0.434946 0.900419 -0.5 0.479377 0.877514 -0.55 0.522611 0.852418 -0.6 0.564547 0.825205 -0.65 0.605086 0.795949 -0.7 0.644127 0.764724 -0.75 0.681571 0.731603 -0.8 0.717319 0.696661 -0.85 0.75127 0.659971 -0.9 0.783323 0.621608 -0.95 0.81334 0.581655 -1 0.841255 0.540225 -1.05 0.867034 0.497436 -1.1 0.890639 0.453406 -1.15 0.912037 0.408253 -1.2 0.931192 0.362094 -1.25 0.948069 0.315048 -1.3 0.962632 0.267233 -1.35 0.974846 0.218766 -1.4 0.984677 0.169766 -1.45 0.992087 0.12035 -1.5 0.997044 0.0706359 -1.55 0.99951 0.0207423 -1.6 0.999451 -0.0292132 -1.65 0.996832 -0.0791126 -1.7 0.991621 -0.128824 -1.75 0.983844 -0.178179 -1.8 0.973556 -0.227062 -1.85 0.960816 -0.275364 -1.9 0.945682 -0.322977 -1.95 0.928212 -0.369793 -2 0.908464 -0.415703 -2.05 0.886494 -0.460597 -2.1 0.862363 -0.504368 -2.15 0.836126 -0.546907 -2.2 0.807842 -0.588105 -2.25 0.77757 -0.627854 -2.3 0.745366 -0.666045 -2.35 0.711289 -0.702569 -2.4 0.675396 -0.737318 -2.45 0.637746 -0.770184 -2.5 0.598437 -0.801048 -2.55 0.557607 -0.829841 -2.6 0.515372 -0.856524 -2.65 0.47185 -0.88106 -2.7 0.427158 -0.903409 -2.75 0.381414 -0.923533 -2.8 0.334733 -0.941395 -2.85 0.287234 -0.956956 -2.9 0.239033 -0.970177 -2.95 0.190247 -0.981021 -3 0.140994 -0.989448 -3.05 0.0913914 -0.995421 -3.1 0.0415552 -0.998901 -3.15 -0.00839699 -0.99985 -3.2 -0.0583482 -0.998229 -3.25 -0.108147 -0.994018 -3.3 -0.157648 -0.987254 -3.35 -0.206738 -0.97799 -3.4 -0.255306 -0.966276 -3.45 -0.30324 -0.952166 -3.5 -0.350428 -0.93571 -3.55 -0.396758 -0.916961 -3.6 -0.442119 -0.89597 -3.65 -0.486399 -0.872789 -3.7 -0.529485 -0.847469 -3.75 -0.571267 -0.820064 -3.8 -0.611631 -0.790623 -3.85 -0.650467 -0.7592 -3.9 -0.687663 -0.725846 -3.95 -0.723107 -0.690613 -4 -0.756685 -0.653591 -4.05 -0.788325 -0.614912 -4.1 -0.817974 -0.574689 -4.15 -0.845582 -0.533032 -4.2 -0.871095 -0.490056 -4.25 -0.894462 -0.445871 -4.3 -0.915632 -0.40059 -4.35 -0.934552 -0.354325 -4.4 -0.95117 -0.307188 -4.45 -0.965435 -0.259293 -4.5 -0.977295 -0.21075 -4.55 -0.986699 -0.161672 -4.6 -0.993593 -0.112172 -4.65 -0.997932 -0.0623777 -4.7 -0.999719 -0.012438 -4.75 -0.998982 0.037526 -4.8 -0.995748 0.087394 -4.85 -0.990044 0.137045 -4.9 -0.9819 0.18636 -4.95 -0.971341 0.235217 -5 -0.958397 0.283495 -5.05 -0.943095 0.331076 -5.1 -0.925462 0.377837 -5.15 -0.905526 0.423659 -5.2 -0.883316 0.468421 -5.25 -0.858858 0.512003 -5.3 -0.832189 0.554277 -5.35 -0.803395 0.59512 -5.4 -0.772573 0.634451 -5.45 -0.739818 0.672191 -5.5 -0.705227 0.708262 -5.55 -0.668895 0.742585 -5.6 -0.630918 0.775083 -5.65 -0.591391 0.805678 -5.7 -0.55041 0.83429 -5.75 -0.508071 0.860841 -5.8 -0.464469 0.885255 -5.85 -0.419701 0.907451 -5.9 -0.373861 0.927352 -5.95 -0.327051 0.944886 -6 -0.279415 0.960036 -6.05 -0.23108 0.972786 -6.1 -0.18217 0.983113 -6.15 -0.132806 0.990994 -6.2 -0.0831124 0.996408 -6.25 -0.0332105 0.999333 -6.28 -0.00322054 0.999883 +0.5 0.4793775 0.8775139 +1 0.8412554 0.540225 +1.5 0.9970436 0.07063589 +2 0.9084636 -0.4157026 +2.5 0.5984372 -0.8010479 +3 0.1409945 -0.9894479 +3.5 -0.350428 -0.9357101 +4 -0.7566852 -0.6535909 +4.5 -0.9772954 -0.21075 +5 -0.9583971 0.2834953 +5.5 -0.7052272 0.7082618 +6 -0.279415 0.9600362 diff --git a/tests/sundials/harmonic_oscillator_04.cc b/tests/sundials/harmonic_oscillator_04.cc index b3cc67cab1..325f3b16ef 100644 --- a/tests/sundials/harmonic_oscillator_04.cc +++ b/tests/sundials/harmonic_oscillator_04.cc @@ -101,8 +101,11 @@ int main (int argc, char **argv) const VectorType &sol, const unsigned int step_number) -> int { - out << t << " " - << sol[0] << " " << sol[1] << " " << sol[2] << std::endl; + // limit the output to every 10th step and increase the precision to make + // the test more robust + if (step_number % 10 == 0) + out << t << " " << std::setprecision(7) + << sol[0] << " " << sol[1] << " " << sol[2] << std::endl; return 0; }; diff --git a/tests/sundials/harmonic_oscillator_04.output b/tests/sundials/harmonic_oscillator_04.output index 02827a714d..a8d6922f9b 100644 --- a/tests/sundials/harmonic_oscillator_04.output +++ b/tests/sundials/harmonic_oscillator_04.output @@ -1,102 +1,11 @@ 0 3.9 1.1 2.8 -0.1 3.99995 0.720432 2.49987 -0.2 3.78894 0.660967 2.49997 -0.3 3.52275 0.681501 2.49986 -0.4 3.26217 0.72296 2.49997 -0.5 3.01935 0.771864 2.4999 -0.6 2.79594 0.82467 2.49994 -0.7 2.59116 0.880241 2.49994 -0.8 2.4037 0.938097 2.49991 -0.9 2.23217 0.997959 2.49997 -1 2.07527 1.0596 2.49991 -1.1 1.93182 1.12281 2.49998 -1.2 1.80073 1.18737 2.49993 -1.3 1.68106 1.25304 2.49998 -1.4 1.57194 1.31959 2.49995 -1.5 1.47261 1.38677 2.49997 -1.6 1.38237 1.45434 2.49997 -1.7 1.3006 1.52203 2.49996 -1.8 1.2267 1.58963 2.49998 -1.9 1.16015 1.65689 2.49996 -2 1.10046 1.72361 2.49999 -2.1 1.04715 1.78959 2.49996 -2.2 0.999783 1.85466 2.49999 -2.3 0.957942 1.91866 2.49997 -2.4 0.921233 1.98145 2.49998 -2.5 0.889283 2.04291 2.49998 -2.6 0.861743 2.10294 2.49998 -2.7 0.838291 2.16142 2.49998 -2.8 0.818628 2.21827 2.49998 -2.9 0.802485 2.27338 2.49998 -3 0.78962 2.32667 2.49998 -3.1 0.779824 2.37802 2.49998 -3.2 0.772919 2.42731 2.49998 -3.3 0.768758 2.47441 2.49999 -3.4 0.767229 2.51916 2.49998 -3.5 0.768257 2.56138 2.5 -3.6 0.7718 2.60085 2.50001 -3.7 0.777859 2.63733 2.49998 -3.8 0.786474 2.67052 2.49993 -3.9 0.797733 2.70008 2.4999 -4 0.811773 2.72558 2.49999 -4.1 0.828789 2.74657 2.50008 -4.2 0.84904 2.76245 2.50006 -4.3 0.872862 2.77257 2.49987 -4.4 0.900673 2.77611 2.49997 -4.5 0.932987 2.77216 2.4999 -4.6 0.970423 2.75959 2.50008 -4.7 1.01371 2.73716 2.50002 -4.8 1.06366 2.70339 2.49987 -4.9 1.12115 2.65673 2.50006 -5 1.187 2.59554 2.50009 -5.1 1.26179 2.51839 2.49993 -5.2 1.34554 2.42435 2.49999 -5.3 1.43719 2.31362 2.49988 -5.4 1.53404 2.18823 2.49988 -5.5 1.6313 2.05269 2.49994 -5.6 1.72208 1.91414 2.50001 -5.7 1.79854 1.7815 2.50002 -5.8 1.85371 1.66352 2.49999 -5.9 1.88345 1.56671 2.49994 -6 1.88731 1.4941 2.49988 -6.1 1.86803 1.44543 2.49982 -6.2 1.83015 1.41827 2.50004 -6.3 1.77867 1.40922 2.50005 -6.4 1.71817 1.41482 2.49984 -6.5 1.65242 1.43201 2.49985 -6.6 1.58434 1.45824 2.49989 -6.7 1.51607 1.49149 2.50006 -6.8 1.44916 1.53017 2.49996 -6.9 1.38465 1.57301 2.49987 -7 1.32327 1.61902 2.50004 -7.1 1.26548 1.6674 2.5 -7.2 1.21156 1.7175 2.4999 -7.3 1.16164 1.76879 2.5 -7.4 1.11578 1.82081 2.50002 -7.5 1.07396 1.87319 2.49993 -7.6 1.03609 1.92558 2.49996 -7.7 1.00208 1.97772 2.50002 -7.8 0.971784 2.02935 2.49996 -7.9 0.945072 2.08025 2.49995 -8 0.921787 2.13022 2.50001 -8.1 0.901781 2.17907 2.49998 -8.2 0.884906 2.22664 2.49996 -8.3 0.871025 2.27275 2.49999 -8.4 0.860013 2.31723 2.49998 -8.5 0.851761 2.35992 2.49997 -8.6 0.84618 2.40062 2.49998 -8.7 0.843199 2.43916 2.49998 -8.8 0.842774 2.47531 2.49999 -8.9 0.844885 2.50883 2.50001 -9 0.849543 2.53948 2.50008 -9.1 0.856788 2.56694 2.49996 -9.2 0.866696 2.59088 2.4999 -9.3 0.879382 2.61091 2.50016 -9.4 0.895002 2.6266 2.49985 -9.5 0.913755 2.63743 2.49992 -9.6 0.935893 2.64284 2.50001 -9.7 0.961713 2.64217 2.49985 -9.8 0.991567 2.63469 2.50001 -9.9 1.02585 2.61958 2.49985 -10 1.06497 2.59596 2.49997 -10 1.06497 2.59596 2.49997 +1 2.075275 1.059602 2.499911 +2 1.10046 1.72361 2.499985 +3 0.7896202 2.326668 2.499981 +4 0.8117726 2.725584 2.499993 +5 1.187003 2.595542 2.500085 +6 1.887311 1.494098 2.499879 +7 1.323271 1.619016 2.500041 +8 0.9217875 2.130219 2.50001 +9 0.8495426 2.539475 2.50008 +10 1.06497 2.595956 2.499973