OpenPFC  0.1.4
Phase Field Crystal simulation framework
Loading...
Searching...
No Matches
pfc::world::World< T > Struct Template Referencefinal

Represents the global simulation domain (the "world"). More...

#include <world.hpp>

Collaboration diagram for pfc::world::World< T >:

Public Member Functions

 World (const Int3 &lower, const Int3 &upper, const CoordinateSystem< T > &cs)
 Constructs a World object.
 
bool operator== (const World &other) const noexcept
 Equality operator.
 
bool operator!= (const World &other) const noexcept
 Inequality operator.
 

Public Attributes

const Int3 m_lower
 Lower index bounds.
 
const Int3 m_upper
 Upper index bounds.
 
const Int3 m_size
 Grid dimensions: {nx, ny, nz}.
 
const CoordinateSystem< T > m_cs
 Coordinate system.
 

Friends

template<typename T_ >
std::ostream & operator<< (std::ostream &os, const World< T_ > &w) noexcept
 Stream output operator.
 

Detailed Description

template<typename T>
struct pfc::world::World< T >

Represents the global simulation domain (the "world").

The World class defines the size of the global simulation domain and coordinate system. It is a purely functional object with no mutable state, constructed once and immutable thereafter. This design enhances correctness, thread safety, testability, and reproducibility.

Coordinate system is defined via a tag-based programming approach, allowing different coordinate systems (Cartesian, Polar, Cylindrical) without creating a separate class for each. We default to 3D Cartesian as it's most common.

Template Parameters
TCoordinate system tag (e.g., CartesianTag)
See also
world_factory.hpp for construction
world_queries.hpp for accessing properties
Examples
/home/runner/work/OpenPFC/OpenPFC/examples/17_custom_coordinate_system.cpp, /home/runner/work/OpenPFC/OpenPFC/include/openpfc/core/decomposition.hpp, /home/runner/work/OpenPFC/OpenPFC/include/openpfc/results_writer.hpp, /home/runner/work/OpenPFC/OpenPFC/include/openpfc/results_writers/vtk_writer.hpp, /home/runner/work/OpenPFC/OpenPFC/include/openpfc/time.hpp, 01_world_basics.cpp, 02_domain_decomposition.cpp, 02_fft_transforms.cpp, 03_parallel_fft.cpp, 03_simulator_workflow.cpp, 04_diffusion_model.cpp, 05_simulator.cpp, 06_multi_index.cpp, 07_array.cpp, 08_discrete_fields.cpp, Array-style, Basic, Complex, Coordinate-space, Creating, Full, Functional, Integration, Interpolation, MPI, Reading, Simple, world.cpp, and world_strong_types_example.cpp.

Constructor & Destructor Documentation

◆ World()

template<typename T >
pfc::world::World< T >::World ( const Int3 &  lower,
const Int3 &  upper,
const CoordinateSystem< T > &  cs 
)
explicit

Constructs a World object.

Parameters
lowerLower index bounds of the world.
upperUpper index bounds of the world.
csCoordinate system.
Examples
/home/runner/work/OpenPFC/OpenPFC/include/openpfc/core/decomposition.hpp, /home/runner/work/OpenPFC/OpenPFC/include/openpfc/fft.hpp, and /home/runner/work/OpenPFC/OpenPFC/include/openpfc/model.hpp.
Here is the caller graph for this function:

Member Function Documentation

◆ operator!=()

template<typename T >
bool pfc::world::World< T >::operator!= ( const World< T > &  other) const
inlinenoexcept

Inequality operator.

Parameters
otherAnother World object.
Returns
True if not equal, false otherwise.

◆ operator==()

template<typename T >
bool pfc::world::World< T >::operator== ( const World< T > &  other) const
inlinenoexcept

Equality operator.

Parameters
otherAnother World object.
Returns
True if equal, false otherwise.

Friends And Related Symbol Documentation

◆ operator<<

template<typename T >
template<typename T_ >
std::ostream & operator<< ( std::ostream &  os,
const World< T_ > &  w 
)
friend

Stream output operator.

Parameters
osOutput stream.
wWorld object.
Returns
Reference to the output stream.

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