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

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

#include <array>
#include <cstdint>
#include <map>
#include <string>
#include <vector>
#include "mesh.h"

Go to the source code of this file.

Classes

struct  PeriodicNodes
 Periodic classes of the mesh nodes: the translation of each lattice direction, and per node its key (the lowest node id of its class) and its lattice offset L, with x_n = x_key + sum_j L_j translations[j]. More...
 
class  PeriodicGrid
 Points on a grid of spacing h. A point within the tolerance of a query lies in one of the 3^N_DIM grid cells around the query's. More...
 

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.