Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website
Loading...
Searching...
No Matches
periodic.cpp File Reference

Identification of the nodes of periodic boundary zones. More...

#include "periodic.h"
#include <algorithm>
#include <cmath>
#include <limits>
#include <map>
#include <set>
#include <stdexcept>
#include <string>

Functions

std::vector< size_t > periodic_directions (const std::vector< Mesh::PeriodicPair > &pairs, PeriodicNodes &result)
 Check the pairs (zones used once, nonzero translations, at most three distinct ones) and fill result.zones and result.translations. Returns the lattice direction of every pair: pairs with the same translation share one.
 
rtype periodic_tolerance (rtype h)
 Matching tolerance of a pair whose zones' shortest edge is h.
 
std::string periodic_point_string (const std::array< rtype, N_DIM > &x)
 "(x, y[, z])", for error messages.
 
PeriodicNodes match_periodic_nodes (const std::vector< std::array< rtype, N_DIM > > &nodes, const std::vector< Mesh::BoundaryFace > &boundary_faces, const std::vector< Mesh::PeriodicPair > &pairs)
 Match the nodes of zone_b of every pair to the nodes of zone_a translated by the pair's translation (within 1e-6 of the zones' shortest edge) and join the matches into periodic classes. Pairs with the same translation share a lattice direction; there are at most three directions. Throws if a node has no match or several, or if the matches put a node at two different offsets from its key.
 

Detailed Description

Identification of the nodes of periodic boundary zones.

Author
Matthew Bonanni (mbona.nosp@m.nni0.nosp@m.01@gm.nosp@m.ail..nosp@m.com)
Version
0.1
Date
2026-10-02

Function Documentation

◆ match_periodic_nodes()

PeriodicNodes match_periodic_nodes ( const std::vector< std::array< rtype, N_DIM > > &  nodes,
const std::vector< Mesh::BoundaryFace > &  boundary_faces,
const std::vector< Mesh::PeriodicPair > &  pairs 
)

Match the nodes of zone_b of every pair to the nodes of zone_a translated by the pair's translation (within 1e-6 of the zones' shortest edge) and join the matches into periodic classes. Pairs with the same translation share a lattice direction; there are at most three directions. Throws if a node has no match or several, or if the matches put a node at two different offsets from its key.

◆ periodic_directions()

std::vector< size_t > periodic_directions ( const std::vector< Mesh::PeriodicPair > &  pairs,
PeriodicNodes &  result 
)

Check the pairs (zones used once, nonzero translations, at most three distinct ones) and fill result.zones and result.translations. Returns the lattice direction of every pair: pairs with the same translation share one.

◆ periodic_point_string()

std::string periodic_point_string ( const std::array< rtype, N_DIM > &  x)

"(x, y[, z])", for error messages.

◆ periodic_tolerance()

rtype periodic_tolerance ( rtype  h)

Matching tolerance of a pair whose zones' shortest edge is h.