OpenPFC release v0.1.2 (2025-11-21)
This version of OpenPFC delivers developer ergonomics and reliability
improvements: ergonomic World creation helpers, compile-time mathematical
constants, comprehensive documentation, higher test coverage, and build
hardening — making OpenPFC easier to use and safer to extend.
Added: New ergonomic World creation helpers, a compile-time mathematical
constants library, major documentation improvements (100% @file coverage,
REUSE-compliant SPDX headers), and broader testing with ~90% line and ~95%
function coverage plus a pre-commit clang-format hook. Build hardening includes
-Werror=format-security.
Fixed: More robust CMake detection for Catch2 and HeFFTe, corrected tungsten
application linkage, replacement of runtime π calculations with
pfc::constants::pi, and minor formatting cleanups.
Breaking changes: Model::rank0 is now private; use
Model::is_rank0() instead. This is a straightforward search-and-replace with
no runtime overhead.
Added
- Core: World construction helper functions in
include/openpfc/core/world.hpp
providing ergonomic, zero-cost abstractions for common grid creation patterns.
Added 5 inline helper functions:uniform(int)anduniform(int, double)for
N³ grids,from_bounds(...)for automatic spacing computation from physical
bounds (periodic/non-periodic aware),with_spacing(...)for custom spacing
with default origin, andwith_origin(...)for custom origin with unit spacing.
All helpers include input validation with clear error messages. Reduces
boilerplate fromworld::create({64,64,64}, {0,0,0}, {1,1,1})to
world::uniform(64). Backward compatible - existingcreate()API unchanged.
Comprehensive test coverage (32 new assertions). Example program added in
examples/world_helpers_example.cpp. - Core: Mathematical constants in
include/openpfc/constants.hppfor
compile-time evaluation with zero runtime overhead. Added 12 constants: π,
2π, π/2, π/4, 1/π, √π, √2, √3, e, ln(2), ln(10), and φ (golden ratio).
All constants areconstexpr doublewith 16+ decimal digits precision.
Comprehensive Doxygen documentation included. Constants accessible via both
pfc::constants::piandpfc::pinamespaces. API matches C++20
std::numbersfor future migration. - Testing: Comprehensive test suite for mathematical constants in
tests/unit/core/test_constants.cppwith 13 test cases and 41 assertions
covering precision verification, derived constants, compile-time evaluation,
and integration scenarios (FFT wave numbers, crystal geometry). - Testing: Pre-commit hook for automatic clang-format checking to prevent
formatting issues before pushing to CI. Hook available inscripts/pre-commit-hook
with installation instructions inscripts/README.md. - Testing: Comprehensive test coverage improvements achieving 90.7% line
coverage and 94.8% function coverage. Added tests forutils.hpp,
world.cpp, andfixed_bc.hpp. - Build system: Added
-Werror=format-securitycompiler flag to catch
format string vulnerabilities locally before CI, matching CI behavior. - Documentation: Added SPDX license headers to test README files
(tests/,tests/benchmarks/,tests/fixtures/,tests/integration/,
tests/unit/) for REUSE compliance (174/174 files now compliant). - Documentation: Added comprehensive
@filedocumentation tags to all 41
public header files ininclude/openpfc/achieving 100% coverage. Each header
now includes brief description, detailed explanation, practical usage examples,
and cross-references to related components. Reduced Doxygen@filewarnings
from 47 to 0. Improves API discoverability for new users and enables better
IDE/LLM assistance.
Fixed
- Examples: Replaced runtime pi calculation (
std::atan(1.0) * 4.0) with
compile-timepfc::constants::piindiffusion_model.hpp,
12_cahn_hilliard.cpp, and05_simulator.cppfor zero runtime overhead in
FFT wave number calculations. Removed unused global PI constants. - CMake build system: Fixed Catch2 detection in
FindCatch2.cmakeby
explicitly settingCatch2_FOUNDvariable afterFetchContent_MakeAvailable.
This enables the test suite to build whenOpenPFC_BUILD_TESTS=ON. - CMake build system: Fixed HeFFTe detection in
FindHeffte.cmakeby
settingHeffte_FOUND=TRUEafter FetchContent to prevent fatal errors when
HeFFTe is downloaded instead of using system-installed package. - tungsten application: Added explicit
find_package(Heffte REQUIRED)and
corrected target link toHeffte::Heffteto ensure proper linkage with
separately installed HeFFTe v2.4.1. - Code quality: Fixed format-security compiler error in
utils.hppby
adding overload forstring_format()with no variadic arguments. - Code formatting: Removed trailing whitespace in
test_fft.cppto pass
clang-format checks.
Breaking Changes
- Model::rank0 is now private: The public member variable
rank0has been
moved to private section and renamed tom_rank0. Use theModel::is_rank0()
method instead.- Migration: Replace
model.rank0withmodel.is_rank0()in your code - Reason: Better encapsulation and consistent API with other query methods
likeget_world()andget_fft() - Impact: All examples and applications updated to use the new API
- Note: The method
is_rank0()is nowconstandinlinefor zero overhead
- Migration: Replace