From f264dff08735a07e3006a371e8a73a489faa8c49 Mon Sep 17 00:00:00 2001 From: vbd Date: Fri, 3 Aug 2007 09:08:39 +0000 Subject: [PATCH] adding renormalization --- src/ParaMEDMEM/CommInterface.hxx | 6 +++ src/ParaMEDMEM/DEC.cxx | 51 +++++++++++++++---- src/ParaMEDMEM/DEC.hxx | 10 +++- src/ParaMEDMEM/InterpolationMatrix.cxx | 39 ++++++++++++-- src/ParaMEDMEM/InterpolationMatrix.hxx | 9 ++-- src/ParaMEDMEM/IntersectionDEC.cxx | 31 +++++++++-- src/ParaMEDMEM/Makefile.in | 2 + src/ParaMEDMEM/ParaFIELD.cxx | 48 +++++++++++++++-- src/ParaMEDMEM/ParaFIELD.hxx | 3 ++ src/ParaMEDMEM/ParaSUPPORT.cxx | 4 +- src/ParaMEDMEM/ParaSUPPORT.hxx | 9 ++-- src/ParaMEDMEM/test_INTERPOL_2D.cxx | 4 +- src/ParaMEDMEM/test_IntersectionDEC.cxx | 26 +++++++--- src/ParaMEDMEM/test_MEDMEMConstructor.cxx | 4 +- src/ParaMEDMEM/test_Seq3DsurfIntersection.cxx | 4 +- src/ParaMEDMEM/test_SeqIntersectionDEC.cxx | 6 ++- 16 files changed, 209 insertions(+), 47 deletions(-) diff --git a/src/ParaMEDMEM/CommInterface.hxx b/src/ParaMEDMEM/CommInterface.hxx index 5c9b799b9..840639935 100644 --- a/src/ParaMEDMEM/CommInterface.hxx +++ b/src/ParaMEDMEM/CommInterface.hxx @@ -53,6 +53,12 @@ public: recvcount, recvtype, source, recvtag, comm,status); } int worldSize() const {int size; MPI_Comm_size(MPI_COMM_WORLD, &size); return size;} + int reduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + int root, MPI_Comm comm) const + {return MPI_Reduce(sendbuf, recvbuf, count, datatype, op, root, comm);} + int allReduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + MPI_Comm comm) const + {return MPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm);} }; } diff --git a/src/ParaMEDMEM/DEC.cxx b/src/ParaMEDMEM/DEC.cxx index 1bcf37d16..20fd34f66 100644 --- a/src/ParaMEDMEM/DEC.cxx +++ b/src/ParaMEDMEM/DEC.cxx @@ -9,12 +9,15 @@ #include "ComponentTopology.hxx" #include "ParaFIELD.hxx" #include "DEC.hxx" +#include "./ICoCo/ICoCoField.hxx" +#include "./ICoCo/ICoCoMEDField.hxx" +#include "./ICoCo/ICoCoTrioField.hxx" namespace ParaMEDMEM { DEC::DEC(ProcessorGroup& source_group, ProcessorGroup& target_group):_local_field(0), - _source_group(&source_group), _target_group(&target_group) + _source_group(&source_group), _target_group(&target_group), _owns_field(false) { _union_group = source_group.fuse(target_group); } @@ -22,16 +25,44 @@ namespace ParaMEDMEM DEC::~DEC() { delete _union_group; + if (_owns_field) + delete _local_field; } -void DEC::attachLocalField(const ParaFIELD* field) -{ - _local_field=field; - //if (field!=0) - //{ - //BlockTopology* topo=dynamic_cast(field->getTopology()); - _comm_interface=&(field->getTopology()->getProcGroup()->getCommInterface()); - //} -} + void DEC::attachLocalField(const ParaFIELD* field) + { + _local_field=field; + _comm_interface=&(field->getTopology()->getProcGroup()->getCommInterface()); + } + + void DEC::attachLocalField(const ICoCo::Field* field) + { + const ICoCo::MEDField* medfield =dynamic_cast (field); + if(medfield !=0) + { + attachLocalField(medfield->getField()); + return; + } + const ICoCo::TrioField* triofield=dynamic_cast (field); + if (triofield !=0) + { + ProcessorGroup* localgroup; + if (_source_group->containsMyRank()) localgroup=_source_group; + else localgroup=_target_group; + + ICoCo::Field* parafield=new ICoCo::MEDField(*triofield, *localgroup); + _owns_field = true; + attachLocalField(parafield); + } + throw MEDMEM::MEDEXCEPTION("incompatible field type"); + } + void DEC::setForcedRenormalizationFlag(bool flag) + { + _forced_renormalization_flag=flag; + } + bool DEC::getForcedRenormalizationFlag() + { + return _forced_renormalization_flag; + } } diff --git a/src/ParaMEDMEM/DEC.hxx b/src/ParaMEDMEM/DEC.hxx index b4a83de1a..75c45152e 100644 --- a/src/ParaMEDMEM/DEC.hxx +++ b/src/ParaMEDMEM/DEC.hxx @@ -1,6 +1,9 @@ #ifndef DEC_HXX_ #define DEC_HXX_ - +namespace ICoCo +{ + class Field; +} namespace ParaMEDMEM { class ProcessorGroup; @@ -12,6 +15,7 @@ public: DEC():_local_field(0){} DEC(ProcessorGroup& local_group, ProcessorGroup& distant_group); void attachLocalField(const ParaFIELD* field); + void attachLocalField(const ICoCo::Field* field); virtual void prepareSourceDE()=0; virtual void prepareTargetDE()=0; virtual void recvData()=0; @@ -19,6 +23,8 @@ public: virtual void synchronize()=0; virtual ~DEC(); virtual void computeProcGroup(){}; + void setForcedRenormalizationFlag(bool flag); + bool getForcedRenormalizationFlag(); protected: const ParaFIELD* _local_field; //! Processor group representing the union of target and source processors @@ -27,6 +33,8 @@ protected: ProcessorGroup* _target_group; const CommInterface* _comm_interface; + bool _forced_renormalization_flag; + bool _owns_field; }; } diff --git a/src/ParaMEDMEM/InterpolationMatrix.cxx b/src/ParaMEDMEM/InterpolationMatrix.cxx index 58f9b406c..625fa7c9c 100644 --- a/src/ParaMEDMEM/InterpolationMatrix.cxx +++ b/src/ParaMEDMEM/InterpolationMatrix.cxx @@ -66,12 +66,19 @@ The number of elements per row is stored in the row_offsets array. */ void InterpolationMatrix::addContribution(MEDMEM::MESH& distant_support, int iproc_distant, int* distant_elems) { + + if (distant_support.getMeshDimension() != _source_support.getMeshDimension() || + distant_support.getMeshDimension() != _source_support.getMeshDimension() ) + throw MEDMEM::MEDEXCEPTION("local and distant meshes do not have the same space and mesh dimensions"); + //creating the interpolator structure - MEDMEM::Interpolation* interpolator; + MEDMEM::Interpolation* interpolator; if (distant_support.getMeshDimension()==2 && distant_support.getSpaceDimension()==3) interpolator=new MEDMEM::Interpolation3DSurf(); else if (distant_support.getMeshDimension()==2 && distant_support.getSpaceDimension()==2) interpolator=new MEDMEM::Interpolation2D(); + else + throw MEDMEM::MEDEXCEPTION("no interpolator exists for these mesh and space dimensions "); //computation of the intersection volumes between source and target elements int source_size= _source_support.getNumberOfElements(MED_EN::MED_CELL,MED_EN::MED_ALL_ELEMENTS); @@ -81,10 +88,10 @@ void InterpolationMatrix::addContribution(MEDMEM::MESH& distant_support, int ipr throw MEDEXCEPTION("uncoherent number of rows in interpolation matrix"); //computing the vectors containing the source and target element volumes - MEDMEM::SUPPORT target_support(&distant_support,"all cells", MED_EN::MED_CELL); - MEDMEM::FIELD* target_triangle_surf = distant_support.getArea(&target_support); + MEDMEM::SUPPORT target_support(&distant_support,"all cells", MED_EN::MED_CELL); + MEDMEM::FIELD* target_triangle_surf = getSupportVolumes(target_support); MEDMEM::SUPPORT source_support (const_cast(&_source_support),"all cells", MED_EN::MED_CELL); - MEDMEM::FIELD* source_triangle_surf = _source_support.getArea(&source_support); + MEDMEM::FIELD* source_triangle_surf = getSupportVolumes(source_support); //storing the source volumes _source_volume.resize(source_size); @@ -245,7 +252,7 @@ void InterpolationMatrix::transposeMultiply(MEDMEM::FIELD& field) const //VS^(-1) is the inverse of the diagonal matrix storing //volumes of the source cells for (int i=0; i& field) const } +/*! +\brief returns the volumes of the cells underlying the field \a field +For 2D geometries, the returned field contains the areas. +For 3D geometries, the returned field contains the volumes. + +\param field field on which cells the volumes are required +\return field containing the volumes +*/ + MEDMEM::FIELD* InterpolationMatrix::getSupportVolumes(const MEDMEM::SUPPORT& support) + { + const MEDMEM::MESH* mesh=support.getMesh(); + int dim = mesh->getMeshDimension(); + switch (dim) + { + case 2: + return mesh->getArea(&support); + case 3: + return mesh->getVolume(&support); + default: + throw MEDMEM::MEDEXCEPTION("interpolation is not available for this dimension"); + } + } } diff --git a/src/ParaMEDMEM/InterpolationMatrix.hxx b/src/ParaMEDMEM/InterpolationMatrix.hxx index 599f00be9..cb579e07d 100644 --- a/src/ParaMEDMEM/InterpolationMatrix.hxx +++ b/src/ParaMEDMEM/InterpolationMatrix.hxx @@ -15,8 +15,6 @@ namespace ParaMEDMEM const ProcessorGroup& distant_group, const string& method); - //InterpolationMatrix(const MEDMEM::MESH& source_support, const string& method); - //InterpolationMatrix(const MEDMEM::MESH& target_support, const MEDMEM::MESH& source_support); virtual ~InterpolationMatrix(); void addContribution(MEDMEM::MESH& distant_support, int iproc_distant, int* distant_elems); void multiply(MEDMEM::FIELD&) const; @@ -25,11 +23,12 @@ namespace ParaMEDMEM int getNbRows() const {return _row_offsets.size();} private: - // vector > _source_indices; + + MEDMEM::FIELD* InterpolationMatrix::getSupportVolumes(const MEDMEM::SUPPORT& field); + + private: vector _row_offsets; - //vector _col_numbers; vector > _col_offsets; - // vector _coeffs; const MEDMEM::MESH& _source_support; MxN_Mapping _mapping; string _method; diff --git a/src/ParaMEDMEM/IntersectionDEC.cxx b/src/ParaMEDMEM/IntersectionDEC.cxx index 142ea8d40..45e561367 100644 --- a/src/ParaMEDMEM/IntersectionDEC.cxx +++ b/src/ParaMEDMEM/IntersectionDEC.cxx @@ -94,7 +94,6 @@ void IntersectionDEC::synchronize() } } _interpolation_matrix->prepare(); - // _volume_vector=para_mesh->getVolume(); } @@ -104,13 +103,39 @@ void IntersectionDEC::recvData() if (_source_group->containsMyRank()) _interpolation_matrix->transposeMultiply(*_local_field->getField()); else if (_target_group->containsMyRank()) - _interpolation_matrix->multiply(*_local_field->getField()); + { + _interpolation_matrix->multiply(*_local_field->getField()); + if (_forced_renormalization_flag) + for (int icomp=0; icomp<_local_field->getField()->getNumberOfComponents(); icomp++) + { + double total_norm = _local_field->getVolumeIntegral(icomp+1); + double source_norm=total_norm; + _comm_interface->broadcast(&source_norm, 1, MPI_DOUBLE, 0,* dynamic_cast(_union_group)->getComm()); + + if (_target_group->containsMyRank() && abs(total_norm)>1e-100) + _local_field->getField()->applyLin(source_norm/total_norm,0.0,icomp+1); + } + } + + } void IntersectionDEC::sendData() { if (_source_group->containsMyRank()) - _interpolation_matrix->multiply(*_local_field->getField()); + { + _interpolation_matrix->multiply(*_local_field->getField()); + if (_forced_renormalization_flag) + for (int icomp=0; icomp<_local_field->getField()->getNumberOfComponents(); icomp++) + { + double total_norm = _local_field->getVolumeIntegral(icomp+1); + double source_norm = total_norm; + _comm_interface->broadcast(&source_norm, 1, MPI_DOUBLE, 0,* dynamic_cast(_union_group)->getComm()); + + if (_target_group->containsMyRank() && abs(total_norm)>1e-100) + _local_field->getField()->applyLin(source_norm/total_norm,0.0,icomp+1); + } + } else if (_target_group->containsMyRank()) _interpolation_matrix->transposeMultiply(*_local_field->getField()); } diff --git a/src/ParaMEDMEM/Makefile.in b/src/ParaMEDMEM/Makefile.in index a46917871..8c1cf6ed4 100644 --- a/src/ParaMEDMEM/Makefile.in +++ b/src/ParaMEDMEM/Makefile.in @@ -28,12 +28,14 @@ top_srcdir=@top_srcdir@ top_builddir=../.. srcdir=@srcdir@ + VPATH=.:$(srcdir):$(srcdir)/tests MACHINE=PCLINUX @COMMENCE@ +SUBDIRS= ICoCo EXPORT_PYSCRIPTS = \ diff --git a/src/ParaMEDMEM/ParaFIELD.cxx b/src/ParaMEDMEM/ParaFIELD.cxx index 3a195d114..e224f3150 100644 --- a/src/ParaMEDMEM/ParaFIELD.cxx +++ b/src/ParaMEDMEM/ParaFIELD.cxx @@ -7,7 +7,9 @@ #include "UnstructuredParaSUPPORT.hxx" #include "ExplicitCoincidentDEC.hxx" #include "StructuredCoincidentDEC.hxx" - +#include "CommInterface.hxx" +#include "ProcessorGroup.hxx" +#include "MPIProcessorGroup.hxx" #include "ParaFIELD.hxx" #include "ParaMESH.hxx" @@ -38,8 +40,7 @@ ParaFIELD::ParaFIELD(const ParaSUPPORT* para_support, const ComponentTopology& c } } -// int nb_components=0; -// if (component_topology.getProcGroup()!=0) + int nb_components = component_topology.nbLocalComponents(); if (nb_components!=0) { @@ -47,8 +48,8 @@ ParaFIELD::ParaFIELD(const ParaSUPPORT* para_support, const ComponentTopology& c } else return; - _field->setName("toto"); - _field->setDescription("titi"); + _field->setName("Default ParaFIELD name"); + _field->setDescription("Default ParaFIELD description"); _field->setNumberOfValues(para_support->getSupport()->getNumberOfElements(MED_EN::MED_ALL_ELEMENTS)); string* compnames=new string[nb_components]; string* compdesc=new string[nb_components]; @@ -148,4 +149,41 @@ void ParaFIELD::synchronizeSource(ParaFIELD* target_field){ delete data_channel; } +double ParaFIELD::getVolumeIntegral(int icomp) const +{ + CommInterface comm_interface = _topology->getProcGroup()->getCommInterface(); + const MEDMEM::SUPPORT* support = _field->getSupport(); + FIELD* volume= getSupportVolumes(*support); + double integral=0; + for (int i=0; igetNumberOfElements(MED_EN::MED_ALL_ELEMENTS); i++) + integral+=_field->getValueIJ(i+1,icomp)*volume->getValueIJ(i+1,1); + + double total=0.0; + comm_interface.allReduce(&integral, &total, 1, MPI_DOUBLE, MPI_SUM, * dynamic_cast(_topology->getProcGroup())->getComm()); + return total; +} + +/*! +\brief returns the volumes of the cells underlying the field \a field + +For 2D geometries, the returned field contains the areas. +For 3D geometries, the returned field contains the volumes. + +\param field field on which cells the volumes are required +\return field containing the volumes +*/ + MEDMEM::FIELD* ParaFIELD::getSupportVolumes(const MEDMEM::SUPPORT& support) const + { + const MEDMEM::MESH* mesh=support.getMesh(); + int dim = mesh->getMeshDimension(); + switch (dim) + { + case 2: + return mesh->getArea(&support); + case 3: + return mesh->getVolume(&support); + default: + throw MEDMEM::MEDEXCEPTION("interpolation is not available for this dimension"); + } + } } diff --git a/src/ParaMEDMEM/ParaFIELD.hxx b/src/ParaMEDMEM/ParaFIELD.hxx index f560066fe..506e47b49 100644 --- a/src/ParaMEDMEM/ParaFIELD.hxx +++ b/src/ParaMEDMEM/ParaFIELD.hxx @@ -36,7 +36,10 @@ public: const ParaSUPPORT* getSupport() const {return _support;} Topology* getTopology() const {return _topology;} int nbComponents() const {return _component_topology.nbComponents();} + double getVolumeIntegral(int icomp) const; + double getL2norm()const{return -1;} private: + MEDMEM::FIELD* getSupportVolumes(const MEDMEM::SUPPORT& support) const; const ComponentTopology& _component_topology; Topology* _topology; MEDMEM::FIELD* _field; diff --git a/src/ParaMEDMEM/ParaSUPPORT.cxx b/src/ParaMEDMEM/ParaSUPPORT.cxx index f3848c530..a1977d3ca 100644 --- a/src/ParaMEDMEM/ParaSUPPORT.cxx +++ b/src/ParaMEDMEM/ParaSUPPORT.cxx @@ -9,12 +9,14 @@ namespace ParaMEDMEM { } - ParaSUPPORT::ParaSUPPORT(const MEDMEM::SUPPORT& support, const ProcessorGroup& proc_group):_support(&support) { + ParaSUPPORT::ParaSUPPORT(const MEDMEM::SUPPORT& support, const ProcessorGroup& proc_group):_support(&support), _owns_support(false) { _mesh = new ParaMESH(*(support.getMesh()), proc_group, "mesh from support"); } ParaSUPPORT::~ParaSUPPORT() { + if (_owns_support) + delete _support; } } diff --git a/src/ParaMEDMEM/ParaSUPPORT.hxx b/src/ParaMEDMEM/ParaSUPPORT.hxx index 3acd4960c..12fe8836d 100644 --- a/src/ParaMEDMEM/ParaSUPPORT.hxx +++ b/src/ParaMEDMEM/ParaSUPPORT.hxx @@ -15,15 +15,18 @@ namespace ParaMEDMEM public: ParaSUPPORT(); ParaSUPPORT(const ParaMESH* mesh, const MEDMEM::SUPPORT* support): - _support(support), _mesh(mesh){}; - ParaSUPPORT(const MEDMEM::SUPPORT&, const ProcessorGroup& proc_group); - virtual ~ParaSUPPORT(); + _support(support), _mesh(mesh), _owns_support(false){}; + ParaSUPPORT(const ParaMESH* mesh); + ParaSUPPORT(const MEDMEM::SUPPORT&, const ProcessorGroup& proc_group); + virtual ~ParaSUPPORT(); virtual const Topology* getTopology() const{}; virtual const MEDMEM::SUPPORT* getSupport() const {return _support;} virtual const ParaMESH* getMesh() const {return _mesh;} protected : + const MEDMEM::SUPPORT* _support; const ParaMESH* _mesh; + bool _owns_support; }; } diff --git a/src/ParaMEDMEM/test_INTERPOL_2D.cxx b/src/ParaMEDMEM/test_INTERPOL_2D.cxx index eb5d7372c..c63c5b977 100644 --- a/src/ParaMEDMEM/test_INTERPOL_2D.cxx +++ b/src/ParaMEDMEM/test_INTERPOL_2D.cxx @@ -1,4 +1,4 @@ -#include "INTERPOLATION_2D.hxx" +#include "Interpolation2D.hxx" #include "MEDMEM_Mesh.hxx" int main() @@ -6,7 +6,7 @@ int main() MEDMEM::MESH source(MED_DRIVER,"/home/vb144235/resources/square128000.med","Mesh_1"); MEDMEM::MESH target(MED_DRIVER,"/home/vb144235/resources/square30000.med","Mesh_1"); - ParaMEDMEM::INTERPOLATION_2D interp; + MEDMEM::Interpolation2D interp; // interp.setOptions(1e-6,1,2); interp.interpol_maillages(source,target); } diff --git a/src/ParaMEDMEM/test_IntersectionDEC.cxx b/src/ParaMEDMEM/test_IntersectionDEC.cxx index bf849b42b..f02a5c757 100644 --- a/src/ParaMEDMEM/test_IntersectionDEC.cxx +++ b/src/ParaMEDMEM/test_IntersectionDEC.cxx @@ -67,7 +67,9 @@ int main(int argc, char** argv) //loading the geometry for the source group if (source_group->containsMyRank()) { - string master = "/home/vb144235/resources/square128000_split"; + // string master = "/home/vb144235/resources/square128000_split"; + string master = "/home/vb144235/resources/square1_split"; + cout <<"loading source"<containsMyRank()) { - string master = "/home/vb144235/resources/square30000_split"; + // string master = "/home/vb144235/resources/square30000_split"; + string master= "/home/vb144235/resources/square2_split"; target_mesh=new ParaMESH(MED_DRIVER,master,*target_group); topo_target=target_mesh->getBlockTopology(); ostringstream strstream; strstream << master<<(rank-nproc_source+1)<<".med"; //strstream<<"/home/vb144235/resources/square30000.med"; ostringstream meshname ; - meshname<< "Mesh_1_"<setValue(value); cout <<"creating intersectionDEC"<write(MED_DRIVER,"/home/vb144235/tmp/sourcesquareb"); + source_field.write(MED_DRIVER,"/home/vb144235/tmp/sourcesquareb","boundary"); + + dec.recvData(); cout <<"writing"<write(MED_DRIVER,"/home/vb144235/tmp/sourcesquare"); source_field.write(MED_DRIVER,"/home/vb144235/tmp/sourcesquare","boundary"); @@ -160,9 +169,14 @@ int main(int argc, char** argv) value[ielem]=0.0; target_field.getField()->setValue(value); IntersectionDEC dec(*source_group,*target_group); - dec.attachTargetField(&target_field); + dec.attachLocalField(&target_field); dec.synchronize(); + dec.setForcedRenormalizationFlag(true); + dec.recvData(); + target_mesh->write(MED_DRIVER, "/home/vb144235/tmp/targetsquareb"); + target_field.write(MED_DRIVER, "/home/vb144235/tmp/targetsquareb", "boundary"); + dec.sendData(); target_mesh->write(MED_DRIVER, "/home/vb144235/tmp/targetsquare"); target_field.write(MED_DRIVER, "/home/vb144235/tmp/targetsquare", "boundary"); delete[] value; diff --git a/src/ParaMEDMEM/test_MEDMEMConstructor.cxx b/src/ParaMEDMEM/test_MEDMEMConstructor.cxx index d19c0aa59..fdebd7495 100644 --- a/src/ParaMEDMEM/test_MEDMEMConstructor.cxx +++ b/src/ParaMEDMEM/test_MEDMEMConstructor.cxx @@ -129,7 +129,7 @@ int main(int argc, char** argv) source_field.getField()->setValue(value); cout <<"creating intersectionDEC"<setValue(value); IntersectionDEC dec(*source_group,*target_group); - dec.attachTargetField(&target_field); + dec.attachLocalField(&target_field); dec.synchronize(); dec.recvData(); target_mesh->write(MED_DRIVER, "/home/vb144235/tmp/targetsquare"); diff --git a/src/ParaMEDMEM/test_Seq3DsurfIntersection.cxx b/src/ParaMEDMEM/test_Seq3DsurfIntersection.cxx index 6f77ee6e0..0f4697862 100644 --- a/src/ParaMEDMEM/test_Seq3DsurfIntersection.cxx +++ b/src/ParaMEDMEM/test_Seq3DsurfIntersection.cxx @@ -136,7 +136,7 @@ int main(int argc, char** argv) source_field.getField()->setValue(value); cout <<"creating intersectionDEC"<setValue(value); IntersectionDEC dec(*source_group,*target_group); - dec.attachTargetField(&target_field); + dec.attachLocalField(&target_field); dec.synchronize(); dec.recvData(); target_mesh_bis->write(MED_DRIVER, "/home/vb144235/tmp/targetcylinder"); diff --git a/src/ParaMEDMEM/test_SeqIntersectionDEC.cxx b/src/ParaMEDMEM/test_SeqIntersectionDEC.cxx index 416c9d6c2..7c8defa25 100644 --- a/src/ParaMEDMEM/test_SeqIntersectionDEC.cxx +++ b/src/ParaMEDMEM/test_SeqIntersectionDEC.cxx @@ -136,10 +136,11 @@ int main(int argc, char** argv) source_field.getField()->setValue(value); cout <<"creating intersectionDEC"<write(MED_DRIVER,"/home/vb144235/tmp/sourcesquare"); source_field.write(MED_DRIVER,"/home/vb144235/tmp/sourcesquare","boundary"); @@ -160,9 +161,10 @@ int main(int argc, char** argv) value[ielem]=0.0; target_field.getField()->setValue(value); IntersectionDEC dec(*source_group,*target_group); - dec.attachTargetField(&target_field); + dec.attachLocalField(&target_field); dec.synchronize(); dec.recvData(); + dec.sendData(); target_mesh->write(MED_DRIVER, "/home/vb144235/tmp/targetsquare"); target_field.write(MED_DRIVER, "/home/vb144235/tmp/targetsquare", "boundary"); delete[] value; -- 2.39.2