group_particles
Loading...
Searching...
No Matches
callback_utils_radius.hpp
Go to the documentation of this file.
1
7#ifndef CALLBACK_UTILS_RADIUS_HPP
8#define CALLBACK_UTILS_RADIUS_HPP
9
10#include "callback.hpp"
11
12namespace CallbackUtils {
13
16namespace radius
17{
18
23 template<typename AFields, typename RField>
24 class Simple :
25 virtual public Callback<AFields>
26 {// {{{
27 static_assert(RField::dim == 1);
28 static_assert(RField::type == FieldTypes::GrpFld);
29 static_assert(std::is_floating_point_v<typename RField::value_type>);
30 typename RField::value_type scaling;
31 public :
34 Simple (typename RField::value_type scaling_) :
35 scaling { scaling_ }
36 { }
37
40 Simple () :
41 scaling { (typename RField::value_type)1.0 }
42 { }
43
44 coord_t grp_radius (const typename Callback<AFields>::GrpProperties &grp) const override final
45 {
46 return scaling * grp.template get<RField>();
47 }
48 };// }}}
49
50} // namespace radius
51
52} // namespace CallbackUtils
53
54#endif // CALLBACK_UTILS_RADIUS_HPP
Contains the abstract base class that the user should subclass from in order to define the desired fu...
Specialization of the Callback::BaseProperties type to groups.
Definition callback.hpp:85
radius is propertional to one of the group properties.
Definition callback_utils_radius.hpp:26
Simple(typename RField::value_type scaling_)
Definition callback_utils_radius.hpp:34
Simple()
Definition callback_utils_radius.hpp:40
float coord_t
Internal coordinate type.
Definition fields.hpp:28
contains classes that implement parts of the Callback base.
Definition callback_utils.hpp:35
The abstract base class the user should inherit from.
Definition callback.hpp:32