1#include <boost/test/tools/context.hpp>
26 BOOST_TEST(ranks.
size() == 1);
27 BOOST_TEST(ranks.
front() == 0);
32 BOOST_TEST((secondaryRanks.begin() == secondaryRanks.end()));
54 BOOST_TEST(ranks == expected, boost::test_tools::per_element());
61 BOOST_TEST(ranks == expected, boost::test_tools::per_element());
72 const double norm = 16.881943016134134;
73 if (context.isPrimary()) {
78 if (context.isRank(1)) {
83 if (context.isRank(2)) {
95 const double norm = 16.881943016134134;
97 v << 1, 2, 3, 4, 5, 6, 7, 8, 9;
106 if (context.isPrimary()) {
107 Eigen::VectorXd u(3), v(3);
112 if (context.isRank(1)) {
113 Eigen::VectorXd u(2), v(2);
118 if (context.isRank(2)) {
119 Eigen::VectorXd u(4), v(4);
131 Eigen::VectorXd u(9), v(9);
132 u << 1, 2, 3, 4, 5, 6, 7, 8, 9;
133 v << 9, 8, 7, 6, 5, 4, 3, 2, 1;
142 if (context.isPrimary()) {
149 int in = 1,
out = -1;
151 BOOST_TEST(
out == 9);
154 double in = 1.1,
out = -1;
156 BOOST_TEST(
out == 9.9);
159 if (context.isRank(1)) {
167 int in = 3,
out = -1;
169 BOOST_TEST(
out == -1);
172 double in = 3.3,
out = -1;
174 BOOST_TEST(
out == -1);
177 if (context.isRank(2)) {
185 int in = 5,
out = -1;
187 BOOST_TEST(
out == -1);
190 double in = 5.5,
out = -1;
192 BOOST_TEST(
out == -1);
208 int in = 1,
out = -1;
210 BOOST_TEST(
out == in);
213 double in = 1.1,
out = -1;
215 BOOST_TEST(
out == in);
224 if (context.isPrimary()) {
231 int in = 1,
out = -1;
233 BOOST_TEST(
out == 9);
236 double in = 1.1,
out = -1;
238 BOOST_TEST(
out == 9.9);
241 if (context.isRank(1)) {
248 int in = 3,
out = -1;
250 BOOST_TEST(
out == 9);
253 double in = 3.3,
out = -1;
255 BOOST_TEST(
out == 9.9);
258 if (context.isRank(2)) {
265 int in = 5,
out = -1;
267 BOOST_TEST(
out == 9);
270 double in = 5.5,
out = -1;
272 BOOST_TEST(
out == 9.9);
288 int in = 1,
out = -1;
290 BOOST_TEST(
out == in);
293 double in = 1.1,
out = -1;
295 BOOST_TEST(
out == in);
304 if (context.isPrimary()) {
318 BOOST_TEST(in == 9.9);
334 BOOST_TEST(
out == 9.9);
356 BOOST_TEST(in == 9.9);
BOOST_AUTO_TEST_CASE(testIQNIMVJPPWithSubsteps)
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END()
#define PRECICE_TEST_SETUP(...)
Creates and attaches a TestSetup to a Boost test case.
static void allreduceSum(precice::span< const double > sendData, precice::span< double > rcvData)
static int getSize()
Number of ranks. This includes ranks from both participants, e.g. minimal size is 2.
static double l2norm(const Eigen::VectorXd &vec)
The l2 norm of a vector is calculated on distributed data.
static Rank getRank()
Current rank.
static double dot(const Eigen::VectorXd &vec1, const Eigen::VectorXd &vec2)
static bool isPrimary()
True if this process is running the primary rank.
static void broadcast(bool &value)
static auto allSecondaryRanks()
Returns an iterable range over salve ranks [1, _size)
static auto allRanks()
Returns an iterable range over all ranks [0, _size)
static bool isParallel()
True if this process is running in parallel.
static bool isSecondary()
True if this process is running a secondary rank.
static com::PtrCommunication & getCommunication()
Intra-participant communication.
static void reduceSum(precice::span< const double > sendData, precice::span< double > rcvData)
boost::test_tools::predicate_result equals(const std::vector< float > &VectorA, const std::vector< float > &VectorB, float tolerance)
equals to be used in tests. Compares two std::vectors using a given tolerance. Prints both operands o...
Main namespace of the precice library.