flippy
a c++20 package for dynamically triangulated membrane simulations.
Loading...
Searching...
No Matches
Globally defined functions constants and such

this is the grouped documentation of global objects not part of any specific class. More...

Macros

#define LONG_LONG_MAX   9223372036854775807LL
 Redefinition of the LONG_LONG_MAX macro in case a specific compiler does not implement it. The largest number that fits in the long long type.
 

Typedefs

using fp::Json = nlohmann::json
 shortening of the nlohmann::json namespace, which is an external open source library bundled by flippy.
 

Functions

static void fp::json_dump (std::string const &file_name, const Json &data)
 Simple wrapper function around Json objects built in dump() method.
 
static Json fp::json_read (std::string file_name)
 Simple wrapper function that reads the content of a text file into a json object.
 
template<typename T >
static bool fp::is_member (std::vector< T > const &v, T const &el)
 Convenient wrapper around std::find, which only works for std::vectors.
 

Variables

static constexpr auto fp::VERY_LARGE_NUMBER_ = static_cast<Index>(LONG_LONG_MAX)
 Literal for a very large integral number.
 
static constexpr int fp::BOND_DONATION_CUTOFF = 4
 a node needs to have more than the cutoff number of bonds to be allowed to donate one
 

Detailed Description

this is the grouped documentation of global objects not part of any specific class.

Function Documentation

◆ json_dump()

static void fp::json_dump ( std::string const & file_name,
const Json & data )
inlinestatic

Simple wrapper function around Json objects built in dump() method.

Parameters
file_nameFile name or a string containing the path and the file name.
datajson data object that is supposed to be stored.

◆ json_read()

static Json fp::json_read ( std::string file_name)
inlinestatic

Simple wrapper function that reads the content of a text file into a json object.

The file name onb the disk needs to end in '.json' for this function to work.

Parameters
file_nameFile name or a string containing the path and the file name.
Returns
Json object that was parsed from the provided file.
Warning
This function will stream any file into the json object. If the provided file is not a valid json file this will cause runtime errors.

◆ is_member()

template<typename T >
static bool fp::is_member ( std::vector< T > const & v,
T const & el )
static

Convenient wrapper around std::find, which only works for std::vectors.

Template Parameters
Ttype of the vector elements.
Parameters
vstd::vector in which we want to search.
elthe value of the element that we want to check for.
Returns
The function returns true if el is contained in vector v (at least once), otherwise it returns false.
Here is the caller graph for this function:

Variable Documentation

◆ VERY_LARGE_NUMBER_

auto fp::VERY_LARGE_NUMBER_ = static_cast<Index>(LONG_LONG_MAX)
staticconstexpr

Literal for a very large integral number.

This number will be used for the default instantiation of variables/ data members that hold indices. This is done to avoid instantiation with 0, which could also be a valid index. This way, one can differentiate between unintentionally default instantiated value and a proper value of an index. This will also mean that the use of such improperly instantiated indexer variables will cause an easier-to-identify error during runtime.

See also
fp::BondFlipData fp::Neighbors fp::Triangulation::two_common_neighbours(Index, Index) const fp::Triangulation::two_common_neighbour_positions(Index, Index) const