preCICE v3.1.2
Loading...
Searching...
No Matches
ResidualRelativeConvergenceMeasureTest.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(ResidualRelativeConvergenceMeasureTest)
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(2.9, 2.9, 2.9);
17 Vector3d oldValues1(2.95, 2.95, 2.95);
18 Vector3d oldValues2(2.991, 2.991, 2.991);
19 Vector3d newValues(3, 3, 3);
20
21 // define initial residual, which we want to decrease in the following
22 measure.measure(oldValues0, newValues);
23 BOOST_TEST(not measure.isConvergence());
24
25 measure.measure(oldValues1, newValues);
26 BOOST_TEST(not measure.isConvergence());
27
28 measure.measure(oldValues2, newValues);
29 BOOST_TEST(measure.isConvergence());
30}
31
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(ResidualRelativeConvergenceMeasureTest)
#define PRECICE_TEST(...)
Definition Testing.hpp:27
Measures the convergence from an old data set to a new one.
virtual void measure(const Eigen::VectorXd &oldValues, const Eigen::VectorXd &newValues)
Performs convergence measurement.
virtual bool isConvergence() const
Returns true, if the last measurement indicates convergence.