-// Copyright (C) 2007-2015 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
#include "ICoCoMEDField.hxx"
#include "ParaMEDLoader.hxx"
#include "MEDLoader.hxx"
+#include "TestInterpKernelUtils.hxx"
#include <string>
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void ParaMEDMEMTest::testInterpKernelDEC_2D()
{
procs_target.insert(i);
self_procs.insert(rank);
//
- ParaMEDMEM::MEDCouplingUMesh *mesh=0;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::ParaFIELD *parafieldP0=0;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafieldP0=0;
//
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
//
- ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//
MPI_Barrier(MPI_COMM_WORLD);
if(source_group->containsMyRank())
myCoords->decrRef();
}
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
double *valueP0=parafieldP0->getField()->getArray()->getPointer();
- parafieldP0->getField()->setNature(ConservativeVolumic);
+ parafieldP0->getField()->setNature(IntensiveMaximum);
if(rank==0)
{
valueP0[0]=7.; valueP0[1]=8.;
myCoords->decrRef();
paramesh=new ParaMESH(mesh,*target_group,targetMeshName);
}
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafieldP0->getField()->setNature(ConservativeVolumic);
+ parafieldP0->getField()->setNature(IntensiveMaximum);
}
// test 1
- ParaMEDMEM::InterpKernelDEC dec(*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec(*source_group,*target_group);
if (source_group->containsMyRank())
{
dec.setMethod("P0");
procs_target.insert(i);
self_procs.insert(rank);
//
- ParaMEDMEM::MEDCouplingUMesh *mesh=0;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::ParaFIELD *parafieldP0=0;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafieldP0=0;
//
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
//
- ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//
MPI_Barrier(MPI_COMM_WORLD);
if(source_group->containsMyRank())
myCoords->decrRef();
}
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
double *valueP0=parafieldP0->getField()->getArray()->getPointer();
- parafieldP0->getField()->setNature(ConservativeVolumic);
+ parafieldP0->getField()->setNature(IntensiveMaximum);
if(rank==0)
{
valueP0[0]=7.; valueP0[1]=8.;
myCoords->decrRef();
paramesh=new ParaMESH(mesh,*target_group,targetMeshName);
}
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafieldP0->getField()->setNature(ConservativeVolumic);
+ parafieldP0->getField()->setNature(IntensiveMaximum);
}
// test 1
- ParaMEDMEM::InterpKernelDEC dec(*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec(*source_group,*target_group);
if (source_group->containsMyRank())
{
dec.setMethod("P0");
procs_target.insert(i);
self_procs.insert(rank);
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
- ParaMEDMEM::ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ParaMEDMEM::ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ParaMEDMEM::ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ MEDCoupling::ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ MEDCoupling::ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ MEDCoupling::ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//loading the geometry for the source group
- ParaMEDMEM::InterpKernelDEC dec (*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec (*source_group,*target_group);
- ParaMEDMEM::MEDCouplingUMesh* mesh;
- ParaMEDMEM::ParaMESH* paramesh;
- ParaMEDMEM::ParaFIELD* parafield;
+ MEDCoupling::MEDCouplingUMesh* mesh;
+ MEDCoupling::ParaMESH* paramesh;
+ MEDCoupling::ParaFIELD* parafield;
ICoCo::MEDField* icocofield ;
- string filename_xml1 = getResourceFile("square1_split");
- string filename_xml2 = getResourceFile("square2_split");
+ string filename_xml1 = "square1_split";
+ string filename_xml2 = "square2_split";
//string filename_seq_wr = makeTmpFile("");
//string filename_seq_med = makeTmpFile("myWrField_seq_pointe221.med");
ostringstream strstream;
strstream <<master<<rank+1<<".med";
+ string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_2_"<< rank+1;
- mesh=MEDLoader::ReadUMeshFromFile(strstream.str().c_str(),meshname.str().c_str(),0);
+ mesh=ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
paramesh=new ParaMESH (mesh,*source_group,"source mesh");
- // ParaMEDMEM::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT( support,*source_group);
- ParaMEDMEM::ComponentTopology comptopo;
+ // MEDCoupling::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT( support,*source_group);
+ MEDCoupling::ComponentTopology comptopo;
if(srcM=="P0")
{
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);
}
else
parafield = new ParaFIELD(ON_NODES,NO_TIME,paramesh, comptopo);
string master= filename_xml2;
ostringstream strstream;
strstream << master<<(rank-nproc_source+1)<<".med";
+ string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_3_"<<rank-nproc_source+1;
- mesh = MEDLoader::ReadUMeshFromFile(strstream.str().c_str(),meshname.str().c_str(),0);
+ mesh = ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
paramesh=new ParaMESH (mesh,*target_group,"target mesh");
- // ParaMEDMEM::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT(support,*target_group);
- ParaMEDMEM::ComponentTopology comptopo;
+ // MEDCoupling::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT(support,*target_group);
+ MEDCoupling::ComponentTopology comptopo;
if(targetM=="P0")
{
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);
}
else
parafield = new ParaFIELD(ON_NODES,NO_TIME,paramesh, comptopo);
ostringstream filename;
filename<<"./sourcesquareb_"<<source_group->myRank()+1;
aRemover.Register(filename.str().c_str());
- //MEDLoader::WriteField("./sourcesquareb",parafield->getField());
+ //WriteField("./sourcesquareb",parafield->getField());
dec.recvData();
cout <<"writing"<<endl;
ParaMEDLoader::WriteParaMesh("./sourcesquare",paramesh);
if (source_group->myRank()==0)
aRemover.Register("./sourcesquare");
- //MEDLoader::WriteField("./sourcesquare",parafield->getField());
+ //WriteField("./sourcesquare",parafield->getField());
filename<<"./sourcesquare_"<<source_group->myRank()+1;
dec.recvData();
ParaMEDLoader::WriteParaMesh("./targetsquareb",paramesh);
- //MEDLoader::WriteField("./targetsquareb",parafield->getField());
+ //WriteField("./targetsquareb",parafield->getField());
if (target_group->myRank()==0)
aRemover.Register("./targetsquareb");
ostringstream filename;
aRemover.Register(filename.str().c_str());
dec.sendData();
ParaMEDLoader::WriteParaMesh("./targetsquare",paramesh);
- //MEDLoader::WriteField("./targetsquare",parafield->getField());
+ //WriteField("./targetsquare",parafield->getField());
if (target_group->myRank()==0)
aRemover.Register("./targetsquareb");
procs_target.insert(i);
self_procs.insert(rank);
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
- ParaMEDMEM::ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ParaMEDMEM::ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ParaMEDMEM::ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ MEDCoupling::ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ MEDCoupling::ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ MEDCoupling::ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//loading the geometry for the source group
- ParaMEDMEM::InterpKernelDEC dec (*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec (*source_group,*target_group);
- ParaMEDMEM::MEDCouplingUMesh* mesh;
- ParaMEDMEM::MEDCouplingFieldDouble* mcfield;
+ MEDCoupling::MEDCouplingUMesh* mesh;
+ MEDCoupling::MEDCouplingFieldDouble* mcfield;
- string filename_xml1 = getResourceFile("square1_split");
- string filename_xml2 = getResourceFile("square2_split");
+ string filename_xml1 = "square1_split";
+ string filename_xml2 = "square2_split";
// To remove tmp files from disk
ParaMEDMEMTest_TmpFilesRemover aRemover;
ostringstream strstream;
strstream <<master<<rank+1<<".med";
+ string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_2_"<< rank+1;
- mesh=MEDLoader::ReadUMeshFromFile(strstream.str().c_str(),meshname.str().c_str(),0);
- ParaMEDMEM::ComponentTopology comptopo;
+ mesh=ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
+ MEDCoupling::ComponentTopology comptopo;
if(srcM=="P0")
{
mcfield = MEDCouplingFieldDouble::New(ON_CELLS,NO_TIME);
array->alloc(mcfield->getNumberOfTuples(),1);
mcfield->setArray(array);
array->decrRef();
- mcfield->setNature(ConservativeVolumic);
+ mcfield->setNature(IntensiveMaximum);
}
else
{
string master= filename_xml2;
ostringstream strstream;
strstream << master<<(rank-nproc_source+1)<<".med";
+ string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_3_"<<rank-nproc_source+1;
- mesh = MEDLoader::ReadUMeshFromFile(strstream.str().c_str(),meshname.str().c_str(),0);
- ParaMEDMEM::ComponentTopology comptopo;
+ mesh = ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
+ MEDCoupling::ComponentTopology comptopo;
if(targetM=="P0")
{
mcfield = MEDCouplingFieldDouble::New(ON_CELLS,NO_TIME);
array->alloc(mcfield->getNumberOfTuples(),1);
mcfield->setArray(array);
array->decrRef();
- mcfield->setNature(ConservativeVolumic);
+ mcfield->setNature(IntensiveMaximum);
}
else
{
procs_target.insert(i);
self_procs.insert(rank);
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
- ParaMEDMEM::ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ParaMEDMEM::ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ParaMEDMEM::ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ MEDCoupling::ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ MEDCoupling::ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ MEDCoupling::ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//loading the geometry for the source group
- ParaMEDMEM::InterpKernelDEC dec (*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec (*source_group,*target_group);
- ParaMEDMEM::MEDCouplingUMesh* mesh;
- ParaMEDMEM::ParaMESH* paramesh;
- ParaMEDMEM::ParaFIELD* parafield;
+ MEDCoupling::MEDCouplingUMesh* mesh;
+ MEDCoupling::ParaMESH* paramesh;
+ MEDCoupling::ParaFIELD* parafield;
ICoCo::MEDField* icocofield ;
char * tmp_dir_c = getenv("TMP");
tmp_dir = string(tmp_dir_c);
else
tmp_dir = "/tmp";
- string filename_xml1 = getResourceFile("Mesh3D_10_2d");
- string filename_xml2 = getResourceFile("Mesh3D_11");
+ string filename_xml1 = "Mesh3D_10_2d";
+ string filename_xml2 = "Mesh3D_11";
//string filename_seq_wr = makeTmpFile("");
//string filename_seq_med = makeTmpFile("myWrField_seq_pointe221.med");
ostringstream strstream;
strstream <<master<<rank+1<<".med";
+ std::string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_3_"<< rank+1;
- mesh=MEDLoader::ReadUMeshFromFile(strstream.str().c_str(),meshname.str().c_str(),0);
+ mesh=ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
paramesh=new ParaMESH (mesh,*source_group,"source mesh");
- // ParaMEDMEM::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT( support,*source_group);
- ParaMEDMEM::ComponentTopology comptopo;
+ // MEDCoupling::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT( support,*source_group);
+ MEDCoupling::ComponentTopology comptopo;
if(srcM=="P0")
{
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);
}
else
parafield = new ParaFIELD(ON_NODES,NO_TIME,paramesh, comptopo);
string master= filename_xml2;
ostringstream strstream;
strstream << master << ".med";
+ std::string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_6";
- mesh = MEDLoader::ReadUMeshFromFile(strstream.str().c_str(),meshname.str().c_str(),0);
+ mesh = ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
paramesh=new ParaMESH (mesh,*target_group,"target mesh");
- // ParaMEDMEM::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT(support,*target_group);
- ParaMEDMEM::ComponentTopology comptopo;
+ // MEDCoupling::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT(support,*target_group);
+ MEDCoupling::ComponentTopology comptopo;
if(targetM=="P0")
{
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);
}
else
parafield = new ParaFIELD(ON_NODES,NO_TIME,paramesh, comptopo);
ostringstream filename;
filename<<"./sourcesquareb_"<<source_group->myRank()+1;
aRemover.Register(filename.str().c_str());
- //MEDLoader::WriteField("./sourcesquareb",parafield->getField());
+ //WriteField("./sourcesquareb",parafield->getField());
dec.recvData();
cout <<"writing"<<endl;
ParaMEDLoader::WriteParaMesh("./sourcesquare",paramesh);
if (source_group->myRank()==0)
aRemover.Register("./sourcesquare");
- //MEDLoader::WriteField("./sourcesquare",parafield->getField());
+ //WriteField("./sourcesquare",parafield->getField());
filename<<"./sourcesquare_"<<source_group->myRank()+1;
dec.recvData();
ParaMEDLoader::WriteParaMesh("./targetsquareb",paramesh);
- //MEDLoader::WriteField("./targetsquareb",parafield->getField());
+ //WriteField("./targetsquareb",parafield->getField());
if (target_group->myRank()==0)
aRemover.Register("./targetsquareb");
ostringstream filename;
aRemover.Register(filename.str().c_str());
dec.sendData();
ParaMEDLoader::WriteParaMesh("./targetsquare",paramesh);
- //MEDLoader::WriteField("./targetsquare",parafield->getField());
+ //WriteField("./targetsquare",parafield->getField());
if (target_group->myRank()==0)
aRemover.Register("./targetsquareb");
procs_target.insert(i);
self_procs.insert(rank);
//
- ParaMEDMEM::MEDCouplingUMesh *mesh=0;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::ParaFIELD* parafield=0;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD* parafield=0;
//
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
//
- ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//
MPI_Barrier(MPI_COMM_WORLD);
if(source_group->containsMyRank())
mesh->setCoords(myCoords);
myCoords->decrRef();
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
double *value=parafield->getField()->getArray()->getPointer();
value[0]=34+13*((double)rank);
mesh->setCoords(myCoords);
myCoords->decrRef();
paramesh=new ParaMESH (mesh,*target_group,"target mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
}
//test 1 - Conservative volumic
- ParaMEDMEM::InterpKernelDEC dec(*source_group,*target_group);
- parafield->getField()->setNature(ConservativeVolumic);
+ MEDCoupling::InterpKernelDEC dec(*source_group,*target_group);
+ parafield->getField()->setNature(IntensiveMaximum);
if (source_group->containsMyRank())
{
dec.setMethod("P0");
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[0],res[0],1e-13);
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[1],res[1],1e-13);
}
- //test 2 - Integral
- ParaMEDMEM::InterpKernelDEC dec2(*source_group,*target_group);
- parafield->getField()->setNature(Integral);
+ //test 2 - ExtensiveMaximum
+ MEDCoupling::InterpKernelDEC dec2(*source_group,*target_group);
+ parafield->getField()->setNature(ExtensiveMaximum);
if (source_group->containsMyRank())
{
dec2.setMethod("P0");
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[0],res[0],1e-13);
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[1],res[1],1e-13);
}
- //test 3 - Integral with global constraint
- ParaMEDMEM::InterpKernelDEC dec3(*source_group,*target_group);
- parafield->getField()->setNature(IntegralGlobConstraint);
+ //test 3 - ExtensiveMaximum with global constraint
+ MEDCoupling::InterpKernelDEC dec3(*source_group,*target_group);
+ parafield->getField()->setNature(ExtensiveConservation);
if (source_group->containsMyRank())
{
dec3.setMethod("P0");
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[0],res[0],1e-13);
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[1],res[1],1e-13);
}
- //test 4 - RevIntegral
- ParaMEDMEM::InterpKernelDEC dec4(*source_group,*target_group);
- parafield->getField()->setNature(RevIntegral);
+ //test 4 - IntensiveConservation
+ MEDCoupling::InterpKernelDEC dec4(*source_group,*target_group);
+ parafield->getField()->setNature(IntensiveConservation);
if (source_group->containsMyRank())
{
dec4.setMethod("P0");
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[1],res[1],1e-13);
}
//test 5 - Conservative volumic reversed
- ParaMEDMEM::InterpKernelDEC dec5(*source_group,*target_group);
- parafield->getField()->setNature(ConservativeVolumic);
+ MEDCoupling::InterpKernelDEC dec5(*source_group,*target_group);
+ parafield->getField()->setNature(IntensiveMaximum);
if (source_group->containsMyRank())
{
dec5.setMethod("P0");
res[1]=toSet[1];
dec5.sendData();
}
- //test 6 - Integral reversed
- ParaMEDMEM::InterpKernelDEC dec6(*source_group,*target_group);
- parafield->getField()->setNature(Integral);
+ //test 6 - ExtensiveMaximum reversed
+ MEDCoupling::InterpKernelDEC dec6(*source_group,*target_group);
+ parafield->getField()->setNature(ExtensiveMaximum);
if (source_group->containsMyRank())
{
dec6.setMethod("P0");
res[1]=toSet[1];
dec6.sendData();
}
- //test 7 - Integral with global constraint reversed
- ParaMEDMEM::InterpKernelDEC dec7(*source_group,*target_group);
- parafield->getField()->setNature(IntegralGlobConstraint);
+ //test 7 - ExtensiveMaximum with global constraint reversed
+ MEDCoupling::InterpKernelDEC dec7(*source_group,*target_group);
+ parafield->getField()->setNature(ExtensiveConservation);
if (source_group->containsMyRank())
{
dec7.setMethod("P0");
res[1]=toSet[1];
dec7.sendData();
}
- //test 8 - Integral with RevIntegral reversed
- ParaMEDMEM::InterpKernelDEC dec8(*source_group,*target_group);
- parafield->getField()->setNature(RevIntegral);
+ //test 8 - ExtensiveMaximum with IntensiveConservation reversed
+ MEDCoupling::InterpKernelDEC dec8(*source_group,*target_group);
+ parafield->getField()->setNature(IntensiveConservation);
if (source_group->containsMyRank())
{
dec8.setMethod("P0");
procs_target.insert(i);
self_procs.insert(rank);
//
- ParaMEDMEM::MEDCouplingUMesh *mesh=0;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::ParaFIELD *parafieldP0=0,*parafieldP1=0;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafieldP0=0,*parafieldP1=0;
//
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
//
- ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//
MPI_Barrier(MPI_COMM_WORLD);
if(source_group->containsMyRank())
myCoords->decrRef();
}
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
parafieldP1 = new ParaFIELD(ON_NODES,NO_TIME,paramesh, comptopo);
double *valueP0=parafieldP0->getField()->getArray()->getPointer();
double *valueP1=parafieldP1->getField()->getArray()->getPointer();
- parafieldP0->getField()->setNature(ConservativeVolumic);
- parafieldP1->getField()->setNature(ConservativeVolumic);
+ parafieldP0->getField()->setNature(IntensiveMaximum);
+ parafieldP1->getField()->setNature(IntensiveMaximum);
if(rank==0)
{
valueP0[0]=31.;
paramesh->setNodeGlobal(da);
da->decrRef();
}
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
parafieldP1 = new ParaFIELD(ON_NODES,NO_TIME,paramesh, comptopo);
- parafieldP0->getField()->setNature(ConservativeVolumic);
- parafieldP1->getField()->setNature(ConservativeVolumic);
+ parafieldP0->getField()->setNature(IntensiveMaximum);
+ parafieldP1->getField()->setNature(IntensiveMaximum);
}
// test 1 - P0 P1
- ParaMEDMEM::InterpKernelDEC dec(*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec(*source_group,*target_group);
if (source_group->containsMyRank())
{
dec.setMethod("P0");
for (int i=nproc_source;i<size; i++)
procs_target.insert(i);
//
- ParaMEDMEM::MEDCouplingUMesh *mesh=0;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::ParaFIELD *parafield=0;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafield=0;
//
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
//
- ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//
MPI_Barrier(MPI_COMM_WORLD);
if(source_group->containsMyRank())
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,targetConn+7);
mesh->finishInsertingCells();
}
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);
double *vals=parafield->getField()->getArray()->getPointer();
if(rank==0)
{ vals[0]=7.; vals[1]=8.; }
else
{
mesh=MEDCouplingUMesh::New("an example of -1 D mesh",-1);
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*target_group,"target mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);
}
- ParaMEDMEM::InterpKernelDEC dec(*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec(*source_group,*target_group);
if(source_group->containsMyRank())
{
dec.setMethod("P0");
CPPUNIT_ASSERT_DOUBLES_EQUAL(9.125,res[0],1e-12);
dec.sendData();
}
- ParaMEDMEM::InterpKernelDEC dec2(*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec2(*source_group,*target_group);
dec2.setMethod("P0");
- parafield->getField()->setNature(IntegralGlobConstraint);
+ parafield->getField()->setNature(ExtensiveConservation);
if(source_group->containsMyRank())
{
double *vals=parafield->getField()->getArray()->getPointer();
dec2.sendData();
}
//
- ParaMEDMEM::InterpKernelDEC dec3(*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec3(*source_group,*target_group);
dec3.setMethod("P0");
- parafield->getField()->setNature(Integral);
+ parafield->getField()->setNature(ExtensiveMaximum);
if(source_group->containsMyRank())
{
double *vals=parafield->getField()->getArray()->getPointer();
dec3.sendData();
}
//
- ParaMEDMEM::InterpKernelDEC dec4(*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec4(*source_group,*target_group);
dec4.setMethod("P0");
- parafield->getField()->setNature(RevIntegral);
+ parafield->getField()->setNature(IntensiveConservation);
if(source_group->containsMyRank())
{
double *vals=parafield->getField()->getArray()->getPointer();
procs_source.insert(0);
procs_target.insert(1);
//
- ParaMEDMEM::MEDCouplingUMesh *mesh=0;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::ParaFIELD *parafield=0;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafield=0;
//
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
//
MPI_Barrier(MPI_COMM_WORLD);
double targetCoords[8]={ 0.,0., 1., 0., 0., 1., 1., 1. };
ProcessorGroup* target_group=0;
ProcessorGroup* source_group=0;
//
- ParaMEDMEM::InterpKernelDEC *dec=0;
+ MEDCoupling::InterpKernelDEC *dec=0;
if(rank==0 || rank==1)
{
- target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target,partialComm);
- source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source,partialComm);
+ target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target,partialComm);
+ source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source,partialComm);
if(source_group->containsMyRank())
{
mesh=MEDCouplingUMesh::New();
mesh->allocateCells(1);
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,targetConn);
mesh->finishInsertingCells();
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);
double *vals=parafield->getField()->getArray()->getPointer();
vals[0]=7.;
- dec=new ParaMEDMEM::InterpKernelDEC(*source_group,*target_group);
+ dec=new MEDCoupling::InterpKernelDEC(*source_group,*target_group);
dec->attachLocalField(parafield);
dec->synchronize();
dec->sendData();
mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,targetConn);
mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,targetConn+3);
mesh->finishInsertingCells();
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*target_group,"target mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
- dec=new ParaMEDMEM::InterpKernelDEC(*source_group,*target_group);
+ parafield->getField()->setNature(IntensiveMaximum);
+ dec=new MEDCoupling::InterpKernelDEC(*source_group,*target_group);
dec->attachLocalField(parafield);
dec->synchronize();
dec->recvData();
delete target_group;
delete source_group;
delete dec;
+ if(partialComm != MPI_COMM_NULL)
+ comm.commFree(&partialComm);
+ comm.groupFree(&grp);
+ comm.groupFree(&group_world);
MPI_Barrier(MPI_COMM_WORLD);
}
procs_target.insert(i);
self_procs.insert(rank);
//
- ParaMEDMEM::MEDCouplingUMesh *mesh=0;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::ParaFIELD *parafieldP0=0;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafieldP0=0;
//
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
//
- ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//
MPI_Barrier(MPI_COMM_WORLD);
if(source_group->containsMyRank())
myCoords->decrRef();
//
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
double *valueP0=parafieldP0->getField()->getArray()->getPointer();
- parafieldP0->getField()->setNature(ConservativeVolumic);
+ parafieldP0->getField()->setNature(IntensiveMaximum);
valueP0[0]=7.; valueP0[1]=8.;
}
else
myCoords->decrRef();
paramesh=new ParaMESH(mesh,*target_group,targetMeshName);
}
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafieldP0->getField()->setNature(ConservativeVolumic);
+ parafieldP0->getField()->setNature(IntensiveMaximum);
}
// test 1
- ParaMEDMEM::InterpKernelDEC dec(*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec(*source_group,*target_group);
if (source_group->containsMyRank())
{
dec.setMethod("P0");
procs_target.insert(i);
self_procs.insert(rank);
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
- ParaMEDMEM::ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ParaMEDMEM::ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ParaMEDMEM::ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ MEDCoupling::ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ MEDCoupling::ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ MEDCoupling::ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//loading the geometry for the source group
- ParaMEDMEM::InterpKernelDEC dec (*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec (*source_group,*target_group);
- ParaMEDMEM::MEDCouplingUMesh* mesh;
- ParaMEDMEM::ParaMESH* paramesh;
- ParaMEDMEM::ParaFIELD* parafield;
+ MEDCoupling::MEDCouplingUMesh* mesh;
+ MEDCoupling::ParaMESH* paramesh;
+ MEDCoupling::ParaFIELD* parafield;
ICoCo::MEDField* icocofield ;
tmp_dir = string(tmp_dir_c);
else
tmp_dir = "/tmp";
- string filename_xml1 = getResourceFile("square1_split");
- string filename_xml2 = getResourceFile("square2_split");
+ string filename_xml1 = "square1_split";
+ string filename_xml2 = "square2_split";
//string filename_seq_wr = makeTmpFile("");
//string filename_seq_med = makeTmpFile("myWrField_seq_pointe221.med");
ostringstream strstream;
strstream <<master<<rank+1<<".med";
+ string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_2_"<< rank+1;
- mesh=MEDLoader::ReadUMeshFromFile(strstream.str().c_str(),meshname.str().c_str(),0);
+ mesh=ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
paramesh=new ParaMESH (mesh,*source_group,"source mesh");
- // ParaMEDMEM::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT( support,*source_group);
- ParaMEDMEM::ComponentTopology comptopo;
+ // MEDCoupling::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT( support,*source_group);
+ MEDCoupling::ComponentTopology comptopo;
if(srcM=="P0")
{
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);//InvertIntegral);//ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);//InvertIntegral);//IntensiveMaximum);
}
else
parafield = new ParaFIELD(ON_NODES,NO_TIME,paramesh, comptopo);
string master= filename_xml2;
ostringstream strstream;
strstream << master<<(rank-nproc_source+1)<<".med";
+ string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_3_"<<rank-nproc_source+1;
- mesh = MEDLoader::ReadUMeshFromFile(strstream.str().c_str(),meshname.str().c_str(),0);
+ mesh = ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
paramesh=new ParaMESH (mesh,*target_group,"target mesh");
- // ParaMEDMEM::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT(support,*target_group);
- ParaMEDMEM::ComponentTopology comptopo;
+ // MEDCoupling::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT(support,*target_group);
+ MEDCoupling::ComponentTopology comptopo;
if(targetM=="P0")
{
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);//InvertIntegral);//ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);//InvertIntegral);//IntensiveMaximum);
}
else
parafield = new ParaFIELD(ON_NODES,NO_TIME,paramesh, comptopo);