|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Gray-Scott reaction-diffusion rule. More...
#include <tpl_ca_continuous_rules.H>
Public Types | |
| using | state_type = Reaction_Diffusion_Cell< Real > |
| Cell state consumed and produced by the rule. | |
| using | kernel_type = Kernel |
| Laplacian kernel type. | |
Public Member Functions | |
| Gray_Scott_Rule (Real feed, Real kill, Real du, Real dv, Real dt=Real{1}, Kernel laplacian=laplacian_5p_kernel< Real >()) | |
| Build a Gray-Scott rule. | |
| Real | feed () const noexcept |
| Real | kill () const noexcept |
| Real | Du () const noexcept |
| Real | Dv () const noexcept |
| Real | dt () const noexcept |
| const Kernel & | laplacian () const noexcept |
| state_type | operator() (const state_type ¤t, Neighbor_View< state_type > neighbours) const |
| Compute the next Gray-Scott state. | |
Private Member Functions | |
| Real | laplace_u (Neighbor_View< state_type > neighbours, const state_type ¤t) const |
| Real | laplace_v (Neighbor_View< state_type > neighbours, const state_type ¤t) const |
Private Attributes | |
| Real | feed_ |
| Real | kill_ |
| Real | du_ |
| Real | dv_ |
| Real | dt_ |
| Kernel | lap_ |
Gray-Scott reaction-diffusion rule.
Explicit Euler update:
The default 5-point Laplacian expects a Moore<2, 1> neighbourhood; diagonal neighbour weights are zero. Concentrations are contracted to [0, 1] for documented stable parameters. The constructor enforces 0 < dt <= 1.0, which covers the standard Gray-Scott presets with dx = 1 used by CA examples.
| Real | floating-point field type. |
| Kernel | Laplacian kernel type. |
Definition at line 317 of file tpl_ca_continuous_rules.H.
| using Aleph::CA::Gray_Scott_Rule< Real, Kernel >::kernel_type = Kernel |
Laplacian kernel type.
Definition at line 323 of file tpl_ca_continuous_rules.H.
| using Aleph::CA::Gray_Scott_Rule< Real, Kernel >::state_type = Reaction_Diffusion_Cell<Real> |
Cell state consumed and produced by the rule.
Definition at line 321 of file tpl_ca_continuous_rules.H.
|
inline |
Build a Gray-Scott rule.
| [in] | feed | feed rate F, usually in [0, 0.1]. |
| [in] | kill | kill rate K, usually in [0, 0.1]. |
| [in] | du | diffusion coefficient for u. |
| [in] | dv | diffusion coefficient for v. |
| [in] | dt | explicit Euler time step; stable contract: 0 < dt <= 1.0. |
| [in] | laplacian | convolution kernel; defaults to 5-point Laplacian. |
| std::domain_error | if any parameter is outside its documented range. |
Definition at line 363 of file tpl_ca_continuous_rules.H.
|
inlinenoexcept |
Definition at line 405 of file tpl_ca_continuous_rules.H.
References Aleph::CA::Gray_Scott_Rule< Real, Kernel >::dt_.
|
inlinenoexcept |
u diffusion coefficient. Definition at line 393 of file tpl_ca_continuous_rules.H.
References Aleph::CA::Gray_Scott_Rule< Real, Kernel >::du_.
|
inlinenoexcept |
v diffusion coefficient. Definition at line 399 of file tpl_ca_continuous_rules.H.
References Aleph::CA::Gray_Scott_Rule< Real, Kernel >::dv_.
|
inlinenoexcept |
F. Definition at line 381 of file tpl_ca_continuous_rules.H.
References Aleph::CA::Gray_Scott_Rule< Real, Kernel >::feed_.
|
inlinenoexcept |
K. Definition at line 387 of file tpl_ca_continuous_rules.H.
References Aleph::CA::Gray_Scott_Rule< Real, Kernel >::kill_.
|
inlineprivate |
Definition at line 333 of file tpl_ca_continuous_rules.H.
References Aleph::blossom_maximum_cardinality_matching(), k, Aleph::CA::Gray_Scott_Rule< Real, Kernel >::lap_, and Aleph::CA::Reaction_Diffusion_Cell< Real >::u.
Referenced by Aleph::CA::Gray_Scott_Rule< Real, Kernel >::operator()().
|
inlineprivate |
Definition at line 341 of file tpl_ca_continuous_rules.H.
References Aleph::blossom_maximum_cardinality_matching(), k, Aleph::CA::Gray_Scott_Rule< Real, Kernel >::lap_, and Aleph::CA::Reaction_Diffusion_Cell< Real >::v.
Referenced by Aleph::CA::Gray_Scott_Rule< Real, Kernel >::operator()().
|
inlinenoexcept |
Definition at line 411 of file tpl_ca_continuous_rules.H.
References Aleph::CA::Gray_Scott_Rule< Real, Kernel >::lap_.
|
inline |
Compute the next Gray-Scott state.
| [in] | current | current (u, v) concentration. |
| [in] | neighbours | neighbour cells in Moore<2, Kernel::radius_v> order. |
| std::length_error | if neighbour count does not match the kernel. |
| std::runtime_error | if the update leaves the stable [0, 1] concentration interval beyond roundoff tolerance. |
Definition at line 426 of file tpl_ca_continuous_rules.H.
References ah_length_error_if, Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::ca_continuous_detail::clamp_unit_after_check(), Aleph::CA::Gray_Scott_Rule< Real, Kernel >::dt_, Aleph::CA::Gray_Scott_Rule< Real, Kernel >::du_, Aleph::CA::Gray_Scott_Rule< Real, Kernel >::dv_, Aleph::CA::Gray_Scott_Rule< Real, Kernel >::feed_, Aleph::CA::Gray_Scott_Rule< Real, Kernel >::kill_, Aleph::CA::Gray_Scott_Rule< Real, Kernel >::laplace_u(), Aleph::CA::Gray_Scott_Rule< Real, Kernel >::laplace_v(), Aleph::CA::Reaction_Diffusion_Cell< Real >::u, and Aleph::CA::Reaction_Diffusion_Cell< Real >::v.
|
private |
Definition at line 330 of file tpl_ca_continuous_rules.H.
Referenced by Aleph::CA::Gray_Scott_Rule< Real, Kernel >::dt(), and Aleph::CA::Gray_Scott_Rule< Real, Kernel >::operator()().
|
private |
Definition at line 328 of file tpl_ca_continuous_rules.H.
Referenced by Aleph::CA::Gray_Scott_Rule< Real, Kernel >::Du(), and Aleph::CA::Gray_Scott_Rule< Real, Kernel >::operator()().
|
private |
Definition at line 329 of file tpl_ca_continuous_rules.H.
Referenced by Aleph::CA::Gray_Scott_Rule< Real, Kernel >::Dv(), and Aleph::CA::Gray_Scott_Rule< Real, Kernel >::operator()().
|
private |
Definition at line 326 of file tpl_ca_continuous_rules.H.
Referenced by Aleph::CA::Gray_Scott_Rule< Real, Kernel >::feed(), and Aleph::CA::Gray_Scott_Rule< Real, Kernel >::operator()().
|
private |
Definition at line 327 of file tpl_ca_continuous_rules.H.
Referenced by Aleph::CA::Gray_Scott_Rule< Real, Kernel >::kill(), and Aleph::CA::Gray_Scott_Rule< Real, Kernel >::operator()().
|
private |
Definition at line 331 of file tpl_ca_continuous_rules.H.
Referenced by Aleph::CA::Gray_Scott_Rule< Real, Kernel >::laplace_u(), Aleph::CA::Gray_Scott_Rule< Real, Kernel >::laplace_v(), and Aleph::CA::Gray_Scott_Rule< Real, Kernel >::laplacian().