Warning, file /include/orange/surf/detail/InvolutePoint.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include <cmath>
0010
0011 #include "corecel/Types.hh"
0012 #include "corecel/cont/Array.hh"
0013 #include "orange/OrangeTypes.hh"
0014
0015 namespace celeritas
0016 {
0017 namespace detail
0018 {
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 class InvolutePoint
0032 {
0033 public:
0034
0035
0036 using Real2 = Array<real_type, 2>;
0037
0038
0039 public:
0040
0041 inline CELER_FUNCTION InvolutePoint(real_type r_b, real_type a);
0042
0043
0044 inline CELER_FUNCTION Real2 operator()(real_type theta) const;
0045
0046
0047
0048
0049 CELER_FUNCTION real_type r_b() const { return r_b_; }
0050 CELER_FUNCTION real_type a() const { return a_; }
0051
0052 private:
0053
0054
0055
0056 real_type r_b_;
0057 real_type a_;
0058 };
0059
0060
0061
0062
0063
0064
0065
0066 CELER_FUNCTION InvolutePoint::InvolutePoint(real_type r_b, real_type a)
0067 : r_b_(r_b), a_(a)
0068 {
0069 CELER_EXPECT(r_b > 0);
0070 CELER_EXPECT(a >= 0);
0071 }
0072
0073
0074
0075
0076 CELER_FUNCTION Real2 InvolutePoint::operator()(real_type theta) const
0077 {
0078 real_type angle = theta + a_;
0079 Real2 point;
0080
0081 point[0] = r_b_ * (std::cos(angle) + theta * std::sin(angle));
0082 point[1] = r_b_ * (std::sin(angle) - theta * std::cos(angle));
0083
0084 return point;
0085 }
0086
0087 }
0088 }