Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
correlation::calculators::MotifFinder Class Reference

Utility class for finding structural motifs (rings) in a system. More...

#include <MotifFinder.hpp>

Static Public Member Functions

static std::map< int, size_t > findRings (const correlation::core::NeighborGraph &graph, size_t max_size=6)
 Finds and counts all chordless rings up to a maximum size using King's criterion.
static std::map< int, size_t > findFranzblauRings (const correlation::core::NeighborGraph &graph, size_t max_size=6)
 Finds and counts all Franzblau shortest-path primitive rings up to a maximum size.
static std::map< int, size_t > findRings (const correlation::core::NeighborGraph &graph, size_t max_size, RingType ring_type)
 Finds and counts all rings according to the specified ring criterion.
static std::vector< std::vector< correlation::core::AtomID > > extractCycles (const correlation::core::NeighborGraph &graph, size_t target_size)
 Extracts all exact cycles of a specific target size using King's criterion.
static std::vector< std::vector< correlation::core::AtomID > > extractFranzblauCycles (const correlation::core::NeighborGraph &graph, size_t target_size)
 Extracts all exact cycles of a specific target size using Franzblau's criterion.
static std::vector< std::vector< correlation::core::AtomID > > extractCycles (const correlation::core::NeighborGraph &graph, size_t target_size, RingType ring_type)
 Extracts all exact cycles of a specific target size according to the ring criterion.
static std::vector< std::vector< correlation::core::AtomID > > extractAllCycles (const correlation::core::NeighborGraph &graph, size_t max_size, RingType ring_type=RingType::King)
 Extracts all exact cycles up to a maximum size according to the ring criterion.
static correlation::core::NeighborGraph buildBridgedGraph (const correlation::core::NeighborGraph &graph, const correlation::core::Cell &cell, std::string_view former_element, std::string_view bridging_element)
 Builds a projected neighbor graph collapsing bridging atoms (e.g. Si-O-Si -> Si-Si).
static std::vector< std::vector< correlation::core::AtomID > > filterAlternatingCycles (const std::vector< std::vector< correlation::core::AtomID > > &cycles, const correlation::core::Cell &cell, std::string_view element_a, std::string_view element_b)
 Filters cycle list to retain only cycles strictly alternating between two elements.

Detailed Description

Utility class for finding structural motifs (rings) in a system.

This class provides static methods to search for and count chordless rings within a molecular system, leveraging the neighbor graph structure. Supports both King shortest-distance rings and Franzblau unique-geodesic primitive rings.

Member Function Documentation

◆ buildBridgedGraph()

correlation::core::NeighborGraph correlation::calculators::MotifFinder::buildBridgedGraph ( const correlation::core::NeighborGraph & graph,
const correlation::core::Cell & cell,
std::string_view former_element,
std::string_view bridging_element )
staticnodiscard

Builds a projected neighbor graph collapsing bridging atoms (e.g. Si-O-Si -> Si-Si).

In network glasses such as SiO2, this constructs an adjacency graph purely among network-former atoms that share a common bridging atom.

Parameters
[in]graphThe underlying atomic neighbor graph.
[in]cellThe atomic cell containing element species and positions.
[in]former_elementChemical symbol of network-former (e.g. "Si").
[in]bridging_elementChemical symbol of bridging species (e.g. "O").
Returns
A new NeighborGraph linking former atoms.
Here is the call graph for this function:

◆ extractAllCycles()

std::vector< std::vector< correlation::core::AtomID > > correlation::calculators::MotifFinder::extractAllCycles ( const correlation::core::NeighborGraph & graph,
size_t max_size,
RingType ring_type = RingType::King )
staticnodiscard

Extracts all exact cycles up to a maximum size according to the ring criterion.

Parameters
[in]graphThe neighbor graph to search.
[in]max_sizeThe maximum ring size to extract.
[in]ring_typeThe ring criterion (King or Franzblau).
Returns
A vector of all detected rings.
Here is the caller graph for this function:

◆ extractCycles() [1/2]

std::vector< std::vector< correlation::core::AtomID > > correlation::calculators::MotifFinder::extractCycles ( const correlation::core::NeighborGraph & graph,
size_t target_size )
staticnodiscard

Extracts all exact cycles of a specific target size using King's criterion.

Parameters
[in]graphThe neighbor graph to search.
[in]target_sizeThe exact size of the rings to extract.
Returns
A vector of rings, where each ring is represented as a vector of AtomIDs in order.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractCycles() [2/2]

std::vector< std::vector< correlation::core::AtomID > > correlation::calculators::MotifFinder::extractCycles ( const correlation::core::NeighborGraph & graph,
size_t target_size,
RingType ring_type )
staticnodiscard

Extracts all exact cycles of a specific target size according to the ring criterion.

Parameters
[in]graphThe neighbor graph to search.
[in]target_sizeThe exact size of the rings to extract.
[in]ring_typeThe ring criterion (King or Franzblau).
Returns
A vector of rings.

◆ extractFranzblauCycles()

std::vector< std::vector< correlation::core::AtomID > > correlation::calculators::MotifFinder::extractFranzblauCycles ( const correlation::core::NeighborGraph & graph,
size_t target_size )
staticnodiscard

Extracts all exact cycles of a specific target size using Franzblau's criterion.

Parameters
[in]graphThe neighbor graph to search.
[in]target_sizeThe exact size of the rings to extract.
Returns
A vector of rings, where each ring is represented as a vector of AtomIDs in order.
Here is the call graph for this function:

◆ filterAlternatingCycles()

std::vector< std::vector< correlation::core::AtomID > > correlation::calculators::MotifFinder::filterAlternatingCycles ( const std::vector< std::vector< correlation::core::AtomID > > & cycles,
const correlation::core::Cell & cell,
std::string_view element_a,
std::string_view element_b )
staticnodiscard

Filters cycle list to retain only cycles strictly alternating between two elements.

For example in SiO2, retains rings whose sequence is Si-O-Si-O...

Parameters
[in]cyclesList of extracted atomic cycles.
[in]cellThe atomic cell containing element species.
[in]element_aFirst element in alternating sequence.
[in]element_bSecond element in alternating sequence.
Returns
Filtered vector of alternating cycles.
Here is the call graph for this function:

◆ findFranzblauRings()

std::map< int, size_t > correlation::calculators::MotifFinder::findFranzblauRings ( const correlation::core::NeighborGraph & graph,
size_t max_size = 6 )
staticnodiscard

Finds and counts all Franzblau shortest-path primitive rings up to a maximum size.

Parameters
[in]graphThe neighbor graph representing atomic bonds.
[in]max_sizeThe maximum ring size (number of atoms) to search for.
Returns
A map where the key is the ring size and the value is the total count.
Here is the call graph for this function:

◆ findRings() [1/2]

std::map< int, size_t > correlation::calculators::MotifFinder::findRings ( const correlation::core::NeighborGraph & graph,
size_t max_size,
RingType ring_type )
staticnodiscard

Finds and counts all rings according to the specified ring criterion.

Parameters
[in]graphThe neighbor graph representing atomic bonds.
[in]max_sizeThe maximum ring size to search for.
[in]ring_typeThe ring criterion (King or Franzblau).
Returns
A map where the key is the ring size and the value is the total count.

◆ findRings() [2/2]

std::map< int, size_t > correlation::calculators::MotifFinder::findRings ( const correlation::core::NeighborGraph & graph,
size_t max_size = 6 )
staticnodiscard

Finds and counts all chordless rings up to a maximum size using King's criterion.

Parameters
[in]graphThe neighbor graph representing atomic bonds.
[in]max_sizeThe maximum ring size (number of atoms) to search for.
Returns
A map where the key is the ring size and the value is the total count.
Here is the call graph for this function:
Here is the caller graph for this function:

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