Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
tpl_ca_ghost_lattice_test.cc File Reference

Full-coverage tests for Aleph::CA::Ghost_Lattice (Phase 4). More...

#include <array>
#include <cstdint>
#include <stdexcept>
#include <gtest/gtest.h>
#include <ca-traits.H>
#include <tpl_ca_concepts.H>
#include <tpl_ca_storage.H>
#include <tpl_ca_lattice.H>
#include <tpl_ca_ghost_lattice.H>
#include <tpl_ca_neighborhood.H>
#include <tpl_ca_rule.H>
#include <tpl_ca_engine.H>
Include dependency graph for tpl_ca_ghost_lattice_test.cc:

Go to the source code of this file.

Functions

 TEST (CAGhostLatticeStrictAccess, InRangeMatchesStampedValues)
 
 TEST (CAGhostLatticeStrictAccess, OutOfRangeThrows)
 
 TEST (CAGhostLatticeShape, DimensionSizeExtentsHaloRadius)
 
 TEST (CAGhostLatticeShape, SizeAxisOutOfRangeThrows)
 
 TEST (CAGhostLatticeShapeEmptyExtents, OneDimensionalEmptyIsStable)
 
 TEST (CAGhostLatticeShapeEmptyExtents, TwoDimensionalEmptyAxesAreStable)
 
 TEST (CAGhostLatticeFill, FillSetsOnlyInteriorUntilRefresh)
 
 TEST (CAGhostLatticeHalo, OpenBoundaryHaloIsZero)
 
 TEST (CAGhostLatticeHalo, DirichletConstantValueHalo)
 
 TEST (CAGhostLatticeHalo, PeriodicHaloCopiesOppositeEdge)
 
 TEST (CAGhostLatticeHalo, ReflectiveHaloMirrorsInterior)
 
 TEST (CAGhostLatticeHalo, NeumannHaloClampsToBoundary)
 
template<typename Boundary >
static void expect_equivalent_at_safe ()
 
 TEST (CAGhostLatticeEquivalence, OpenMatchesClassic)
 
 TEST (CAGhostLatticeEquivalence, ToroidalMatchesClassic)
 
 TEST (CAGhostLatticeEquivalence, ReflectiveMatchesClassic)
 
 TEST (CAGhostLatticeEquivalence, NeumannMatchesClassic)
 
 TEST (CAGhostLatticeEquivalence, DirichletMatchesClassic)
 
 TEST (CAGhostLatticeHaloRadius2, BothRingsCarryPolicyValues)
 
 TEST (CAGhostLattice1D, PeriodicHaloAndEquivalence)
 
 TEST (CAGhostLattice3D, ReflectiveCornerConsistency)
 
 TEST (CAGhostLattice, SwapExchangesContents)
 
template<typename Boundary >
static void run_engine_equivalence (std::size_t steps)
 
 TEST (CAGhostEngineEquivalence, OpenBoundaryAt100Steps)
 
 TEST (CAGhostEngineEquivalence, ToroidalBoundaryAt150Steps)
 
 TEST (CAGhostEngineEquivalence, ReflectiveBoundaryAt120Steps)
 
 TEST (CAGhostEngineEquivalence, NeumannBoundaryAt100Steps)
 
 TEST (CAGhostEngineEquivalence, DirichletZeroAt100Steps)
 
 TEST (CAGhostEngineEquivalence, DirichletOneAt50Steps)
 
 TEST (CAGhostEngineRadius2, VonNeumannR2EquivalenceOnDirichlet)
 

Detailed Description

Full-coverage tests for Aleph::CA::Ghost_Lattice (Phase 4).

Scope:

  • Concept conformance (LatticeLike).
  • Strict at/set bounds-check semantics.
  • refresh_halo fills the halo correctly for every policy.
  • at_safe on the ghost lattice matches the classic Lattice at every in-halo coordinate, for every boundary policy (Open, Periodic/Toroidal, Reflective, Dirichlet/Constant, Neumann).
  • Engine equivalence: running Conway's Game of Life through the Synchronous_Engine for 100+ steps on a classic Lattice and on a Ghost_Lattice yields bit-identical states.
  • Halo radius >= 2 also works.
  • 1D and 3D sanity checks.

Definition in file tpl_ca_ghost_lattice_test.cc.

Function Documentation

◆ expect_equivalent_at_safe()

template<typename Boundary >
static void expect_equivalent_at_safe ( )
static

Definition at line 312 of file tpl_ca_ghost_lattice_test.cc.

References l.

◆ run_engine_equivalence()

template<typename Boundary >
static void run_engine_equivalence ( std::size_t  steps)
static

◆ TEST() [1/28]

TEST ( CAGhostEngineEquivalence  ,
DirichletOneAt50Steps   
)

Definition at line 548 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [2/28]

TEST ( CAGhostEngineEquivalence  ,
DirichletZeroAt100Steps   
)

Definition at line 542 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [3/28]

TEST ( CAGhostEngineEquivalence  ,
NeumannBoundaryAt100Steps   
)

Definition at line 537 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [4/28]

TEST ( CAGhostEngineEquivalence  ,
OpenBoundaryAt100Steps   
)

Definition at line 522 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [5/28]

TEST ( CAGhostEngineEquivalence  ,
ReflectiveBoundaryAt120Steps   
)

Definition at line 532 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [6/28]

TEST ( CAGhostEngineEquivalence  ,
ToroidalBoundaryAt150Steps   
)

Definition at line 527 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [7/28]

TEST ( CAGhostEngineRadius2  ,
VonNeumannR2EquivalenceOnDirichlet   
)

◆ TEST() [8/28]

TEST ( CAGhostLattice  ,
SwapExchangesContents   
)

Definition at line 435 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [9/28]

TEST ( CAGhostLattice1D  ,
PeriodicHaloAndEquivalence   
)

Definition at line 393 of file tpl_ca_ghost_lattice_test.cc.

References l.

◆ TEST() [10/28]

TEST ( CAGhostLattice3D  ,
ReflectiveCornerConsistency   
)

Definition at line 411 of file tpl_ca_ghost_lattice_test.cc.

References k, and l.

◆ TEST() [11/28]

TEST ( CAGhostLatticeEquivalence  ,
DirichletMatchesClassic   
)

Definition at line 342 of file tpl_ca_ghost_lattice_test.cc.

References l.

◆ TEST() [12/28]

TEST ( CAGhostLatticeEquivalence  ,
NeumannMatchesClassic   
)

Definition at line 337 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [13/28]

TEST ( CAGhostLatticeEquivalence  ,
OpenMatchesClassic   
)

Definition at line 325 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [14/28]

TEST ( CAGhostLatticeEquivalence  ,
ReflectiveMatchesClassic   
)

Definition at line 333 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [15/28]

TEST ( CAGhostLatticeEquivalence  ,
ToroidalMatchesClassic   
)

Definition at line 329 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [16/28]

TEST ( CAGhostLatticeFill  ,
FillSetsOnlyInteriorUntilRefresh   
)

Definition at line 210 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [17/28]

TEST ( CAGhostLatticeHalo  ,
DirichletConstantValueHalo   
)

◆ TEST() [18/28]

TEST ( CAGhostLatticeHalo  ,
NeumannHaloClampsToBoundary   
)

Definition at line 292 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [19/28]

TEST ( CAGhostLatticeHalo  ,
OpenBoundaryHaloIsZero   
)

Definition at line 232 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [20/28]

TEST ( CAGhostLatticeHalo  ,
PeriodicHaloCopiesOppositeEdge   
)

Definition at line 260 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [21/28]

TEST ( CAGhostLatticeHalo  ,
ReflectiveHaloMirrorsInterior   
)

Definition at line 276 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [22/28]

TEST ( CAGhostLatticeHaloRadius2  ,
BothRingsCarryPolicyValues   
)

Definition at line 364 of file tpl_ca_ghost_lattice_test.cc.

References l.

◆ TEST() [23/28]

TEST ( CAGhostLatticeShape  ,
DimensionSizeExtentsHaloRadius   
)

Definition at line 132 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [24/28]

TEST ( CAGhostLatticeShape  ,
SizeAxisOutOfRangeThrows   
)

Definition at line 146 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [25/28]

TEST ( CAGhostLatticeShapeEmptyExtents  ,
OneDimensionalEmptyIsStable   
)

Definition at line 152 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [26/28]

TEST ( CAGhostLatticeShapeEmptyExtents  ,
TwoDimensionalEmptyAxesAreStable   
)

Definition at line 172 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [27/28]

TEST ( CAGhostLatticeStrictAccess  ,
InRangeMatchesStampedValues   
)

Definition at line 115 of file tpl_ca_ghost_lattice_test.cc.

◆ TEST() [28/28]

TEST ( CAGhostLatticeStrictAccess  ,
OutOfRangeThrows   
)

Definition at line 123 of file tpl_ca_ghost_lattice_test.cc.