30#include "gsl/gsl_errno.h"
31#include "gsl/gsl_integration.h"
32#include "gsl/gsl_sf_pow_int.h"
49 const double &lambdaleft,
50 const double &lambdaright,
52 s_0_m(s_0), lambdaleft_m(lambdaleft),
53 lambdaright_m(lambdaright), rho_m(rho) {
54 std::vector<double> coordinates;
55 coordinates.push_back(xlab);
56 coordinates.push_back(zlab);
64 s_0_m(transform.s_0_m), lambdaleft_m(transform.lambdaleft_m),
65 lambdaright_m(transform.lambdaright_m),
66 rho_m(transform.rho_m), x_m(transform.x_m),
67 z_m(transform.z_m), s_m(transform.s_m) {
86 std::vector<double> result;
87 result.push_back(
x_m);
88 result.push_back(
z_m);
89 result.push_back(
s_m);
94 const double &s)
const {
95 std::vector<double> result;
108 const double &s)
const {
115 gsl_integration_workspace *w = gsl_integration_workspace_alloc(
workspaceSize);
116 double resultX, resultY, absErrX, absErrY;
117 gsl_error_handler_t* err_default = gsl_set_error_handler_off();
123 *
gmsg <<
"Warning - failed to reach specified error " <<
error
124 <<
" in multipoleT coordinateTransform" <<
endl;
125 *
gmsg <<
" X " << errX <<
" absErr: " << absErrX <<
" s: " << s <<
endl;
126 *
gmsg <<
" Y " << errY <<
" absErr: " << absErrY <<
" s: " << s <<
endl;
128 gsl_integration_workspace_free(w);
129 gsl_set_error_handler(err_default);
130 std::vector<double> result;
131 result.push_back(resultX);
132 result.push_back(resultY);
137 const double &zlab) {
143 double eqn1 = (r_1[0] - xlab) * shat1[0] + (r_1[1] - zlab) * shat1[1];
144 double eqn2 = (r_2[0] - xlab) * shat2[0] + (r_2[1] - zlab) * shat2[1];
145 if (eqn1 * eqn2 > 0) {
153 while (
n < 10000 &&
std::abs(s1 - s2) > 1
e-12) {
154 double stemp = (s2 + s1) / 2;
157 double eqntemp = (r_temp[0] - xlab) * shattemp[0] +
158 (r_temp[1] - zlab) * shattemp[1];
161 }
else if (eqntemp < 0) {
177 const double &zlab) {
180 x_m = (xlab * shat[1] - zlab * shat[0] -
181 r_0[0] * shat[1] + r_0[1] * shat[0]);
185 std::vector<double> &coordinates,
186 const double &boundingBoxLength) {
187 std::vector<double> r_entrance =
190 double x = coordinates[0], z = coordinates[1];
191 coordinates[0] = x * shat[1] + z * shat[0] + r_entrance[0];
192 coordinates[1] = -x * shat[0] + z * shat[1] + r_entrance[1];
Tps< T > log(const Tps< T > &x)
Natural logarithm.
Tps< T > cos(const Tps< T > &x)
Cosine.
Tps< T > cosh(const Tps< T > &x)
Hyperbolic cosine.
Tps< T > tanh(const Tps< T > &x)
Hyperbolic tangent.
Tps< T > sin(const Tps< T > &x)
Sine.
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
Inform & endl(Inform &inf)
double getUnitTangentVectorX(double s, void *p)
double getUnitTangentVectorY(double s, void *p)
constexpr double e
The value of.
std::vector< double > getUnitTangentVector(const double &s) const
static const int algorithm
void transformFromEntranceCoordinates(std::vector< double > &coordinates, const double &boundingBoxLength)
void calcXCoordinate(const double &xlab, const double &ylab)
static const double error
CoordinateTransform()=delete
std::vector< double > getTransformation() const
std::vector< double > calcReferenceTrajectory(const double &s) const
CoordinateTransform & operator=(const CoordinateTransform &transform)
void calcSCoordinate(const double &xlab, const double &ylab)
static const int workspaceSize