fix for curve in cylindrical coordinates and multigrids

Signed-off-by: Thorsten Liebig <Thorsten.Liebig@gmx.de>
pull/12/head
Thorsten Liebig 2013-12-03 11:26:31 +01:00
parent 724767ada4
commit 3930db8be3
2 changed files with 12 additions and 1 deletions

View File

@ -367,6 +367,8 @@ Grid_Path Operator_Cylinder::FindPath(double start[], double stop[])
if (ret==0) if (ret==0)
{ {
TransformCoordSystem(intersect,intersect,CARTESIAN,m_MeshType); TransformCoordSystem(intersect,intersect,CARTESIAN,m_MeshType);
intersect[1] = GetDiscLine(1,GetNumberOfLines(1,true)-1-(int)CC_closedAlpha);
l_start[1] = FitToAlphaRange(l_start[1]);
path1 = Operator::FindPath(l_start, intersect); path1 = Operator::FindPath(l_start, intersect);
if (g_settings.GetVerboseLevel()>2) if (g_settings.GetVerboseLevel()>2)
cerr << __func__ << ": Intersection top: " << intersect[0] << "," << intersect[1] << "," << intersect[2] << endl; cerr << __func__ << ": Intersection top: " << intersect[0] << "," << intersect[1] << "," << intersect[2] << endl;
@ -396,6 +398,8 @@ Grid_Path Operator_Cylinder::FindPath(double start[], double stop[])
if (ret==0) if (ret==0)
{ {
intersect[1] = GetDiscLine(1,0);
l_stop[1] = FitToAlphaRange(l_stop[1]);
path2 = Operator::FindPath(intersect, l_stop); path2 = Operator::FindPath(intersect, l_stop);
if (g_settings.GetVerboseLevel()>2) if (g_settings.GetVerboseLevel()>2)
cerr << __func__ << ": Intersection bottom: " << intersect[0] << "," << intersect[1] << "," << intersect[2] << endl; cerr << __func__ << ": Intersection bottom: " << intersect[0] << "," << intersect[1] << "," << intersect[2] << endl;
@ -417,6 +421,13 @@ Grid_Path Operator_Cylinder::FindPath(double start[], double stop[])
path.dir.push_back(path2.dir.at(t)); path.dir.push_back(path2.dir.at(t));
} }
if (CC_closedAlpha==true)
for (size_t t=0; t<path.dir.size(); ++t)
{
if ( ((path.dir.at(t)==0) || (path.dir.at(t)==2)) && (path.posPath[1].at(t)==0))
path.posPath[1].at(t) = numLines[1]-2;
}
return path; return path;
} }

View File

@ -278,7 +278,7 @@ void Operator_CylinderMultiGrid::DumpPEC2File( string filename, unsigned int *ra
range[2*n] = 0; range[2*n] = 0;
range[2*n+1] = numLines[n]-1; range[2*n+1] = numLines[n]-1;
} }
range[0] = m_Split_Pos; range[0] = m_Split_Pos-1;
Operator_Cylinder::DumpPEC2File(filename + "_S" + ConvertInt(m_MultiGridLevel), range); Operator_Cylinder::DumpPEC2File(filename + "_S" + ConvertInt(m_MultiGridLevel), range);
delete[] range; delete[] range;
range=NULL; range=NULL;