50 [[nodiscard]] std::string
toString()
const override
52 std::ostringstream result;
53 result <<
"Parameters: ["
83 void step(
double t,
double deltaT)
override;
84 void addInput(
const std::shared_ptr<Element>& inputElement,
85 const std::string& inputComponent =
"output")
override;
86 std::string
toString()
const override;
87 std::shared_ptr<Element>
clone()
const override;
Abstract base class for all simulation elements.
Definition element.h:28
Resamples a 1D input field of size N to this element's output size M.
Definition resize.h:72
std::string toString() const override
Definition resize.cpp:71
void changeInputDimensions(const ElementDimensions &newInputDimensions)
Resize the input field dimensions and rebuild the input buffer. Connections are not removed automatic...
Definition resize.cpp:84
void init() override
Initialize the element (called once before the simulation loop).
Definition resize.cpp:16
void step(double t, double deltaT) override
Advance the element by one time step.
Definition resize.cpp:22
ResizeParameters getParameters() const
Definition resize.cpp:97
void setParameters(const ResizeParameters ¶meters)
Definition resize.cpp:91
void addInput(const std::shared_ptr< Element > &inputElement, const std::string &inputComponent="output") override
Register inputElement as an upstream source for this element.
Definition resize.cpp:43
std::shared_ptr< Element > clone() const override
Definition resize.cpp:79
InterpolationMethod
Interpolation method used when resampling an input field to a new size.
Definition resize.h:16
@ LINEAR
Piecewise linear interpolation.
@ NEAREST
Nearest-neighbour sampling.
@ CUBIC
Catmull-Rom cubic spline interpolation.
Definition element_parameters.h:10
const std::map< InterpolationMethod, std::string > InterpolationMethodToString
Maps InterpolationMethod values to human-readable strings.
Definition resize.h:23
Definition element_parameters.h:188
Definition element_parameters.h:159
std::string toString() const
Definition element_parameters.cpp:55
Definition element_parameters.h:206
Parameters for a 1D Resize element.
Definition resize.h:32
bool operator==(const ResizeParameters &other) const
Definition resize.h:44
InterpolationMethod method
Interpolation method used for resampling.
Definition resize.h:33
ElementDimensions inputDimensions
Spatial dimensions of the source (input) field.
Definition resize.h:34
std::string toString() const override
Definition resize.h:50
ResizeParameters(const InterpolationMethod method=InterpolationMethod::LINEAR, const ElementDimensions &inputDimensions=ElementDimensions{})
Construct Resize parameters.
Definition resize.h:39