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

Interpolate field value at physical coordinates (const overload)

Interpolate field value at physical coordinates (const overload)Const version of interpolate(). Returns a const reference to the field value. Use this when you don't need to modify the field value.

Template Parameters
TField value type
DDimensionality
Parameters
fieldThe discrete field to interpolate (const)
coordinatesPhysical coordinates to interpolate at
Returns
Const reference to the field value at the nearest grid point

from const field

const pfc::DiscreteField<double, 3> field = create_field();
// Can read but not modify
const double& value = pfc::interpolate(field, {10.0, 20.0, 30.0});
std::cout << "Value: " << value << std::endl;
// value = 42.0; // ❌ Won't compile (const)
Represents the global simulation domain (the "world").
Definition world.hpp:91
Note
This overload is selected when field is const
All other behavior identical to mutable version
See also
interpolate(DiscreteField&, const std::array<double,D>&) mutable version