#include <triqs/mesh/discrete.hpp>
Discrete mesh type.
A discrete mesh satisfies the triqs::mesh::Mesh concept. It is defined by its size \( N \geq 0 \) and has the following properties:
- Each mesh point is identified by a unique index \( n \in \{0, 1, \ldots, N-1\} \).
- An index \( n \) is mapped to the corresponding data index \( d \) by the identity function \( d(n) = n \) and vice versa.
- There is no explicit value associated with a mesh point, i.e. it does not satisfy the triqs::mesh::MeshWithValues concept.
Definition at line 51 of file discrete.hpp.
|
|
using | data_index_t = long |
| | Data index type.
|
|
using | index_t = long |
| | Index type.
|
|
| | discrete (long N=0) |
| | Construct a discrete mesh of a given size \( N \geq 0 \).
|
|
auto | begin () const |
| | Get an iterator to the beginning of the mesh.
|
|
auto | cbegin () const |
| | Get a const iterator to the beginning of the mesh.
|
|
auto | cend () const |
| | Get a const iterator to the end of the mesh.
|
| void | deserialize (auto &ar) |
| | Deserialize the mesh from a generic archive.
|
|
auto | end () const |
| | Get an iterator to the end of the mesh.
|
| bool | is_index_valid (index_t n) const noexcept |
| | Check if an index \( n \) is valid.
|
|
uint64_t | mesh_hash () const |
| | Get the hash value of the mesh.
|
| mesh_point_t | operator() (index_t n) const |
| | Function call operator to access a mesh point by its index \( n \in \{0, 1, \ldots, N-1\} \).
|
|
bool | operator== (discrete const &) const =default |
| | Equal-to comparison operator compares the size \( N \) of the meshes.
|
| mesh_point_t | operator[] (long d) const |
| | Subscript operator to access a mesh point by its data index \( d \in \{0, 1, \ldots, N-1\} \).
|
| void | serialize (auto &ar) const |
| | Serialize the mesh to a generic archive.
|
|
long | size () const |
| | Get the size \( N \) of the mesh, i.e. the number of mesh points.
|
| data_index_t | to_data_index (index_t n) const noexcept |
| | Map an index \( n \in \{0, 1, \ldots, N-1\} \) to its corresponding data index \( d(n) \).
|
| index_t | to_index (long d) const noexcept |
| | Map a data index \( d \in \{0, 1, \ldots, N-1\} \) to the corresponding index \( n(d) \).
|
|
|
static std::string | hdf5_format () |
| | Get the HDF5 format tag.
|
◆ discrete()
| triqs::mesh::discrete::discrete |
( |
long | N = 0 | ) |
|
|
inline |
Construct a discrete mesh of a given size \( N \geq 0 \).
- Parameters
-
Definition at line 100 of file discrete.hpp.
◆ deserialize()
| void triqs::mesh::discrete::deserialize |
( |
auto & | ar | ) |
|
|
inline |
Deserialize the mesh from a generic archive.
- Parameters
-
| ar | Archive to deserialize from. |
Definition at line 188 of file discrete.hpp.
◆ is_index_valid()
| bool triqs::mesh::discrete::is_index_valid |
( |
index_t | n | ) |
const |
|
inlinenodiscardnoexcept |
Check if an index \( n \) is valid.
- Parameters
-
- Returns
- True if \( 0 \leq n < N \), false otherwise.
Definition at line 111 of file discrete.hpp.
◆ operator()()
Function call operator to access a mesh point by its index \( n \in \{0, 1, \ldots, N-1\} \).
- Parameters
-
| n | Index \( n \) of the mesh point. |
- Returns
- mesh_point_t with the index \( n \), data index \( d(n) = n \) and hash value of the current mesh.
Definition at line 149 of file discrete.hpp.
◆ operator[]()
| mesh_point_t triqs::mesh::discrete::operator[] |
( |
long | d | ) |
const |
|
inlinenodiscard |
Subscript operator to access a mesh point by its data index \( d \in \{0, 1, \ldots, N-1\} \).
- Parameters
-
| d | Data index \( d \) of the mesh point. |
- Returns
- mesh_point_t with the index \( n(d) = d \), data index \( d \) and hash value of the current mesh.
Definition at line 141 of file discrete.hpp.
◆ serialize()
| void triqs::mesh::discrete::serialize |
( |
auto & | ar | ) |
const |
|
inline |
Serialize the mesh to a generic archive.
- Parameters
-
| ar | Archive to serialize to. |
Definition at line 182 of file discrete.hpp.
◆ to_data_index()
Map an index \( n \in \{0, 1, \ldots, N-1\} \) to its corresponding data index \( d(n) \).
- Parameters
-
- Returns
- Data index \( d(n) = n \).
Definition at line 119 of file discrete.hpp.
◆ to_index()
| index_t triqs::mesh::discrete::to_index |
( |
long | d | ) |
const |
|
inlinenodiscardnoexcept |
Map a data index \( d \in \{0, 1, \ldots, N-1\} \) to the corresponding index \( n(d) \).
- Parameters
-
| d | Data index \( d \) to map. |
- Returns
- Index \( n(d) = d \).
Definition at line 130 of file discrete.hpp.
◆ h5_read
| void h5_read |
( |
h5::group | g, |
|
|
std::string const & | name, |
|
|
discrete & | m ) |
|
friend |
Read a triqs::mesh::discrete mesh from HDF5.
- Parameters
-
| g | h5::group to be read from. |
| name | Name of the subgroup. |
| m | Mesh object to be read into. |
Definition at line 213 of file discrete.hpp.
◆ h5_write
| void h5_write |
( |
h5::group | g, |
|
|
std::string const & | name, |
|
|
discrete const & | m ) |
|
friend |
Write a triqs::mesh::discrete mesh to HDF5.
- Parameters
-
| g | h5::group to be written to. |
| name | Name of the subgroup. |
| m | Mesh object to be written. |
Definition at line 200 of file discrete.hpp.
◆ operator<<
| std::ostream & operator<< |
( |
std::ostream & | sout, |
|
|
discrete const & | m ) |
|
friend |
Write a triqs::mesh::discrete mesh to a std::ostream.
- Parameters
-
| sout | std::ostream object. |
| m | Mesh to be written. |
- Returns
- Reference to std::ostream object.
Definition at line 176 of file discrete.hpp.
The documentation for this class was generated from the following file: