-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
{
public:
static const int MY_SPACEDIM=3;
+ static const int MY_MESHDIM=3;
+ static const INTERP_KERNEL::NumberingPolicy My_numPol=INTERP_KERNEL::ALL_C_MODE;
typedef int MyConnType;
};
// here the max 3D distance is 1e-5 > 1e-6 so 1 is expected
std::copy(coo,coo+9,tmp0);
std::copy(coo2,coo2+9,tmp1);
- ret=INTERP_KERNEL::PlanarIntersector<MyMeshType,MyMatrixType>::projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,0.5,true);
+ ret=INTERP_KERNEL::PlanarIntersector<MyMeshType,MyMatrixType>::Projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,-1.,0.5,true);
CPPUNIT_ASSERT_EQUAL(1,ret);
const double expected0[9]={0.,0.,0.,1.,0.,0.,0.,1.,0.};
for(int i=0;i<9;i++)
// here the max 3D distance is 1e-8 < 1e-6 so 0 is expected
std::copy(coo,coo+9,tmp0);
std::copy(coo2,coo2+9,tmp1);
- ret=INTERP_KERNEL::PlanarIntersector<MyMeshType,MyMatrixType>::projection(tmp0,tmp1,3,3,1e-2,1e-8/* <- */,0.5,true);
+ ret=INTERP_KERNEL::PlanarIntersector<MyMeshType,MyMatrixType>::Projection(tmp0,tmp1,3,3,1e-2,1e-8/* <- */,-1.,0.5,true);
CPPUNIT_ASSERT_EQUAL(0,ret);
// here testing when max 3D distance is 1e-5 > 1e-6 with inverted cells
std::copy(coo,coo+9,tmp0);
std::copy(coo2,coo2+3,tmp1+6); std::copy(coo2+3,coo2+6,tmp1+3); std::copy(coo2+6,coo2+9,tmp1);
- ret=INTERP_KERNEL::PlanarIntersector<MyMeshType,MyMatrixType>::projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,0.5,true);
+ ret=INTERP_KERNEL::PlanarIntersector<MyMeshType,MyMatrixType>::Projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,-1.,0.5,true);
CPPUNIT_ASSERT_EQUAL(-1,ret);
const double expected1[9]={-0.7071067811865476,-0.7071067811865476,0.,0.,-1.4142135623730951,0.,-1.4142135623730951,-1.4142135623730951,0.};
const double expected2[9]={-1.4142135623730951,-1.4142135623730951,0.,0.,-1.4142135623730951,0.,-0.7071067811865476,-0.7071067811865476,0.};
void INTERP_TEST::ThreeDSurfProjectionTest::test2()
{// here the two triangles have their center of inertia very close (eps) but the angle between the two planes is "big"
//coo=DataArrayDouble([0.,0.,0.,1.,0.,0.,0.,1.,0.],3,3)
- //coocpy=coo.deepCpy()
+ //coocpy=coo.deepCopy()
//MEDCouplingPointSet.Rotate3DAlg([0.,0.,0.],[-1,-1.,0.],pi/3,coocpy)
//coocpy+=[eps*sqrt(3)/2,eps/2,eps*0.]
//
// here the max 3D distance is 1e-5 > 1e-6 so 1 is expected
std::copy(coo,coo+9,tmp0);
std::copy(coo2,coo2+9,tmp1);
- ret=INTERP_KERNEL::PlanarIntersector<MyMeshType,MyMatrixType>::projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,0.5,true);
+ ret=INTERP_KERNEL::PlanarIntersector<MyMeshType,MyMatrixType>::Projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,-1.,0.5,true);
CPPUNIT_ASSERT_EQUAL(1,ret);
// here the max 3D distance is 1e-8 < 1e-6 so 0 is expected
std::copy(coo,coo+9,tmp0);
std::copy(coo2,coo2+9,tmp1);
- ret=INTERP_KERNEL::PlanarIntersector<MyMeshType,MyMatrixType>::projection(tmp0,tmp1,3,3,1e-2,1e-8/* <- */,0.5,true);
+ ret=INTERP_KERNEL::PlanarIntersector<MyMeshType,MyMatrixType>::Projection(tmp0,tmp1,3,3,1e-2,1e-8/* <- */,-1.,0.5,true);
+ CPPUNIT_ASSERT_EQUAL(0,ret);
+ // again max 3D distance is 1e-5 > 1e-6 so 1 is expected
+ std::copy(coo,coo+9,tmp0);
+ std::copy(coo2,coo2+9,tmp1);
+ ret=INTERP_KERNEL::PlanarIntersector<MyMeshType,MyMatrixType>::Projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,-1.,0.5,true);
+ CPPUNIT_ASSERT_EQUAL(1,ret);
+ // again max 3D distance is 1e-5 > 1e-6 but minDot set to 0.8. 0 expected. because the angle is pi/4 so cos(pi/3) > 0.8
+ std::copy(coo,coo+9,tmp0);
+ std::copy(coo2,coo2+9,tmp1);
+ ret=INTERP_KERNEL::PlanarIntersector<MyMeshType,MyMatrixType>::Projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,0.8/* <- */,0.5,true);
+ CPPUNIT_ASSERT_EQUAL(0,ret);
+ // again max 3D distance is 1e-5 > 1e-6 but minDot set to 0.7. 1 expected. because the angle is pi/4 so cos(pi/3) < 0.49
+ std::copy(coo,coo+9,tmp0);
+ std::copy(coo2,coo2+9,tmp1);
+ ret=INTERP_KERNEL::PlanarIntersector<MyMeshType,MyMatrixType>::Projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,0.49/* <- */,0.5,true);
+ CPPUNIT_ASSERT_EQUAL(1,ret);
+ // again max 3D distance is 1e-5 > 1e-6 but minDot set to 0.7. 0 expected. because the angle is pi/4 so cos(pi/3) > 0.51
+ std::copy(coo,coo+9,tmp0);
+ std::copy(coo2,coo2+9,tmp1);
+ ret=INTERP_KERNEL::PlanarIntersector<MyMeshType,MyMatrixType>::Projection(tmp0,tmp1,3,3,1e-2,1e-5/* <- */,0.51/* <- */,0.5,true);
CPPUNIT_ASSERT_EQUAL(0,ret);
//
delete [] tmp0;