SPHinXsys 中用到的标签派发技术

class Base; // Indicating base class
struct Fixed // Indicating with fixed adaptation
{
static inline const bool is_adaptive = false;
static inline const bool is_fixed = true;
static inline const bool is_dynamic = false;
};
struct Adaptive // Indicating with adaptive resolution
{
static inline const bool is_adaptive = true;
static inline const bool is_fixed = false;
static inline const bool is_dynamic = true;
};
template <typename... InnerParameters>
class Inner; /**< Inner interaction: interaction within a body*/
template <typename... ContactParameters>
class Contact; /**< Contact interaction: interaction between a body with one or several another bodies */什么是tag dispatch
为什么 SPHinXsys 喜欢这样写
Last updated