Commit dff4e004 authored by Phillip Lino Rall's avatar Phillip Lino Rall
Browse files

Merge branch 'cutted_lens_support' of i10git.cs.fau.de:er96apow/UGBlocks_V3

parents 2998507e 6318c60e
......@@ -29,7 +29,7 @@ unix: VTK_LIBS = \
# Pathes
# -Home Directory
HOME_DIR = /home/pflaum/UGBlocks
HOME_DIR = C:\Users\rall\Documents\UGBLOCKS\trunk
#HOME_DIR = ../../
# -UGBlocks Directory
......
......@@ -244,7 +244,7 @@ void Variable<DTyp>::QPrint_VTK(QString DateiName, double (*convert)(DTyp x),dou
}
QTextStream Datei(&file);
Datei.setRealNumberPrecision(10);
// for parallel
double* data_coord;
int size, rank;
......
......@@ -514,6 +514,18 @@ inline double Variable<double>::Give_data<hexahedronEl> ( params_in ) const {
template <>
template <>
inline void Variable<double>::Set_data<hexahedronEl> ( params_in, double value ) {
if (id == 4 && i == 8 && j == 8 && k == 8)
{
std::cout << "broh " << std::endl;
}
else if (id == 5 && i == 0 && j == 0 && k == 8)
{
std::cout << "broh " << std::endl;
}
else if (id == 8 && i == 0 && j == 8 && k == 8)
{
std::cout << "broh " << std::endl;
}
data_hexahedra[id][i+ ( Nx+1 ) * ( j+ ( Ny+1 ) *k ) ] = value;
}
......
......@@ -111,17 +111,17 @@ Variable<DTyp>::Variable(Blockgrid& blockgrid_ ) :
data_neighbor_edges = new DTyp**[ug->Give_number_edges() ];
for ( int id=0; id<ug->Give_number_edges(); ++id ) {
num_neighbor = ug->Give_edge ( id )->Give_number_neighbors();
if ( ug->Give_edge ( id )->my_object ( my_rank ) ) {
data_neighbor_edges[id] = new DTyp*[num_neighbor];
for ( int i=0; i<num_neighbor; ++i ) {
num_total = blockgrid->Give_Nx_edge ( id ) +1;
totalNumberData = totalNumberData + num_total;
}
} else data_neighbor_edges[id] = NULL;
}
for ( int id=0; id<ug->Give_number_edges(); ++id ) {
num_neighbor = ug->Give_edge ( id )->Give_number_neighbors();
if ( ug->Give_edge ( id )->my_object ( my_rank ) ) {
//data_neighbor_edges[id] = new DTyp*[num_neighbor];
for ( int i=0; i<num_neighbor; ++i ) {
num_total = blockgrid->Give_Nx_edge ( id ) +1;
totalNumberData = totalNumberData + num_total;
}
}// else data_neighbor_edges[id] = NULL;
}
// points
data_points = new DTyp*[ug->Give_number_points() ];
......@@ -224,7 +224,8 @@ Variable<DTyp>::Variable(Blockgrid& blockgrid_ ) :
if ( ug->Give_edge ( id )->my_object ( my_rank ) ) {
data_neighbor_edges[id] = new DTyp*[num_neighbor];
for ( int i=0; i<num_neighbor; ++i ) {
num_total = blockgrid->Give_Nx_edge ( id ) +1;
num_total = blockgrid->Give_Nx_edge ( id ) +1;
data_neighbor_edges[id][i] = &(dataTotal[indexStart]);
indexStart = indexStart + num_total;
......@@ -251,8 +252,8 @@ Variable<DTyp>::Variable(Blockgrid& blockgrid_ ) :
num_total = ug->Give_point ( id )->Give_number_neighbors();
if ( ug->Give_point ( id )->my_object ( my_rank ) ) {
data_neighbor_points[id] = new DTyp[num_total];
data_neighbor_points[id] = &(dataTotal[indexStart]);
//data_neighbor_points[id] = new DTyp[num_total];
data_neighbor_points[id] = &(dataTotal[indexStart]);
indexStart = indexStart + num_total;
......@@ -391,10 +392,10 @@ void Variable<DTyp>::Delete_data() {
}
data_points = NULL;
if ( data_neighbor_points != NULL ) {
delete [] data_neighbor_points;
}
data_neighbor_points = NULL;
if ( data_neighbor_points != NULL ) {
delete [] data_neighbor_points;
}
data_neighbor_points = NULL;
delete [] ug_edge_number_neighbors;
}
......
......@@ -101,7 +101,6 @@ 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;
id_of_grid = id_count_grid; ++id_count_grid;
phase_shift = NULL;
bg_coord = NULL;
......@@ -121,6 +120,27 @@ Blockgrid::Blockgrid ( Unstructured_grid *ug_, int Nx, int Ny, int Nz, int Nr )
variable_set = false;
}
Blockgrid::Blockgrid(Unstructured_grid *ug_, int Nx, int Ny, int Nz, int Nr, int Nr2){
id_of_grid = id_count_grid; ++id_count_grid;
phase_shift = NULL;
bg_coord = NULL;
ug = ug_;
if ( ug->degree_of_freedom() !=5 ) {
cout << " error in Blockgrid::Blockgrid(Unstructured_grid *ug_,int Nx,int Ny,int Nz,int Nr) "
<< endl;
cout << " number of degree of freedom is: " << ug->degree_of_freedom() << endl;
}
number_points = new int[5];
number_points[0] = Nx;
number_points[1] = Ny;
number_points[2] = Nz;
number_points[3] = Nr;
number_points[4] = Nr2;
variable_set = false;
}
Blockgrid::Blockgrid ( Unstructured_grid *ug_, int Nx, int Ny, std::vector<int>& Nz ) {
id_of_grid = id_count_grid; ++id_count_grid;
phase_shift = NULL;
......@@ -270,6 +290,8 @@ Blockgrid::~Blockgrid()
if ( number_points!=NULL )
delete [] number_points;
number_points = NULL;
if (bg_coord != NULL)
delete bg_coord;
}
int Blockgrid::Give_Nx_hexahedron ( int id ) const
......@@ -1060,7 +1082,8 @@ void Blockgrid_coordinates::init_blockgrid_coordinates_boundary()
int Ny = bg->Give_Ny_hexahedron(id_hex)+1;
int Nz = bg->Give_Nz_hexahedron(id_hex)+1;
blockgrid_hexa_boundary.at(id_hex).resize(Nx*Ny*Nz);
for(int i=0;i<Nx;++i) for(int j=0;j<Ny;++j) for(int k=0;k<Nz;++k)
//for(int i=0;i<Nx;++i) for(int j=0;j<Ny;++j) for(int k=0;k<Nz;++k)
for(int k=0;k<Nz;++k) for(int j=0;j<Ny;++j) for(int i=0;i<Nx;++i)
{
//if ((i > 0 || i < Nx-1) ^ (j > 0 || j < Ny-1) ^ (k > 0 || k < Nz-1))
......@@ -1080,13 +1103,14 @@ void Blockgrid_coordinates::init_blockgrid_coordinates_boundary()
int NxInner = bg->Give_Nx_hexahedron(id_hexInner)+1;
int NyInner = bg->Give_Ny_hexahedron(id_hexInner)+1;
int NzInner = bg->Give_Nz_hexahedron(id_hexInner)+1;
for(int iInner=0;iInner<NxInner;++iInner) for(int jInner=0;jInner<NyInner;++jInner) for(int kInner=0;kInner<NzInner;++kInner)
//for(int iInner=0;iInner<NxInner;++iInner) for(int jInner=0;jInner<NyInner;++jInner) for(int kInner=0;kInner<NzInner;++kInner)
for(int kInner=0;kInner<NzInner;++kInner) for(int jInner=0;jInner<NyInner;++jInner) for(int iInner=0;iInner<NxInner;++iInner)
{
// not sure which if loop is correct:
//if ((iInner > 0 || iInner < NxInner-1) ^ (jInner > 0 || jInner < NyInner-1) ^ (kInner > 0 || kInner < NzInner-1))
if (true || (iInner == 0 || iInner == NxInner-1) || (jInner == 0 || jInner == NyInner-1) || (kInner == 0 || kInner == NzInner-1))
{
if(bg->Give_coord_hexahedron(id_hex,i,j,k) == bg->Give_coord_hexahedron(id_hexInner,iInner,jInner,kInner) )
if(D3VectorNormSquared(bg->Give_coord_hexahedron(id_hex,i,j,k) - bg->Give_coord_hexahedron(id_hexInner,iInner,jInner,kInner)) < 1e-10 )
{
int convertedLocalIndex = i +(Nx)*(j +(Ny)* k);
......
......@@ -49,6 +49,7 @@ class Blockgrid_coordinates {
* */
void init_blockgrid_coordinates_boundary();
void delete_blockgrid_coordinates();
std::vector<std::vector<std::vector<int> > > getHexaCoordiantesBoundary(){return blockgrid_hexa_boundary;}
std::vector<std::vector<std::vector<int> > > blockgrid_hexa_boundary;
std::vector< std::vector< D3vector > > blockgrid_hexa_coordinates;
......@@ -71,6 +72,7 @@ class Blockgrid {
Blockgrid(Unstructured_grid *ug, int N);
Blockgrid(Unstructured_grid *ug, int Nx, int Ny, int Nz);
Blockgrid(Unstructured_grid *ug, int Nx, int Ny, int Nz, int Nr);
Blockgrid(Unstructured_grid *ug, int Nx, int Ny, int Nz, int Nr, int Nr2);
Blockgrid(Unstructured_grid *ug_, int Nx, int Ny, std::vector<int>& Nz);
Blockgrid(Unstructured_grid *ug_, std::vector<int>& Nx, std::vector<int>& Ny, std::vector<int>& Nz);
Blockgrid(Unstructured_grid *ug_, std::vector<int> Nvec);
......@@ -140,7 +142,7 @@ class Blockgrid {
// Anzahl der Punkte in Richtung i
// i=0, ..., degree_of_freedom()-1
Blockgrid_coordinates * bg_coord;
Blockgrid_coordinates * bg_coord{};
Unstructured_grid *ug;
private:
......
This diff is collapsed.
......@@ -25,23 +25,42 @@ 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 RadiusLeft, double RadiusRight, double MechanicalRadiusLeft,double MechanicalRadiusRight, double thickness, double curvatureLeft, double curvatureRight, double offsetX, double offsetY, double offsetZ, bool inner_grid_arched = false, double radius = 0.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_;
};
......
......@@ -476,11 +476,22 @@ Boundary_Marker::Boundary_Marker ( Unstructured_grid* ug_ ) : Marker ( ug_ )
Boundary_Marker::~Boundary_Marker() {}
void Boundary_Marker::markBoundaryDir3D(dir3D dir)
{
void Boundary_Marker::markBoundaryDir3D(dir3D dir, int blockRangeStart, int blockRangeEnd)
{
if (blockRangeStart == -1)
{return;}
if (blockRangeEnd < 0 || blockRangeEnd > ug->Give_number_hexahedra())
{
blockRangeEnd = ug->Give_number_hexahedra();
}
if (blockRangeStart < 0 || blockRangeStart > ug->Give_number_hexahedra())
{
blockRangeStart = 0;
}
Quadrangle_el* quad;
Hexahedron_el* hex ;
for ( int id = 0;id < ug->Give_number_hexahedra();++id ) {
for ( int id = blockRangeStart;id < blockRangeEnd;++id ) {
hex = ug->Give_hexahedron ( id );
if ( ug->Give_quadrangle ( hex->Give_id_quadrangle ( dir ) )->Give_exists_exterior() == false ) {
......@@ -492,14 +503,25 @@ void Boundary_Marker::markBoundaryDir3D(dir3D dir)
for ( int i=0; i<4; ++i )
Set_marker<pointEl> ( quad->Give_id_corner ( ( dir2D_sons ) i ), yes_mark );
}
}
}
}
void Boundary_Marker::unmarkBoundaryDir3D(dir3D dir)
void Boundary_Marker::unmarkBoundaryDir3D(dir3D dir, int blockRangeStart, int blockRangeEnd)
{
if (blockRangeStart == -1)
{return;}
if (blockRangeEnd < 0 || blockRangeEnd > ug->Give_number_hexahedra())
{
blockRangeEnd = ug->Give_number_hexahedra();
}
if (blockRangeStart < 0 || blockRangeStart > ug->Give_number_hexahedra())
{
blockRangeStart = 0;
}
Quadrangle_el* quad;
Hexahedron_el* hex ;
for ( int id = 0;id < ug->Give_number_hexahedra();++id ) {
for ( int id = blockRangeStart;id < blockRangeStart;++id ) {
hex = ug->Give_hexahedron ( id );
if ( ug->Give_quadrangle ( hex->Give_id_quadrangle ( dir ) )->Give_exists_exterior() == false ) {
......
......@@ -93,8 +93,8 @@ public:
Boundary_Marker(Unstructured_grid* ug_);
~Boundary_Marker();
//* mark boundary in dirction dir3D (Ndir3D, Edir3D... )
void markBoundaryDir3D(dir3D dir);
void unmarkBoundaryDir3D(dir3D dir);
void markBoundaryDir3D(dir3D dir, int blockRangeStart = 0, int blockRangeEnd = -1 );
void unmarkBoundaryDir3D(dir3D dir, int blockRangeStart = 0, int blockRangeEnd = -1 );
};
......
......@@ -89,6 +89,13 @@ Not_constant_direction_marker::Not_constant_direction_marker(Unstructured_grid*
}
}
Not_constant_direction_marker::~Not_constant_direction_marker()
{
delete[] not_const_x;
delete[] not_const_y;
delete[] not_const_z;
}
void Not_constant_direction_marker::Mark_x_as_not_constant_at(int i, bool bb) {
if(i<0 || i>=num_hexahedra)
cout << " error in Constant_direction_marker::Mark_x_as_const_at" << endl;
......@@ -183,6 +190,8 @@ Unstructured_grid::~Unstructured_grid() {
delete all_points;
delete zordering;
if (my_not_constant_directions != NULL)
delete my_not_constant_directions;
}
void Unstructured_grid::Set_number_points(int num_points_) {
......@@ -230,6 +239,7 @@ void Unstructured_grid::Set_hexahedron(int id,
hexahedra[id].Set_id_corner(WNTdir3D,i_WNT);
hexahedra[id].Set_id_corner(ENTdir3D,i_ENT);
hexahedra[id].Set_coord(WSDdir3D,points[i_WSD].Give_coordinate());
hexahedra[id].Set_coord(ESDdir3D,points[i_ESD].Give_coordinate());
......@@ -254,6 +264,7 @@ void Unstructured_grid::Set_hexahedron(int id,
if(construction_hexahedron_points_done_yn==true)
cout << " error in Unstructured_grid::Set_hexahedron !" << endl;
hexahedra[id].Set_id_corner(WSDdir3D,i_WSD);
hexahedra[id].Set_id_corner(ESDdir3D,i_ESD);
hexahedra[id].Set_id_corner(WNDdir3D,i_WND);
......@@ -263,6 +274,7 @@ void Unstructured_grid::Set_hexahedron(int id,
hexahedra[id].Set_id_corner(WNTdir3D,i_WNT);
hexahedra[id].Set_id_corner(ENTdir3D,i_ENT);
hexahedra[id].Set_coord(WSDdir3D,coord_WSD);
hexahedra[id].Set_coord(ESDdir3D,coord_ESD);
hexahedra[id].Set_coord(WNDdir3D,coord_WND);
......
......@@ -24,6 +24,7 @@
#include <string>
#include <list>
#include <vector>
#include <algorithm>
////////////////////////////////////////////////////////////////
......@@ -63,7 +64,7 @@ void Calculate_corresponding_corners(dir3D_sons corner, dir3D_sons& SED_corner,
class Not_constant_direction_marker {
public:
Not_constant_direction_marker(Unstructured_grid* grid);
~Not_constant_direction_marker();
int stenIndex(int i, int j, int k, int Nx, int Ny, int id) const {
return ((i-1)*not_const_x[id] + ((Nx-2)*not_const_x[id] + 1)*
((j-1)*not_const_y[id] + ((Ny-2)*not_const_y[id] + 1)*
......@@ -188,11 +189,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]); }
......@@ -299,7 +300,7 @@ class Unstructured_grid : public Partitioning {
std::vector<double> relativeCoordVector;
std::vector<double> construction_lx, construction_ly, construction_lz;
bool constructionBoolArched;
bool constructionBoolPeriodic;
bool constructionBoolPeriodic{false};
bool transformFromQuadrangle;
......
......@@ -34,6 +34,7 @@
#include "../extemp/co_fu.h"
#include "../extemp/functor.h"
#include "interpol.h"
#include "customtime.h"
#include <iomanip>
#include "assert.h"
......@@ -52,25 +53,25 @@ bool contained_in_tet(D3vector lam) {
}
bool contained_in_tet_strong(D3vector lam) {
if(lam.x < -0.1) return false;
if(lam.y < -0.1) return false;
if(lam.z < -0.1) return false;
if(lam.x + lam.y + lam.z > 1.1) return false;
if(lam.x < -0.2) return false;
if(lam.y < -0.2) return false;
if(lam.z < -0.2) return false;
if(lam.x + lam.y + lam.z > 1.2) return false;
return true;
}
bool new_lam_better(D3vector lam_old, D3vector lam_new) {
if (MIN(lam_new ) < -0.1 || MAX(lam_new) > 1.1) return false;
if (MIN(lam_old ) < -0.1 || MAX(lam_old) > 1.1) return true;
if (MIN(lam_new ) < -0.2 || MAX(lam_new) > 1.2) return false;
if (MIN(lam_old ) < -0.2 || MAX(lam_old) > 1.2) return true;
if (MIN(lam_new) < MIN(lam_old)) return true;
if (MAX(lam_new) < MAX(lam_old)) return true;
}
bool new_lam_worse(D3vector lam_old, D3vector lam_new) {
if(MIN(lam_new) < MIN(lam_old) && MIN(lam_old) < -0.1) return true;
if(MAX(lam_new) > MAX(lam_old) && MAX(lam_old) > 1.1) return true;
if(MIN(lam_new) < MIN(lam_old) && MIN(lam_old) < -0.2) return true;
if(MAX(lam_new) > MAX(lam_old) && MAX(lam_old) > 1.2) return true;
return false;
}
......@@ -1499,7 +1500,6 @@ void Interpolate_direct::init()
indexAllFacesOutside.at(4) = filterCorrectNeighbours(indexAllFacesOutside.at(4));
if (indexAllFacesOutside.at(4).empty())
{
//cout << "no outer neighbours here ! " << endl;
correctRelation.at(4) = emptyVector;
}
else
......@@ -1524,12 +1524,11 @@ void Interpolate_direct::init()
indexAllFacesOutside.at(5) = filterCorrectNeighbours(indexAllFacesOutside.at(5));
if (indexAllFacesOutside.at(5).empty())
{
//cout << "no outer neighbours here ! " << endl;
correctRelation.at(5) = emptyVector;
}
else
{
correctRelation.at(5) = calculateNeighbourIndexRelation(indexAllFacesInside.at(5), indexAllFacesOutside.at(5));
correctRelation.at(5) = calculateNeighbourIndexRelation(indexAllFacesInside.at(5), indexAllFacesOutside.at(5));
}
......@@ -1689,7 +1688,11 @@ void Interpolate_direct::init()
std::vector<std::vector<int> > Interpolate_direct::calculateNeighbourIndexRelation(std::vector<std::vector<int> > inner, std::vector<std::vector<int> > outer)
{
// 1 : find index which does not change --> not part of the boundary
//cout << "checking ... " << endl;
if (outer.size() != inner.size())
{
cout << "ops " << endl;
}
std::vector<int> diffToAdd(4);
std::vector<int> IndexToInvert(4);
std::vector<int> IndexToSwitch(4);
......@@ -1738,7 +1741,6 @@ std::vector<std::vector<int> > Interpolate_direct::calculateNeighbourIndexRelati
}
diffToAdd.at(indexNotAtBoundaryInner) = outer.front().at(indexNotAtBoundaryOuter) - inner.front().at(indexNotAtBoundaryInner);
retVal.push_back(diffToAdd);
//return std::vector< int >(0);
//check index, which does NOT change and calculate difference
//case 1 :: 0 invert and 0 rotation
......@@ -2470,43 +2472,6 @@ std::vector<int> Interpolate_direct::calculateNeighbourIndex(std::vector<std::ve
int indexConverted = convertedI +Nx*(convertedJ +Ny* convertedK);
//indexConverted = 0;
//int indexTemp = iTemp +NxOuter*(jTemp +NyOuter* convertedK); // to be saved!!!
// D3vector boxWSDInner = arrayBoxWSDENT.at(id_hex_inside).at(indexConverted).at(0);
// D3vector boxENTInner = arrayBoxWSDENT.at(id_hex_inside).at(indexConverted).at(1);
// D3vector cWSD, cESD;
// D3vector cWND, cEND;
// D3vector cWST, cEST;
// D3vector cWNT, cENT;
// D3vector boxWSD, boxENT;
// cWSD = blockgrid->Give_coord_hexahedron(id_hex_outside,iTemp, jTemp, kTemp );
// cESD = blockgrid->Give_coord_hexahedron(id_hex_outside,iTemp+1,jTemp ,kTemp );
// cWND = blockgrid->Give_coord_hexahedron(id_hex_outside,iTemp, jTemp+1,kTemp );
// cEND = blockgrid->Give_coord_hexahedron(id_hex_outside,iTemp+1,jTemp+1,kTemp );
// cWST = blockgrid->Give_coord_hexahedron(id_hex_outside,iTemp, jTemp, kTemp+1);
// cEST = blockgrid->Give_coord_hexahedron(id_hex_outside,iTemp+1,jTemp ,kTemp+1);
// cWNT = blockgrid->Give_coord_hexahedron(id_hex_outside,iTemp, jTemp+1,kTemp+1);
// cENT = blockgrid->Give_coord_hexahedron(id_hex_outside,iTemp+1,jTemp+1,kTemp+1);
// // bounding box calculation
// boxWSD.x = MIN(MIN(MIN(cWSD.x,cESD.x),MIN(cWND.x,cEND.x)),
// MIN(MIN(cWST.x,cEST.x),MIN(cWNT.x,cENT.x)));// - factor *hx;
// boxWSD.y = MIN(MIN(MIN(cWSD.y,cESD.y),MIN(cWND.y,cEND.y)),
// MIN(MIN(cWST.y,cEST.y),MIN(cWNT.y,cENT.y)));// - factor *hy;
// boxWSD.z = MIN(MIN(MIN(cWSD.z,cESD.z),MIN(cWND.z,cEND.z)),
// MIN(MIN(cWST.z,cEST.z),MIN(cWNT.z,cENT.z)));// - factor *hz;
// boxENT.x = MAX(MAX(MAX(cWSD.x,cESD.x),MAX(cWND.x,cEND.x)),
// MAX(MAX(cWST.x,cEST.x),MAX(cWNT.x,cENT.x)));// + factor *hx;
// boxENT.y = MAX(MAX(MAX(cWSD.y,cESD.y),MAX(cWND.y,cEND.y)),
// MAX(MAX(cWST.y,cEST.y),MAX(cWNT.y,cENT.y)));// + factor *hy;
// boxENT.z = MAX(MAX(MAX(cWSD.z,cESD.z),MAX(cWND.z,cEND.z)),
// MAX(MAX(cWST.z,cEST.z),MAX(cWNT.z,cENT.z)));// + factor *hz;
//D3vector boxWSDOuter = arrayBoxWSDENT.at(idHexTempTest).at(indexTemp).at(0);
//D3vector boxENTOuter = arrayBoxWSDENT.at(idHexTempTest).at(indexTemp).at(1);
//check, if boundary already written here
bool write = true;
......@@ -2519,6 +2484,10 @@ std::vector<int> Interpolate_direct::calculateNeighbourIndex(std::vector<std::ve
}
if (write)
{
if (array_box_boundary.at(id_hex_inside).at(indexConverted).size() > 9)
{
std::cout << "4 edges?? " << std::endl;
}
array_box_boundary.at(id_hex_inside).at(indexConverted).push_back(id_hex_outside);
array_box_boundary.at(id_hex_inside).at(indexConverted).push_back(iTemp);
array_box_boundary.at(id_hex_inside).at(indexConverted).push_back(jTemp);
......@@ -2546,13 +2515,23 @@ std::vector<int> Interpolate_direct::calculateNeighbourIndex(std::vector<std::ve
std::vector<std::vector <int> > Interpolate_direct::filterCorrectNeighbours(std::vector<std::vector<int> > outer)
{
//filter wrong Neighbours (from other side)
// cout << "outer size " << outer.size() << endl;
// for (int iterInner = 0; iterInner < outer.size(); iterInner++)
// {
// for (int iterI = 0; iterI < outer.at(iterInner).size(); iterI++)
// {
// cout << outer.at(iterInner).at(iterI) << " ";
// }
// cout << "\n";
// }
// cout << endl;
std::vector<int> sumHasToBeFour(blockgrid->Give_unstructured_grid()->Give_number_hexahedra());
std::vector<std::vector<int > > outerCorrect(0);
for (int iterOutside = 0 ; iterOutside < outer.size() ; iterOutside++ )
{
sumHasToBeFour.at(outer.at(iterOutside).at(0))++;
}
int correctNeighbourHex;
int correctNeighbourHex{-1};
for (int iterOutside = 0 ; iterOutside < sumHasToBeFour.size() ; iterOutside++ )
{
if (sumHasToBeFour.at(iterOutside) == 4)
......@@ -2568,6 +2547,10 @@ std::vector<std::vector <int> > Interpolate_direct::filterCorrectNeighbours(std:
outerCorrect.push_back(outer.at(iterOutside));
}
}
if (outerCorrect.size() != 4 && outerCorrect.size() != 0)
{
cout << "size has to be 4 or 0, but isnt"<< endl;
}
return outerCorrect;
}
......@@ -2887,6 +2870,8 @@ int Interpolate_direct::checkBox(int id_Hex, int i, int j, int k, D3vector v)
boxWSD = arrayBoxWSDENT.at(id_Hex).at(i +Nx*(j +Ny* k)).at(0);
boxENT = arrayBoxWSDENT.at(id_Hex).at(i +Nx*(j +Ny* k)).at(1);
// writeBox(boxWSD,boxENT,std::string("box"));
if (boxENT>=v && boxWSD<=v)
{
......@@ -2931,7 +2916,7 @@ int Interpolate_direct::checkBox(int id_Hex, int i, int j, int k, D3vector v)