41 constexpr double epsilon = 1e-6;
42 return std::abs(
width - other.
width) < epsilon &&
51 [[nodiscard]] std::string
toString()
const override
53 std::ostringstream result;
54 result << std::fixed << std::setprecision(2);
55 result <<
"Parameters: ["
56 <<
"Width: " <<
width <<
", "
61 <<
"Circular: " << (
circular ?
"true" :
"false") <<
", "
62 <<
"Normalized: "<< (
normalized ?
"true" :
"false") <<
"]";
83 std::array<int, 2> kernelRange_x{};
84 std::array<int, 2> kernelRange_y{};
85 std::vector<int> extIndex_x;
86 std::vector<int> extIndex_y;
87 std::vector<double> kernel_1d_x;
88 std::vector<double> kernel_1d_y;
89 std::vector<double> scratchTmp_;
90 std::vector<double> scratchConvolution_;
96 void step(
double t,
double deltaT)
override;
97 [[nodiscard]] std::string
toString()
const override;
98 [[nodiscard]] std::shared_ptr<Element>
clone()
const override;
2D asymmetric Gaussian kernel that induces directional peak drift.
Definition asymmetric_gauss_kernel_2d.h:80
std::string toString() const override
Definition asymmetric_gauss_kernel_2d.cpp:121
AsymmetricGaussKernel2DParameters getParameters() const
Definition asymmetric_gauss_kernel_2d.cpp:140
void init() override
Initialize the element (called once before the simulation loop).
Definition asymmetric_gauss_kernel_2d.cpp:17
void step(double t, double deltaT) override
Advance the element by one time step.
Definition asymmetric_gauss_kernel_2d.cpp:102
std::shared_ptr< Element > clone() const override
Definition asymmetric_gauss_kernel_2d.cpp:129
void setParameters(const AsymmetricGaussKernel2DParameters ¶meters)
Definition asymmetric_gauss_kernel_2d.cpp:134
Abstract base class for all convolution-based interaction kernels.
Definition kernel.h:17
Definition element_parameters.h:10
Parameters for AsymmetricGaussKernel2D.
Definition asymmetric_gauss_kernel_2d.h:20
std::string toString() const override
Definition asymmetric_gauss_kernel_2d.h:51
bool operator==(const AsymmetricGaussKernel2DParameters &other) const
Definition asymmetric_gauss_kernel_2d.h:39
double amplitude
Peak amplitude.
Definition asymmetric_gauss_kernel_2d.h:22
bool normalized
Normalise the Gaussian before applying amplitude.
Definition asymmetric_gauss_kernel_2d.h:27
double amplitudeGlobal
Spatially uniform offset added after convolution.
Definition asymmetric_gauss_kernel_2d.h:23
double timeShift_x
Spatial shift along x (positive = rightward drift).
Definition asymmetric_gauss_kernel_2d.h:24
AsymmetricGaussKernel2DParameters(double width=3.0, double amplitude=3.0, double amplitudeGlobal=0.0, double timeShift_x=0.0, double timeShift_y=0.0, bool circular=true, bool normalized=true)
Definition asymmetric_gauss_kernel_2d.h:29
double width
Gaussian standard deviation σ (same for both axes).
Definition asymmetric_gauss_kernel_2d.h:21
bool circular
Enable circular (toroidal) convolution.
Definition asymmetric_gauss_kernel_2d.h:26
double timeShift_y
Spatial shift along y (positive = downward drift).
Definition asymmetric_gauss_kernel_2d.h:25
Definition element_parameters.h:188
Definition element_parameters.h:206