From 2f1259d5d080377c3db4111f84e33808b9614975 Mon Sep 17 00:00:00 2001 From: vbd Date: Mon, 20 Oct 2008 07:37:39 +0000 Subject: [PATCH] adding tests --- .../Test/InterpolationOptionsTest.cxx | 61 +++++++++++++++++++ .../Test/InterpolationOptionsTest.hxx | 42 +++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 src/INTERP_KERNEL/Test/InterpolationOptionsTest.cxx create mode 100644 src/INTERP_KERNEL/Test/InterpolationOptionsTest.hxx diff --git a/src/INTERP_KERNEL/Test/InterpolationOptionsTest.cxx b/src/INTERP_KERNEL/Test/InterpolationOptionsTest.cxx new file mode 100644 index 000000000..7db73d2dd --- /dev/null +++ b/src/INTERP_KERNEL/Test/InterpolationOptionsTest.cxx @@ -0,0 +1,61 @@ +#include "InterpolationOptionsTest.hxx" +#include "MEDNormalizedUnstructuredMesh.hxx" +#include "Interpolation2D.hxx" +#include +#include + +namespace INTERP_TEST +{ + + + void InterpolationOptionsTest::setUp() + { + } + + + void InterpolationOptionsTest::tearDown() + { + } + + /** + * Test that creates a tree in 2D and check that + * the results are correct in three + * cases : + * a non matching search + * a standard case + * a bbox overlapping the bboxes of the tree + */ + void InterpolationOptionsTest::test_InterpolationOptions() { + string sourcename=getenv("MED_ROOT_DIR"); + sourcename +="/share/salome/resources/med/square1.med"; + MEDMEM::MESH source_mesh (MED_DRIVER,sourcename,"Mesh_2"); + + string targetname=getenv("MED_ROOT_DIR"); + targetname +="/share/salome/resources/med/square2.med"; + MEDMEM::MESH target_mesh (MED_DRIVER,targetname,"Mesh_3"); + + MEDMEM::SUPPORT source_support(&source_mesh,"on All support"); + MEDMEM::FIELD source_field(&source_support,1); + double* value=const_cast(source_field.getValue()); + for (int i=0; i target_field(&target_support,1); + double* targetvalue=const_cast(target_field.getValue()); + for (int i=0; i wrap_source_mesh(&source_mesh); + MEDNormalizedUnstructuredMesh<2,2> wrap_target_mesh(&target_mesh); + // Go for interpolation... + INTERP_KERNEL::Interpolation2D myInterpolator; + //optionnal call to parametrize your interpolation. First precision, tracelevel, intersector wanted. + myInterpolator.setPrecision(1e-7); + myInterpolator.setPrintLevel(1); + } + + +} diff --git a/src/INTERP_KERNEL/Test/InterpolationOptionsTest.hxx b/src/INTERP_KERNEL/Test/InterpolationOptionsTest.hxx new file mode 100644 index 000000000..07b94eb09 --- /dev/null +++ b/src/INTERP_KERNEL/Test/InterpolationOptionsTest.hxx @@ -0,0 +1,42 @@ +#ifndef __TU_INTERPOLATIONOPTIONS_HXX__ +#define __TU_INTERPOLATIONOPTIONS_HXX__ + +#include +#include "../InterpolationOptions.hxx" +#include "MEDMEM_Field.hxx" + +namespace INTERP_TEST +{ + + /** + * \brief Test suite testing some of the low level methods of TransformedTriangle. + * + */ + class InterpolationOptionsTest : public CppUnit::TestFixture + { + + CPPUNIT_TEST_SUITE( InterpolationOptionsTest ); + CPPUNIT_TEST( test_InterpolationOptions ); + CPPUNIT_TEST_SUITE_END(); + + + public: + void setUp(); + + void tearDown(); + + // tests + void test_InterpolationOptions(); + + private: + + }; + + + + +} + + + +#endif -- 2.39.2