X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParaMEDMEMTest%2FParaMEDMEMTest_NonCoincidentDEC.cxx;h=e3926ce722ca56e21cf6f92b862af5230cbe8f40;hb=8210342873f7be4a650c18c7875cc4ec2a8e4d86;hp=bfdd2a05d18c7899a2dcdfc8b3c82b2405f970e2;hpb=1123dccd6613b2e8abba35182759d5c4a11ecc8d;p=tools%2Fmedcoupling.git diff --git a/src/ParaMEDMEMTest/ParaMEDMEMTest_NonCoincidentDEC.cxx b/src/ParaMEDMEMTest/ParaMEDMEMTest_NonCoincidentDEC.cxx index bfdd2a05d..e3926ce72 100644 --- a/src/ParaMEDMEMTest/ParaMEDMEMTest_NonCoincidentDEC.cxx +++ b/src/ParaMEDMEMTest/ParaMEDMEMTest_NonCoincidentDEC.cxx @@ -1,4 +1,4 @@ -// 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 @@ -33,7 +33,7 @@ #include "ParaFIELD.hxx" #include "UnstructuredParaSUPPORT.hxx" #include "ICoCoMEDField.hxx" - + #include // use this define to enable lines, execution of which leads to Segmentation Fault @@ -44,9 +44,9 @@ using namespace std; -using namespace ParaMEDMEM; +using namespace MEDCoupling; using namespace MEDMEM; - + /* * Check methods defined in InterpKernelDEC.hxx * @@ -66,30 +66,30 @@ void ParaMEDMEMTest::testNonCoincidentDEC_2D() //the test is meant to run on five processors if (size !=5) return ; - - testNonCoincidentDEC( "/share/salome/resources/med/square1_split", + + testNonCoincidentDEC( "square1_split", "Mesh_2", - "/share/salome/resources/med/square2_split", + "square2_split", "Mesh_3", 3, 1e-6); -} +} void ParaMEDMEMTest::testNonCoincidentDEC_3D() { int size; MPI_Comm_size(MPI_COMM_WORLD,&size); - + //the test is meant to run on five processors if (size !=4) return ; - - testNonCoincidentDEC( "/share/salome/resources/med/blade_12000_split2", + + testNonCoincidentDEC( "blade_12000_split2", "Mesh_1", - "/share/salome/resources/med/blade_3000_split2", + "blade_3000_split2", "Mesh_1", 2, 1e4); -} +} void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1, const string& meshname1, @@ -102,41 +102,41 @@ void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1, int rank; MPI_Comm_size(MPI_COMM_WORLD,&size); MPI_Comm_rank(MPI_COMM_WORLD,&rank); - + set self_procs; set procs_source; set procs_target; - + for (int i=0; i* field; - ParaMEDMEM::ParaMESH* paramesh; - ParaMEDMEM::ParaFIELD* parafield; - + MEDCoupling::ParaMESH* paramesh; + MEDCoupling::ParaFIELD* parafield; + string filename_xml1 = getResourceFile(filename1); - string filename_xml2 = getResourceFile(filename2); + string filename_xml2 = getResourceFile(filename2); //string filename_seq_wr = makeTmpFile(""); //string filename_seq_med = makeTmpFile("myWrField_seq_pointe221.med"); - + // To remove tmp files from disk ParaMEDMEMTest_TmpFilesRemover aRemover; //aRemover.Register(filename_seq_wr); @@ -146,22 +146,22 @@ void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1, if (source_group->containsMyRank()) { string master = filename_xml1; - + ostringstream strstream; strstream <getNumberOfElements(MED_EN::MED_ALL_ELEMENTS); double * value= new double[nb_local]; for(int ielem=0; ielemgetField()->setValue(value); icocofield=new ICoCo::MEDField(paramesh,parafield); - + dec.attachLocalField(icocofield); delete [] value; } - + //loading the geometry for the target group if (target_group->containsMyRank()) { @@ -182,34 +182,34 @@ void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1, strstream << master<<(rank-nproc_source+1)<<".med"; ostringstream meshname ; meshname<< meshname2<<"_"<getNumberOfElements(MED_EN::MED_ALL_ELEMENTS); double * value= new double[nb_local]; for(int ielem=0; ielemgetField()->setValue(value); icocofield=new ICoCo::MEDField(paramesh,parafield); - + dec.attachLocalField(icocofield); delete [] value; } - - - //attaching a DEC to the source group + + + //attaching a DEC to the source group double field_before_int; double field_after_int; - + if (source_group->containsMyRank()) - { + { field_before_int = parafield->getVolumeIntegral(1); MPI_Bcast(&field_before_int, 1,MPI_DOUBLE, 0,MPI_COMM_WORLD); dec.synchronize(); @@ -218,29 +218,29 @@ void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1, dec.sendData(); // paramesh->write(MED_DRIVER,"./sourcesquarenc"); - //parafield->write(MED_DRIVER,"./sourcesquarenc","boundary"); - - + //parafield->write(MED_DRIVER,"./sourcesquarenc","boundary"); + + } - + //attaching a DEC to the target group if (target_group->containsMyRank()) { MPI_Bcast(&field_before_int, 1,MPI_DOUBLE, 0,MPI_COMM_WORLD); - + dec.synchronize(); dec.setOption("ForcedRenormalization",false); dec.recvData(); //paramesh->write(MED_DRIVER, "./targetsquarenc"); //parafield->write(MED_DRIVER, "./targetsquarenc", "boundary"); field_after_int = parafield->getVolumeIntegral(1); - + } MPI_Bcast(&field_before_int,1,MPI_DOUBLE,0,MPI_COMM_WORLD); MPI_Bcast(&field_after_int, 1,MPI_DOUBLE, size-1,MPI_COMM_WORLD); - + CPPUNIT_ASSERT_DOUBLES_EQUAL(field_before_int, field_after_int, epsilon); - + delete source_group; delete target_group; delete self_group; @@ -251,6 +251,6 @@ void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1, delete parasupport; delete mesh; MPI_Barrier(MPI_COMM_WORLD); - + } #endif