Skip to content

OpenPFC release v0.1.3 (2025-11-25)

Choose a tag to compare

@ahojukka5 ahojukka5 released this 24 Nov 22:26
· 345 commits to master since this release
86a3a4b

This release focuses on extensibility, clarity, and zero-cost helpers:
custom coordinate systems via ADL, comprehensive API documentation with runnable
examples, FFT k-space helper functions, and an API cleanup moving
DiscreteField::interpolate() to a free function for consistency and ADL
extensibility.

Added: New custom coordinate system example, richer API documentation with
example programs, k-space helper functions for spectral methods, and a modern
interpolation API via free functions.

Fixed: none in this release.

Breaking changes: none — DiscreteField::interpolate() member remains available
but is deprecated in favor of the free function.


Added

  • Examples: Custom coordinate system example in examples/17_custom_coordinate_system.cpp
    demonstrating OpenPFC's extensibility via ADL (Argument-Dependent Lookup). Implements
    complete polar (2D: r, θ) and spherical (3D: r, θ, φ) coordinate systems with coordinate
    transformations (polar_to_coords(), polar_to_indices(), spherical_to_coords(),
    spherical_to_indices()). Includes comprehensive Doxygen documentation (615 lines),
    round-trip transformation verification, and 4-step recipe showing users how to add
    custom coordinate systems without modifying OpenPFC source code. Embodies "Laboratory,
    Not Fortress" philosophy - users can extend with cylindrical, spherical, or custom
    geometries through tag-based dispatch and free functions. Example compiles cleanly
    with zero warnings and demonstrates working coordinate conversions with correct output.
  • Documentation: Comprehensive API documentation for top 10 most-used public
    APIs with detailed @example blocks and usage patterns. Enhanced documentation
    covers World (domain creation and coordinate transforms), Model (physics
    implementation), Simulator (time integration orchestration), FFT (spectral
    transforms), Time (time stepping), Decomposition (parallel decomposition),
    ResultsWriter (output formats), FieldModifier (IC/BC extensibility), and
    DiscreteField (coordinate-aware fields). Added 10 standalone example programs
    (4,570+ lines) demonstrating complete usage workflows from basic setup to
    production PFC simulations. Includes build system integration via
    docs/api/examples/CMakeLists.txt with BUILD_API_EXAMPLES option. Documentation
    warnings reduced from 9 to 1 (89% improvement). All examples validated and
    test suite confirms no regressions (73 test cases, 5,836 assertions passing).
  • FFT: K-space helper functions in include/openpfc/fft/kspace.hpp providing
    zero-cost abstractions for wave vector calculations in spectral methods.
    Added 4 inline helper functions: k_frequency_scaling(world) for computing
    frequency scaling factors (2π/L), k_component(index, size, freq_scale) for
    wave vector components with Nyquist folding, k_laplacian_value(ki, kj, kk)
    for computing -k² Laplacian operator, and k_squared_value(ki, kj, kk) for
    magnitude squared. Eliminates 120+ lines of duplicated k-space calculation
    code across examples (04_diffusion_model.cpp, 12_cahn_hilliard.cpp, tungsten.cpp,
    etc.). All functions are inline, noexcept, and compile to identical machine
    code as manual implementation (zero runtime overhead). Comprehensive test
    coverage (177 assertions in 6 test cases). Example program added in
    examples/fft_kspace_helpers_example.cpp demonstrating before/after comparison.
  • DiscreteField: Converted interpolate() from member function to free function
    pfc::interpolate(field, coords) aligning with OpenPFC's "structs + free functions"
    design philosophy. Added both mutable and const overloads for type safety. Member
    function deprecated with [[deprecated]] attribute for v1.x backward compatibility
    (will be removed in v2.0). Free function enables ADL-based extension allowing users
    to provide custom interpolation schemes without modifying OpenPFC. Updated all
    11 call sites across tests, examples, and documentation to use new API. Added
    comprehensive test coverage (95+ new test lines) including mutable/const overloads,
    ADL lookup verification, and nearest-neighbor rounding behavior tests. All 222
    assertions pass. Zero runtime overhead maintained (inline functions).