OpenPFC  0.1.4
Phase Field Crystal simulation framework
Loading...
Searching...
No Matches
pfc::GridSize Struct Reference

Grid dimensions (number of grid points per dimension) More...

#include <strong_types.hpp>

Collaboration diagram for pfc::GridSize:

Public Member Functions

 GridSize (const Int3 &v)
 Construct from Int3 (implicit for backward compatibility)
 
const Int3 & get () const noexcept
 Get underlying value.
 
 operator const Int3 & () const noexcept
 Implicit conversion to Int3.
 
bool operator== (const GridSize &other) const noexcept
 Equality comparison.
 
bool operator!= (const GridSize &other) const noexcept
 Inequality comparison.
 

Public Attributes

Int3 value
 Underlying array value.
 

Detailed Description

Grid dimensions (number of grid points per dimension)

Represents the size of the computational grid in each dimension. Use this instead of raw Int3 for function parameters to make intent clear and catch argument order mistakes.

Note
Zero-cost: sizeof(GridSize) == sizeof(Int3)
Trivially copyable: No heap allocation or deep copy
GridSize size({64, 64, 64}); // 64³ grid
Int3 raw = size; // Implicit conversion
Grid dimensions (number of grid points per dimension)
Definition strong_types.hpp:176
Represents the global simulation domain (the "world").
Definition world.hpp:91
Examples
04_diffusion_model.cpp, and world_strong_types_example.cpp.

Constructor & Destructor Documentation

◆ GridSize()

pfc::GridSize::GridSize ( const Int3 &  v)
inline

Construct from Int3 (implicit for backward compatibility)

Parameters
vGrid dimensions

Member Function Documentation

◆ get()

const Int3 & pfc::GridSize::get ( ) const
inlinenoexcept

Get underlying value.

Returns
Reference to underlying Int3
Here is the caller graph for this function:

◆ operator const Int3 &()

pfc::GridSize::operator const Int3 & ( ) const
inlinenoexcept

Implicit conversion to Int3.

Returns
Reference to underlying Int3

◆ operator!=()

bool pfc::GridSize::operator!= ( const GridSize other) const
inlinenoexcept

Inequality comparison.

Parameters
otherGridSize to compare
Returns
true if values are not equal

◆ operator==()

bool pfc::GridSize::operator== ( const GridSize other) const
inlinenoexcept

Equality comparison.

Parameters
otherGridSize to compare
Returns
true if values are equal

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