_coordsB = mesh_B.getCoordinatesPtr();
if(PlanarIntersector<SPACEDIM,MESHDIM,ConnType,numPol,MyMeshType>::_printLevel >= 1)
{
- std::cout << "_intersection_type = triangles " << std::endl;
+ std::cout << " - intersection type = triangles " << std::endl;
if(SPACEDIM==3) std::cout << "_do_rotate = true"<< std::endl;
}
}
double TriangulationIntersector<SPACEDIM,MESHDIM,ConnType,numPol,MyMeshType>::intersectCells(ConnType icell_A, ConnType icell_B,
int nb_NodesA, int nb_NodesB)
{
- double result=0;
-
+ double result=0.;
+
//Obtain the coordinates of A and B
std::vector<double> Coords_A (SPACEDIM*nb_NodesA);
std::vector<double> Coords_B (SPACEDIM*nb_NodesB);
PlanarIntersector<SPACEDIM,MESHDIM,ConnType,numPol,MyMeshType>::_dimCaracteristic * PlanarIntersector<SPACEDIM,MESHDIM,ConnType,numPol,MyMeshType>::_precision,
PlanarIntersector<SPACEDIM,MESHDIM,ConnType,numPol,MyMeshType>::_medianPlane, PlanarIntersector<SPACEDIM,MESHDIM,ConnType,numPol,MyMeshType>::_doRotate);
+ //DEBUG PRINTS
+ if(PlanarIntersector<SPACEDIM,MESHDIM,ConnType,numPol,MyMeshType>::_printLevel >= 3)
+ {
+ std::cout << std::endl << "Cell coordinates (possibly after projection)" << std::endl;
+ std::cout << std::endl << "icell_A= " << icell_A << ", nb nodes A= " << nb_NodesA << std::endl;
+ for(int i_A =0; i_A< nb_NodesA; i_A++)
+ {for (int idim=0; idim<SPACEDIM; idim++) std::cout << Coords_A[SPACEDIM*i_A+idim] << " "; std::cout << std::endl;}
+ std::cout << std::endl << "icell_B= " << icell_B << ", nb nodes B= " << nb_NodesB << std::endl;
+ for(int i_B =0; i_B< nb_NodesB; i_B++)
+ {for (int idim=0; idim<SPACEDIM; idim++) std::cout << Coords_B[SPACEDIM*i_B+idim]<< " "; std::cout << std::endl; }
+ }
+
//Compute the intersection area
double area[SPACEDIM];
for(ConnType i_A = 1; i_A<nb_NodesA-1; i_A++)
for(ConnType i = 1; i<nb_inter-1; i++)
{
INTERP_KERNEL::crossprod<2>(&inter[0],&inter[2*i],&inter[2*(i+1)],area);
- result +=0.5*norm<2>(area);
+ result +=0.5*fabs(area[0]);
}
//DEBUG prints
if(PlanarIntersector<SPACEDIM,MESHDIM,ConnType,numPol,MyMeshType>::_printLevel >= 3)
}
}
}
-
+
+ //DEBUG PRINTS
if(PlanarIntersector<SPACEDIM,MESHDIM,ConnType,numPol,MyMeshType>::_printLevel >= 3)
- {
- std::cout << std::endl << "Cell coordinates after projection" << std::endl;
- std::cout << std::endl << "icell_A= " << icell_A << ", nb nodes A= " << nb_NodesA << std::endl;
- for(int i_A =0; i_A< nb_NodesA; i_A++)
- {for (int idim=0; idim<SPACEDIM; idim++) std::cout << Coords_A[SPACEDIM*i_A+idim] << " "; std::cout << std::endl;}
- std::cout << std::endl << "icell_B= " << icell_B << ", nb nodes B= " << nb_NodesB << std::endl;
- for(int i_B =0; i_B< nb_NodesB; i_B++)
- {for (int idim=0; idim<SPACEDIM; idim++) std::cout << Coords_B[SPACEDIM*i_B+idim]<< " "; std::cout << std::endl; }
- std::cout << std::endl <<"Intersection area= " << result << std::endl;
- }
+ std::cout << std::endl <<"Intersection area = " << result << std::endl;
+
return result;
}
}