preCICE v3.1.1
Loading...
Searching...
No Matches
RelativeConvergenceMeasureTest.cpp
Go to the documentation of this file.
1#include <Eigen/Core>
4#include "testing/Testing.hpp"
5
6BOOST_AUTO_TEST_SUITE(CplSchemeTests)
7
8BOOST_AUTO_TEST_CASE(RelativeConvergenceMeasureTest)
9{
10 PRECICE_TEST(1_rank);
11 using Eigen::Vector3d;
12 double convergenceLimit = 0.1; // 10%
14
15 // Create data sets for old state of data and new state of data
16 Vector3d oldValues0(1, 1, 1);
17 Vector3d oldValues1(2, 2, 2);
18 Vector3d oldValues2(2.9, 2.9, 2.9);
19 Vector3d newValues(3, 3, 3);
20
21 measure.measure(oldValues0, newValues);
22 BOOST_TEST(not measure.isConvergence());
23
24 measure.measure(oldValues1, newValues);
25 BOOST_TEST(not measure.isConvergence());
26
27 measure.measure(oldValues2, newValues);
28 BOOST_TEST(measure.isConvergence());
29}
30
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(RelativeConvergenceMeasureTest)
#define PRECICE_TEST(...)
Definition Testing.hpp:27
Measures the convergence from an old data set to a new one.
virtual bool isConvergence() const
Returns true, if the last measurement indicates convergence.
virtual void measure(const Eigen::VectorXd &oldValues, const Eigen::VectorXd &newValues)
Performs convergence measurement.