![]() |
OpenPFC
0.1.4
Phase Field Crystal simulation framework
|
Namespace for decomposition-related classes and functions. More...
Classes | |
| struct | World |
| Represents the global simulation domain (the "world"). More... | |
Typedefs | |
| using | CartesianWorld = World< CartesianTag > |
| Type alias for Cartesian 3D World (most common usage) | |
Functions | |
| template<typename T > | |
| auto | create (const World< T > &world, const heffte::box3d< int > &box) |
| Construct a new World object from an existing one and a box. | |
| template<typename T > | |
| auto | to_indices (const World< T > &world) |
| template<typename T > | |
| auto | split_world (const World< T > &world, const Int3 &grid) |
| CartesianWorld | create (const Int3 &size) |
| Create a World object with the specified size and default offset and spacing. | |
| CartesianWorld | create (const GridSize &size, const PhysicalOrigin &origin, const GridSpacing &spacing) |
| Create a World object with strong types for type safety. | |
| CartesianWorld | create (const Int3 &size, const Real3 &offset, const Real3 &spacing) |
| Create a World object with raw arrays (DEPRECATED) | |
| CartesianWorld | uniform (int size) |
| Create uniform grid with unit spacing at origin. | |
| CartesianWorld | uniform (int size, double spacing) |
| Create uniform grid with specified spacing. | |
| CartesianWorld | from_bounds (Int3 size, Real3 lower, Real3 upper, Bool3 periodic={true, true, true}) |
| Create grid from physical bounds (automatically computes spacing). | |
| CartesianWorld | with_spacing (Int3 size, Real3 spacing) |
| Create grid with default origin but custom spacing. | |
| CartesianWorld | with_origin (Int3 size, Real3 origin) |
| Create grid with custom origin but unit spacing. | |
| template<typename T > | |
| Int3 | get_size (const World< T > &world) noexcept |
| template<typename T > | |
| int | get_size (const World< T > &world, int index) |
| template<typename T > | |
| size_t | get_total_size (const World< T > &world) noexcept |
| const auto & | get_lower (const CartesianWorld &world) noexcept |
| Get the lower bounds of the world. | |
| const auto & | get_lower (const CartesianWorld &world, int index) |
| Get the lower bounds of the world in a specific dimension. | |
| const auto & | get_upper (const CartesianWorld &world) noexcept |
| Get the upper bounds of the world in a specific dimension. | |
| auto | get_upper (const CartesianWorld &world, int index) |
| Get the upper bounds of the world in a specific dimension. | |
| template<typename T > | |
| const auto & | get_coordinate_system (const World< T > &world) noexcept |
| Get the coordinate system of the world. | |
| const Real3 & | get_spacing (const CartesianWorld &world) noexcept |
| double | get_spacing (const CartesianWorld &world, int index) noexcept |
| const Real3 & | get_origin (const CartesianWorld &world) noexcept |
| double | get_origin (const CartesianWorld &world, int index) noexcept |
| template<typename T > | |
| auto | to_coords (const World< T > &world, const Int3 &indices) noexcept |
| template<typename T > | |
| auto | to_indices (const World< T > &world, const Real3 &coords) noexcept |
| template<typename T > | |
| double | physical_volume (const World< T > &world) noexcept |
| Compute physical volume of domain. | |
| template<typename T > | |
| bool | is_1d (const World< T > &world) noexcept |
| Check if domain is 1D (only x-direction has > 1 point) | |
| template<typename T > | |
| bool | is_2d (const World< T > &world) noexcept |
| Check if domain is 2D (x and y have > 1 point, z has 1) | |
| template<typename T > | |
| bool | is_3d (const World< T > &world) noexcept |
| Check if domain is 3D (all dimensions have > 1 point) | |
| template<typename T > | |
| int | dimensionality (const World< T > &world) noexcept |
| Get dimensionality as integer. | |
| template<typename T > | |
| Real3 | get_lower_bounds (const World< T > &world) noexcept |
| Get physical lower bounds (origin corner) | |
| template<typename T > | |
| Real3 | get_upper_bounds (const World< T > &world) noexcept |
| Get physical upper bounds (far corner) | |
| template<typename T > | |
| std::array< std::vector< double >, 3 > | coordinates (const World< T > &world) noexcept |
Namespace for decomposition-related classes and functions.
| CartesianWorld pfc::world::create | ( | const GridSize & | size, |
| const PhysicalOrigin & | origin, | ||
| const GridSpacing & | spacing | ||
| ) |
Create a World object with strong types for type safety.
This is the preferred API for creating World objects. Strong types (GridSize, PhysicalOrigin, GridSpacing) make the API self-documenting and prevent parameter confusion at compile time.
| size | Grid dimensions (number of points per dimension) |
| origin | Physical origin of the coordinate system |
| spacing | Physical spacing between grid points |
| CartesianWorld pfc::world::create | ( | const Int3 & | size | ) |
| CartesianWorld pfc::world::create | ( | const Int3 & | size, |
| const Real3 & | offset, | ||
| const Real3 & | spacing | ||
| ) |
Create a World object with raw arrays (DEPRECATED)
| size | Grid dimensions |
| offset | Physical offset (origin) of coordinate system |
| spacing | Physical spacing between grid points |
Migration guide:
Get dimensionality as integer.
Returns 1, 2, or 3 based on how many dimensions have more than one grid point. Returns 0 for degenerate case where all dimensions have size 1.
| world | World instance |
Time complexity: O(1)

|
inline |
Create grid from physical bounds (automatically computes spacing).
| size | Grid dimensions |
| lower | Lower physical bounds |
| upper | Upper physical bounds |
| periodic | Periodicity flags (default: all periodic) |
| std::invalid_argument | if any dimension size <= 0 |
| std::invalid_argument | if any upper bound <= corresponding lower bound |
|
inlinenoexcept |
Get the coordinate system of the world.
| w | World object. |

|
inlinenoexcept |
Get the lower bounds of the world.
| w | World object. |

|
inline |
Get the lower bounds of the world in a specific dimension.
| w | World object. |
| i | Dimension index. |

Get physical lower bounds (origin corner)
Returns the physical coordinates of the grid point at index (0, 0, 0). This is the lower corner of the domain.
| world | World instance |
Time complexity: O(1)
|
inlinenoexcept |
Get the upper bounds of the world in a specific dimension.
| w | World object. |

|
inline |
Get the upper bounds of the world in a specific dimension.
| w | World object. |
| i | Dimension index. |

Get physical upper bounds (far corner)
Returns the physical coordinates of the grid point at the maximum indices (nx-1, ny-1, nz-1). This is the upper corner of the domain.
| world | World instance |
Time complexity: O(1)
Check if domain is 1D (only x-direction has > 1 point)
A domain is considered 1D if only the first dimension has more than one grid point.
| world | World instance |
Time complexity: O(1)

Check if domain is 2D (x and y have > 1 point, z has 1)
A domain is considered 2D if the first two dimensions have more than one grid point and the third has exactly one.
| world | World instance |
Time complexity: O(1)

Check if domain is 3D (all dimensions have > 1 point)
A domain is considered 3D if all three dimensions have more than one grid point.
| world | World instance |
Time complexity: O(1)

Compute physical volume of domain.
Returns the total physical volume (or area in 2D, length in 1D) of the simulation domain.
| world | World instance |
Time complexity: O(1) Space complexity: O(1)
|
inline |
Create uniform grid with unit spacing at origin.
Most common case: N×N×N grid with spacing=1, origin=(0,0,0).
| size | Grid dimensions (same in all directions) |
| std::invalid_argument | if size <= 0 |

|
inline |
Create uniform grid with specified spacing.
| size | Grid dimensions (same in all directions) |
| spacing | Grid spacing (same in all directions) |
| std::invalid_argument | if size <= 0 |
| std::invalid_argument | if spacing <= 0 |

|
inline |
Create grid with custom origin but unit spacing.
| size | Grid dimensions |
| origin | Physical origin |
| std::invalid_argument | if any size <= 0 |

|
inline |
Create grid with default origin but custom spacing.
| size | Grid dimensions |
| spacing | Grid spacing |
| std::invalid_argument | if any size <= 0 |
| std::invalid_argument | if any spacing <= 0 |
