eliminate some warnings

This commit is contained in:
Joachim Schoeberl 2011-06-26 07:42:55 +00:00
parent 660f31d7cd
commit 3d909c8195
4 changed files with 54 additions and 51 deletions

View File

@ -67,9 +67,6 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION

View File

@ -33,7 +33,56 @@ namespace netgen
}
template <>
void CircleSeg<3> :: LineIntersections (const double a, const double b, const double c,
Array < Point<3> > & points, const double eps) const
{
cerr << "CircleSeg<3>::LineIntersections not implemented" << endl;
}
template <>
void CircleSeg<2> :: LineIntersections (const double a, const double b, const double c,
Array < Point<2> > & points, const double eps) const
{
points.SetSize(0);
double px=0,py=0;
if(fabs(b) > 1e-20)
py = -c/b;
else
px = -c/a;
const double c1 = a*a + b*b;
const double c2 = 2. * ( a*(py-pm(1)) - b*(px-pm(0)));
const double c3 = pow(px-pm(0),2) + pow(py-pm(1),2) - pow(Radius(),2);
const double discr = c2*c2 - 4*c1*c3;
if(discr < 0)
return;
Array<double> t;
if(fabs(discr) < 1e-20)
t.Append(-0.5*c2/c1);
else
{
t.Append((-c2+sqrt(discr))/(2.*c1));
t.Append((-c2-sqrt(discr))/(2.*c1));
}
for(int i=0; i<t.Size(); i++)
{
Point<2> p (px-t[i]*b,py+t[i]*a);
double angle = atan2(p(1),p(0))+M_PI;
if(angle > StartAngle()-eps && angle < EndAngle()+eps)
points.Append(p);
}
}

View File

@ -491,49 +491,6 @@ namespace netgen
}
template<int D>
void CircleSeg<D> :: LineIntersections (const double a, const double b, const double c,
Array < Point<D> > & points, const double eps) const
{
points.SetSize(0);
double px=0,py=0;
if(fabs(b) > 1e-20)
py = -c/b;
else
px = -c/a;
const double c1 = a*a + b*b;
const double c2 = 2. * ( a*(py-pm(1)) - b*(px-pm(0)));
const double c3 = pow(px-pm(0),2) + pow(py-pm(1),2) - pow(Radius(),2);
const double discr = c2*c2 - 4*c1*c3;
if(discr < 0)
return;
Array<double> t;
if(fabs(discr) < 1e-20)
t.Append(-0.5*c2/c1);
else
{
t.Append((-c2+sqrt(discr))/(2.*c1));
t.Append((-c2-sqrt(discr))/(2.*c1));
}
for(int i=0; i<t.Size(); i++)
{
Point<D> p (px-t[i]*b,py+t[i]*a);
double angle = atan2(p(1),p(0))+M_PI;
if(angle > StartAngle()-eps && angle < EndAngle()+eps)
points.Append(p);
}
}

View File

@ -18,8 +18,8 @@ namespace netgen
PrintMessage ( 4, "RESET");
int nvold = nv;
int nedold = ned;
int nfaold = nfa;
// int nedold = ned;
// int nfaold = nfa;
ne = mesh.GetNE();
nv = mesh.GetNV();
@ -780,7 +780,7 @@ namespace netgen
// compare received vertices with own ones
int ii = 0;
int cntel = 0;
// int cntel = 0;
int volel = 1;
if ( id != 0 )
@ -1277,7 +1277,7 @@ namespace netgen
MyMPI_Bcast (*recvarray, sender-1, MPI_HIGHORDER_COMM);
// compare received vertices with own ones
int ii = 0;
int cntel = 0;
// int cntel = 0;
int volel = 1;
while ( ii< recvarray -> Size() )
@ -1437,7 +1437,7 @@ namespace netgen
(*sendarray)[2] = ned;
(*sendarray)[3] = np;
int ii = 4;
// int ii = 4;
for ( int el = 1; el <= ne; el++ )
(*sendarray).Append ( GetLoc2Glob_VolEl (el ) );