Commit 772912ba authored by Phillip Lino Rall's avatar Phillip Lino Rall
Browse files

adding support of cutted lenses

parent bd34f1aa
......@@ -101,7 +101,7 @@ Blockgrid::Blockgrid ( Unstructured_grid *ug_, int Nx, int Ny, int Nz ) {
Blockgrid::Blockgrid ( Unstructured_grid *ug_, int Nx, int Ny, int Nz, int Nr ) {
cout << "Nx " << Nx << "Ny " << Ny << "Nz " << Nz << "Nr " << Nr << endl;
// cout << "Nx " << Nx << "Ny " << Ny << "Nz " << Nz << "Nr " << Nr << endl;
id_of_grid = id_count_grid; ++id_count_grid;
phase_shift = NULL;
bg_coord = NULL;
......
......@@ -62,8 +62,11 @@ D3vector transform_right_lens_diag_NW_quad ( double t1, double t2, double* point
double offsetZ_global_data = pointer_global_data[5];
double z_left_inner_global_data = pointer_global_data[6];
double z_left_outer_global_data = pointer_global_data[7];
double z_right_inner_global_data = pointer_global_data[8];
double z_right_outer_global_data = pointer_global_data[9];
double z_right_inner_global_data = pointer_global_data[8];
double z_right_outer_global_data = pointer_global_data[9];
double cut_edge_from_left = pointer_global_data[10];
double cut_edge_from_right = pointer_global_data[11];
double temp = t1;
t1 = t2;
t2 = temp;
......@@ -139,8 +142,6 @@ D3vector transform_right_lens_inner_quad ( double t1, double t2, double* pointer
//return D3vector (0 , 0 , fabs((t1-0)*(t2-0)*(t1-1)*(t2-1)) * 10);
return D3vector (0 , 0 , z);
// return R_global_data*D3vector ( x,y,z);
}
D3vector transform_left_lens_inner_quad ( double t1, double t2, double* pointer_global_data) {
......@@ -485,9 +486,6 @@ D3vector transform_inner_faces_NE_quad( double t1, double t2, double* pointer_gl
t1 = t2;
t2 = temp;
}
double t = t2;
double sign = (curvatureRight_global_data > 0) ? 1 : ((curvatureRight_global_data < 0) ? -1 : 0) ;
double signLeft = (curvatureLeft_global_data > 0) ? 1 : ((curvatureLeft_global_data < 0) ? -1 : 0) ;
......@@ -569,7 +567,8 @@ D3vector transform_left_lens_diag ( double t, double* pointer_global_data) {
double sign = (curvatureLeft_global_data > 0) ? 1 : ((curvatureLeft_global_data < 0) ? -1 : 0) ;
return D3vector ( 0.0 ,0.0 , offsetZ_global_data+sign*(-1*( sqrt(pow(curvatureLeft_global_data,2)-pow(r_global_data * (1-t) + R_global_data * t,2)) +sign *(-curvatureLeft_global_data +( (1-t)*z_left_inner_global_data + t * z_left_outer_global_data)))));
double z = offsetZ_global_data+sign*(-1*( sqrt(pow(curvatureLeft_global_data,2)-pow(r_global_data * (1-t) + R_global_data * t,2)) +sign *(-curvatureLeft_global_data +( (1-t)*z_left_inner_global_data + t * z_left_outer_global_data))));
return D3vector ( 0.0 ,0.0 , z );
}
D3vector transform_left_lens_rectangle ( double t, double* pointer_global_data) {
......@@ -581,7 +580,8 @@ D3vector transform_left_lens_rectangle ( double t, double* pointer_global_data)
//std::cout << "t : " << t << " : " << offsetZ_global_data-1*( sqrt(pow(curvatureLeft_global_data,2)-pow(r_global_data,2) * (t*t + (1-t)*(1-t))) - curvatureLeft_global_data + z_left_inner_global_data) <<std::endl;
double sign = (curvatureLeft_global_data > 0) ? 1 : ((curvatureLeft_global_data < 0) ? -1 : 0) ;
//std::cout << "transform_left_lens_rectangle : t = " << t << " : " <<offsetZ_global_data+sign*(-1*( sqrt(pow(curvatureLeft_global_data,2)-pow(r_global_data,2) * (t*t + (1-t)*(1-t))) - sign* (curvatureLeft_global_data - z_left_inner_global_data)) ) <<std::endl;
return D3vector ( 0.0 ,0.0 ,offsetZ_global_data+sign*(-1*( sqrt(pow(curvatureLeft_global_data,2)-pow(r_global_data,2) * (t*t + (1-t)*(1-t))) - sign* (curvatureLeft_global_data - z_left_inner_global_data)) ));
double z = offsetZ_global_data+sign*(-1*( sqrt(pow(curvatureLeft_global_data,2)-pow(r_global_data,2) * (t*t + (1-t)*(1-t))) - sign* (curvatureLeft_global_data - z_left_inner_global_data)) );
return D3vector ( 0.0 ,0.0 ,z);
//offsetZ_global_data-1*( sqrt(pow(curvatureLeft_global_data,2)-pow(r_global_data,2) * (t*t + (1-t)*(1-t))) - curvatureLeft_global_data + z_left_inner_global_data) )
}
......@@ -597,7 +597,9 @@ D3vector transform_right_lens_diag ( double t, double* pointer_global_data) {
double sign = (curvatureRight_global_data > 0) ? 1 : ((curvatureRight_global_data < 0) ? -1 : 0) ;
//std::cout << "transform_right_lens_diag : t = " << t << " : " <<offsetZ_global_data+ sign*( ( sqrt(pow(curvatureRight_global_data,2)-pow(r_global_data * (1-t) + R_global_data * t,2)) + sign*(-curvatureRight_global_data +( (1-t)*(thickness_global_data-z_right_inner_global_data) + t * (thickness_global_data-z_right_outer_global_data))))) <<std::endl;
return D3vector ( 0.0 ,0.0 ,offsetZ_global_data+ sign*( ( sqrt(pow(curvatureRight_global_data,2)-pow(r_global_data * (1-t) + R_global_data * t,2)) + sign*(-curvatureRight_global_data +( (1-t)*(thickness_global_data-z_right_inner_global_data) + t * (thickness_global_data-z_right_outer_global_data))))));
double z = offsetZ_global_data+ sign*( ( sqrt(pow(curvatureRight_global_data,2)-pow(r_global_data * (1-t) + R_global_data * t,2)) + sign*(-curvatureRight_global_data +( (1-t)*(thickness_global_data-z_right_inner_global_data) + t * (thickness_global_data-z_right_outer_global_data)))));
return D3vector ( 0.0 ,0.0 , z);
}
D3vector transform_right_lens_rectangle ( double t, double* pointer_global_data) {
......@@ -768,6 +770,8 @@ Lens_Geometry::Lens_Geometry (double Radius, double thickness, double curvatureL
}
// cout << z_right_outer - z_left_outer << endl;
// cout << thickness << endl;
// double diff = z_right_outer - z_left_outer - thickness ;
......@@ -884,6 +888,9 @@ Lens_Geometry::Lens_Geometry (double Radius, double thickness, double curvatureL
Lens_Geometry_Quad::Lens_Geometry_Quad(double Radius, double thickness, double curvatureLeft, double curvatureRight, double offsetX, double offsetY, double offsetZ, bool inner_grid_arched, double radius, double cut_edge_from_left, double cut_edge_from_right)
{
if (radius == 0)
{
radius = Radius / 2.0;
......@@ -901,7 +908,15 @@ Lens_Geometry_Quad::Lens_Geometry_Quad(double Radius, double thickness, double c
double inversFocal = (1.5 - 1.0) * ( (1.0 / curvatureLeft) - ( 1.0 / -curvatureRight ) + ( 1.5 - 1.0) * thickness / ( 1.5 * -curvatureRight * curvatureLeft ));
cout << "Focal length of Lens is " << 1.0 / inversFocal << " (assume n = 1.5 ) ." << endl;
focalLength_ = 1.0 / inversFocal;
cout << "Focal length of Lens is " << focalLength_ << " (assume n = 1.5 ) ." << endl;
thickness_ = thickness;
offsetX_ = offsetX;
offsetY_ = offsetY;
offsetZ_ = offsetZ;
pointer_global_data = new double[size_pointer_global_data];
pointer_global_data[0] = Radius;
pointer_global_data[1] = radius;
......@@ -965,6 +980,10 @@ Lens_Geometry_Quad::Lens_Geometry_Quad(double Radius, double thickness, double c
}
// if (curvatureRight < 0 && curvatureLeft < 0)
// {
// assert (((fabs(z_right_outer - z_left_outer) - thickness) < 0.0) && "Lens has negative thickness at edge! Make lens more thick or increase radius of curvature.");
......@@ -981,8 +1000,10 @@ Lens_Geometry_Quad::Lens_Geometry_Quad(double Radius, double thickness, double c
pointer_global_data[7] = z_left_outer;
pointer_global_data[8] = z_right_inner;
pointer_global_data[9] = z_right_outer;
pointer_global_data[10] = cut_edge_from_left;
pointer_global_data[11] = cut_edge_from_right;
std::cout << "adding cutted edges : \n";
pointer_global_data[10] = z_left_outer + cut_edge_from_left;
pointer_global_data[11] = z_right_outer - cut_edge_from_right;
// cout << "fixed lens param., channge again " << endl;
......@@ -1090,15 +1111,271 @@ Lens_Geometry_Quad::Lens_Geometry_Quad(double Radius, double thickness, double c
Set_transformation_face(8,9,14,15,transform_right_lens_diag_SE_quad);
//inner block: corner ids: 0 2 4 6 8 10 12 14
construction_done();
}
Lens_Geometry_cutted_edges::Lens_Geometry_cutted_edges(double Radius, double thickness, double curvatureLeft, double curvatureRight, double offsetX, double offsetY, double offsetZ, bool inner_grid_arched, double radius, double cut_edge_from_left, double cut_edge_from_right)
{
if (radius == 0)
{
radius = Radius / 2.0;
}
assert(Radius > radius);
size_pointer_global_data = 12;
if (fabs(curvatureLeft) >1e10)
{
curvatureLeft = 1e10;
}
if (fabs(curvatureRight) >1e10)
{
curvatureRight = 1e10;
}
double inversFocal = (1.5 - 1.0) * ( (1.0 / curvatureLeft) - ( 1.0 / -curvatureRight ) + ( 1.5 - 1.0) * thickness / ( 1.5 * -curvatureRight * curvatureLeft ));
focalLength_ = 1.0 / inversFocal;
cout << "Focal length of Lens is " << focalLength_ << " (assume n = 1.5 ) ." << endl;
thickness_ = thickness;
offsetX_ = offsetX;
offsetY_ = offsetY;
offsetZ_ = offsetZ;
pointer_global_data = new double[size_pointer_global_data];
pointer_global_data[0] = Radius;
pointer_global_data[1] = radius;
pointer_global_data[2] = curvatureLeft;
pointer_global_data[3] = curvatureRight;
pointer_global_data[4] = thickness;
pointer_global_data[5] = offsetZ;
assert ((thickness > 0.0) && "Thickness must be positive.");
assert ((Radius > 0.0) && "Radius must be positive.");
assert ((radius > 0.0) && "radius must be positive.");
constructionParameters.resize(8);
constructionParameters[0] = Radius;
constructionParameters[1] = radius;
constructionParameters[2] = thickness;
constructionParameters[3] = curvatureLeft;
constructionParameters[4] = curvatureRight;
constructionParameters[5] = offsetX;
constructionParameters[6] = offsetY;
constructionParameters[7] = offsetZ;
constructionBoolArched = inner_grid_arched;
// maybe adjust, if lens is negative (most thick part not in the centre but at the edges!)
relativeCoordVector.push_back(0.0);
relativeCoordVector.push_back(thickness);
typFuerSlice = lensUgTyp;
int num_blocks_z_dir = 1;
assert(num_blocks_z_dir>0);
int num_blocks_total = 9 * num_blocks_z_dir;
int num_points_per_face = 8;
int numPoints = num_points_per_face*(num_blocks_z_dir+1) ;
numPoints = 24;
double z_left_inner = -sqrt( pow(curvatureLeft ,2) - radius * radius ) + curvatureLeft + offsetZ;
double z_left_outer = -sqrt( pow(curvatureLeft ,2) - Radius * Radius ) + curvatureLeft + offsetZ;
double z_right_inner = +sqrt( pow(curvatureRight,2) - radius * radius ) - curvatureRight + offsetZ + thickness;
double z_right_outer = +sqrt( pow(curvatureRight,2) - Radius * Radius ) - curvatureRight + offsetZ + thickness;
double RadiusOuter = Radius * 1.2;
double z_left_edge = -sqrt( pow(curvatureLeft ,2) - RadiusOuter * RadiusOuter ) + curvatureLeft + offsetZ;
double z_right_edge = +sqrt( pow(curvatureRight,2) - Radius * Radius ) - curvatureRight + offsetZ + thickness;
if (curvatureLeft< 0.0)
{
z_left_inner = +sqrt( pow(curvatureLeft ,2) - radius * radius ) + curvatureLeft + offsetZ;
z_left_outer = +sqrt( pow(curvatureLeft ,2) - Radius * Radius ) + curvatureLeft + offsetZ;
}
if (curvatureRight< 0.0)
{
z_right_inner = -sqrt( pow(curvatureRight,2) - radius * radius ) - curvatureRight + offsetZ + thickness;
z_right_outer = -sqrt( pow(curvatureRight,2) - Radius * Radius ) - curvatureRight + offsetZ + thickness;
}
if (curvatureLeft == 0.0)
{
z_left_inner = 0.0 + offsetZ;
z_left_outer = 0.0 + offsetZ;
}
if (curvatureRight == 0.0)
{
z_right_inner = 0.0 + offsetZ + thickness;
z_right_outer = 0.0 + offsetZ + thickness;
}
// if (curvatureRight < 0 && curvatureLeft < 0)
// {
// assert (((fabs(z_right_outer - z_left_outer) - thickness) < 0.0) && "Lens has negative thickness at edge! Make lens more thick or increase radius of curvature.");
// }
if (curvatureRight > 0 && curvatureLeft > 0)
{
assert ((((z_right_outer - z_left_outer) ) > 0.0) && "Lens has negative thickness at edge! Make lens more thick or increase radius of curvature.");
}
pointer_global_data[6] = z_left_inner;
pointer_global_data[7] = z_left_outer;
pointer_global_data[8] = z_right_inner;
pointer_global_data[9] = z_right_outer;
pointer_global_data[10] = z_right_edge;
pointer_global_data[11] = z_left_edge;
// cout << "fixed lens param., channge again " << endl;
// radius = 1;
// Radius = 2;
// z_left_inner = z_left_outer = 0;
// z_right_inner = z_right_outer = 1;
Set_number_points ( numPoints );
Set_number_hexahedra ( num_blocks_total );
Set_coordinate_point( 0, D3vector ( offsetX+radius,offsetY,z_left_inner ));
Set_coordinate_point( 1, D3vector ( offsetX+Radius,offsetY,z_left_outer ));
Set_coordinate_point( 2, D3vector ( offsetX ,offsetY+radius,z_left_inner ));
Set_coordinate_point( 3, D3vector ( offsetX ,offsetY+Radius,z_left_outer ));
Set_coordinate_point( 4, D3vector ( offsetX-radius,offsetY,z_left_inner ));
Set_coordinate_point( 5, D3vector ( offsetX-Radius,offsetY,z_left_outer ));
Set_coordinate_point( 6, D3vector ( offsetX ,offsetY-radius,z_left_inner ));
Set_coordinate_point( 7, D3vector ( offsetX ,offsetY-Radius,z_left_outer ));
Set_coordinate_point( 8, D3vector ( offsetX+radius,offsetY,z_right_inner ));
Set_coordinate_point( 9, D3vector ( offsetX+Radius,offsetY,z_right_outer ));
Set_coordinate_point( 10, D3vector ( offsetX ,offsetY+radius,z_right_inner ));
Set_coordinate_point( 11, D3vector ( offsetX ,offsetY+Radius,z_right_outer ));
Set_coordinate_point( 12, D3vector ( offsetX-radius,offsetY,z_right_inner ));
Set_coordinate_point( 13, D3vector ( offsetX-Radius,offsetY,z_right_outer ));
Set_coordinate_point( 14, D3vector ( offsetX ,offsetY-radius,z_right_inner ));
Set_coordinate_point( 15, D3vector ( offsetX ,offsetY-Radius,z_right_outer ));
Set_coordinate_point( 16, D3vector ( offsetX+radius,offsetY,z_right_inner ));
Set_coordinate_point( 17, D3vector ( offsetX+Radius,offsetY,z_right_outer ));
Set_coordinate_point( 18, D3vector ( offsetX,offsetY+radius,z_right_inner ));
Set_coordinate_point( 19, D3vector ( offsetX,offsetY+Radius,z_right_outer ));
Set_coordinate_point( 20, D3vector ( offsetX-radius,offsetY,z_right_inner ));
Set_coordinate_point( 21, D3vector ( offsetX-Radius,offsetY,z_right_outer ));
Set_coordinate_point( 22, D3vector ( offsetX,offsetY-radius,z_right_inner ));
Set_coordinate_point( 23, D3vector ( offsetX,offsetY-Radius,z_right_outer ));
int num_blocks = 1;
for ( int i = 0; i < num_blocks; ++i ) {
Set_hexahedron ( i, i*num_points_per_face + 0, i*num_points_per_face + 2,
i*num_points_per_face + 6, i*num_points_per_face + 4,
( i+1 ) * num_points_per_face + 0, ( i+1 ) * num_points_per_face +2,
( i+1 ) * num_points_per_face + 6, ( i+1 ) * num_points_per_face +4 );
}
for ( int j = 0; j < num_points_per_face; j=j+2) {
for ( int i = 0; i < num_blocks; ++i) {
int myIndex = (j/2+1)*num_blocks +i;
Set_hexahedron ( myIndex,
i*num_points_per_face + j+0,
i*num_points_per_face + j+1,
i*num_points_per_face +((j+2) % num_points_per_face),
i*num_points_per_face +((j+3) % num_points_per_face),
(i+1)*num_points_per_face + j+0,
(i+1)*num_points_per_face + j+1,
(i+1)*num_points_per_face +((j+2) % num_points_per_face),
(i+1)*num_points_per_face +((j+3) % num_points_per_face)
);
}
}
//outer hexhedrons
for ( int j = 0; j < num_points_per_face; j=j+2) {
for ( int i = 0; i < num_blocks; ++i) {
int myIndex = (j/2+1)*num_blocks +i+16;
Set_hexahedron ( myIndex,
i*num_points_per_face + j+0,
i*num_points_per_face + j+1,
i*num_points_per_face +((j+2) % num_points_per_face),
i*num_points_per_face +((j+3) % num_points_per_face),
(i+1)*num_points_per_face + j+0,
(i+1)*num_points_per_face + j+1,
(i+1)*num_points_per_face +((j+2) % num_points_per_face),
(i+1)*num_points_per_face +((j+3) % num_points_per_face)
);
}
}
construction_hexahedron_points_done();
//inner block: corner ids: 0 2 4 6 8 10 12 14
Set_transformation_face(0,2,4,6,transform_left_lens_inner_quad); // z=0 plane transform_left_lens_inner_quad
Set_transformation_face(0,2,8,10,transform_inner_faces_NE_quad); //transform_inner_quad_NE transform_inner_quad_NW transform_inner_quad_SW transform_inner_quad_SE
Set_transformation_face(2,4,10,12,transform_inner_faces_NE_quad); //??
Set_transformation_face(4,6,12,14,transform_inner_faces_NE_quad); //??
Set_transformation_face(0,6,8,14,transform_inner_faces_NE_quad); //??
Set_transformation_face(8,10,12,14,transform_right_lens_inner_quad); // z = right plane transform_right_lens_inner_quad
//top-east block: corner ids: 0 1 2 3 8 9 10 11
Set_transformation_face(0,1,2,3,transform_left_lens_diag_NE_quad);
Set_transformation_face(0,1,8,9,transform_diag_inner_faces_NE_quad);
Set_transformation_face(0,2,8,10,transform_inner_faces_NE_quad);
Set_transformation_face(2,3,10,11,transform_diag_inner_faces_NE_quad);
Set_transformation_face(1,3,9,11,transform_outer_boundary_NE); //
Set_transformation_face(8,9,10,11,transform_right_lens_diag_NE_quad);
//north-west block: corner ids: 2 3 4 5 10 11 12 13
Set_transformation_face(2,3,4,5,transform_left_lens_diag_NW_quad);//transform_left_lens_diag_NW_quad
Set_transformation_face(2,3,10,11,transform_diag_inner_faces_NE_quad);
Set_transformation_face(2,4,10,12,transform_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(10,11,12,13,transform_right_lens_diag_NW_quad); //transform_right_lens_diag_NW_quad
//bottom-west block: corner ids: 4 5 6 7 12 13 14 15
//eher: S-W-BLOCK
Set_transformation_face(4,5,6,7,transform_left_lens_diag_SW_quad);
Set_transformation_face(4,5,12,13,transform_diag_inner_faces_NE_quad);
Set_transformation_face(4,6,12,14,transform_inner_faces_NE_quad);
Set_transformation_face(6,7,14,15,transform_diag_inner_faces_NE_quad);
Set_transformation_face(5,7,13,15,transform_outer_boundary_SW); //
Set_transformation_face(12,13,14,15,transform_right_lens_diag_SW_quad);
//bottom-east block: corner ids: 0 1 6 7 8 9 14 15
//eher: S-E-BLOCK
Set_transformation_face(0,1,6,7,transform_left_lens_diag_SE_quad);
Set_transformation_face(0,1,8,9,transform_diag_inner_faces_NE_quad);
Set_transformation_face(0,6,8,14,transform_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(8,9,14,15,transform_right_lens_diag_SE_quad);
//Set_transformation_face(0,2,4,6,transform_quadrangle_TEST);
//Set_transformation_face(0,2,8,10,transform_quadrangle_TEST); //transform_quadrangle_test
//Set_transformation_face(2,4,10,12,transform_quadrangle_TEST);
//Set_transformation_face(4,6,12,14,transform_quadrangle_TEST);
//Set_transformation_face(0,6,8,14,transform_quadrangle_TEST);
//Set_transformation_face(8,10,12,14,transform_quadrangle_TEST);
construction_done();
......
......@@ -25,23 +25,43 @@ class Lens_Geometry_Quad : public Unstructured_grid {
Lens_Geometry_Quad(double Radius, double thickness, double curvatureLeft, double curvatureRight, double offsetX, double offsetY, double offsetZ, bool inner_grid_arched = false, double radius = 0.0, double cut_edge_from_left = 0, double cut_edge_from_right = 0);
~Lens_Geometry_Quad(){};
double Radius;
double radius;
double length;
double getThickness(){return thickness_;};
double getOffsetX(){return offsetX_;};
double getOffsetY(){return offsetY_;};
double getOffsetZ(){return offsetZ_;};
double getFocalLength(){return focalLength_;};
private:
double Radius_;
double radius_;
double thickness_;
double offsetX_;
double offsetY_;
double offsetZ_;
double focalLength_;
};
class Lens_Geometry_cutted_edges : public Unstructured_grid {
public:
Lens_Geometry_cutted_edges(double Radius, double thickness, double curvatureLeft, double curvatureRight, double radiusForCutLeft, double radiusForCutRight, double edgeThickness, double offsetX, double offsetY, double offsetZ, bool inner_grid_arched = false, double radius = 0.0);
//Lens_Geometry_cutted_edges(double Radius, double thickness, double curvatureLeft, double curvatureRight, double distForCutLeft, double distForCutRight, double edgeThickness, double offsetX, double offsetY, double offsetZ, bool inner_grid_arched = false, double radius = 0.0);
Lens_Geometry_cutted_edges(double Radius, double thickness, double curvatureLeft, double curvatureRight, double offsetX, double offsetY, double offsetZ, bool inner_grid_arched = false, double radius = 0.0, double cut_edge_from_left = 0, double cut_edge_from_right = 0);
~Lens_Geometry_cutted_edges(){};
double Radius;
double radius;
double length;
double getThickness(){return thickness_;};
double getOffsetX(){return offsetX_;};
double getOffsetY(){return offsetY_;};
double getOffsetZ(){return offsetZ_;};
double getFocalLength(){return focalLength_;};
private:
double Radius_;
double radius_;
double thickness_;
double offsetX_;
double offsetY_;
double offsetZ_;
double focalLength_;
};
......
......@@ -188,11 +188,11 @@ class Unstructured_grid : public Partitioning {
bool Give_transform_From_Quadrangle() {return transformFromQuadrangle;}
// bool Adjacent(int num_hex, int num_edge);
void Set_edge_to_quad_id(int index, int value){ if(index < Give_number_edges());edge_to_quad_id.at(index) = value; };
int Give_edge_to_quad_id(int index){ if(index < Give_number_edges());return edge_to_quad_id.at(index); };
void Set_edge_to_quad_id(int index, int value){ if(index < Give_number_edges()){edge_to_quad_id.at(index) = value; } };
int Give_edge_to_quad_id(int index){ if(index < Give_number_edges()){return edge_to_quad_id.at(index); } };
void Set_edge_to_quad_dir(int index, int value){ if(index < Give_number_edges());edge_to_quad_dir.at(index) = value; };
int Give_edge_to_quad_dir(int index){ if(index < Give_number_edges());return edge_to_quad_dir.at(index); };
void Set_edge_to_quad_dir(int index, int value){ if(index < Give_number_edges()){edge_to_quad_dir.at(index) = value; } };
int Give_edge_to_quad_dir(int index){ if(index < Give_number_edges()){return edge_to_quad_dir.at(index); } };
Hexahedron_el* Give_hexahedron(int i) { return &(hexahedra[i]); }
Quadrangle_el* Give_quadrangle(int i) { return &(quadrangles[i]); }
......
......@@ -60,7 +60,8 @@ class D3vector {
void operator-=(const D3vector& v) { x-=v.x; y-=v.y; z-=v.z; }
void operator*=(const double v) { x*=v; y*=v; z*=v; }
void operator/=(const double v) { x/=v; y/=v; z/=v; }
bool operator==(const D3vector& v) {if(fabs(v.x - x) <1e-10 && fabs(v.y - y) <1e-10 && fabs(v.z - z) <1e-10 ){return true;} else {return false;} }
//bool operator==(const D3vector& v) {if(fabs(v.x - x) <1e-10 && fabs(v.y - y) <1e-10 && fabs(v.z - z) <1e-10 ){return true;} else {return false;} }
bool operator==(const D3vector& v) {if( (v.x == x) && (v.y == y) && (v.z == z) ){return true;} else {return false;} }
bool operator<(const D3vector& v) {if(v.x > x && v.y > y && v.z > z){return true;} else {return false;} }
bool operator>(const D3vector& v) {if(v.x < x && v.y < y && v.z < z){return true;} else {return false;} }
bool operator<=(const D3vector& v) {if(v.x >= x && v.y >= y && v.z >= z){return true;} else {return false;} }
......@@ -247,7 +248,8 @@ class D3matrix {
}
void invert_gauss_elimination()
{
int n;
//for 3x3 matrix only
//int n;
double a[3][6];
for (int i = 0 ; i<3;i++)
{
......@@ -258,7 +260,7 @@ class D3matrix {
}
}
int order = 3;
n = 3;
//n = 3;
a[0][0] = x1;
a[1][0] = y1;
a[2][0] = z1;
......@@ -269,15 +271,6 @@ class D3matrix {
a[1][2] = y3;
a[2][2] = z3;
// a[0][0] = x1;
// a[1][0] = x2;
// a[2][0] = x3;
// a[0][1] = y1;
// a[1][1] = y2;
// a[2][1] = y3;
// a[0][2] = z1;
// a[1][2] = z2;
// a[2][2] = z3;
double temp;
......@@ -355,15 +348,6 @@ class D3matrix {
y3 = a[1][2+order];
z3 = a[2][2+order];
// x1 = a[0][0+order];
// x2 = a[1][0+order];
// x3 = a[2][0+order];
// y1 = a[0][1+order];
// y2 = a[1][1+order];
// y3 = a[2][1+order];
// z1 = a[0][2+order];
// z2 = a[1][2+order];
// z3 = a[2][2+order];
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment