![]() |
OpenPFC
0.1.4
Phase Field Crystal simulation framework
|
Primary template for defining coordinate systems by tag. More...
Primary template for defining coordinate systems by tag.
The CoordinateSystem<Tag> template provides a mechanism to define coordinate systems in a modular and extensible way, where each Tag corresponds to a specific geometry (e.g., Cartesian, Polar, Cylindrical).
Specializations of this template should define:
to_physical(const Int3&) -> Real3to_index(const Real3&) -> Int3This design decouples geometry from logic and enables user-defined coordinate systems to integrate cleanly with the simulation framework. It also avoids inheritance or runtime polymorphism, favoring compile-time specialization and inlining for performance-critical transformations.
Example usage:
Coordinate systems are used by the World<Tag> class and related infrastructure to define how grid indices map to real-world physical coordinates.
| Tag | A user-defined type that uniquely identifies the coordinate system. |