OpenPFC  0.1.4
Phase Field Crystal simulation framework
Loading...
Searching...
No Matches
Complex

fields (for FFT operations)

using Complex = std::complex<double>;
{64, 64, 33}, // FFT size (nz/2+1 for real-to-complex)
{0, 0, 0},
{0.0, 0.0, 0.0},
{1.0, 1.0, 1.0}
);
// Initialize complex field
kspace_field.apply([](double kx, double ky, double kz) {
double k2 = kx*kx + ky*ky + kz*kz;
return Complex(std::exp(-k2/10.0), 0.0);
});
Represents the global simulation domain (the "world").
Definition world.hpp:91

Performance Considerations:

Memory Layout:

Common Use Cases:

Note
Geometry (origin, discretization, bounds) is immutable after construction
Only nearest-neighbor interpolation supported (no linear/cubic)
For MPI subdomains, use offset parameter to specify global position
Warning
interpolate() returns reference - ensure coordinate is in bounds! Use inbounds() first if uncertain
See also
Array<T,D> for underlying storage
MultiIndex<D> for index iteration
world.hpp for coordinate system abstraction
Model::get_real_field() for integration with simulation fields