preCICE v3.1.2
Loading...
Searching...
No Matches
AbsoluteConvergenceMeasureTest.cpp
Go to the documentation of this file.
1#include <Eigen/Core>
5#include "testing/Testing.hpp"
6
7using namespace precice;
8using namespace cplscheme;
9
10BOOST_AUTO_TEST_SUITE(CplSchemeTests)
11
12BOOST_AUTO_TEST_CASE(AbsoluteConvergenceMeasureTest)
13{
14 PRECICE_TEST(1_rank);
15 using Eigen::Vector3d;
16 // Create convergence measure for Vector data
17 double convergenceLimit = 9.0;
18 cplscheme::impl::AbsoluteConvergenceMeasure measure(convergenceLimit);
19
20 // Create data sets for old state of data and new state of data
21 Vector3d oldValues0(-2, -1, 0);
22 Vector3d oldValues1(2, 3, 4);
23 Vector3d oldValues2(3, 4, 5);
24 Vector3d newValues(5, 6, 7);
25
26 measure.measure(oldValues0, newValues);
27 BOOST_TEST(not measure.isConvergence());
28
29 measure.measure(oldValues1, newValues);
30 BOOST_TEST(measure.isConvergence());
31
32 measure.measure(oldValues2, newValues);
33 BOOST_TEST(measure.isConvergence());
34}
35
BOOST_AUTO_TEST_CASE(AbsoluteConvergenceMeasureTest)
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END()
#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.
Main namespace of the precice library.