20 const double ampGlobal = 0.00,
const double timeShift = 0.00,
27 constexpr double epsilon = 1e-6;
29 return std::abs(
width - other.
width) < epsilon &&
37 [[nodiscard]] std::string
toString()
const override
39 std::ostringstream result;
40 result << std::fixed << std::setprecision(2);
41 result <<
"Parameters: ["
42 <<
"Width: " <<
width <<
", "
46 <<
"Circular: " << (
circular ?
"true" :
"false") <<
", "
47 <<
"Normalized: " << (
normalized ?
"true" :
"false") <<
"]";
64 std::vector<double> gauss;
65 std::vector<double> gaussDerivative;
66 std::vector<double> scratchExtended;
67 std::vector<double> scratchConvolution;
76 void step(
double t,
double deltaT)
override;
77 std::string
toString()
const override;
78 std::shared_ptr<Element>
clone()
const override;
Spatially shifted Gaussian kernel that induces directional peak drift.
Definition asymmetric_gauss_kernel.h:61
AsymmetricGaussKernelParameters getParameters() const
Definition asymmetric_gauss_kernel.cpp:108
void init() override
Initialize the element (called once before the simulation loop).
Definition asymmetric_gauss_kernel.cpp:15
void setParameters(const AsymmetricGaussKernelParameters &gk_parameters)
Definition asymmetric_gauss_kernel.cpp:102
std::shared_ptr< Element > clone() const override
Definition asymmetric_gauss_kernel.cpp:96
std::string toString() const override
Definition asymmetric_gauss_kernel.cpp:88
void step(double t, double deltaT) override
Advance the element by one time step.
Definition asymmetric_gauss_kernel.cpp:67
Abstract base class for all convolution-based interaction kernels.
Definition kernel.h:17
Definition element_parameters.h:10
Parameters for an asymmetric (shifted) Gaussian convolution kernel.
Definition asymmetric_gauss_kernel.h:11
AsymmetricGaussKernelParameters(const double width=3.0, const double amp=3.0, const double ampGlobal=0.00, const double timeShift=0.00, const bool circular=true, const bool normalized=true)
Definition asymmetric_gauss_kernel.h:19
bool circular
Enable circular (toroidal) convolution.
Definition asymmetric_gauss_kernel.h:16
bool normalized
Normalise the Gaussian before convolution.
Definition asymmetric_gauss_kernel.h:17
double width
Gaussian standard deviation σ.
Definition asymmetric_gauss_kernel.h:12
std::string toString() const override
Definition asymmetric_gauss_kernel.h:37
double amplitude
Peak amplitude of the Gaussian.
Definition asymmetric_gauss_kernel.h:13
double timeShift
Spatial shift of the kernel centre (positive = rightward drift).
Definition asymmetric_gauss_kernel.h:15
double amplitudeGlobal
Spatially uniform offset added after convolution.
Definition asymmetric_gauss_kernel.h:14
bool operator==(const AsymmetricGaussKernelParameters &other) const
Definition asymmetric_gauss_kernel.h:26
Definition element_parameters.h:188
Definition element_parameters.h:206