flippy
a c++20 package for dynamically triangulated membrane simulations.
Loading...
Searching...
No Matches
fp::BondFlipData Struct Reference

A helper struct; keeps track of bond flips. More...

#include <Triangulation.hpp>

Collaboration diagram for fp::BondFlipData:

Public Attributes

bool flipped = false
 track if the bond was flipped.
 
Index common_nn_0 = VERY_LARGE_NUMBER_
 Global id of a node that is supposed to receive a bond after a flip.
 
Index common_nn_1 = VERY_LARGE_NUMBER_
 Global id of a node that is supposed to receive a bond after a flip.
 

Detailed Description

A helper struct; keeps track of bond flips.

A bond flip can be unsuccessful, e.g., if the requested two nodes that are donating an edge already have too few edges (more details on bond flips and how they can fail are provided in the Triangulation.flip_bond(Index, Index, Real, Real) function). If the flip does happen, then flipped will be changed to true by the Triangulation.flip_bond(Index, Index, Real, Real) function and common_nn_0 and common_nn_1 will record the ids of nodes that receive new common bond. If the flip does not happen then the common_nn_0 and common_nn_1 data members will hold a VERY_LARGE_NUMBER_ with which they were initiated.

The initiation with VERY_LARGE_NUMBER_ is done to avoid common_nn_0 and common_nn_1 being zero initiated. This mechanism will lead to wrong behavior that is easier to identify during debugging in situations of un-careful usage. Example of such un-careful usage is if the end-user does not check that the bonds were not flipped and tries to un-flip bonds.

State of the triangulation before and after the flip.
before the flip after the flip
common nn 1 common nn 1
/ \ / | \
/ \ / | \
node --------- nn node | nn
\ / \ | /
\ / \ | /
common nn 0 common nn 0
Template Parameters
Indextype that will be used for all integer numbers inside this class/struct. Any data type that satisfies the indexing_number concept is allowed, for example, unsigned int.
See also
Triangulation.flip_bond(Index, Index, Real, Real)
Triangulation.unflip_bond(Index, Index, BondFlipData<Index> const&)
Triangulation.flip_bond_unchecked(Index, Index, Index, Index)

The documentation for this struct was generated from the following file: