Peano 4
No Matches
peano4::parallel::tests::NodeTest Class Reference

I test the mapping of vertex adjacency data onto stack numbers here. More...

#include <NodeTest.h>

Inheritance diagram for peano4::parallel::tests::NodeTest:
Collaboration diagram for peano4::parallel::tests::NodeTest:

Public Member Functions

 NodeTest ()
virtual void run () override
 This routine is triggered by the TestCaseCollection.
- Public Member Functions inherited from tarch::tests::TestCase
 TestCase (const std::string &testCaseName)
virtual ~TestCase ()
int getNumberOfErrors () const
std::string getTestCaseName () const

Private Member Functions

void testGetPeriodicBoundaryNumber ()
void testGetOutputStacksForPeriodicBoundaryExchange ()
 Boundary data exchange test case.
void testTagCalculation ()

Static Private Attributes

static tarch::logging::Log _log
 Logging device.

Additional Inherited Members

- Protected Member Functions inherited from tarch::tests::TestCase
 TestCase ()=delete
- Protected Attributes inherited from tarch::tests::TestCase
const std::string _testCaseName
 Name of the test case.
int _errors
 Error counter.
bool _error
 Indicate within macro if one specific validation failed.

Detailed Description

I test the mapping of vertex adjacency data onto stack numbers here.

Definition at line 21 of file NodeTest.h.

Constructor & Destructor Documentation

◆ NodeTest()

peano4::parallel::tests::NodeTest::NodeTest ( )

Definition at line 18 of file NodeTest.cpp.

Member Function Documentation

◆ run()

void peano4::parallel::tests::NodeTest::run ( )

This routine is triggered by the TestCaseCollection.

Implements tarch::tests::TestCase.

Definition at line 130 of file NodeTest.cpp.

References logTraceIn, logTraceOut, and testMethod.

◆ testGetOutputStacksForPeriodicBoundaryExchange()

void peano4::parallel::tests::NodeTest::testGetOutputStacksForPeriodicBoundaryExchange ( )

Boundary data exchange test case.

First step: top right corner

Pass in the vertex at the top right corner of a unit cube/square and set its adjacency information such as if we had periodic BCs in all directions. So we should exchange along all coordinate axes and along the diagonals, too. This means that we pipe out data according to the table below. We also validate that the corresponding input stacks are different.

direction to from
top 8 16
diagonal top right 7 15
right 10 18

Second step: bottom left corner

Counter part on bottom left vertex of domain with an adjacency list of [-2,-2,-2,0]. This gives:

direction to from
left 11 19
diagonal left bottom 14 22
bottom 13 21

Third step:

We have to find out that the stacks are properly matching once we mirror (copy) them onto each other. According to the tables above we'd expect the following outcome:

in out
7 22
8 21
10 19
11 18
13 16
14 15

We see immediately from the numbering, that this is "just" kind of the inverse index.

Definition at line 38 of file NodeTest.cpp.

References peano4::parallel::Node::getOutputStacksForPeriodicBoundaryExchange(), peano4::parallel::Node::getPeriodicBoundaryExchangeInputStackNumberForOutputStack(), peano4::parallel::Node::isPeriodicBoundaryExchangeOutputStackNumber(), peano4::parallel::Node::mapPeriodicBoundaryExchangeOutputStackOntoInputStack(), peano4::grid::Spacetree::RankOfPeriodicBoundaryCondition, peano4::parallel::Node::toString(), validate, validateEquals, validateEqualsWithParams1, validateEqualsWithParams2, validateEqualsWithParams3, and validateWithParams3.

Here is the call graph for this function:

◆ testGetPeriodicBoundaryNumber()

void peano4::parallel::tests::NodeTest::testGetPeriodicBoundaryNumber ( )

◆ testTagCalculation()

Field Documentation

◆ _log

tarch::logging::Log peano4::parallel::tests::NodeTest::_log

Logging device.

Definition at line 26 of file NodeTest.h.

The documentation for this class was generated from the following files: