BoundingBox::BoundingBox(const double** pts, const unsigned numPts)
:_coords(new double[6])
{
- using namespace std;
assert(numPts > 1);
// initialize with first two points
for(BoxCoord c = XMIN ; c <= ZMIN ; c = BoxCoord(c + 1))
{
- _coords[c] = min(pt1[c], pt2[c]);
- _coords[c + 3] = max(pt1[c], pt2[c]);
+ _coords[c] = std::min(pt1[c], pt2[c]);
+ _coords[c + 3] = std::max(pt1[c], pt2[c]);
}
for(unsigned i = 2 ; i < numPts ; ++i)
BoundingBox::BoundingBox(const BoundingBox& box1, const BoundingBox& box2)
: _coords(new double[6])
{
- using namespace std;
assert(_coords != 0);
for(BoxCoord c = XMIN ; c <= ZMIN ; c = BoxCoord(c + 1))
{
- _coords[c] = min(box1._coords[c], box2._coords[c]);
- _coords[c + 3] = max(box1._coords[c + 3], box2._coords[c + 3]);
+ _coords[c] = std::min(box1._coords[c], box2._coords[c]);
+ _coords[c + 3] = std::max(box1._coords[c + 3], box2._coords[c + 3]);
}
assert(isValid());
*/
void BoundingBox::updateWithPoint(const double* pt)
{
- using namespace std;
-
for(BoxCoord c = XMIN ; c <= ZMIN ; c = BoxCoord(c + 1))
{
const double ptVal = pt[c];
// update min and max coordinates
- _coords[c] = min(_coords[c], ptVal);
- _coords[c + 3] = max(_coords[c + 3], ptVal);
+ _coords[c] = std::min(_coords[c], ptVal);
+ _coords[c + 3] = std::max(_coords[c + 3], ptVal);
}
}
#include <sstream>
#include <limits>
-using namespace std;
-
namespace INTERP_KERNEL
{
std::map<NormalizedCellType,CellModel> CellModel::_map_of_unique_instance;
{
if(_map_of_unique_instance.empty())
buildUniqueInstance();
- const map<NormalizedCellType,CellModel>::iterator iter=_map_of_unique_instance.find(type);
+ const std::map<NormalizedCellType,CellModel>::iterator iter=_map_of_unique_instance.find(type);
if(iter==_map_of_unique_instance.end())
{
- ostringstream stream; stream << "no cellmodel for normalized type " << type;
+ std::ostringstream stream; stream << "no cellmodel for normalized type " << type;
throw Exception(stream.str().c_str());
}
return (*iter).second;
void CellModel::buildUniqueInstance()
{
- _map_of_unique_instance.insert(make_pair(NORM_POINT0,CellModel(NORM_POINT0)));
- _map_of_unique_instance.insert(make_pair(NORM_SEG2,CellModel(NORM_SEG2)));
- _map_of_unique_instance.insert(make_pair(NORM_SEG3,CellModel(NORM_SEG3)));
- _map_of_unique_instance.insert(make_pair(NORM_TRI3,CellModel(NORM_TRI3)));
- _map_of_unique_instance.insert(make_pair(NORM_QUAD4,CellModel(NORM_QUAD4)));
- _map_of_unique_instance.insert(make_pair(NORM_TRI6,CellModel(NORM_TRI6)));
- _map_of_unique_instance.insert(make_pair(NORM_QUAD8,CellModel(NORM_QUAD8)));
- _map_of_unique_instance.insert(make_pair(NORM_TETRA4,CellModel(NORM_TETRA4)));
- _map_of_unique_instance.insert(make_pair(NORM_HEXA8,CellModel(NORM_HEXA8)));
- _map_of_unique_instance.insert(make_pair(NORM_PYRA5,CellModel(NORM_PYRA5)));
- _map_of_unique_instance.insert(make_pair(NORM_PENTA6,CellModel(NORM_PENTA6)));
- _map_of_unique_instance.insert(make_pair(NORM_TETRA10,CellModel(NORM_TETRA10)));
- _map_of_unique_instance.insert(make_pair(NORM_PYRA13,CellModel(NORM_PYRA13)));
- _map_of_unique_instance.insert(make_pair(NORM_PENTA15,CellModel(NORM_PENTA15)));
- _map_of_unique_instance.insert(make_pair(NORM_HEXA20,CellModel(NORM_HEXA20)));
- _map_of_unique_instance.insert(make_pair(NORM_POLYGON,CellModel(NORM_POLYGON)));
- _map_of_unique_instance.insert(make_pair(NORM_POLYHED,CellModel(NORM_POLYHED)));
+ _map_of_unique_instance.insert(std::make_pair(NORM_POINT0,CellModel(NORM_POINT0)));
+ _map_of_unique_instance.insert(std::make_pair(NORM_SEG2,CellModel(NORM_SEG2)));
+ _map_of_unique_instance.insert(std::make_pair(NORM_SEG3,CellModel(NORM_SEG3)));
+ _map_of_unique_instance.insert(std::make_pair(NORM_TRI3,CellModel(NORM_TRI3)));
+ _map_of_unique_instance.insert(std::make_pair(NORM_QUAD4,CellModel(NORM_QUAD4)));
+ _map_of_unique_instance.insert(std::make_pair(NORM_TRI6,CellModel(NORM_TRI6)));
+ _map_of_unique_instance.insert(std::make_pair(NORM_QUAD8,CellModel(NORM_QUAD8)));
+ _map_of_unique_instance.insert(std::make_pair(NORM_TETRA4,CellModel(NORM_TETRA4)));
+ _map_of_unique_instance.insert(std::make_pair(NORM_HEXA8,CellModel(NORM_HEXA8)));
+ _map_of_unique_instance.insert(std::make_pair(NORM_PYRA5,CellModel(NORM_PYRA5)));
+ _map_of_unique_instance.insert(std::make_pair(NORM_PENTA6,CellModel(NORM_PENTA6)));
+ _map_of_unique_instance.insert(std::make_pair(NORM_TETRA10,CellModel(NORM_TETRA10)));
+ _map_of_unique_instance.insert(std::make_pair(NORM_PYRA13,CellModel(NORM_PYRA13)));
+ _map_of_unique_instance.insert(std::make_pair(NORM_PENTA15,CellModel(NORM_PENTA15)));
+ _map_of_unique_instance.insert(std::make_pair(NORM_HEXA20,CellModel(NORM_HEXA20)));
+ _map_of_unique_instance.insert(std::make_pair(NORM_POLYGON,CellModel(NORM_POLYGON)));
+ _map_of_unique_instance.insert(std::make_pair(NORM_POLYHED,CellModel(NORM_POLYHED)));
}
CellModel::CellModel(NormalizedCellType type):_type(type)
#include <iterator>
#include <set>
-using namespace std;
using namespace INTERP_KERNEL;
ComposedEdge::ComposedEdge(const ComposedEdge& other)
{
- for(list<ElementaryEdge *>::const_iterator iter=other._sub_edges.begin();iter!=other._sub_edges.end();iter++)
+ for(std::list<ElementaryEdge *>::const_iterator iter=other._sub_edges.begin();iter!=other._sub_edges.end();iter++)
_sub_edges.push_back((*iter)->clone());
}
void ComposedEdge::setValueAt(int i, Edge *e, bool direction)
{
- list<ElementaryEdge*>::iterator it=_sub_edges.begin();
+ std::list<ElementaryEdge*>::iterator it=_sub_edges.begin();
for(int j=0;j<i;j++)
it++;
delete *it;
double ComposedEdge::getCommonLengthWith(const ComposedEdge& other) const
{
double ret=0.;
- for(list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
+ for(std::list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
{
if(find_if(other._sub_edges.begin(),other._sub_edges.end(),AbsEdgeCmp(*iter))!=other._sub_edges.end())
{
void ComposedEdge::pushBack(ComposedEdge *elem)
{
- list<ElementaryEdge *> *elemsOfElem=elem->getListBehind();
+ std::list<ElementaryEdge *> *elemsOfElem=elem->getListBehind();
_sub_edges.insert(_sub_edges.end(),elemsOfElem->begin(),elemsOfElem->end());
}
ElementaryEdge *ComposedEdge::operator[](int i) const
{
- list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();
+ std::list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();
for(int ii=0;ii<i;ii++)
iter++;
return *iter;
void ComposedEdge::reverse()
{
_sub_edges.reverse();
- for(list<ElementaryEdge *>::iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
+ for(std::list<ElementaryEdge *>::iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
(*iter)->reverse();
}
void ComposedEdge::initLocations() const
{
- for(list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
+ for(std::list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
(*iter)->initLocations();
}
bool ComposedEdge::isNodeIn(Node *n) const
{
bool ret=false;
- for(list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end() && !ret;iter++)
+ for(std::list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end() && !ret;iter++)
ret=(*iter)->isNodeIn(n);
return ret;
}
double ComposedEdge::getArea() const
{
double ret=0.;
- for(list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
+ for(std::list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
ret+=(*iter)->getAreaOfZone();
return ret;
}
double ComposedEdge::getPerimeter() const
{
double ret=0.;
- for(list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
+ for(std::list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
ret+=(*iter)->getCurveLength();
return ret;
}
bary[0]=0.;
bary[1]=0.;
double area=0.;
- for(list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
+ for(std::list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
{
(*iter)->getBarycenterOfZone(bary);
area+=(*iter)->getAreaOfZone();
void ComposedEdge::dumpInXfigFile(std::ostream& stream, int resolution, const Bounds& box) const
{
stream.precision(10);
- for(list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
+ for(std::list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
(*iter)->dumpInXfigFile(stream,resolution,box);
}
void ComposedEdge::fillBounds(Bounds& output) const
{
- for(list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
+ for(std::list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
(*iter)->fillBounds(output);
}
*/
void ComposedEdge::applySimilarity(double xBary, double yBary, double dimChar)
{
- for(list<ElementaryEdge *>::iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
+ for(std::list<ElementaryEdge *>::iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
(*iter)->applySimilarity(xBary,yBary,dimChar);
}
*/
void ComposedEdge::applyGlobalSimilarity(double xBary, double yBary, double dimChar)
{
- set<Node *> allNodes;
+ std::set<Node *> allNodes;
getAllNodes(allNodes);
- for(set<Node *>::iterator iter=allNodes.begin();iter!=allNodes.end();iter++)
+ for(std::set<Node *>::iterator iter=allNodes.begin();iter!=allNodes.end();iter++)
(*iter)->applySimilarity(xBary,yBary,dimChar);
- for(list<ElementaryEdge *>::iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
+ for(std::list<ElementaryEdge *>::iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
(*iter)->applySimilarity(xBary,yBary,dimChar);
}
*/
void ComposedEdge::dispatchPerimeter(double& partConsidered) const
{
- for(list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
+ for(std::list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
{
TypeOfEdgeLocInPolygon loc=(*iter)->getLoc();
if(loc==FULL_IN_1 || loc==FULL_ON_1)
*/
void ComposedEdge::dispatchPerimeterExcl(double& partConsidered, double& commonPart) const
{
- for(list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
+ for(std::list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
{
TypeOfEdgeLocInPolygon loc=(*iter)->getLoc();
if(loc==FULL_IN_1)
void ComposedEdge::getAllNodes(std::set<Node *>& output) const
{
- list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();
+ std::list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();
for(;iter!=_sub_edges.end();iter++)
(*iter)->getAllNodes(output);
}
{
weigh=0.; bary[0]=0.; bary[1]=0.;
double tmp1,tmp2[2];
- for(list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
+ for(std::list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
{
(*iter)->getBarycenter(tmp2,tmp1);
weigh+=tmp1;
if(b.nearlyWhere((*nodeToTest)[0],(*nodeToTest)[1])==OUT)
return false;
// searching for e1
- set<Node *> nodes;
+ std::set<Node *> nodes;
getAllNodes(nodes);
- set<double> radialDistributionOfNodes;
- set<Node *>::const_iterator iter;
+ std::set<double> radialDistributionOfNodes;
+ std::set<Node *>::const_iterator iter;
for(iter=nodes.begin();iter!=nodes.end();iter++)
radialDistributionOfNodes.insert(nodeToTest->getSlope(*(*iter)));
- vector<double> radialDistrib(radialDistributionOfNodes.begin(),radialDistributionOfNodes.end());
+ std::vector<double> radialDistrib(radialDistributionOfNodes.begin(),radialDistributionOfNodes.end());
radialDistributionOfNodes.clear();
- vector<double> radialDistrib2(radialDistrib.size());
+ std::vector<double> radialDistrib2(radialDistrib.size());
copy(radialDistrib.begin()+1,radialDistrib.end(),radialDistrib2.begin());
radialDistrib2.back()=M_PI+radialDistrib.front();
- vector<double> radialDistrib3(radialDistrib.size());
- transform(radialDistrib2.begin(),radialDistrib2.end(),radialDistrib.begin(),radialDistrib3.begin(),minus<double>());
- vector<double>::iterator iter3=max_element(radialDistrib3.begin(),radialDistrib3.end());
+ std::vector<double> radialDistrib3(radialDistrib.size());
+ std::transform(radialDistrib2.begin(),radialDistrib2.end(),radialDistrib.begin(),radialDistrib3.begin(),std::minus<double>());
+ std::vector<double>::iterator iter3=max_element(radialDistrib3.begin(),radialDistrib3.end());
int i=iter3-radialDistrib3.begin();
// ok for e1 - Let's go.
EdgeInfLin *e1=new EdgeInfLin(nodeToTest,radialDistrib[i]+radialDistrib3[i]/2.);
double ref=e1->getCharactValue(*nodeToTest);
- set< IntersectElement > inOutSwitch;
- for(list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
+ std::set< IntersectElement > inOutSwitch;
+ for(std::list<ElementaryEdge *>::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
{
ElementaryEdge *val=(*iter);
if(val)
{
Edge *e=val->getPtr();
- auto_ptr<EdgeIntersector> intersc(Edge::buildIntersectorWith(e1,e));
+ std::auto_ptr<EdgeIntersector> intersc(Edge::buildIntersectorWith(e1,e));
bool obviousNoIntersection,areOverlapped;
intersc->areOverlappedOrOnlyColinears(0,obviousNoIntersection,areOverlapped);
if(obviousNoIntersection)
}
if(!areOverlapped)
{
- list< IntersectElement > listOfIntesc=intersc->getIntersectionsCharacteristicVal();
- for(list< IntersectElement >::iterator iter2=listOfIntesc.begin();iter2!=listOfIntesc.end();iter2++)
+ std::list< IntersectElement > listOfIntesc=intersc->getIntersectionsCharacteristicVal();
+ for(std::list< IntersectElement >::iterator iter2=listOfIntesc.begin();iter2!=listOfIntesc.end();iter2++)
if((*iter2).isIncludedByBoth())
inOutSwitch.insert(*iter2);
}
}
e1->decrRef();
bool ret=false;
- for(set< IntersectElement >::iterator iter=inOutSwitch.begin();iter!=inOutSwitch.end();iter++)
+ for(std::set< IntersectElement >::iterator iter=inOutSwitch.begin();iter!=inOutSwitch.end();iter++)
{
if((*iter).getVal1()<ref)
{
return _sub_edges.front()->intresincEqCoarse(other);
}
-void ComposedEdge::clearAll(list<ElementaryEdge *>::iterator startToDel)
+void ComposedEdge::clearAll(std::list<ElementaryEdge *>::iterator startToDel)
{
- for(list<ElementaryEdge *>::iterator iter=startToDel;iter!=_sub_edges.end();iter++)
+ for(std::list<ElementaryEdge *>::iterator iter=startToDel;iter!=_sub_edges.end();iter++)
delete (*iter);
}
#include <algorithm>
-using namespace std;
using namespace INTERP_KERNEL;
MergePoints::MergePoints():_ass1Start1(0),_ass1End1(0),_ass1Start2(0),_ass1End2(0),
bool EdgeIntersector::intersect(const Bounds *whereToFind, std::vector<Node *>& newNodes, bool& order, MergePoints& commonNode)
{
- list< IntersectElement > listOfIntesc=getIntersectionsCharacteristicVal();
- list< IntersectElement >::iterator iter;
+ std::list< IntersectElement > listOfIntesc=getIntersectionsCharacteristicVal();
+ std::list< IntersectElement >::iterator iter;
for(iter=listOfIntesc.begin();iter!=listOfIntesc.end();)
{
if((*iter).isOnMergedExtremity())
}
else
{
- vector<IntersectElement> vecOfIntesc(listOfIntesc.begin(),listOfIntesc.end());
+ std::vector<IntersectElement> vecOfIntesc(listOfIntesc.begin(),listOfIntesc.end());
listOfIntesc.clear();
sort(vecOfIntesc.begin(),vecOfIntesc.end());
- for(vector<IntersectElement>::iterator iterV=vecOfIntesc.begin();iterV!=vecOfIntesc.end();iterV++)
+ for(std::vector<IntersectElement>::iterator iterV=vecOfIntesc.begin();iterV!=vecOfIntesc.end();iterV++)
newNodes.push_back((*iterV).getNodeAndReleaseIt());
order=vecOfIntesc.front().isLowerOnOther(vecOfIntesc.back());
}
*/
void Edge::getNormalVector(double *vectOutput) const
{
- copy((const double *)(*_end),(const double *)(*_end)+2,vectOutput);
- transform(vectOutput,vectOutput+2,(const double *)(*_start),vectOutput,minus<double>());
+ std::copy((const double *)(*_end),(const double *)(*_end)+2,vectOutput);
+ std::transform(vectOutput,vectOutput+2,(const double *)(*_start),vectOutput,std::minus<double>());
double norm=1./Node::norm(vectOutput);
- transform(vectOutput,vectOutput+2,vectOutput,bind2nd(multiplies<double>(),norm));
+ std::transform(vectOutput,vectOutput+2,vectOutput,bind2nd(std::multiplies<double>(),norm));
double tmp=vectOutput[0];
vectOutput[0]=vectOutput[1];
vectOutput[1]=-tmp;
MergePoints commonNode;
for(int i=0;i<nbOfV1;i++)
{
- vector<double>::const_iterator iter=find_if(distrib2.begin()+1,distrib2.end(),bind2nd(greater_equal<double>(),distrib1[i]));
+ std::vector<double>::const_iterator iter=find_if(distrib2.begin()+1,distrib2.end(),bind2nd(std::greater_equal<double>(),distrib1[i]));
if(iter!=distrib2.end())
{
for(int j=(iter-1)-distrib2.begin();j<nbOfV2;j++)
return intersectOverlapped(f1,f2,intersector,commonNode,outValForF1,outValForF2);
if(obviousNoIntersection)
return false;
- vector<Node *> newNodes;
+ std::vector<Node *> newNodes;
bool order;
if(intersector->intersect(whereToFind,newNodes,order,commonNode))
{
if(newNodes.empty())
throw Exception("Internal error occured - error in intersector implementation!");// This case should never happen
- vector<Node *>::iterator iter=newNodes.begin();
- vector<Node *>::reverse_iterator iterR=newNodes.rbegin();
+ std::vector<Node *>::iterator iter=newNodes.begin();
+ std::vector<Node *>::reverse_iterator iterR=newNodes.rbegin();
f1->addSubEdgeInVector(f1->getStartNode(),*iter,outValForF1);
f2->addSubEdgeInVector(f2->getStartNode(),order?*iter:*iterR,outValForF2);
- for(vector<Node *>::iterator iter=newNodes.begin();iter!=newNodes.end();iter++,iterR++)
+ for(std::vector<Node *>::iterator iter=newNodes.begin();iter!=newNodes.end();iter++,iterR++)
{
if((iter+1)==newNodes.end())
{
#include <sstream>
#include <algorithm>
-using namespace std;
using namespace INTERP_KERNEL;
ArcCArcCIntersector::ArcCArcCIntersector(const EdgeArcCircle& e1, const EdgeArcCircle& e2):SameTypeEdgeIntersector(e1,e2),_dist(0.)
a=EdgeArcCircle::normalizeAngle(phi-angle0L+M_PI);
if(EdgeArcCircle::isIn2Pi(angle0L,angleL,a))
cmpContainer[sizeOfCmpContainer++]=cst-cst2;
- a=*max_element(cmpContainer,cmpContainer+sizeOfCmpContainer);
+ a=*std::max_element(cmpContainer,cmpContainer+sizeOfCmpContainer);
return Node::areDoubleEqualsWP(a,1.,2.);
}
middle->dumpInXfigFile(stream,resolution,box);
middle->decrRef();
direction?_end->dumpInXfigFile(stream,resolution,box):_start->dumpInXfigFile(stream,resolution,box);
- stream << endl;
+ stream << std::endl;
}
void EdgeArcCircle::update(Node *m)
#include "InterpKernelGeo2DNode.hxx"
#include "InterpKernelException.hxx"
-using namespace std;
using namespace INTERP_KERNEL;
namespace INTERP_KERNEL
{
stream << "2 1 0 1 ";
fillXfigStreamForLoc(stream);
- stream << " 7 50 -1 -1 0.000 0 0 -1 0 0 2" << endl;
+ stream << " 7 50 -1 -1 0.000 0 0 -1 0 0 2" << std::endl;
direction?_start->dumpInXfigFile(stream,resolution,box):_end->dumpInXfigFile(stream,resolution,box);
direction?_end->dumpInXfigFile(stream,resolution,box):_start->dumpInXfigFile(stream,resolution,box);
- stream << endl;
+ stream << std::endl;
}
void EdgeLin::update(Node *m)
#include "InterpKernelGeo2DNode.hxx"
#include "InterpKernelGeo2DEdgeArcCircle.hxx"
-using namespace std;
using namespace INTERP_KERNEL;
Node::Node(double x, double y):_cnt(1),_loc(UNKNOWN)
#include <cstring>
#include <limits>
-using namespace std;
using namespace INTERP_KERNEL;
namespace INTERP_KERNEL
QuadraticPolygon::QuadraticPolygon(const char *file)
{
char currentLine[MAX_SIZE_OF_LINE_XFIG_FILE];
- ifstream stream(file);
- stream.exceptions(ios_base::eofbit);
+ std::ifstream stream(file);
+ stream.exceptions(std::ios_base::eofbit);
try
{
do
}
while(1);
}
- catch(ifstream::failure&)
+ catch(std::ifstream::failure&)
{
}
front()->changeStartNodeWith(back()->getEndNode());
void QuadraticPolygon::buildDbgFile(const std::vector<Node *>& nodes, const char *fileName)
{
- ofstream file(fileName);
- file << setprecision(16);
- file << " double coords[]=" << endl << " { ";
- for(vector<Node *>::const_iterator iter=nodes.begin();iter!=nodes.end();iter++)
+ std::ofstream file(fileName);
+ file << std::setprecision(16);
+ file << " double coords[]=" << std::endl << " { ";
+ for(std::vector<Node *>::const_iterator iter=nodes.begin();iter!=nodes.end();iter++)
{
if(iter!=nodes.begin())
- file << "," << endl << " ";
+ file << "," << std::endl << " ";
file << (*(*iter))[0] << ", " << (*(*iter))[1];
}
- file << "};" << endl;
+ file << "};" << std::endl;
}
void QuadraticPolygon::closeMe() const
void QuadraticPolygon::dumpInXfigFileWithOther(const ComposedEdge& other, const char *fileName) const
{
- ofstream file(fileName);
+ std::ofstream file(fileName);
const int resolution=1200;
Bounds box;
box.prepareForAggregation();
void QuadraticPolygon::dumpInXfigFile(const char *fileName) const
{
- ofstream file(fileName);
+ std::ofstream file(fileName);
const int resolution=1200;
Bounds box;
box.prepareForAggregation();
void QuadraticPolygon::dumpInXfigFile(std::ostream& stream, int resolution, const Bounds& box) const
{
- stream << "#FIG 3.2 Produced by xfig version 3.2.5-alpha5" << endl;
- stream << "Landscape" << endl;
- stream << "Center" << endl;
- stream << "Metric" << endl;
- stream << "Letter" << endl;
- stream << "100.00" << endl;
- stream << "Single" << endl;
- stream << "-2" << endl;
- stream << resolution << " 2" << endl;
+ stream << "#FIG 3.2 Produced by xfig version 3.2.5-alpha5" << std::endl;
+ stream << "Landscape" << std::endl;
+ stream << "Center" << std::endl;
+ stream << "Metric" << std::endl;
+ stream << "Letter" << std::endl;
+ stream << "100.00" << std::endl;
+ stream << "Single" << std::endl;
+ stream << "-2" << std::endl;
+ stream << resolution << " 2" << std::endl;
ComposedEdge::dumpInXfigFile(stream,resolution,box);
}
{
double ret=0.,xBaryBB,yBaryBB;
double fact=normalize(&other,xBaryBB,yBaryBB);
- vector<QuadraticPolygon *> polygs=intersectMySelfWith(other);
- for(vector<QuadraticPolygon *>::iterator iter=polygs.begin();iter!=polygs.end();iter++)
+ std::vector<QuadraticPolygon *> polygs=intersectMySelfWith(other);
+ for(std::vector<QuadraticPolygon *>::iterator iter=polygs.begin();iter!=polygs.end();iter++)
{
ret+=fabs((*iter)->getArea());
delete *iter;
double ret=0.,bary[2],area,xBaryBB,yBaryBB;
barycenter[0] = barycenter[1] = 0.;
double fact=normalize(&other,xBaryBB,yBaryBB);
- vector<QuadraticPolygon *> polygs=intersectMySelfWith(other);
- for(vector<QuadraticPolygon *>::iterator iter=polygs.begin();iter!=polygs.end();iter++)
+ std::vector<QuadraticPolygon *> polygs=intersectMySelfWith(other);
+ for(std::vector<QuadraticPolygon *>::iterator iter=polygs.begin();iter!=polygs.end();iter++)
{
area=fabs((*iter)->getArea());
(*iter)->getBarycenter(bary);
double QuadraticPolygon::intersectWith(const QuadraticPolygon& other) const
{
double ret=0.;
- vector<QuadraticPolygon *> polygs=intersectMySelfWith(other);
- for(vector<QuadraticPolygon *>::iterator iter=polygs.begin();iter!=polygs.end();iter++)
+ std::vector<QuadraticPolygon *> polygs=intersectMySelfWith(other);
+ for(std::vector<QuadraticPolygon *>::iterator iter=polygs.begin();iter!=polygs.end();iter++)
{
ret+=fabs((*iter)->getArea());
delete *iter;
{
double ret=0., bary[2];
barycenter[0] = barycenter[1] = 0.;
- vector<QuadraticPolygon *> polygs=intersectMySelfWith(other);
- for(vector<QuadraticPolygon *>::iterator iter=polygs.begin();iter!=polygs.end();iter++)
+ std::vector<QuadraticPolygon *> polygs=intersectMySelfWith(other);
+ for(std::vector<QuadraticPolygon *>::iterator iter=polygs.begin();iter!=polygs.end();iter++)
{
double area = fabs((*iter)->getArea());
(*iter)->getBarycenter(bary);
*/
std::vector<QuadraticPolygon *> QuadraticPolygon::buildIntersectionPolygons(const QuadraticPolygon& pol1, const QuadraticPolygon& pol2) const
{
- vector<QuadraticPolygon *> ret;
- list<QuadraticPolygon *> pol2Zip=pol2.zipConsecutiveInSegments();
+ std::vector<QuadraticPolygon *> ret;
+ std::list<QuadraticPolygon *> pol2Zip=pol2.zipConsecutiveInSegments();
if(!pol2Zip.empty())
closePolygons(pol2Zip,pol1,ret);
else
*/
std::list<QuadraticPolygon *> QuadraticPolygon::zipConsecutiveInSegments() const
{
- list<QuadraticPolygon *> ret;
+ std::list<QuadraticPolygon *> ret;
IteratorOnComposedEdge it((ComposedEdge *)this);
int nbOfTurns=recursiveSize();
int i=0;
{
bool directionKnownInPol1=false;
bool directionInPol1;
- for(list<QuadraticPolygon *>::iterator iter=pol2Zip.begin();iter!=pol2Zip.end();)
+ for(std::list<QuadraticPolygon *>::iterator iter=pol2Zip.begin();iter!=pol2Zip.end();)
{
if((*iter)->completed())
{
else
directionKnownInPol1=true;
}
- list<QuadraticPolygon *>::iterator iter2=iter; iter2++;
- list<QuadraticPolygon *>::iterator iter3=(*iter)->fillAsMuchAsPossibleWith(pol1,iter2,pol2Zip.end(),directionInPol1);
+ std::list<QuadraticPolygon *>::iterator iter2=iter; iter2++;
+ std::list<QuadraticPolygon *>::iterator iter3=(*iter)->fillAsMuchAsPossibleWith(pol1,iter2,pol2Zip.end(),directionInPol1);
if(iter3!=pol2Zip.end())
{
(*iter)->pushBack(*iter3);
std::list<QuadraticPolygon *>::iterator QuadraticPolygon::checkInList(Node *n, std::list<QuadraticPolygon *>::iterator iStart,
std::list<QuadraticPolygon *>::iterator iEnd)
{
- for(list<QuadraticPolygon *>::iterator iter=iStart;iter!=iEnd;iter++)
+ for(std::list<QuadraticPolygon *>::iterator iter=iStart;iter!=iEnd;iter++)
if((*iter)->isNodeIn(n))
return iter;
return iEnd;
*/
void TetraAffineTransform::dump() const
{
- using namespace std;
-
std::cout << "A = " << std::endl << "[";
for(int i = 0; i < 3; ++i)
{
std::cout << _linear_transform[3*i] << ", " << _linear_transform[3*i + 1] << ", " << _linear_transform[3*i + 2];
- if(i != 2 ) std::cout << endl;
+ if(i != 2 ) std::cout << std::endl;
}
- std::cout << "]" << endl;
+ std::cout << "]" << std::endl;
- std::cout << "b = " << "[" << _translation[0] << ", " << _translation[1] << ", " << _translation[2] << "]" << endl;
+ std::cout << "b = " << "[" << _translation[0] << ", " << _translation[1] << ", " << _translation[2] << "]" << std::endl;
}
/////////////////////////////////////////////////////////////////////////////////////////
//#define DMP_UNITTETRAINTERSECTIONBARY
-using namespace std;
namespace INTERP_KERNEL
{
}
// check if polygon orientation is same as the one of triangle
- vector<double*>::const_iterator p = pPolygonA->begin(), pEnd = pPolygonA->end();
+ std::vector<double*>::const_iterator p = pPolygonA->begin(), pEnd = pPolygonA->end();
#ifdef DMP_UNITTETRAINTERSECTIONBARY
- cout.precision(18);
- cout << "**** int polygon() " << endl;
+ std::cout.precision(18);
+ std::cout << "**** int polygon() " << std::endl;
while ( p != pEnd )
{
double* pp = *p++;
- cout << pEnd - p << ": ( " << pp[0] << ", " << pp[1] << ", " << pp[2] << " )" << endl;
+ std::cout << pEnd - p << ": ( " << pp[0] << ", " << pp[1] << ", " << pp[2] << " )" << std::endl;
}
p = pPolygonA->begin();
#endif
if ( p == pEnd )
{
#ifdef DMP_UNITTETRAINTERSECTIONBARY
- cout << "All points equal" << endl;
+ std::cout << "All points equal" << std::endl;
#endif
clearPolygons();
return;
if ( p == pEnd )
{
#ifdef DMP_UNITTETRAINTERSECTIONBARY
- cout << "Only two points differ" << endl;
+ std::cout << "Only two points differ" << std::endl;
#endif
clearPolygons();
return ;
if (_isTetraInversed) reverse = !reverse;
// store polygon
- _faces.push_back( vector< double* > () );
- vector< double* >& faceCorner = _faces.back();
+ _faces.push_back( std::vector< double* > () );
+ std::vector< double* >& faceCorner = _faces.back();
faceCorner.resize( pPolygonA->size()/* + 1*/ );
int i = 0;
if ( reverse )
{
- vector<double*>::const_reverse_iterator polyF = pPolygonA->rbegin(), polyEnd;
+ std::vector<double*>::const_reverse_iterator polyF = pPolygonA->rbegin(), polyEnd;
for ( polyEnd = pPolygonA->rend(); polyF != polyEnd; ++i, ++polyF )
if ( i==0 || !samePoint( *polyF, faceCorner[i-1] ))
copyVector3( *polyF, faceCorner[i] = new double[3] );
}
else
{
- vector<double*>::const_iterator polyF = pPolygonA->begin(), polyEnd;
+ std::vector<double*>::const_iterator polyF = pPolygonA->begin(), polyEnd;
for ( polyEnd = pPolygonA->end(); polyF != polyEnd; ++i, ++polyF )
if ( i==0 || !samePoint( *polyF, faceCorner[i-1] ))
copyVector3( *polyF, faceCorner[i] = new double[3] );
if ( _polyNormals.empty() )
_polyNormals.reserve(4);
- _polyNormals.push_back( vector< double >( polyNormal, polyNormal+3 ));
+ _polyNormals.push_back( std::vector< double >( polyNormal, polyNormal+3 ));
}
#ifdef DMP_UNITTETRAINTERSECTIONBARY
- cout << "**** addSide() " << _faces.size() << endl;
+ std::cout << "**** addSide() " << _faces.size() << std::endl;
for ( int i = 0; i < faceCorner.size(); ++i )
{
double* p = faceCorner[i];
- cout << i << ": ( " << p[0] << ", " << p[1] << ", " << p[2] << " )" << endl;
+ std::cout << i << ": ( " << p[0] << ", " << p[1] << ", " << p[2] << " )" << std::endl;
}
- cout << "NORM: ( " << _polyNormals.back()[0] << ", " << _polyNormals.back()[1] << ", " << _polyNormals.back()[2] << " )" << endl;
+ std::cout << "NORM: ( " << _polyNormals.back()[0] << ", " << _polyNormals.back()[1] << ", " << _polyNormals.back()[2] << " )" << std::endl;
#endif
clearPolygons();
}
baryCenter[0] = baryCenter[1] = baryCenter[2] = 0.;
- list< vector< double* > >::iterator f = _faces.begin(), fEnd = _faces.end();
+ std::list< std::vector< double* > >::iterator f = _faces.begin(), fEnd = _faces.end();
double * P = f->at(0);
for ( ++f; f != fEnd; ++f )
{
- vector< double* >& polygon = *f;
+ std::vector< double* >& polygon = *f;
if ( polygon.empty() )
continue;
bool pBelongsToPoly = false;
- vector<double*>::iterator v = polygon.begin(), vEnd = polygon.end();
+ std::vector<double*>::iterator v = polygon.begin(), vEnd = polygon.end();
for ( ; !pBelongsToPoly && v != vEnd; ++v )
pBelongsToPoly = samePoint( P, *v );
if ( pBelongsToPoly )
baryCenter[2] /= _int_volume;
#ifdef DMP_UNITTETRAINTERSECTIONBARY
- cout.precision(5);
- cout << "**** Barycenter " << baryCenter[0] <<", "<< baryCenter[1] <<", "<< baryCenter[2]
- << "\t **** Volume " << _int_volume << endl;
- cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl;
+ std::cout.precision(5);
+ std::cout << "**** Barycenter " << baryCenter[0] <<", "<< baryCenter[1] <<", "<< baryCenter[2]
+ << "\t **** Volume " << _int_volume << std::endl;
+ std::cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl;
#endif
return true;
}
bool sideAdded[NB_TETRA_SIDES] = { false, false, false, false };
int nbAddedSides = 0;
- list< vector< double* > >::iterator f = _faces.begin(), fEnd = _faces.end();
+ std::list< std::vector< double* > >::iterator f = _faces.begin(), fEnd = _faces.end();
for ( ; f != fEnd; ++f )
{
- vector< double* >& polygon = *f;
+ std::vector< double* >& polygon = *f;
double coordSum[3] = {0,0,0};
for ( int i = 0; i < (int)polygon.size(); ++i )
{
int nbIntersectPolygs = _faces.size();
- vector< double* > * sideFaces[ 4 ]; // future polygons on sides of tetra
+ std::vector< double* > * sideFaces[ 4 ]; // future polygons on sides of tetra
for ( int i = 0; i < NB_TETRA_SIDES; ++i )
{
sideFaces[ i ]=0;
if ( !sideAdded[ i ] )
{
- _faces.push_back( vector< double* > () );
+ _faces.push_back( std::vector< double* > () );
sideFaces[ i ] = &_faces.back();
}
}
f = _faces.begin(), fEnd = _faces.end();
for ( int iF = 0; iF < nbIntersectPolygs; ++f, ++iF ) // loop on added intersection polygons
{
- vector< double* >& polygon = *f;
+ std::vector< double* >& polygon = *f;
for ( int i = 0; i < (int)polygon.size(); ++i )
{
// segment ends
}
}
#ifdef DMP_UNITTETRAINTERSECTIONBARY
- cout << "**** after Add segments to sides " << endl;
+ std::cout << "**** after Add segments to sides " << std::endl;
for ( int i = 0; i < NB_TETRA_SIDES; ++i )
{
- cout << "\t Side " << i << endl;
+ std::cout << "\t Side " << i << std::endl;
if ( !sideFaces[i] )
{
- cout << "\t cut by triagle" << endl;
+ std::cout << "\t cut by triagle" << std::endl;
}
else
{
- vector< double* >& sideFace = *sideFaces[i];
+ std::vector< double* >& sideFace = *sideFaces[i];
for ( int i = 0; i < sideFace.size(); ++i )
{
double* p = sideFace[i];
- cout << "\t" << i << ": ( " << p[0] << ", " << p[1] << ", " << p[2] << " )" << endl;
+ std::cout << "\t" << i << ": ( " << p[0] << ", " << p[1] << ", " << p[2] << " )" << std::endl;
}
}
}
f = _faces.begin(), fEnd = _faces.end();
for ( int iF = 0; iF < nbIntersectPolygs; ++f, ++iF ) // loop on added intersection polygons
{
- vector< double* >& polygon = *f;
+ std::vector< double* >& polygon = *f;
double corner2Poly[3] = { polygon[0][0], polygon[0][1], polygon[0][2] };
if ( ic ) corner2Poly[ ic-1 ] -= 1.0;
if ( dot < -DEFAULT_ABS_TOL*DEFAULT_ABS_TOL )
{
#ifdef DMP_UNITTETRAINTERSECTIONBARY
- cout << "side " << iF+1 << ": cut " << ic << endl;
+ std::cout << "side " << iF+1 << ": cut " << ic << std::endl;
#endif
cutOffCorners[ ic ] = true;
nbCutOffCorners++;
for ( int i = 0; i < 3; ++i ) // loop on orthogonal faces of the unit tetra
{
if ( !sideFaces[i] ) continue;
- vector< double* >& sideFace = *sideFaces[i];
+ std::vector< double* >& sideFace = *sideFaces[i];
int nbPoints = sideFace.size();
if ( nbPoints == 0 )
nbCutOffCorners--;
cutOffCorners[ passThIndex ] = false;
#ifdef DMP_UNITTETRAINTERSECTIONBARY
- cout << "PASS THROUGH " << passThIndex << endl;
+ std::cout << "PASS THROUGH " << passThIndex << std::endl;
#endif
}
}
for ( int i = 0; i < NB_TETRA_SIDES; ++i )
{
if ( !sideFaces[ i ] ) continue;
- vector< double* >& sideFace = *sideFaces[i];
+ std::vector< double* >& sideFace = *sideFaces[i];
int excludeCorner = (i + 1) % NB_TETRA_NODES;
for ( int ic = 0; ic < NB_TETRA_NODES; ++ic )
}
#ifdef DMP_UNITTETRAINTERSECTIONBARY
- cout << "**** after Add corners to sides " << endl;
+ std::cout << "**** after Add corners to sides " << std::endl;
for ( int i = 0; i < NB_TETRA_SIDES; ++i )
{
- cout << "\t Side " << i << endl;
+ std::cout << "\t Side " << i << std::endl;
if ( !sideFaces[i] ) {
- cout << "\t cut by triagle" << endl;
+ std::cout << "\t cut by triagle" << std::endl;
}
else
{
- vector< double* >& sideFace = *sideFaces[i];
+ std::vector< double* >& sideFace = *sideFaces[i];
for ( int i = 0; i < sideFace.size(); ++i )
{
double* p = sideFace[i];
- cout << "\t" << i << ": ( " << p[0] << ", " << p[1] << ", " << p[2] << " )" << endl;
+ std::cout << "\t" << i << ": ( " << p[0] << ", " << p[1] << ", " << p[2] << " )" << std::endl;
}
}
}
- cout << "Cut off corners: ";
+ std::cout << "Cut off corners: ";
if ( nbCutOffCorners == 0 )
- cout << "NO";
+ std::cout << "NO";
else
for ( int ic = 0; ic < NB_TETRA_NODES; ++ic )
- cout << cutOffCorners[ ic ];
- cout << endl;
+ std::cout << cutOffCorners[ ic ];
+ std::cout << std::endl;
#endif
// ------------------------------------------------------------------------
// Sort corners of filled up faces on tetra sides and exclude equal points
int iF = 0;
for ( f = _faces.begin(); f != fEnd; ++f, ++iF )
{
- vector< double* >& face = *f;
+ std::vector< double* >& face = *f;
if ( face.size() >= 3 )
{
clearPolygons(); // free memory of _polygonA
sortIntersectionPolygon( A, _barycenterA );
}
// exclude equal points
- vector< double* >::iterator v = _polygonA.begin(), vEnd = _polygonA.end();
+ std::vector< double* >::iterator v = _polygonA.begin(), vEnd = _polygonA.end();
face.push_back( *v );
*v = 0;
for ( ++v; v != vEnd; ++v )
}
}
#ifdef DMP_UNITTETRAINTERSECTIONBARY
- cout << "**** after HEALING all faces " << endl;
+ std::cout << "**** after HEALING all faces " << std::endl;
for (iF=0, f = _faces.begin(); f != fEnd; ++f, ++iF )
{
- cout << "\t Side " << iF << endl;
- vector< double* >& sideFace = *f;
+ std::cout << "\t Side " << iF << std::endl;
+ std::vector< double* >& sideFace = *f;
for ( int i = 0; i < sideFace.size(); ++i )
{
double* p = sideFace[i];
- cout << "\t" << i << ": ( " << p[0] << ", " << p[1] << ", " << p[2] << " )" << endl;
+ std::cout << "\t" << i << ": ( " << p[0] << ", " << p[1] << ", " << p[2] << " )" << std::endl;
}
}
#endif
void UnitTetraIntersectionBary::clearPolygons(bool andFaces)
{
- for(vector<double*>::iterator it = _polygonA.begin() ; it != _polygonA.end() ; ++it)
+ for(std::vector<double*>::iterator it = _polygonA.begin() ; it != _polygonA.end() ; ++it)
{ delete[] *it;
*it = 0;
}
- for(vector<double*>::iterator it = _polygonB.begin() ; it != _polygonB.end() ; ++it)
+ for(std::vector<double*>::iterator it = _polygonB.begin() ; it != _polygonB.end() ; ++it)
{
delete[] *it;
*it = 0;
if ( andFaces )
{
- list< vector< double* > >::iterator f = this->_faces.begin(), fEnd = this->_faces.end();
+ std::list< std::vector< double* > >::iterator f = this->_faces.begin(), fEnd = this->_faces.end();
for ( ; f != fEnd; ++f )
{
- vector< double* >& polygon = *f;
- for(vector<double*>::iterator it = polygon.begin() ; it != polygon.end() ; ++it)
+ std::vector< double* >& polygon = *f;
+ for(std::vector<double*>::iterator it = polygon.begin() ; it != polygon.end() ; ++it)
{
delete[] *it;
*it = 0;
#include "ExprEvalInterpTest.hxx"
#include "InterpKernelExprParser.hxx"
-using namespace std;
using namespace INTERP_TEST;
void ExprEvalInterpTest::testBuildStringFromFortran()
{
char toto1[]="123456 ";
char result[]="123456";
- string titi;
+ std::string titi;
titi=INTERP_KERNEL::ExprParser::buildStringFromFortran(toto1,8);
CPPUNIT_ASSERT_EQUAL(6,(int)titi.length());
CPPUNIT_ASSERT(titi==result);
{
char toto[]=" jkhjkh ooooppp l ";
char result[]="jkhjkhoooopppl";
- string totoS(toto);
- string totoR=INTERP_KERNEL::ExprParser::deleteWhiteSpaces(totoS);
+ std::string totoS(toto);
+ std::string totoR=INTERP_KERNEL::ExprParser::deleteWhiteSpaces(totoS);
CPPUNIT_ASSERT(totoR==result);
CPPUNIT_ASSERT_EQUAL(14,(int)totoR.length());
//
//#define VOL_PREC 1.0e-6
using namespace MEDMEM;
-using namespace std;
using namespace INTERP_KERNEL;
using namespace MED_EN;
{
if(iter->count(i) != 0.0)
{
- map<int, double>::const_iterator iter2 = iter->find(i);
+ std::map<int, double>::const_iterator iter2 = iter->find(i);
vol += iter2->second;
}
}
{
double vol = 0.0;
const std::map<int, double>& col = m[i];
- for(map<int, double>::const_iterator iter = col.begin() ; iter != col.end() ; ++iter)
+ for(std::map<int, double>::const_iterator iter = col.begin() ; iter != col.end() ; ++iter)
{
vol += std::fabs(iter->second);
}
double Interpolation3DTest::sumVolume(const IntersectionMatrix& m) const
{
- vector<double> volumes;
+ std::vector<double> volumes;
for(IntersectionMatrix::const_iterator iter = m.begin() ; iter != m.end() ; ++iter)
{
- for(map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
+ for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
volumes.push_back(iter2->second);
// vol += std::abs(iter2->second);
int i = 0;
for(IntersectionMatrix::const_iterator iter = m1.begin() ; iter != m1.end() ; ++iter)
{
- for(map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
+ for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
int j = iter2->first;
if(m2.at(j-1).count(i+1) == 0)
for(IntersectionMatrix::const_iterator iter = m1.begin() ; iter != m1.end() ; ++iter)
{
- for(map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
+ for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
int j = iter2->first;
const double v1 = iter2->second;
//if(m2[j - 1].count(i+1) > 0)
// {
- map<int, double> theMap = m2.at(j-1);
+ std::map<int, double> theMap = m2.at(j-1);
const double v2 = theMap[i + 1];
if(v1 != v2)
{
bool isDiagonal = true;
for(IntersectionMatrix::const_iterator iter = m.begin() ; iter != m.end() ; ++iter)
{
- for(map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
+ for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
int j = iter2->first;
const double vol = iter2->second;
void Interpolation3DTest::dumpIntersectionMatrix(const IntersectionMatrix& m) const
{
int i = 0;
- std::cout << "Intersection matrix is " << endl;
+ std::cout << "Intersection matrix is " << std::endl;
for(IntersectionMatrix::const_iterator iter = m.begin() ; iter != m.end() ; ++iter)
{
- for(map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
+ for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
- std::cout << "V(" << i << ", " << iter2->first << ") = " << iter2->second << endl;
+ std::cout << "V(" << i << ", " << iter2->first << ") = " << iter2->second << std::endl;
}
++i;
#include <cmath>
#include <iostream>
-using namespace std;
-
namespace INTERP_TEST
{
{
std::cerr << deque1[i] << " ";
}
- std::cerr<< endl;
+ std::cerr<< std::endl;
}
void vectPrintOut(std::vector< double > vect)
{
{
std::cerr << vect[i] << " ";
}
- std::cerr<< endl;
+ std::cerr<< std::endl;
}
void tabPrintOut( const double * tab,int size)
{
{
std::cerr << tab[i] << " ";
}
- std::cerr<< endl;
+ std::cerr<< std::endl;
}
/**
//#define VOL_PREC 1.0e-6
using namespace MEDMEM;
-using namespace std;
using namespace MED_EN;
using namespace INTERP_KERNEL;
{
if(iter->count(i) != 0.0)
{
- map<int, double>::const_iterator iter2 = iter->find(i);
+ std::map<int, double>::const_iterator iter2 = iter->find(i);
vol += fabs(iter2->second);
}
}
{
double vol = 0.0;
const std::map<int, double>& col = m[i];
- for(map<int, double>::const_iterator iter = col.begin() ; iter != col.end() ; ++iter)
+ for(std::map<int, double>::const_iterator iter = col.begin() ; iter != col.end() ; ++iter)
{
vol += fabs(iter->second);
}
double MeshTestToolkit<SPACEDIM,MESHDIM>::sumVolume(const IntersectionMatrix& m) const
{
- vector<double> volumes;
+ std::vector<double> volumes;
for(IntersectionMatrix::const_iterator iter = m.begin() ; iter != m.end() ; ++iter)
{
- for(map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
+ for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
volumes.push_back(fabs(iter2->second));
}
int i = 0;
for(IntersectionMatrix::const_iterator iter = m1.begin() ; iter != m1.end() ; ++iter)
{
- for(map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
+ for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
int j = iter2->first;
if(m2.at(j-1).count(i+1) == 0)
for(IntersectionMatrix::const_iterator iter = m1.begin() ; iter != m1.end() ; ++iter)
{
- for(map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
+ for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
int j = iter2->first;
const double v1 = fabs(iter2->second);
//if(m2[j - 1].count(i+1) > 0)
// {
- map<int, double> theMap = m2.at(j-1);
+ std::map<int, double> theMap = m2.at(j-1);
const double v2 = fabs(theMap[i + 1]);
if(v1 != v2)
{
#include <sstream>
#include <iostream>
-using namespace std;
using namespace INTERP_KERNEL;
namespace INTERP_TEST
void QuadraticPlanarInterpTest::ReadWriteInXfigElementary()
{
//Testing bounds calculation. For Seg2
- istringstream stream("2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2\n3200 3400 4500 4700");
+ std::istringstream stream("2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2\n3200 3400 4500 4700");
EdgeLin *e1=new EdgeLin(stream);
Bounds bound=e1->getBounds();
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.32,bound[0],ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.34,bound[2],ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.47,bound[3],ADMISSIBLE_ERROR);
e1->decrRef();
- istringstream stream2("2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2\n4500 4700 3200 3400");
+ std::istringstream stream2("2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2\n4500 4700 3200 3400");
e1=new EdgeLin(stream2);
bound=e1->getBounds();
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.32,bound[0],ADMISSIBLE_ERROR);
void QuadraticPlanarInterpTest::IntersectionBasics()
{
//Testing intersection of Bounds.
- istringstream stream1("2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2\n3200 3400 4500 4800");
+ std::istringstream stream1("2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2\n3200 3400 4500 4800");
EdgeLin *e1=new EdgeLin(stream1);
- istringstream stream2("2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2\n3200 3400 4500 4800");
+ std::istringstream stream2("2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2\n3200 3400 4500 4800");
EdgeLin *e2=new EdgeLin(stream2);
Bounds *bound=e1->getBounds().amIIntersectingWith(e2->getBounds()); CPPUNIT_ASSERT(bound);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.32,(*bound)[0],ADMISSIBLE_ERROR);
delete bound;
e2->decrRef(); e1->decrRef();
//
- istringstream stream3("2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2\n3000 7200 6000 3700");
+ std::istringstream stream3("2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2\n3000 7200 6000 3700");
EdgeLin *e3=new EdgeLin(stream3);
- istringstream stream4("2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2\n4800 6600 7200 4200");
+ std::istringstream stream4("2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2\n4800 6600 7200 4200");
EdgeLin *e4=new EdgeLin(stream4);
bound=e3->getBounds().amIIntersectingWith(e4->getBounds()); CPPUNIT_ASSERT(bound);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.48,(*bound)[0],ADMISSIBLE_ERROR);
#include <sstream>
#include <iostream>
-using namespace std;
using namespace INTERP_KERNEL;
namespace INTERP_TEST
// ArcCArcCIntersector
//
TypeOfLocInEdge where1,where2;
- vector<Node *> v4;
+ std::vector<Node *> v4;
MergePoints v3;
EdgeArcCircle *e2;
ArcCArcCIntersector *intersector=0;
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[1]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT(!v4[0]->isEqual(*v4[1]));
CPPUNIT_ASSERT_DOUBLES_EQUAL(btw2NodesAndACenter(*v4[0],*v4[1],e1->getCenter()),0.35587863972199624,1e-10);
- for(vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
+ for(std::vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
(*iter)->decrRef();
v4.clear(); v3.clear();
delete intersector; e2->decrRef(); e1->decrRef();
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[1]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT(!v4[0]->isEqual(*v4[1]));
CPPUNIT_ASSERT_DOUBLES_EQUAL(btw2NodesAndACenter(*v4[0],*v4[1],e1->getCenter()),0.35587863972199624,1e-10);
- for(vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
+ for(std::vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
(*iter)->decrRef();
v4.clear(); v3.clear();
delete intersector; e2->decrRef(); e1->decrRef();
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[1]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT(!v4[0]->isEqual(*v4[1]));
CPPUNIT_ASSERT_DOUBLES_EQUAL(btw2NodesAndACenter(*v4[0],*v4[1],e1->getCenter()),0.6793851523346941,1e-10);
- for(vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
+ for(std::vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
(*iter)->decrRef();
v4.clear(); v3.clear();
delete intersector; e2->decrRef(); e1->decrRef();
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[1]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT(!v4[0]->isEqual(*v4[1]));
CPPUNIT_ASSERT_DOUBLES_EQUAL(btw2NodesAndACenter(*v4[0],*v4[1],e1->getCenter()),0.6793851523346941,1e-10);
- for(vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
+ for(std::vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
(*iter)->decrRef();
v4.clear(); v3.clear();
delete intersector; e2->decrRef(); e1->decrRef();
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[1]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT(!v4[0]->isEqual(*v4[1]));
CPPUNIT_ASSERT_DOUBLES_EQUAL(1.1195732971845034,btw2NodesAndACenter(*v4[0],*v4[1],e1->getCenter()),1e-10);
- for(vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
+ for(std::vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
(*iter)->decrRef();
v4.clear(); v3.clear();
delete intersector; e2->decrRef(); e1->decrRef();
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[1]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT(!v4[0]->isEqual(*v4[1]));
CPPUNIT_ASSERT_DOUBLES_EQUAL(-1.1195732971845034,btw2NodesAndACenter(*v4[0],*v4[1],e1->getCenter()),1e-10);
- for(vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
+ for(std::vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
(*iter)->decrRef();
v4.clear(); v3.clear();
delete intersector; e2->decrRef(); e1->decrRef();
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[1]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT(!v4[0]->isEqual(*v4[1]));
CPPUNIT_ASSERT_DOUBLES_EQUAL(-3.0844420190512074,btw2NodesAndACenter(*v4[0],*v4[1],e1->getCenter()),1e-10);
- for(vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
+ for(std::vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
(*iter)->decrRef();
v4.clear(); v3.clear();
delete intersector; e2->decrRef(); e1->decrRef();
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[1]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT(!v4[0]->isEqual(*v4[1]));
CPPUNIT_ASSERT_DOUBLES_EQUAL(-3.0844420190512074,btw2NodesAndACenter(*v4[0],*v4[1],e1->getCenter()),1e-10);
- for(vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
+ for(std::vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
(*iter)->decrRef();
v4.clear(); v3.clear();
delete intersector; e2->decrRef(); e1->decrRef();
CPPUNIT_ASSERT_EQUAL(1,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_DOUBLES_EQUAL(e1->getRadius(),Node::distanceBtw2Pt(e1->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
CPPUNIT_ASSERT_DOUBLES_EQUAL(e2->getRadius(),Node::distanceBtw2Pt(e2->getCenter(),(*(v4[0]))),ADMISSIBLE_ERROR);
- for(vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
+ for(std::vector<Node *>::iterator iter=v4.begin();iter!=v4.end();iter++)
(*iter)->decrRef();
v4.clear(); v4.clear();
delete intersector; e2->decrRef(); e1->decrRef();
bool obvious,areOverlapped;
intersector->areOverlappedOrOnlyColinears(0,obvious,areOverlapped);
CPPUNIT_ASSERT(!obvious && !areOverlapped);
- vector<Node *> v4;
+ std::vector<Node *> v4;
MergePoints v3;
CPPUNIT_ASSERT(intersector->intersect(0,v4,order,v3)); CPPUNIT_ASSERT(!order); CPPUNIT_ASSERT_EQUAL(2,(int)v4.size()); CPPUNIT_ASSERT_EQUAL(0,(int)v3.getNumberOfAssociations());
CPPUNIT_ASSERT_DOUBLES_EQUAL(2.,(*v4[0])[0],1e-10); CPPUNIT_ASSERT_DOUBLES_EQUAL(4.3,(*v4[0])[1],1e-10);
QuadraticPolygon *QuadraticPlanarInterpTest::buildQuadraticPolygonCoarseInfo(const double *coords, const int *conn, int lgth)
{
- vector<INTERP_KERNEL::Node *> nodes;
+ std::vector<INTERP_KERNEL::Node *> nodes;
for(int i=0;i<lgth;i++)
nodes.push_back(new INTERP_KERNEL::Node(coords[2*conn[i]],coords[2*conn[i]+1]));
return INTERP_KERNEL::QuadraticPolygon::buildArcCirclePolygon(nodes);
#include <sstream>
#include <iostream>
-using namespace std;
using namespace INTERP_KERNEL;
namespace INTERP_TEST
#include <iostream>
#include <iterator>
-using namespace std;
using namespace INTERP_KERNEL;
namespace INTERP_TEST
EdgeLin *e2_3=new EdgeLin(n2,n3); EdgeLin *e5_6=new EdgeLin(n5,n6);
EdgeLin *e3_1=new EdgeLin(n3,n1); EdgeLin *e6_4=new EdgeLin(n6,n4);
//
- vector<QuadraticPolygon *> result;
+ std::vector<QuadraticPolygon *> result;
for(int k=0;k<2;k++)
for(int i=0;i<3;i++)
{
CPPUNIT_ASSERT_EQUAL(3,result[0]->recursiveSize());
double tmp1=0.,tmp2=0.,tmp3=0.;
pol1.intersectForPerimeter(pol2,tmp1,tmp2,tmp3);
- vector<double> v1,v2;
- vector<int> v3;
+ std::vector<double> v1,v2;
+ std::vector<int> v3;
pol1.intersectForPerimeterAdvanced(pol2,v1,v2);//no common edge
pol1.intersectForPoint(pol2,v3);
CPPUNIT_ASSERT_EQUAL(3,(int)v1.size());
delete result[0];
double tmp1=0.,tmp2=0.,tmp3=0.;
pol7.intersectForPerimeter(pol8,tmp1,tmp2,tmp3);
- vector<double> v1,v2;
+ std::vector<double> v1,v2;
pol7.intersectForPerimeterAdvanced(pol8,v1,v2);//only common edges.
CPPUNIT_ASSERT_DOUBLES_EQUAL(3.2360679774997898,v1[0]+v1[1]+v1[2],1.e-14);
CPPUNIT_ASSERT_DOUBLES_EQUAL(3.2360679774997898,v2[0]+v2[1]+v2[2],1.e-14);
//
QuadraticPolygon pol1; pol1.pushBack(e1_2); pol1.pushBack(e2_3); pol1.pushBack(e3_1);
QuadraticPolygon pol2; pol2.pushBack(e4_5); pol2.pushBack(e5_6); pol2.pushBack(e6_4);
- vector<QuadraticPolygon *> result=pol1.intersectMySelfWith(pol2);
+ std::vector<QuadraticPolygon *> result=pol1.intersectMySelfWith(pol2);
CPPUNIT_ASSERT_EQUAL(1,(int)result.size());
CPPUNIT_ASSERT_EQUAL(3,result[0]->recursiveSize());
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.18,result[0]->getArea(),1e-10);
7.4192455562999999, 6.5142135623000001,
8.3334591186000004, 5.9660254036999998
};
- vector<Node *> nodes;
+ std::vector<Node *> nodes;
nodes.push_back(new Node(coords));
nodes.push_back(new Node(coords+2));
nodes.push_back(new Node(coords+4));
0.1000 , 0.1500 , 0.2000 , 0.2500, 0.3000, 0.3500, 0.4000, 0.4500, 0.5000, 0.5500,
0.6000, 0.6500, 0.7000, 0.7194, 0.7388, 0.7581, 0.7775, 0.7969, 0.8163, 0.8356,
0.8550};
- vector<double> zLev1(Z_VALS_1,Z_VALS_1+NB_OF_CELL_AXIAL_1+1);
+ std::vector<double> zLev1(Z_VALS_1,Z_VALS_1+NB_OF_CELL_AXIAL_1+1);
const int NB_OF_CELL_AXIAL_2=46;
static const double Z_VALS_2[NB_OF_CELL_AXIAL_2+1]=
, 0.20, 0.25, 0.30, 0.350 ,0.40 ,0.450 ,0.500 , 0.550, 0.600 ,0.650 ,0.700
, 0.7194 ,0.7388 ,0.7581 ,0.7775 ,0.7969 ,0.8163 ,0.8356, 0.8550
, 0.8738 ,0.8925 ,0.9113 ,0.9300 ,0.9488 ,0.9675 ,0.9863, 1.0050};
- vector<double> zLev2(Z_VALS_2,Z_VALS_2+NB_OF_CELL_AXIAL_2+1);
- map<int,map<int,double> > m;
+ std::vector<double> zLev2(Z_VALS_2,Z_VALS_2+NB_OF_CELL_AXIAL_2+1);
+ std::map<int,std::map<int,double> > m;
Edge::interpolate1DLin(zLev1,zLev2,m);
CPPUNIT_ASSERT_EQUAL(30,(int)m.size());
double ret=0;
static const double Z_VALS_3[NB_OF_CELL_AXIAL_3+1]={
0.,0.01,0.05,0.10,0.15,0.20,0.25,0.30,
0.35,0.40,0.45,0.50,0.55,0.60 };
- vector<double> zLev3(Z_VALS_3,Z_VALS_3+NB_OF_CELL_AXIAL_3+1);
+ std::vector<double> zLev3(Z_VALS_3,Z_VALS_3+NB_OF_CELL_AXIAL_3+1);
Edge::interpolate1DLin(zLev3,zLev1,m);
CPPUNIT_ASSERT_EQUAL(13,(int)m.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(1.,m[0][8],1e-12);
16.284787383000001, -24.763094964,
16.150490958999999, -24.132999999999999
};
- vector<Node *> nodes1;
+ std::vector<Node *> nodes1;
nodes1.push_back(new Node(coords1));
nodes1.push_back(new Node(coords1+2));
nodes1.push_back(new Node(coords1+4));
nodes1.push_back(new Node(coords1+12));
nodes1.push_back(new Node(coords1+14));
QuadraticPolygon *pol1=QuadraticPolygon::buildArcCirclePolygon(nodes1);
- vector<Node *> nodes2;
+ std::vector<Node *> nodes2;
nodes2.push_back(new Node(coords2));
nodes2.push_back(new Node(coords2+2));
nodes2.push_back(new Node(coords2+4));
nodes2.push_back(new Node(coords2+12));
nodes2.push_back(new Node(coords2+14));
QuadraticPolygon *pol2=QuadraticPolygon::buildArcCirclePolygon(nodes2);
- vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
+ std::vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(1,(int)v.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.00173945,v[0]->getArea(),1e-7);
delete v[0];
10.797961776699999, -22.893119169449999,
10.727500000099999, -23.66
};
- vector<Node *> nodes1;
+ std::vector<Node *> nodes1;
nodes1.push_back(new Node(coords1));
nodes1.push_back(new Node(coords1+2));
nodes1.push_back(new Node(coords1+4));
nodes1.push_back(new Node(coords1+12));
nodes1.push_back(new Node(coords1+14));
QuadraticPolygon *pol1=QuadraticPolygon::buildArcCirclePolygon(nodes1);
- vector<Node *> nodes2;
+ std::vector<Node *> nodes2;
nodes2.push_back(new Node(coords2));
nodes2.push_back(new Node(coords2+2));
nodes2.push_back(new Node(coords2+4));
nodes2.push_back(new Node(coords2+12));
nodes2.push_back(new Node(coords2+14));
QuadraticPolygon *pol2=QuadraticPolygon::buildArcCirclePolygon(nodes2);
- vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
+ std::vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(1,(int)v.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.00164773941455998,v[0]->getArea(),1e-7);
delete v[0];
-2.2684999997999999, 0};
//Edge1_of_pol2 inter Edge4_of_pol1 = {-1.9381648533711939, 1.1189999998498941}
//Edge4_of_pol1 _angle = -0.523598775922546, _angle0 = -3.1415926535897931, _radius = 2.2379999983074721, _center = {-1.4925279436059493e-09, 1.3300635705141101e-10}}
- vector<Node *> nodes1;
+ std::vector<Node *> nodes1;
nodes1.push_back(new Node(coords1));
nodes1.push_back(new Node(coords1+2));
nodes1.push_back(new Node(coords1+4));
nodes1.push_back(new Node(coords1+12));
nodes1.push_back(new Node(coords1+14));
QuadraticPolygon *pol1=QuadraticPolygon::buildArcCirclePolygon(nodes1);
- vector<Node *> nodes2;
+ std::vector<Node *> nodes2;
nodes2.push_back(new Node(coords2));
nodes2.push_back(new Node(coords2+2));
nodes2.push_back(new Node(coords2+4));
nodes2.push_back(new Node(coords2+12));
nodes2.push_back(new Node(coords2+14));
QuadraticPolygon *pol2=QuadraticPolygon::buildArcCirclePolygon(nodes2);
- vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
+ std::vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(0,(int)v.size());
//CPPUNIT_ASSERT_DOUBLES_EQUAL(0.00164773941455998,v[0]->getArea(),1e-7);
//delete v[0];
10.832860069499999, -22.027750000200001,
10.477274402499999, -22.80719124657,
10.3955000001, -23.66};
- vector<Node *> nodes1;
+ std::vector<Node *> nodes1;
nodes1.push_back(new Node(coords1));
nodes1.push_back(new Node(coords1+2));
nodes1.push_back(new Node(coords1+4));
nodes1.push_back(new Node(coords1+12));
nodes1.push_back(new Node(coords1+14));
QuadraticPolygon *pol1=QuadraticPolygon::buildArcCirclePolygon(nodes1);
- vector<Node *> nodes2;
+ std::vector<Node *> nodes2;
nodes2.push_back(new Node(coords2));
nodes2.push_back(new Node(coords2+2));
nodes2.push_back(new Node(coords2+4));
nodes2.push_back(new Node(coords2+12));
nodes2.push_back(new Node(coords2+14));
QuadraticPolygon *pol2=QuadraticPolygon::buildArcCirclePolygon(nodes2);
- vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
+ std::vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(1,(int)v.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(v[0]->getArea(),0.0150659,1e-7);
delete v[0];
-2.1083388453499996, 1.2172499998499999,
-2.445724191994314, 0.65532982205982326,
-2.4344999998499999, 0 };
- vector<Node *> nodes1;
+ std::vector<Node *> nodes1;
nodes1.push_back(new Node(coords1));
nodes1.push_back(new Node(coords1+2));
nodes1.push_back(new Node(coords1+4));
nodes1.push_back(new Node(coords1+12));
nodes1.push_back(new Node(coords1+14));
QuadraticPolygon *pol1=QuadraticPolygon::buildArcCirclePolygon(nodes1);
- vector<Node *> nodes2;
+ std::vector<Node *> nodes2;
nodes2.push_back(new Node(coords2));
nodes2.push_back(new Node(coords2+2));
nodes2.push_back(new Node(coords2+4));
nodes2.push_back(new Node(coords2+12));
nodes2.push_back(new Node(coords2+14));
QuadraticPolygon *pol2=QuadraticPolygon::buildArcCirclePolygon(nodes2);
- vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
+ std::vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(1,(int)v.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.121795,v[0]->getArea(),1.e-6);
delete v[0];
-13.933000000040851, -28.913499999870751,
-15.139355569325469, -28.635180276305853,
-16.323249999975001, -28.273034442748209 };
- vector<Node *> nodes1;
+ std::vector<Node *> nodes1;
nodes1.push_back(new Node(coords1));
nodes1.push_back(new Node(coords1+2));
nodes1.push_back(new Node(coords1+4));
nodes1.push_back(new Node(coords1+12));
nodes1.push_back(new Node(coords1+14));
QuadraticPolygon *pol1=QuadraticPolygon::buildArcCirclePolygon(nodes1);
- vector<Node *> nodes2;
+ std::vector<Node *> nodes2;
nodes2.push_back(new Node(coords2));
nodes2.push_back(new Node(coords2+2));
nodes2.push_back(new Node(coords2+4));
nodes2.push_back(new Node(coords2+12));
nodes2.push_back(new Node(coords2+14));
QuadraticPolygon *pol2=QuadraticPolygon::buildArcCirclePolygon(nodes2);
- vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
+ std::vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(1,(int)v.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.598232,v[0]->getArea(),1.e-6);
delete v[0];
-0.048696224921445964, -0.087834175258503858,
-0.050490195203805516, -0.087452715971391121};
- vector<Node *> nodes1;
+ std::vector<Node *> nodes1;
nodes1.push_back(new Node(coords1));
nodes1.push_back(new Node(coords1+2));
nodes1.push_back(new Node(coords1+4));
nodes1.push_back(new Node(coords1+12));
nodes1.push_back(new Node(coords1+14));
QuadraticPolygon *pol1=QuadraticPolygon::buildArcCirclePolygon(nodes1);
- vector<Node *> nodes2;
+ std::vector<Node *> nodes2;
nodes2.push_back(new Node(coords2));
nodes2.push_back(new Node(coords2+2));
nodes2.push_back(new Node(coords2+4));
nodes2.push_back(new Node(coords2+12));
nodes2.push_back(new Node(coords2+14));
QuadraticPolygon *pol2=QuadraticPolygon::buildArcCirclePolygon(nodes2);
- vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
+ std::vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(0,(int)v.size());
delete pol1;
delete pol2;
-0.002982346712452072, -0.1018362598405457,
-0.003829636200350435, -0.1051516213840111};
- vector<Node *> nodes1;
+ std::vector<Node *> nodes1;
nodes1.push_back(new Node(coords1));
nodes1.push_back(new Node(coords1+2));
nodes1.push_back(new Node(coords1+4));
nodes1.push_back(new Node(coords1+12));
nodes1.push_back(new Node(coords1+14));
QuadraticPolygon *pol1=QuadraticPolygon::buildArcCirclePolygon(nodes1);
- vector<Node *> nodes2;
+ std::vector<Node *> nodes2;
nodes2.push_back(new Node(coords2));
nodes2.push_back(new Node(coords2+2));
nodes2.push_back(new Node(coords2+4));
nodes2.push_back(new Node(coords2+12));
nodes2.push_back(new Node(coords2+14));
QuadraticPolygon *pol2=QuadraticPolygon::buildArcCirclePolygon(nodes2);
- vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
+ std::vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(1,(int)v.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(2.28973e-06,v[0]->getArea(),1.e-11);
delete v[0];
-0.4869622492144596, -0.8783417525850385,
-0.5049019520380551, -0.8745271597139112};
- vector<Node *> nodes1;
+ std::vector<Node *> nodes1;
nodes1.push_back(new Node(coords1));
nodes1.push_back(new Node(coords1+2));
nodes1.push_back(new Node(coords1+4));
nodes1.push_back(new Node(coords1+12));
nodes1.push_back(new Node(coords1+14));
QuadraticPolygon *pol1=QuadraticPolygon::buildArcCirclePolygon(nodes1);
- vector<Node *> nodes2;
+ std::vector<Node *> nodes2;
nodes2.push_back(new Node(coords2));
nodes2.push_back(new Node(coords2+2));
nodes2.push_back(new Node(coords2+4));
nodes2.push_back(new Node(coords2+12));
nodes2.push_back(new Node(coords2+14));
QuadraticPolygon *pol2=QuadraticPolygon::buildArcCirclePolygon(nodes2);
- vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
+ std::vector<QuadraticPolygon *> v=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(1,(int)v.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,v[0]->getArea(),1.e-6);
delete v[0];
for(int j=0;j<2;j++,work2+=8)
{
QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords_2,work2,8);
- //vector<int> tmp;
+ //std::vector<int> tmp;
//pol1->intersectForPoint(*pol2,tmp);
pol1->intersectForPerimeter(*pol2,perimeterFromPol1,perimeterFromPol2,perimeterFromPol1AndPol2);
//pol1->intersectMySelfWith(*pol2);
{
QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords_2,work2,8);
- //vector<int> tmp;
+ //std::vector<int> tmp;
//pol1->intersectForPoint(*pol2,tmp);
pol1->intersectForPerimeter(*pol2,perimeterFromPol1,perimeterFromPol2,perimeterFromPol1AndPol2);
delete pol2;
27,28,29,30,31,32,2,33
};
QuadraticPolygon *pol1,*pol2;
- vector<int> goalOfTest;
+ std::vector<int> goalOfTest;
//
pol1=buildQuadraticPolygonCoarseInfo(coords,tab,8);
// Level 1
//pol1 and pol2 in same orientation
pol1=buildQuadraticPolygonCoarseInfo(coords,tab,8);
pol2=buildQuadraticPolygonCoarseInfo(coords,tab+8,8);
- vector<QuadraticPolygon *> res=pol1->intersectMySelfWith(*pol2);
+ std::vector<QuadraticPolygon *> res=pol1->intersectMySelfWith(*pol2);
CPPUNIT_ASSERT_EQUAL(1,(int)res.size());
CPPUNIT_ASSERT_EQUAL(4,res[0]->recursiveSize());
CPPUNIT_ASSERT_DOUBLES_EQUAL(RefLgth,res[0]->getPerimeter(),1e-12);
QuadraticPolygon *pol1,*pol2;
//pol1 and pol2 in same orientation
- vector<double> test1,test2;
+ std::vector<double> test1,test2;
for(int ii=0;ii<24;ii++)
{
pol1=buildQuadraticPolygonCoarseInfo(coords1,tab1_8+8*ii,8);
{
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab2_8+jj*8,8);
//
- vector<double> v1,v2;
+ std::vector<double> v1,v2;
pol1->initLocations();
pol1->intersectForPerimeterAdvanced(*pol2,v1,v2);
if(ii==16 && jj==1)
#include <iostream>
#include <iterator>
-using namespace std;
using namespace INTERP_KERNEL;
namespace INTERP_TEST
0, 1, 2, 3, 4, 5, 6, 7 };
QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
- vector<double> val1,val2;
+ std::vector<double> val1,val2;
pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
double test1_res[4]={0.,0.366519,0.,0.};
double test2_res[4]={0.,0.,0.,0.366519};
0, 1, 2, 3, 4, 5, 6, 7 };
QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
- vector<double> val1,val2;
+ std::vector<double> val1,val2;
pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
double test1_res[4]={0.,0.366519,0.,0.};
double test2_res[4]={0.,0.,0.,0.366519};
0, 1, 2, 3, 4, 5, 6, 7 };
QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
- vector<double> val1,val2;
+ std::vector<double> val1,val2;
pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
double test1_res[4]={0.,0.18326,0.,0.};
double test2_res[4]={0.,0.,0.,0.18326};
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val1,1.e-13);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val2,1.e-13);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val3,1.e-13);
- vector<double> val4,val5;
+ std::vector<double> val4,val5;
pol1->intersectForPerimeterAdvanced(*pol2,val4,val5);
double test1_res[4]={0.,0.,0.,0.};
CPPUNIT_ASSERT(std::equal(val4.begin(),val4.end(),test1_res,DoubleEqual(1e-13)));
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val1,1.e-13);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val2,1.e-13);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,val3,1.e-13);
- vector<double> val4,val5;
+ std::vector<double> val4,val5;
pol1->intersectForPerimeterAdvanced(*pol2,val4,val5);
double test1_res[4]={0.,0.,0.,0.};
CPPUNIT_ASSERT(std::equal(val4.begin(),val4.end(),test1_res,DoubleEqual(1e-13)));
0, 1, 2, 3, 4, 5, 6, 7 };
QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
- vector<double> val1,val2;
+ std::vector<double> val1,val2;
pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
double test1_res[4]={0.,0.,0.05,0.};
double test2_res[4]={0.,0.,0.05,0.};
CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
delete pol1;
delete pol2;
- vector<int> val3;
+ std::vector<int> val3;
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
pol1->intersectForPoint(*pol2,val3);
0, 1, 2, 3, 4, 5, 6, 7 };
QuadraticPolygon *pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
QuadraticPolygon *pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
- vector<double> val1,val2;
+ std::vector<double> val1,val2;
pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
double test1_res[4]={0.,0.,0.1,0.};
double test2_res[4]={0.,0.,0.1,0.};
CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
delete pol1;
delete pol2;
- vector<int> val3;
+ std::vector<int> val3;
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
pol1->intersectForPoint(*pol2,val3);
//
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
- vector<double> val1,val2;
+ std::vector<double> val1,val2;
pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
double test1_res[4]={0.,0.,0.15,0.};
double test2_res[4]={0.05,0.,0.1,0.};
CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
delete pol1;
delete pol2;
- vector<int> val3;
+ std::vector<int> val3;
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
pol1->intersectForPoint(*pol2,val3);
//
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
- vector<double> val1,val2;
+ std::vector<double> val1,val2;
pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
double test1_res[4]={0.,0.,0.2,0.};
double test2_res[4]={0.1,0.,0.1,0.};
CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
delete pol1;
delete pol2;
- vector<int> val3;
+ std::vector<int> val3;
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
pol1->intersectForPoint(*pol2,val3);
//
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
- vector<double> val1,val2;
+ std::vector<double> val1,val2;
pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
double test1_res[4]={0.,0.,0.15,0.};
double test2_res[4]={0.1,0.,0.05,0.};
CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
delete pol1;
delete pol2;
- vector<int> val3;
+ std::vector<int> val3;
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
pol1->intersectForPoint(*pol2,val3);
//
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
- vector<double> val1,val2;
+ std::vector<double> val1,val2;
pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
double test1_res[4]={0.,0.,0.1,0.};
double test2_res[4]={0.1,0.,0.,0.};
CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
delete pol1;
delete pol2;
- vector<int> val3;
+ std::vector<int> val3;
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
pol1->intersectForPoint(*pol2,val3);
//
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
- vector<double> val1,val2;
+ std::vector<double> val1,val2;
pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
double test1_res[4]={0.,0.,0.05,0.};
double test2_res[4]={0.05,0.,0.,0.};
CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
delete pol1;
delete pol2;
- vector<int> val3;
+ std::vector<int> val3;
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
pol1->intersectForPoint(*pol2,val3);
//
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
- vector<double> val1,val2;
+ std::vector<double> val1,val2;
pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
double test1_res[4]={0.,0.,0.,0.};
double test2_res[4]={0.,0.,0.,0.};
CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-6)));
delete pol1;
delete pol2;
- vector<int> val3;
+ std::vector<int> val3;
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
pol1->intersectForPoint(*pol2,val3);
//
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
- vector<double> val1,val2;
+ std::vector<double> val1,val2;
pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
double test1_res[4]={0.162251,0.151523,0.,0.};
double test2_res[4]={0.,0.311383,0.,0.0978193};
CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-6)));
delete pol1;
delete pol2;
- vector<int> val3;
+ std::vector<int> val3;
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
pol1->intersectForPoint(*pol2,val3);
delete pol1;
delete pol2;
//
- vector<int> val3;
+ std::vector<int> val3;
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
pol1->intersectForPoint(*pol2,val3);
delete pol1;
delete pol2;
//
- vector<int> val3;
+ std::vector<int> val3;
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
pol1->intersectForPoint(*pol2,val3);
//
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
- vector<double> val1,val2;
+ std::vector<double> val1,val2;
pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
double test1_res[4]={0.,0.222704,0.,0.};
double test2_res[4]={0.1,0.0465335,0.1,0.092554};
CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-6)));
delete pol1;
delete pol2;
- vector<int> val3;
+ std::vector<int> val3;
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
pol1->intersectForPoint(*pol2,val3);
//
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
- vector<double> val1,val2;
+ std::vector<double> val1,val2;
pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
double test1_res[4]={0.,0.,0.,0.};
double test2_res[4]={0.1,0.628319,0.1,0.314159};
CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-6)));
delete pol1;
delete pol2;
- vector<int> val3;
+ std::vector<int> val3;
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
pol1->intersectForPoint(*pol2,val3);
//
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
- vector<double> val1,val2;
+ std::vector<double> val1,val2;
pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
double test1_res[4]={0.,0.,0.,0.};
double test2_res[4]={0.,0.,0.,0.};
CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-13)));
delete pol1;
delete pol2;
- vector<int> val3;
+ std::vector<int> val3;
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
pol1->intersectForPoint(*pol2,val3);
//
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
- vector<double> val1,val2;
+ std::vector<double> val1,val2;
pol1->intersectForPerimeterAdvanced(*pol2,val1,val2);
double test1_res[4]={0.,0.,0.,0.};
double test2_res[4]={0.1,0.628319,0.1,0.314159};
CPPUNIT_ASSERT(std::equal(val2.begin(),val2.end(),test2_res,DoubleEqual(1e-6)));
delete pol1;
delete pol2;
- vector<int> val3;
+ std::vector<int> val3;
pol1=buildQuadraticPolygonCoarseInfo(coords,tab8,8);
pol2=buildQuadraticPolygonCoarseInfo(coords2,tab8,8);
pol1->intersectForPoint(*pol2,val3);
void SingleElementPlanarTests::diamondsBasic()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_losange1,_losange2,4,4);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_losange1,_losange2,4,4);
+ std::deque< double > expected_result;
expected_result.push_back(0.5);expected_result.push_back(-0.5);
expected_result.push_back(0);expected_result.push_back(0);
expected_result.push_back(1);expected_result.push_back(0);
CPPUNIT_ASSERT_MESSAGE("Basic diamond crossing test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::diamondsBasic_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_losange1,_losange2,4,4,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(1);expected_result.push_back(0);
expected_result.push_back(0.5);expected_result.push_back(0.5);
expected_result.push_back(0);expected_result.push_back(0);
expected_result.push_back(0.5);expected_result.push_back(-0.5);
CPPUNIT_ASSERT_MESSAGE("Basic diamond crossing test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::tangentDiamonds()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_losange1,_losange3,4,4);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_losange1,_losange3,4,4);
+ std::deque< double > expected_result;
CPPUNIT_ASSERT_MESSAGE("Diamond exclusion tangency test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::tangentDiamonds_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_losange1,_losange3,4,4,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(0.5);expected_result.push_back(0.5);
expected_result.push_back(1);expected_result.push_back(0);
CPPUNIT_ASSERT_MESSAGE("Diamond exclusion tangency test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
// Two tangent squares with overlapping edges, in an inclusion configuration
void SingleElementPlanarTests::tangentSquares()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_square1,_square2,4,4);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_square1,_square2,4,4);
+ std::deque< double > expected_result;
expected_result.push_back(0.);expected_result.push_back(0.25);
expected_result.push_back(0.);expected_result.push_back(-0.25);
expected_result.push_back(1.);expected_result.push_back(0.25);
CPPUNIT_ASSERT_MESSAGE("Squares inclusion tangency test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::tangentSquares_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_square1,_square2,4,4,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(1.);expected_result.push_back(0.25);
expected_result.push_back(0.25);expected_result.push_back(0.25);
expected_result.push_back(1.);expected_result.push_back(-0.25);
CPPUNIT_ASSERT_MESSAGE("Squares inclusion tangency test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
// Two diamonds sharing a vertex in an exclusion configuration
void SingleElementPlanarTests::diamondsSharingVertex1()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_losange1,_losange4,4,4);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_losange1,_losange4,4,4);
+ std::deque< double > expected_result;
CPPUNIT_ASSERT_MESSAGE("Diamond sharing (1) vertex test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::diamondsSharingVertex1_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_losange1,_losange4,4,4,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(1.);expected_result.push_back(0.);
CPPUNIT_ASSERT_MESSAGE("Diamonds sharing (1) vertex test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
// Two identical squares
void SingleElementPlanarTests::identicalSquares()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_square1,_square1,4,4);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_square1,_square1,4,4);
+ std::deque< double > expected_result;
expected_result.push_back(-1.);expected_result.push_back(1.);
expected_result.push_back(-1.);expected_result.push_back(-1.);
expected_result.push_back(1.);expected_result.push_back(1.);
CPPUNIT_ASSERT_MESSAGE("Identical squares test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::identicalSquares_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_square1,_square1,4,4,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(1.);expected_result.push_back(1.);
expected_result.push_back(-1.);expected_result.push_back(1.);
expected_result.push_back(1.);expected_result.push_back(-1.);
CPPUNIT_ASSERT_MESSAGE("Identical squares test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
// Square and diamond intersecting with no degeneracy
// /\
void SingleElementPlanarTests::squareAndDiamondBasic()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_square1,_losange5,4,4);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_square1,_losange5,4,4);
+ std::deque< double > expected_result;
expected_result.push_back(1.);expected_result.push_back(0.5);
expected_result.push_back(0.5);expected_result.push_back(1.);
expected_result.push_back(1.);expected_result.push_back(-0.5);
CPPUNIT_ASSERT_MESSAGE("Square and diamond basic test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::squareAndDiamondBasic_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_square1,_losange5,4,4,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(1.);expected_result.push_back(0.);
expected_result.push_back(1.);expected_result.push_back(0.5);
void SingleElementPlanarTests::squareAndDiamondCritical()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_square1,_losange1,4,4);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_square1,_losange1,4,4);
+ std::deque< double > expected_result;
expected_result.push_back(0.);expected_result.push_back(-1.);
expected_result.push_back(-1.);expected_result.push_back(0.);
expected_result.push_back(1.);expected_result.push_back(0.);
CPPUNIT_ASSERT_MESSAGE("Square and diamond critical tangency test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::squareAndDiamondCritical_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_square1,_losange1,4,4,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(0.5);expected_result.push_back(0.5);
expected_result.push_back(0.);expected_result.push_back(1.);
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_losange6,_losange7,6,5);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_losange6,_losange7,6,5);
+ std::deque< double > expected_result;
expected_result.push_back(0.5);expected_result.push_back(-0.5);
expected_result.push_back(0.5);expected_result.push_back(-0.5);
expected_result.push_back(1);expected_result.push_back(0);
CPPUNIT_ASSERT_MESSAGE("Basic diamond crossing test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::diamondsCritical_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_losange6,_losange7,6,5,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(1);expected_result.push_back(0);
expected_result.push_back(0.5);expected_result.push_back(0.5);
expected_result.push_back(0.5);expected_result.push_back(-0.5);
CPPUNIT_ASSERT_MESSAGE("Basic diamond crossing test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
// Two tangent squares with starting and ending vertices on edges
void SingleElementPlanarTests::quadranglesCritical()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_square4,_square3,4,5);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_square4,_square3,4,5);
+ std::deque< double > expected_result;
expected_result.push_back(-0.5);expected_result.push_back(1.);
expected_result.push_back(-0.5);expected_result.push_back(-1.);
expected_result.push_back(1.);expected_result.push_back(1.);
CPPUNIT_ASSERT_MESSAGE("Critical quadrangles with tangency test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::quadranglesCritical_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_square4,_square3,4,5,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(1.);expected_result.push_back(-1.);
expected_result.push_back(1.);expected_result.push_back(0.5);
expected_result.push_back(-0.5);expected_result.push_back(-1.);
CPPUNIT_ASSERT_MESSAGE("Critical quadrangles with tangency test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::quadrangleAndDiamondCritical()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_square5,_losange8,5,4);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_square5,_losange8,5,4);
+ std::deque< double > expected_result;
expected_result.push_back(0.);expected_result.push_back(1.);
expected_result.push_back(-0.5);expected_result.push_back(-1.);
expected_result.push_back(1.);expected_result.push_back(-1.);
CPPUNIT_ASSERT_MESSAGE("Square and diamond critical tangency test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::quadrangleAndDiamondCritical_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_square5,_losange8,5,4,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(1.);expected_result.push_back(-1.);
expected_result.push_back(1./3);expected_result.push_back(1./3);
expected_result.push_back(0.);expected_result.push_back(-1.);
CPPUNIT_ASSERT_MESSAGE("Square and diamond critical tangency test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
} // square and diamond intersecting at four degenerated pointss
//
// ²/²\
void SingleElementPlanarTests::diamondsCritical2()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_losange1,_losange9,4,4);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_losange1,_losange9,4,4);
+ std::deque< double > expected_result;
expected_result.push_back(0.);expected_result.push_back(-1.);
expected_result.push_back(0.);expected_result.push_back(-1.);
expected_result.push_back(0.5);expected_result.push_back(0.);
CPPUNIT_ASSERT_MESSAGE("Diamonds with crossing at double vertex test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::diamondsCritical2_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_losange1,_losange9,4,4,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(0.);expected_result.push_back(-1.);
expected_result.push_back(0.5);expected_result.push_back(0.);
expected_result.push_back(-1.);expected_result.push_back(0.);
CPPUNIT_ASSERT_MESSAGE("Diamonds with crossing at double vertex test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
// Two tangent hexagons with double vertices and a critical starting vertex on edge
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_hexagon1,_hexagon2,6,6);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_hexagon1,_hexagon2,6,6);
+ std::deque< double > expected_result;
expected_result.push_back(5./3);expected_result.push_back(1./3);
expected_result.push_back(1.);expected_result.push_back(-1.);
expected_result.push_back(1.);expected_result.push_back(1.);
CPPUNIT_ASSERT_MESSAGE("First hexagon critical crossing test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::hexagonsCritical1_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_hexagon1,_hexagon2,6,6,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(-1.);expected_result.push_back(1.);
expected_result.push_back(-1.5);expected_result.push_back(0.5);
expected_result.push_back(0.25);expected_result.push_back(0.75);
CPPUNIT_ASSERT_MESSAGE("First hexagon critical crossing test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
// Two tangent hexagons with double vertices and a critical starting vertex on edge
void SingleElementPlanarTests::hexagonsCritical2()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_hexagon1,_hexagon3,6,6);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_hexagon1,_hexagon3,6,6);
+ std::deque< double > expected_result;
CPPUNIT_ASSERT_MESSAGE("Second hexagon critical crossing test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::hexagonsCritical2_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_hexagon1,_hexagon3,6,6,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(1.);expected_result.push_back(1.);
expected_result.push_back(-1.);expected_result.push_back(1.);
CPPUNIT_ASSERT_MESSAGE("Second hexagon critical crossing test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
// Square and quadrilateron with outer tangency
void SingleElementPlanarTests::squareAndQuadrangleCritical()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_square1,_square6,4,4);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_square1,_square6,4,4);
+ std::deque< double > expected_result;
- CPPUNIT_ASSERT_MESSAGE("Identical squares test failed (CONVEX)", (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ CPPUNIT_ASSERT_MESSAGE("Identical squares test failed (CONVEX)", (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::squareAndQuadrangleCritical_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_square1,_square6,4,4,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(-1.);expected_result.push_back(1.);
expected_result.push_back(0.5);expected_result.push_back(1.);
CPPUNIT_ASSERT_MESSAGE("Identical squares test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
// Two diamonds sharing a vertex in an exclusion configuration
// /\
void SingleElementPlanarTests:: diamondsSharingVertex2()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_losange1,_losange10,4,4);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_losange1,_losange10,4,4);
+ std::deque< double > expected_result;
CPPUNIT_ASSERT_MESSAGE("Diamond sharing vertex (2) test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests:: diamondsSharingVertex2_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_losange1,_losange10,4,4,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(0.);expected_result.push_back(-1.);
CPPUNIT_ASSERT_MESSAGE("Diamond sharing vertex (2) test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
// Triangle and diamond with a critical crossing at double starting vertex
void SingleElementPlanarTests:: triangleAndDiamondCritical()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_losange1,_triangle1,4,3);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_losange1,_triangle1,4,3);
+ std::deque< double > expected_result;
expected_result.push_back(2./3);expected_result.push_back(1./3);
expected_result.push_back(0.5);expected_result.push_back(0.);
expected_result.push_back(0.);expected_result.push_back(1.);
CPPUNIT_ASSERT_MESSAGE("Triangle and diamonds critical test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests:: triangleAndDiamondCritical_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_losange1,_triangle1,4,3,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(2./3);expected_result.push_back(1./3);
expected_result.push_back(0.);expected_result.push_back(1.);
expected_result.push_back(0.5);expected_result.push_back(0.);
CPPUNIT_ASSERT_MESSAGE("Triangle and diamonds critical test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
// Basic triangle and square intersection (two distinct points)
void SingleElementPlanarTests::triangleAndSquareBasic()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_square1,_triangle2,4,3);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_square1,_triangle2,4,3);
+ std::deque< double > expected_result;
expected_result.push_back(1.);expected_result.push_back(1./6);
expected_result.push_back(1.);expected_result.push_back(-1./6);
expected_result.push_back(0.);expected_result.push_back(0.5);
CPPUNIT_ASSERT_MESSAGE("Identical squares test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::triangleAndSquareBasic_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_square1,_triangle2,4,3,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(1.);expected_result.push_back(1./6);
expected_result.push_back(0.375);expected_result.push_back(0.375);
expected_result.push_back(1.);expected_result.push_back(-1./6);
CPPUNIT_ASSERT_MESSAGE("Identical squares test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
// Two triangles with a starting vertex on edge
void SingleElementPlanarTests::trianglesCritical()
{
INTERP_KERNEL::PolygonAlgorithms<3> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_triangle3,_triangle4,3,3);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_triangle3,_triangle4,3,3);
+ std::deque< double > expected_result;
expected_result.push_back(2./3);expected_result.push_back(2.);expected_result.push_back(1./3);
expected_result.push_back(0.5);expected_result.push_back(2.);expected_result.push_back(0.);
expected_result.push_back(0.75);expected_result.push_back(2.);expected_result.push_back(0.25);
CPPUNIT_ASSERT_MESSAGE("Triangles critical test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,3>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,3>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::trianglesCritical_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
double _triangle3rotated[6],_triangle4rotated[6];
for (int i=0; i<3; i++)_triangle3rotated[2*i] = _triangle3[3*i];
for (int i=0; i<3; i++)_triangle3rotated[2*i+1] = _triangle3[3*i+2];
INTERP_KERNEL::intersec_de_polygone<2>(_triangle3rotated,_triangle4rotated,3,3,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(0.5);expected_result.push_back(0.);
expected_result.push_back(2./3);expected_result.push_back(1./3);
expected_result.push_back(0.75);expected_result.push_back(0.25);
CPPUNIT_ASSERT_MESSAGE("Triangles critical test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
// Two tangent paralellograms intersecting at 3 double vertices (one being a starting vertex)
void SingleElementPlanarTests::paralellogramsCritical1()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_parallel1,_parallel2,4,4);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_parallel1,_parallel2,4,4);
+ std::deque< double > expected_result;
expected_result.push_back(0.);expected_result.push_back(0.);
expected_result.push_back(0.);expected_result.push_back(0.);
expected_result.push_back(0.5);expected_result.push_back(1.);
CPPUNIT_ASSERT_MESSAGE("Paralellogram tangency test (1) failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::paralellogramsCritical1_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_parallel1,_parallel2,4,4,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(0.25);expected_result.push_back(0.5);
expected_result.push_back(0.5);expected_result.push_back(1.);
expected_result.push_back(0.);expected_result.push_back(0.);
CPPUNIT_ASSERT_MESSAGE("Paralellogram tangency test (1) failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
// Two paralellograms sharing a vertex in an exclusion configuration
void SingleElementPlanarTests::paralellogramsCritical2()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_parallel1,_parallel3,4,4);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_parallel1,_parallel3,4,4);
+ std::deque< double > expected_result;
CPPUNIT_ASSERT_MESSAGE("Paralellogram tangency test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::paralellogramsCritical2_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_parallel1,_parallel3,4,4,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(0.);expected_result.push_back(0.);
CPPUNIT_ASSERT_MESSAGE("Paralellogram tangency test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
// Two triangles in a tangency configuration with a starting vertex on edge
void SingleElementPlanarTests::trianglesTangencyCritical()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_triangle5,_triangle6,3,3);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_triangle5,_triangle6,3,3);
+ std::deque< double > expected_result;
expected_result.push_back(1./3);expected_result.push_back(1./2);
expected_result.push_back(1./3);expected_result.push_back(1./3);
expected_result.push_back(1./2);expected_result.push_back(1./2);
CPPUNIT_ASSERT_MESSAGE("Triangles tangency critical test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::trianglesTangencyCritical_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_triangle5,_triangle6,3,3,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(1./3);expected_result.push_back(1./2);
expected_result.push_back(1./2);expected_result.push_back(1./2);
expected_result.push_back(1./3);expected_result.push_back(1./3);
CPPUNIT_ASSERT_MESSAGE("Triangles tangency critical test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
// Two triangles with double starting point in an outer tangency configuration
void SingleElementPlanarTests::trianglesTangencyCritical2()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_triangle1,_triangle7,3,3);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_triangle1,_triangle7,3,3);
+ std::deque< double > expected_result;
// if(!checkDequesEqual(actual_result,expected_result, _Epsilon))
// {
- // cerr<< "CPP_UNIT expected result= " << endl;
+ // std::cerr<< "CPP_UNIT expected result= " << std::endl;
// dequePrintOut(expected_result);
- // cerr<< "CPP_UNIT actual result= " << endl;
+ // std::cerr<< "CPP_UNIT actual result= " << std::endl;
// dequePrintOut(actual_result);
// }
CPPUNIT_ASSERT_MESSAGE("Triangles tangency critical (2) test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::trianglesTangencyCritical2_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_triangle1,_triangle7,3,3,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(1.);expected_result.push_back(1.);
expected_result.push_back(0.);expected_result.push_back(1.);
// }
CPPUNIT_ASSERT_MESSAGE("Triangles tangency critical (2) test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
// \brief Status : pass
void SingleElementPlanarTests::trianglesTangencyCritical3()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_triangle8,_triangle9,3,3);
- deque< double > expected_result;
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_triangle8,_triangle9,3,3);
+ std::deque< double > expected_result;
CPPUNIT_ASSERT_MESSAGE("Triangles tangency critical (3) test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::trianglesTangencyCritical3_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_triangle8,_triangle9,3,3,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(22.4601);expected_result.push_back(35.2129);
expected_result.push_back(13.9921);expected_result.push_back(34.693);
CPPUNIT_ASSERT_MESSAGE("Triangles tangency critical (3) test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::trianglesTangencyCritical4()
{
INTERP_KERNEL::PolygonAlgorithms<2> intersector (_Epsilon, _Precision);;
- deque< double > actual_result = intersector.intersectConvexPolygons(_triangle10,_triangle11,3,3);
+ std::deque< double > actual_result = intersector.intersectConvexPolygons(_triangle10,_triangle11,3,3);
- deque< double > expected_result;
+ std::deque< double > expected_result;
expected_result.push_back(82.745193090443536);expected_result.push_back(96.184114390029166);
expected_result.push_back(82.260099999999994);expected_result.push_back(95.720200000000006);
expected_result.push_back(80);expected_result.push_back(100.);
CPPUNIT_ASSERT_MESSAGE("Triangles tangency critical (4) test failed (CONVEX)",
- (INTERP_KERNEL::checkEqualPolygons<deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::deque<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
void SingleElementPlanarTests::trianglesTangencyCritical4_Triangulation()
{
- vector< double > actual_result;
+ std::vector< double > actual_result;
INTERP_KERNEL::intersec_de_polygone<2>(_triangle10,_triangle11,3,3,actual_result,_Epsilon/_Precision, _Precision );
- vector< double > expected_result;
+ std::vector< double > expected_result;
expected_result.push_back(80);expected_result.push_back(100.);
expected_result.push_back(82.745193090443536);expected_result.push_back(96.184114390029166);
expected_result.push_back(82.260099999999994);expected_result.push_back(95.720200000000006);
CPPUNIT_ASSERT_MESSAGE("Triangles tangency critical (4) test failed (TRIANGULATION)",
- (INTERP_KERNEL::checkEqualPolygons<vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
+ (INTERP_KERNEL::checkEqualPolygons<std::vector<double>,2>(&actual_result, &expected_result, _Epsilon)));
}
}
#include "Log.hxx"
using namespace MEDMEM;
-using namespace std;
using namespace INTERP_KERNEL;
using namespace MED_EN;
vector<double> volumes;
for(IntersectionMatrix::const_iterator iter = m.begin() ; iter != m.end() ; ++iter)
{
- for(map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
+ for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
volumes.push_back(iter2->second);
// vol += std::fabs(iter2->second);
int i = 0;
for(IntersectionMatrix::const_iterator iter = m1.begin() ; iter != m1.end() ; ++iter)
{
- for(map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
+ for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
int j = iter2->first;
if(m2.at(j-1).count(i+1) == 0)
for(IntersectionMatrix::const_iterator iter = m1.begin() ; iter != m1.end() ; ++iter)
{
- for(map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
+ for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
int j = iter2->first;
const double v1 = iter2->second;
//if(m2[j - 1].count(i+1) > 0)
// {
- map<int, double> theMap = m2.at(j-1);
+ std::map<int, double> theMap = m2.at(j-1);
const double v2 = theMap[i + 1];
if(v1 != v2)
{
bool isDiagonal = true;
for(IntersectionMatrix::const_iterator iter = m.begin() ; iter != m.end() ; ++iter)
{
- for(map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
+ for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
int j = iter2->first;
const double vol = iter2->second;
void dumpIntersectionMatrix(const IntersectionMatrix& m)
{
int i = 0;
- std::cout << "Intersection matrix is " << endl;
+ std::cout << "Intersection matrix is " << std::endl;
for(IntersectionMatrix::const_iterator iter = m.begin() ; iter != m.end() ; ++iter)
{
- for(map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
+ for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
- std::cout << "V(" << i << ", " << iter2->first << ") = " << iter2->second << endl;
+ std::cout << "V(" << i << ", " << iter2->first << ") = " << iter2->second << std::endl;
}
++i;
void calcIntersectionMatrix(const char* mesh1path, const char* mesh1, const char* mesh2path, const char* mesh2, IntersectionMatrix& m)
{
- const string dataBaseDir = getenv("MED_ROOT_DIR");
- const string dataDir = dataBaseDir + "/share/salome/resources/med/";
+ const std::string dataBaseDir = getenv("MED_ROOT_DIR");
+ const std::string dataDir = dataBaseDir + "/share/salome/resources/med/";
LOG(1, std::endl << "=== -> intersecting src = " << mesh1 << ", target = " << mesh2 );
#include <iostream>
using namespace INTERP_KERNEL;
-using namespace std;
namespace INTERP_TEST
{
{-4.0, 9.0, 3.0 },
{ 0.0, 0.0, 0.0 },
{ 6.0, 1.0,10.0 }};
- vector<const double*> n (4);
+ std::vector<const double*> n (4);
n[0] = &nodes[0][0];
n[1] = &nodes[1][0];
n[2] = &nodes[2][0];
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMemArray.hxx"
-using namespace std;
using namespace ParaMEDMEM;
MEDCouplingUMesh *MEDCouplingBasicsTest::build3DSourceMesh_2()
#include <cmath>
#include <functional>
-using namespace std;
using namespace ParaMEDMEM;
void MEDCouplingBasicsTest::testArray()
//test 1 - no copy ownership C++
myCoords=DataArrayDouble::New();
double *tmp=new double[3*nbOfNodes];
- copy(coords,coords+3*nbOfNodes,tmp);
+ std::copy(coords,coords+3*nbOfNodes,tmp);
myCoords->useArray(tmp,true,CPP_DEALLOC,nbOfNodes,3);
mesh->setCoords(myCoords);
myCoords->decrRef();
//test 2 - no copy ownership C
myCoords=DataArrayDouble::New();
tmp=(double *)malloc(3*nbOfNodes*sizeof(double));
- copy(coords,coords+3*nbOfNodes,tmp);
+ std::copy(coords,coords+3*nbOfNodes,tmp);
myCoords->useArray(tmp,true,C_DEALLOC,nbOfNodes,3);
mesh->setCoords(myCoords);
myCoords->decrRef();
myCoords=DataArrayDouble::New();
myCoords->alloc(nbOfNodes,3);
tmp=myCoords->getPointer();
- copy(coords,coords+3*nbOfNodes,tmp);
+ std::copy(coords,coords+3*nbOfNodes,tmp);
// test 3 bis deepcopy
DataArrayDouble *myCoords2=DataArrayDouble::New();
*myCoords2=*myCoords;
fieldOnCells->setArray(array);
tmp=array->getPointer();
array->decrRef();
- fill(tmp,tmp+9*nbOfCells,7.);
+ std::fill(tmp,tmp+9*nbOfCells,7.);
//content of field changed -> declare it.
fieldOnCells->declareAsNew();
fieldOnCells->checkCoherency();
fieldOnCells->setArray(array);
double *tmp=array->getPointer();
array->decrRef();
- fill(tmp,tmp+6,7.);
+ std::fill(tmp,tmp+6,7.);
fieldOnCells->checkCoherency();
//
fieldOnCells->decrRef();
{
DataArrayDouble *array=DataArrayDouble::New();
array->alloc(5,3);
- fill(array->getPointer(),array->getPointer()+5*3,7.);
+ std::fill(array->getPointer(),array->getPointer()+5*3,7.);
CPPUNIT_ASSERT_DOUBLES_EQUAL(7.,array->getIJ(3,2),1e-14);
double *tmp1=array->getPointer();
DataArrayDouble *array2=array->deepCopy();
//
DataArrayInt *array3=DataArrayInt::New();
array3->alloc(5,3);
- fill(array3->getPointer(),array3->getPointer()+5*3,17);
+ std::fill(array3->getPointer(),array3->getPointer()+5*3,17);
CPPUNIT_ASSERT_EQUAL(17,array3->getIJ(3,2));
int *tmp3=array3->getPointer();
DataArrayInt *array4=array3->deepCopy();
#include <cmath>
#include <functional>
-using namespace std;
using namespace ParaMEDMEM;
void MEDCouplingBasicsTest::test2DInterpP0P0_1()
MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation2D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
INTERP_KERNEL::IntersectionType types[3]={INTERP_KERNEL::Triangulation, INTERP_KERNEL::Convex, INTERP_KERNEL::Geometric2D};
for(int i=0;i<3;i++)
{
MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation2D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
//
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation2D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
//
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation2D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
//
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation2D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
//
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation2D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
INTERP_KERNEL::IntersectionType types[2]={INTERP_KERNEL::Triangulation, INTERP_KERNEL::Geometric2D};
for(int i=0;i<2;i++)
{
MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation2D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P1");
MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation2D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P1");
MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation2D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
INTERP_KERNEL::IntersectionType types[2]={INTERP_KERNEL::Triangulation, INTERP_KERNEL::Geometric2D};
for(int i=0;i<2;i++)
{
MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation2D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P0");
MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation2D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P0");
MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation2D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
INTERP_KERNEL::IntersectionType types[2]={INTERP_KERNEL::Triangulation, INTERP_KERNEL::Geometric2D};
for(int i=0;i<2;i++)
{
MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation2D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P1");
MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3DSurf myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
INTERP_KERNEL::IntersectionType types[3]={INTERP_KERNEL::Triangulation, INTERP_KERNEL::Geometric2D};
for(int i=0;i<2;i++)
{
MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3DSurf myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3DSurf myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
INTERP_KERNEL::IntersectionType types[2]={INTERP_KERNEL::Triangulation, INTERP_KERNEL::Geometric2D};
for(int i=0;i<2;i++)
{
MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3DSurf myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P1");
MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3DSurf myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
INTERP_KERNEL::IntersectionType types[2]={INTERP_KERNEL::Triangulation, INTERP_KERNEL::Geometric2D};
for(int i=0;i<2;i++)
{
MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3DSurf myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P0");
MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3DSurf myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
INTERP_KERNEL::IntersectionType types[2]={INTERP_KERNEL::Triangulation, INTERP_KERNEL::Geometric2D};
for(int i=0;i<2;i++)
{
MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3DSurf myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P1");
MEDCouplingNormalizedUnstructuredMesh<3,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3DSurf myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.setIntersectionType(INTERP_KERNEL::Triangulation);
{
void MEDCouplingBasicsTest::test3DSurfInterpP0P0_3()
{
INTERP_KERNEL::Interpolation3DSurf myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
double vecTrans[3]={0.,0.,1.e-10};
double vec[3]={0.,-1.,0.};
double pt[3]={-0.3,-0.3,5.e-11};
MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
CPPUNIT_ASSERT_EQUAL(8,(int)res.size());
MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P1");
CPPUNIT_ASSERT_EQUAL(9,(int)res.size());
MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P1");
MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P0");
CPPUNIT_ASSERT_EQUAL(8,(int)res.size());
MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P0");
MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P1");
CPPUNIT_ASSERT_EQUAL(8,(int)res.size());
MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P1");
MEDCouplingNormalizedUnstructuredMesh<2,2> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation2D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
//clean up
CPPUNIT_ASSERT_THROW( sourceWrapper.nbCellsAlongAxis(3), INTERP_KERNEL::Exception);
INTERP_KERNEL::InterpolationCC myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
CPPUNIT_ASSERT_EQUAL(8,int( res.size()));
CPPUNIT_ASSERT_EQUAL(8,int( res[0].size()));
const double precis = 1e-7;
- set<double> vals;
+ std::set<double> vals;
double sum = 0;
for ( int i = 0; i < (int)res.size(); ++i )
- for ( map<int,double>::iterator s_v = res[i].begin(); s_v != res[i].end(); ++s_v)
+ for ( std::map<int,double>::iterator s_v = res[i].begin(); s_v != res[i].end(); ++s_v)
{
sum += s_v->second;
double vvv;
//cout << "tgt: " << i << " src: " << s_v->first << " - w: " << s_v->second << endl;
CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, sum, precis );
- set<double>::iterator v = vals.begin();
+ std::set<double>::iterator v = vals.begin();
CPPUNIT_ASSERT_EQUAL( 4, int( vals.size()) );
CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.00462963, *v++, precis );
CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.00925926, *v++, precis );
MEDCouplingNormalizedCartesianMesh<1> sourceWrapper(meshC);
MEDCouplingNormalizedUnstructuredMesh<1,1> targetWrapper(meshU);
INTERP_KERNEL::InterpolationCU myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
const double precis = 1e-13;
myInterpolator.setPrecision(precis);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
-// cout.precision(18);
+// std::cout.precision(18);
// for ( int i = 0; i < (int)res.size(); ++i )
-// for ( map<int,double>::iterator s_v = res[i].begin(); s_v != res[i].end(); ++s_v)
+// for ( std::map<int,double>::iterator s_v = res[i].begin(); s_v != res[i].end(); ++s_v)
// {
-// cout << "CPPUNIT_ASSERT_DOUBLES_EQUAL( "<<s_v->second<<" ,res["<<i<<"]["<<s_v->first<<"],precis);"<<endl;
+// std::cout << "CPPUNIT_ASSERT_DOUBLES_EQUAL( "<<s_v->second<<" ,res["<<i<<"]["<<s_v->first<<"],precis);"<<std::endl;
// }
double sum = sumAll(res);
MEDCouplingNormalizedCartesianMesh<2> sourceWrapper(meshC);
MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(meshU);
INTERP_KERNEL::InterpolationCU myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0972222 ,res[4][2],precis);
CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0138889 ,res[4][5],precis);
- vector<map<int,double> > resRev;
+ std::vector<std::map<int,double> > resRev;
myInterpolator.interpolateMeshesRev(targetWrapper,sourceWrapper,resRev,"P0P0");
CPPUNIT_ASSERT_DOUBLES_EQUAL( res[0][0] ,resRev[0][0],precis);
MEDCouplingNormalizedCartesianMesh<3> sourceWrapper(meshC);
MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(meshU);
INTERP_KERNEL::InterpolationCU myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
const double precis = 1e-13;
myInterpolator.setPrecision(precis);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
//
MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation2D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
CPPUNIT_ASSERT_EQUAL(5,myInterpolator.toIntegralUniform(targetWrapper,res,"P0"));
CPPUNIT_ASSERT_EQUAL(1,(int)res.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.25,res[0][0],1e-12);
MEDCouplingUMesh *targetMesh=build3DSurfTargetMesh_1();
INTERP_KERNEL::Interpolation3DSurf myInterpolator;
MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh);
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
CPPUNIT_ASSERT_EQUAL(5,myInterpolator.toIntegralUniform(targetWrapper,res,"P0"));
CPPUNIT_ASSERT_EQUAL(1,(int)res.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.25*sqrt(2.),res[0][0],1e-12);
MEDCouplingUMesh *targetMesh=build3DTargetMesh_1();
INTERP_KERNEL::Interpolation3D myInterpolator;
MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh);
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
CPPUNIT_ASSERT_EQUAL(8,myInterpolator.toIntegralUniform(targetWrapper,res,"P0"));
CPPUNIT_ASSERT_EQUAL(1,(int)res.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(125000.,res[0][0],1e-6);
//
MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation2D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
CPPUNIT_ASSERT_EQUAL(4,myInterpolator.toIntegralUniform(targetWrapper,res,"P1"));
CPPUNIT_ASSERT_EQUAL(1,(int)res.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.33333333333333331,res[0][0],1e-12);
//
MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(sourceMesh);
INTERP_KERNEL::Interpolation3D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
CPPUNIT_ASSERT_EQUAL(9,myInterpolator.toIntegralUniform(targetWrapper,res,"P1"));
CPPUNIT_ASSERT_EQUAL(1,(int)res.size());
CPPUNIT_ASSERT_DOUBLES_EQUAL(833333.333333333,res[0][0],1e-6);
MEDCouplingNormalizedUnstructuredMesh<2,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation2D myInterpolator;
myInterpolator.setP1P0BaryMethod(true);
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
INTERP_KERNEL::IntersectionType types[2]={INTERP_KERNEL::Triangulation, INTERP_KERNEL::Geometric2D};
for(int i=0;i<2;i++)
{
MEDCouplingNormalizedUnstructuredMesh<3,2> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3DSurf myInterpolator;
myInterpolator.setP1P0BaryMethod(true);
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
INTERP_KERNEL::IntersectionType types[2]={INTERP_KERNEL::Triangulation, INTERP_KERNEL::Geometric2D};
for(int i=0;i<2;i++)
{
MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3D myInterpolator;
myInterpolator.setP1P0BaryMethod(true);
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P0");
CPPUNIT_ASSERT_EQUAL(5,(int)res.size());
MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh);
INTERP_KERNEL::Interpolation3D myInterpolator;
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.setPrecision(1e-12);
myInterpolator.setIntersectionType(INTERP_KERNEL::PointLocator);
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
myInterpolator.setPrecision(precis);
// P0P0
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
CPPUNIT_ASSERT_EQUAL( 3, int( res.size()) );
CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.5, res[0][0], precis);
INTERP_KERNEL::Interpolation2DCurve myInterpolator;
const double precis = 1e-13;
myInterpolator.setPrecision(precis);
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
CPPUNIT_ASSERT_EQUAL( 2, int( res.size()) );
const double precis = 1e-13;
myInterpolator.setPrecision(precis);
myInterpolator.setMedianPlane(1.);// median line on target
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P0");
double tolInters = myInterpolator.getBoundingBoxAdjustmentAbs() * sqrt(2.);
INTERP_KERNEL::Interpolation2DCurve myInterpolator;
const double precis = 1e-13;
myInterpolator.setPrecision(precis);
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P0P1");
const double len1 = 1., len0 = sqrt(2.);
INTERP_KERNEL::Interpolation2DCurve myInterpolator;
const double precis = 1e-13;
myInterpolator.setPrecision(precis);
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P0");
const double len1 = 1., len0 = sqrt(2.);
INTERP_KERNEL::Interpolation2DCurve myInterpolator;
const double precis = 1e-13;
myInterpolator.setPrecision(precis);
- vector<map<int,double> > res;
+ std::vector<std::map<int,double> > res;
myInterpolator.interpolateMeshes(sourceWrapper,targetWrapper,res,"P1P1");
const double len1 = 1., len0 = sqrt(2.);
#include <cmath>
-using namespace std;
using namespace ParaMEDMEM;
void MEDCouplingRemapperTest::test2DInterpP0P0_1()