Skip to content
Snippets Groups Projects
Commit d82b8ebc authored by Phillip Lino Rall's avatar Phillip Lino Rall
Browse files

fft example with amplification

parent 6e740696
Branches
No related tags found
No related merge requests found
...@@ -111,6 +111,12 @@ D3vector transform_right_lens_diag_NW_quad ( double t1, double t2, double* point ...@@ -111,6 +111,12 @@ D3vector transform_right_lens_diag_NW_quad ( double t1, double t2, double* point
x = x*t2; x = x*t2;
double y = R_global_data*(cos ( t1*0.5*M_PI )- ( 1-t1 )) ; double y = R_global_data*(cos ( t1*0.5*M_PI )- ( 1-t1 )) ;
y = y*t2; y = y*t2;
// if (t1 == 0.75 && t2 == 1.0)
// {
// std::cout << "break";
// }
double actualX = 0 + r_global_data * t1 + 0 * t2 + (R_global_data-r_global_data) * t1 * t2; double actualX = 0 + r_global_data * t1 + 0 * t2 + (R_global_data-r_global_data) * t1 * t2;
double actualY = r_global_data - r_global_data * t1 + (R_global_data-r_global_data) * t2 - (R_global_data-r_global_data) * t1 * t2; double actualY = r_global_data - r_global_data * t1 + (R_global_data-r_global_data) * t2 - (R_global_data-r_global_data) * t1 * t2;
...@@ -279,6 +285,8 @@ D3vector transform_right_lens_diag_SW_quad ( double t1, double t2, double* point ...@@ -279,6 +285,8 @@ D3vector transform_right_lens_diag_SW_quad ( double t1, double t2, double* point
double temp = t1; double temp = t1;
t1 = t2; t1 = t2;
t2 = temp; t2 = temp;
//test
t1 = 1.0 - t1;
double t = t2; double t = t2;
double x = -R_global_data *( sin ( t1*0.5*M_PI )-t1); double x = -R_global_data *( sin ( t1*0.5*M_PI )-t1);
x = x*t2; x = x*t2;
...@@ -317,6 +325,8 @@ D3vector transform_left_lens_diag_SW_quad ( double t1, double t2, double* pointe ...@@ -317,6 +325,8 @@ D3vector transform_left_lens_diag_SW_quad ( double t1, double t2, double* pointe
t1 = t2; t1 = t2;
t2 = temp; t2 = temp;
double t = t2; double t = t2;
//test
t1 = 1.0 - t1;
double x = -R_global_data *( sin ( t1*0.5*M_PI )-t1); double x = -R_global_data *( sin ( t1*0.5*M_PI )-t1);
x = x*t2; x = x*t2;
double y = -R_global_data *(cos ( t1*0.5*M_PI )- ( 1-t1 )) ; double y = -R_global_data *(cos ( t1*0.5*M_PI )- ( 1-t1 )) ;
...@@ -353,6 +363,9 @@ D3vector transform_left_lens_diag_SE_quad ( double t1, double t2, double* pointe ...@@ -353,6 +363,9 @@ D3vector transform_left_lens_diag_SE_quad ( double t1, double t2, double* pointe
t1 = t2; t1 = t2;
t2 = temp; t2 = temp;
double t = t2; double t = t2;
//test
t1 = 1.0 - t1;
double x =R_global_data * ( sin ( t1*0.5*M_PI )-t1); double x =R_global_data * ( sin ( t1*0.5*M_PI )-t1);
x = x*t2; x = x*t2;
double y = -R_global_data *(cos ( t1*0.5*M_PI )- ( 1-t1 )) ; double y = -R_global_data *(cos ( t1*0.5*M_PI )- ( 1-t1 )) ;
...@@ -361,7 +374,7 @@ D3vector transform_left_lens_diag_SE_quad ( double t1, double t2, double* pointe ...@@ -361,7 +374,7 @@ D3vector transform_left_lens_diag_SE_quad ( double t1, double t2, double* pointe
double actualX = 0 + r_global_data * t1 + 0 * t2 + (R_global_data-r_global_data) * t1 * t2; double actualX = 0 + r_global_data * t1 + 0 * t2 + (R_global_data-r_global_data) * t1 * t2;
double actualY = r_global_data - r_global_data * t1 + (R_global_data-r_global_data) * t2 - (R_global_data-r_global_data) * t1 * t2; double actualY = r_global_data - r_global_data * t1 + (R_global_data-r_global_data) * t2 - (R_global_data-r_global_data) * t1 * t2;
actualY = -actualY; actualY = -actualY;
//actualX = -actualX;
double sign = (curvatureLeft_global_data > 0) ? 1 : ((curvatureLeft_global_data < 0) ? -1 : 0) ; double sign = (curvatureLeft_global_data > 0) ? 1 : ((curvatureLeft_global_data < 0) ? -1 : 0) ;
double radiusSquared = ((x+actualX)*(x+actualX)+(y+actualY)*(y+actualY)); double radiusSquared = ((x+actualX)*(x+actualX)+(y+actualY)*(y+actualY));
...@@ -370,6 +383,9 @@ D3vector transform_left_lens_diag_SE_quad ( double t1, double t2, double* pointe ...@@ -370,6 +383,9 @@ D3vector transform_left_lens_diag_SE_quad ( double t1, double t2, double* pointe
if (std::isnan(z)) if (std::isnan(z))
{z = 0;} {z = 0;}
// temp = x;
// x = y;
// y = temp;
return D3vector ( x,y,z); return D3vector ( x,y,z);
} }
...@@ -388,14 +404,21 @@ D3vector transform_right_lens_diag_SE_quad ( double t1, double t2, double* point ...@@ -388,14 +404,21 @@ D3vector transform_right_lens_diag_SE_quad ( double t1, double t2, double* point
t1 = t2; t1 = t2;
t2 = temp; t2 = temp;
double t = t2; double t = t2;
//test
t1 = 1.0 - t1;
double x =R_global_data * ( sin ( t1*0.5*M_PI )-t1); double x =R_global_data * ( sin ( t1*0.5*M_PI )-t1);
x = x*t2; x = x*t2;
double y = -R_global_data *(cos ( t1*0.5*M_PI )- ( 1-t1 )) ; double y = -R_global_data *(cos ( t1*0.5*M_PI )- ( 1-t1 )) ;
y = y*t2; y = y*t2;
// if (t1 == 0.75 && t2 == 1.0)
// {
// std::cout << "break";
// }
double actualX = 0 + r_global_data * t1 + 0 * t2 + (R_global_data-r_global_data) * t1 * t2; double actualX = 0 + r_global_data * t1 + 0 * t2 + (R_global_data-r_global_data) * t1 * t2;
double actualY = r_global_data - r_global_data * t1 + (R_global_data-r_global_data) * t2 - (R_global_data-r_global_data) * t1 * t2; double actualY = r_global_data - r_global_data * t1 + (R_global_data-r_global_data) * t2 - (R_global_data-r_global_data) * t1 * t2;
actualY = -actualY; actualY = -actualY;
//actualX = -actualX;
double sign = (curvatureRight_global_data > 0) ? 1 : ((curvatureRight_global_data < 0) ? -1 : 0) ; double sign = (curvatureRight_global_data > 0) ? 1 : ((curvatureRight_global_data < 0) ? -1 : 0) ;
double z = offsetZ_global_data+ double z = offsetZ_global_data+
...@@ -403,10 +426,13 @@ D3vector transform_right_lens_diag_SE_quad ( double t1, double t2, double* point ...@@ -403,10 +426,13 @@ D3vector transform_right_lens_diag_SE_quad ( double t1, double t2, double* point
((x+actualX)*(x+actualX)+(y+actualY)*(y+actualY))) ((x+actualX)*(x+actualX)+(y+actualY)*(y+actualY)))
+ sign*(-curvatureRight_global_data +( (1-t)*(thickness_global_data-z_right_inner_global_data) + t * (thickness_global_data-z_right_outer_global_data))))); + sign*(-curvatureRight_global_data +( (1-t)*(thickness_global_data-z_right_inner_global_data) + t * (thickness_global_data-z_right_outer_global_data)))));
if (std::isnan(z)) if (std::isnan(z))
{ {
z = 0;} z = 0;}
// temp = x;
// x = y;
// y = temp;
return D3vector ( x,y,z); return D3vector ( x,y,z);
} }
...@@ -427,6 +453,7 @@ D3vector transform_left_lens_diag_NE_quad ( double t1, double t2, double* pointe ...@@ -427,6 +453,7 @@ D3vector transform_left_lens_diag_NE_quad ( double t1, double t2, double* pointe
t1 = t2; t1 = t2;
t2 = temp; t2 = temp;
double t = t2; double t = t2;
t1 = 1.0 - t1;
double x = R_global_data * ( sin ( t1*0.5*M_PI )-t1); double x = R_global_data * ( sin ( t1*0.5*M_PI )-t1);
...@@ -641,7 +668,7 @@ D3vector transform_right_lens_diag_NE_quad ( double t1, double t2, double* point ...@@ -641,7 +668,7 @@ D3vector transform_right_lens_diag_NE_quad ( double t1, double t2, double* point
t1 = t2; t1 = t2;
t2 = temp; t2 = temp;
double t = t2; double t = t2;
t1 = 1.0 - t1;
double x = R_global_data * ( sin ( t1*0.5*M_PI )-t1); double x = R_global_data * ( sin ( t1*0.5*M_PI )-t1);
x = x*t2; x = x*t2;
...@@ -1167,15 +1194,7 @@ D3vector transform_right_lens_diag_NE_quad_cut ( double t1, double t2, double* p ...@@ -1167,15 +1194,7 @@ D3vector transform_right_lens_diag_NE_quad_cut ( double t1, double t2, double* p
if (std::isnan(x) || std::isnan(y) || std::isnan(z)) if (std::isnan(x) || std::isnan(y) || std::isnan(z))
{ z = 0;} { z = 0;}
// std::cout << "transform_right_lens_diag_NE_quad_cut ";
// D3vector ( x,y,z).Print();
// std::cout << std::endl;
// double actualZ = offsetZ_global_data+
// sign*( ( sqrt(pow(curvatureRight_global_data,2)-
// radiusSquared)
// + sign*(-curvatureRight_global_data))) ;
// return D3vector (actualX, actualY,actualZ );
//return D3vector ( xT,yT,z);
return D3vector ( x,y,z); return D3vector ( x,y,z);
//return D3vector ( (1-t2) * xAdd,(1-t2) * yAdd,z); //return D3vector ( (1-t2) * xAdd,(1-t2) * yAdd,z);
return D3vector ( 0,0,z); return D3vector ( 0,0,z);
...@@ -1726,6 +1745,7 @@ Lens_Geometry_Quad::Lens_Geometry_Quad(double Radius, double thickness, double c ...@@ -1726,6 +1745,7 @@ Lens_Geometry_Quad::Lens_Geometry_Quad(double Radius, double thickness, double c
Set_transformation_face(4,5,12,13,transform_diag_inner_faces_NE_quad); Set_transformation_face(4,5,12,13,transform_diag_inner_faces_NE_quad);
Set_transformation_face(3,5,11,13,transform_outer_boundary_NW); //transform_outer_boundary_NW Set_transformation_face(3,5,11,13,transform_outer_boundary_NW); //transform_outer_boundary_NW
Set_transformation_face(10,11,12,13,transform_right_lens_diag_NW_quad); //transform_right_lens_diag_NW_quad Set_transformation_face(10,11,12,13,transform_right_lens_diag_NW_quad); //transform_right_lens_diag_NW_quad
//Set_transformation_face(10,11,12,13,transform_quadrangle_NULL); //transform_right_lens_diag_NW_quad
//bottom-west block: corner ids: 4 5 6 7 12 13 14 15 //bottom-west block: corner ids: 4 5 6 7 12 13 14 15
//eher: S-W-BLOCK //eher: S-W-BLOCK
...@@ -1744,7 +1764,7 @@ Lens_Geometry_Quad::Lens_Geometry_Quad(double Radius, double thickness, double c ...@@ -1744,7 +1764,7 @@ Lens_Geometry_Quad::Lens_Geometry_Quad(double Radius, double thickness, double c
Set_transformation_face(6,7,14,15,transform_diag_inner_faces_NE_quad); Set_transformation_face(6,7,14,15,transform_diag_inner_faces_NE_quad);
Set_transformation_face(1,7,9,15,transform_outer_boundary_SE); Set_transformation_face(1,7,9,15,transform_outer_boundary_SE);
Set_transformation_face(8,9,14,15,transform_right_lens_diag_SE_quad); Set_transformation_face(8,9,14,15,transform_right_lens_diag_SE_quad);
//Set_transformation_face(8,9,14,15,transform_quadrangle_NULL);
construction_done(); construction_done();
...@@ -1764,6 +1784,9 @@ Lens_Geometry_cutted_edges::Lens_Geometry_cutted_edges(double RadiusLeft, double ...@@ -1764,6 +1784,9 @@ Lens_Geometry_cutted_edges::Lens_Geometry_cutted_edges(double RadiusLeft, double
{ {
cutRight = true; cutRight = true;
} }
assert(!cutLeft || (curvatureLeft < 0 && cutLeft) && "Assertion failed! If left side of lens is cutted, its curvature must be negative (convex)!");
assert(!cutRight || (curvatureRight < 0 && cutRight) && "Assertion failed! If right side of lens is cutted, its curvature must be negative (convex)!");
if (MechanicalRadiusLeft < RadiusLeft) if (MechanicalRadiusLeft < RadiusLeft)
{ {
std::cout << "warning : mech radius < radius\n set to radiusLeft"; std::cout << "warning : mech radius < radius\n set to radiusLeft";
......
...@@ -54,6 +54,7 @@ class D3vector { ...@@ -54,6 +54,7 @@ class D3vector {
D3vector() : x(0), y(0), z(0) {}; D3vector() : x(0), y(0), z(0) {};
~D3vector(){}; ~D3vector(){};
void Print(); void Print();
void PrintCoordinatesOnly();
void Print(std::ofstream *Datei); void Print(std::ofstream *Datei);
void operator=(const D3vector& v) { x=v.x; y=v.y; z=v.z; } void operator=(const D3vector& v) { x=v.x; y=v.y; z=v.z; }
void operator+=(const D3vector& v) { x+=v.x; y+=v.y; z+=v.z; } void operator+=(const D3vector& v) { x+=v.x; y+=v.y; z+=v.z; }
...@@ -565,6 +566,10 @@ inline void D3vector::Print() { ...@@ -565,6 +566,10 @@ inline void D3vector::Print() {
std::cout << "Coordinate: " << x << ", " << y << ", " << z << ";\n"; std::cout << "Coordinate: " << x << ", " << y << ", " << z << ";\n";
} }
inline void D3vector::PrintCoordinatesOnly() {
std::cout << x << "," << y << "," << z;
}
inline void D3vector::Print(std::ofstream *Datei) { inline void D3vector::Print(std::ofstream *Datei) {
*Datei << x << " " << y << " " << z; *Datei << x << " " << y << " " << z;
} }
......
...@@ -30,10 +30,11 @@ ...@@ -30,10 +30,11 @@
#else #else
#ifdef WIN32 #ifdef WIN32
#include <array> #include <array>
using std::array;
#else #else
#include <tr1/array> #include <tr1/array>
using std::tr1::array;
#endif #endif
using std::tr1::array;
#endif #endif
#endif // _NOARRAYLIB #endif // _NOARRAYLIB
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment