34 [[nodiscard]] std::string
toString()
const override
36 std::ostringstream result;
37 result <<
"Parameters: ["
60 std::vector<double> scratch;
61 std::vector<double> rowIn;
62 std::vector<double> rowOut;
63 std::vector<double> colIn;
64 std::vector<double> colOut;
73 void step(
double t,
double deltaT)
override;
74 void addInput(
const std::shared_ptr<Element>& inputElement,
75 const std::string& inputComponent =
"output")
override;
76 std::string
toString()
const override;
77 std::shared_ptr<Element>
clone()
const override;
Abstract base class for all simulation elements.
Definition element.h:28
Resamples a 2D input field of size (Nx x Ny) to this element's output size (Mx x My).
Definition resize_2d.h:57
void init() override
Initialize the element (called once before the simulation loop).
Definition resize_2d.cpp:37
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_2d.cpp:87
std::shared_ptr< Element > clone() const override
Definition resize_2d.cpp:122
void changeInputDimensions(const ElementDimensions &newInputDimensions)
Resize the input field dimensions and rebuild the input buffer. Connections are not removed automatic...
Definition resize_2d.cpp:127
std::string toString() const override
Definition resize_2d.cpp:114
void setParameters(const Resize2DParameters ¶meters)
Definition resize_2d.cpp:134
void step(double t, double deltaT) override
Advance the element by one time step.
Definition resize_2d.cpp:54
Resize2DParameters getParameters() const
Definition resize_2d.cpp:140
InterpolationMethod
Interpolation method used when resampling an input field to a new size.
Definition resize.h:16
@ LINEAR
Piecewise linear 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 2D Resize element.
Definition resize_2d.h:16
bool operator==(const Resize2DParameters &other) const
Definition resize_2d.h:28
ElementDimensions inputDimensions
Spatial dimensions of the source (input) field.
Definition resize_2d.h:18
InterpolationMethod method
Interpolation method used for resampling.
Definition resize_2d.h:17
Resize2DParameters(const InterpolationMethod method=InterpolationMethod::LINEAR, const ElementDimensions &inputDimensions=ElementDimensions{ 100, 100, 1.0, 1.0 })
Construct Resize2D parameters.
Definition resize_2d.h:23
std::string toString() const override
Definition resize_2d.h:34