#include "NormalizedUnstructuredMesh.hxx"
#include <fstream>
+#include <sstream>
#include <iomanip>
#include <cstring>
#include <limits>
std::list<QuadraticPolygon *> retPolsUnderContruction;
std::list<Edge *> edgesInPol2OnBoundaryL(edgesInPol2OnBoundary.begin(),edgesInPol2OnBoundary.end());
std::map<QuadraticPolygon *, std::list<QuadraticPolygon *> > pol1ZipConsumed;
- while(!pol1Zip.empty() || !edgesInPol2OnBoundaryL.empty())
+ std::size_t maxNbOfTurn=edgesInPol2OnBoundaryL.size(),nbOfTurn=0,iiMNT=0;
+ for(std::list<QuadraticPolygon *>::const_iterator itMNT=pol1Zip.begin();itMNT!=pol1Zip.end();itMNT++,iiMNT++)
+ nbOfTurn+=(*itMNT)->size();
+ maxNbOfTurn=maxNbOfTurn*nbOfTurn; maxNbOfTurn*=maxNbOfTurn;
+ nbOfTurn=0;
+ while(nbOfTurn<maxNbOfTurn && ((!pol1Zip.empty() || !edgesInPol2OnBoundaryL.empty())))
{
for(std::list<QuadraticPolygon *>::iterator it1=retPolsUnderContruction.begin();it1!=retPolsUnderContruction.end();)
{
retPolsUnderContruction.push_back(tmp);
pol1Zip.erase(pol1Zip.begin());
}
+ nbOfTurn++;
+ }
+ if(nbOfTurn==maxNbOfTurn)
+ {
+ std::ostringstream oss; oss << "Error during reconstruction of residual of cell ! It appears that either source or/and target mesh is/are not conform !";
+ oss << " Number of turns is = " << nbOfTurn << " !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
}
for(std::list<QuadraticPolygon *>::iterator it1=retPolsUnderContruction.begin();it1!=retPolsUnderContruction.end();it1++)
{
}
if(!edges1.empty())
{
- INTERP_KERNEL::QuadraticPolygon::ComputeResidual(pol1,edges1,edgesBoundary2,mapp,offset3,i,addCoordsQuadratic,cr,crI,cNb1,cNb2);
+ try
+ {
+ INTERP_KERNEL::QuadraticPolygon::ComputeResidual(pol1,edges1,edgesBoundary2,mapp,offset3,i,addCoordsQuadratic,cr,crI,cNb1,cNb2);
+ }
+ catch(INTERP_KERNEL::Exception& e)
+ {
+ std::ostringstream oss; oss << "Error when computing residual of cell #" << i << " in source/m1 mesh ! Maybe the neighbours of this cell in mesh are not well connected !\n" << "The deep reason is the following : " << e.what();
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
}
for(std::map<int,INTERP_KERNEL::Node *>::const_iterator it=mappRev.begin();it!=mappRev.end();it++)
(*it).second->decrRef();