Commit 3bf7abbb authored by Christoph Pflaum's avatar Christoph Pflaum
Browse files

bug aus PhasenBerechnung raus

parent 16489abc
......@@ -69,7 +69,7 @@ CalcContinuousArg::CalcContinuousArg(Blockgrid2D& blockgrid_) {
Y_coordinate2d Y(blockgrid_);
norm = X*X+Y*Y;
numberBlocks = ug->Give_number_rectangle();
orderedPoints = new std::list<PointForPhase>[numberBlocks];
......@@ -82,9 +82,11 @@ CalcContinuousArg::CalcContinuousArg(Blockgrid2D& blockgrid_) {
for(int i=0;i<=Nx;++i) for(int j=0;j<=Ny;++j) {
norm.Update<rectangleEl>(id);
woSmaller woNext = nichts;
double radiusNext = -1.0;
double radiusM = norm.template Give_data<rectangleEl>(id,i,j,Nx);
/*
//Version nächsten der kleineren Radius hat
double radiusNext = -1.0;
//Westen
if(i>0) {
double r = norm.template Give_data<rectangleEl>(id,i-1,j,Nx);
......@@ -110,13 +112,52 @@ CalcContinuousArg::CalcContinuousArg(Blockgrid2D& blockgrid_) {
}
}
//Norden
if(i<Ny) {
if(j<Ny) {
double r = norm.template Give_data<rectangleEl>(id,i,j+1,Nx);
if(r < radiusM && r > radiusNext) {
radiusNext = r;
woNext = Norden;
}
}
*/
//Version mit kleinstem Radius
double radiusNext = radiusM;
//Westen
if(i>0) {
double r = norm.template Give_data<rectangleEl>(id,i-1,j,Nx);
if(r < radiusNext) {
radiusNext = r;
woNext = Westen;
}
}
//Osten
if(i<Nx) {
double r = norm.template Give_data<rectangleEl>(id,i+1,j,Nx);
if(r < radiusNext) {
radiusNext = r;
woNext = Osten;
}
}
//Sueden
if(j>0) {
double r = norm.template Give_data<rectangleEl>(id,i,j-1,Nx);
if(r < radiusNext) {
radiusNext = r;
woNext = Sueden;
}
}
//Norden
if(j<Ny) {
double r = norm.template Give_data<rectangleEl>(id,i,j+1,Nx);
if(r < radiusNext) {
radiusNext = r;
woNext = Norden;
}
}
if(woNext == Westen) orderedPoints[id].push_back(PointForPhase(i,j,radiusM,i-1,j));
if(woNext == Osten) orderedPoints[id].push_back(PointForPhase(i,j,radiusM,i+1,j));
if(woNext == Sueden) orderedPoints[id].push_back(PointForPhase(i,j,radiusM,i,j-1));
......@@ -146,9 +187,9 @@ void CalcContinuousArg::calcArg(Variable2D<double>& phase, Variable2D<std::compl
for(std::list<BlockForPhase>::iterator it=orderedBlocks.begin(); it != orderedBlocks.end(); ++it) {
int id = it->getId();
phase.Update<rectangleEl>(id);
for(std::list<PointForPhase>::iterator itP=orderedPoints[id].begin(); itP != orderedPoints[id].end(); ++itP) {
phase.Update<rectangleEl>(id);
int Nx = blockgrid->Give_Nx_rectangle(id);
int i = itP->getI();
......@@ -163,11 +204,11 @@ void CalcContinuousArg::calcArg(Variable2D<double>& phase, Variable2D<std::compl
double phaseNext = phase.template Give_data<rectangleEl>(id,iSmall,jSmall,Nx);
if(fabs(phaseM-phaseNext)>2.0) {
if(phaseM < phaseNext) while(phaseM < phaseNext) phaseM = phaseM + 2.0*M_PI;
else while(phaseM > phaseNext) phaseM = phaseM - 2.0*M_PI;
phase.setValueAtRectangularPoint(phaseM,id,i,j,Nx);
}
if(fabs(phaseM-phaseNext)>M_PI) {
if(phaseM < phaseNext) while(phaseM < phaseNext && fabs(phaseM-phaseNext)>M_PI) phaseM = phaseM + 2.0*M_PI;
else while(phaseM > phaseNext && fabs(phaseM-phaseNext)>M_PI) phaseM = phaseM - 2.0*M_PI;
phase.setValueAtRectangularPoint(phaseM,id,i,j,Nx);
}
}
phase.Update_back(id);
}
......
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