From 5dcdc2b6a915a809dd2d7831e4b2e85ae286328a Mon Sep 17 00:00:00 2001 From: geay Date: Fri, 6 Jun 2014 11:42:04 +0200 Subject: [PATCH] Ready to detach trio part. --- src/MEDCoupling/MEDCouplingField.cxx | 2 +- src/MEDCoupling/MEDCouplingFieldDouble.cxx | 11 +- src/ParaMEDMEM/DEC.cxx | 1 - src/ParaMEDMEM/DisjointDEC.cxx | 42 ++----- src/ParaMEDMEM/DisjointDEC.hxx | 12 +- src/ParaMEDMEM/ExplicitCoincidentDEC.cxx | 4 +- src/ParaMEDMEM/ICoCoField.cxx | 23 ++-- src/ParaMEDMEM/ICoCoField.hxx | 15 +-- src/ParaMEDMEM/ICoCoMEDField.cxx | 119 +----------------- src/ParaMEDMEM/ICoCoMEDField.hxx | 12 +- src/ParaMEDMEM/ICoCoTrioField.cxx | 119 ++++++++++++++++++ src/ParaMEDMEM/ICoCoTrioField.hxx | 4 +- .../ParaMEDMEMTest_InterpKernelDEC.cxx | 18 +-- src/ParaMEDMEMTest/test_perf.cxx | 6 +- 14 files changed, 188 insertions(+), 200 deletions(-) diff --git a/src/MEDCoupling/MEDCouplingField.cxx b/src/MEDCoupling/MEDCouplingField.cxx index a9d5ff5e4..1c9ca16a3 100644 --- a/src/MEDCoupling/MEDCouplingField.cxx +++ b/src/MEDCoupling/MEDCouplingField.cxx @@ -541,7 +541,7 @@ DataArrayInt *MEDCouplingField::computeTupleIdsToSelectFromCellIds(const int *st /*! * Returns number of tuples expected regarding the spatial discretization of \a this - * field and number of entities in the underlying mesh. + * field and number of entities in the underlying mesh. This method behaves exactly as MEDCouplingFieldDouble::getNumberOfTuples. * \return int - the number of expected tuples. * \throw If the spatial discretization of \a this field is NULL. * \throw If the mesh is not set. diff --git a/src/MEDCoupling/MEDCouplingFieldDouble.cxx b/src/MEDCoupling/MEDCouplingFieldDouble.cxx index cfa138f3a..2a6c64755 100644 --- a/src/MEDCoupling/MEDCouplingFieldDouble.cxx +++ b/src/MEDCoupling/MEDCouplingFieldDouble.cxx @@ -1877,25 +1877,32 @@ int MEDCouplingFieldDouble::getNumberOfComponents() const } /*! + * Use MEDCouplingField::getNumberOfTuplesExpected instead of this method. This method will be removed soon, because it is + * confusing compared to getNumberOfComponents() and getNumberOfValues() behaviour. + * * Returns number of tuples in \a this field, that depends on * - the number of entities in the underlying mesh * - \ref MEDCouplingSpatialDisc "spatial discretization" of \a this field (e.g. number * of Gauss points if \a this->getTypeOfField() == * \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT"). * - * The returned value does **not depend** on the number of tuples in the data array + * The returned value does \b not \b depend on the number of tuples in the data array * (which has to be equal to the returned value), \b contrary to * getNumberOfComponents() and getNumberOfValues() that retrieve information from the - * data array. + * data array (Sorry, it is confusing !). + * So \b this \b method \b behaves \b exactly \b as MEDCouplingField::getNumberOfTuplesExpected \b method. + * * \warning No checkCoherency() is done here. * For more info on the data arrays, see \ref MEDCouplingArrayPage. * \return int - the number of tuples. * \throw If the mesh is not set. * \throw If the spatial discretization of \a this field is NULL. * \throw If the spatial discretization is not fully defined. + * \sa MEDCouplingField::getNumberOfTuplesExpected */ int MEDCouplingFieldDouble::getNumberOfTuples() const { + //std::cerr << " ******* MEDCouplingFieldDouble::getNumberOfTuples is deprecated : use MEDCouplingField::getNumberOfTuplesExpected instead ! ******" << std::endl; if(!_mesh) throw INTERP_KERNEL::Exception("Impossible to retrieve number of tuples because no mesh specified !"); if(!((const MEDCouplingFieldDiscretization *)_type)) diff --git a/src/ParaMEDMEM/DEC.cxx b/src/ParaMEDMEM/DEC.cxx index e186a4723..b4584faa4 100644 --- a/src/ParaMEDMEM/DEC.cxx +++ b/src/ParaMEDMEM/DEC.cxx @@ -26,7 +26,6 @@ #include "DEC.hxx" #include "ICoCoField.hxx" #include "ICoCoMEDField.hxx" -#include "ICoCoTrioField.hxx" #include "MPIProcessorGroup.hxx" #include diff --git a/src/ParaMEDMEM/DisjointDEC.cxx b/src/ParaMEDMEM/DisjointDEC.cxx index 3170acb82..1b1c2f360 100644 --- a/src/ParaMEDMEM/DisjointDEC.cxx +++ b/src/ParaMEDMEM/DisjointDEC.cxx @@ -26,7 +26,6 @@ #include "ParaMESH.hxx" #include "ICoCoField.hxx" #include "ICoCoMEDField.hxx" -#include "ICoCoTrioField.hxx" #include "MPIProcessorGroup.hxx" #include @@ -80,13 +79,12 @@ namespace ParaMEDMEM _source_group(&source_group), _target_group(&target_group), _owns_field(false), - _owns_groups(false), - _icoco_field(0) + _owns_groups(false) { _union_group = source_group.fuse(target_group); } - DisjointDEC::DisjointDEC(const DisjointDEC& s):DEC(s),_local_field(0),_union_group(0),_source_group(0),_target_group(0),_owns_field(false),_owns_groups(false),_icoco_field(0) + DisjointDEC::DisjointDEC(const DisjointDEC& s):DEC(s),_local_field(0),_union_group(0),_source_group(0),_target_group(0),_owns_field(false),_owns_groups(false) { copyInstance(s); } @@ -118,8 +116,7 @@ namespace ParaMEDMEM DisjointDEC::DisjointDEC(const std::set& source_ids, const std::set& target_ids, const MPI_Comm& world_comm):_local_field(0), _owns_field(false), - _owns_groups(true), - _icoco_field(0) + _owns_groups(true) { ParaMEDMEM::CommInterface comm; // Create the list of procs including source and target @@ -195,8 +192,6 @@ namespace ParaMEDMEM _owns_groups=false; _source_group=0; _target_group=0; - delete _icoco_field; - _icoco_field=0; delete _union_group; _union_group=0; } @@ -212,7 +207,7 @@ namespace ParaMEDMEM will be updated by a recvData() call. Reversely, if the processor is on the sending end, the field will be read, possibly transformed, and sent appropriately to the other side. */ - void DisjointDEC::attachLocalField(const ParaFIELD* field, bool ownPt) + void DisjointDEC::attachLocalField(const ParaFIELD *field, bool ownPt) { if(!isInUnion()) return ; @@ -234,7 +229,7 @@ namespace ParaMEDMEM and sent appropriately to the other side. */ - void DisjointDEC::attachLocalField(MEDCouplingFieldDouble* field) + void DisjointDEC::attachLocalField(MEDCouplingFieldDouble *field) { if(!isInUnion()) return ; @@ -262,32 +257,13 @@ namespace ParaMEDMEM - a ICOCo::TrioField, that is created from tables extracted from a TRIO-U structure. */ - void DisjointDEC::attachLocalField(const ICoCo::Field* field) + void DisjointDEC::attachLocalField(const ICoCo::MEDField *field) { if(!isInUnion()) return ; - const ICoCo::MEDField* medfield=dynamic_cast (field); - if(medfield !=0) - { - attachLocalField(medfield->getField()); - return; - } - const ICoCo::TrioField* triofield=dynamic_cast (field); - if (triofield !=0) - { - /* Strange part of code localgroup not used ! - ProcessorGroup* localgroup; - if (_source_group->containsMyRank()) - localgroup=_source_group; - else - localgroup=_target_group;*/ - delete _icoco_field; - - _icoco_field=new ICoCo::MEDField(*const_cast(triofield)); - attachLocalField(_icoco_field); - return; - } - throw INTERP_KERNEL::Exception("incompatible field type"); + if(!field) + throw INTERP_KERNEL::Exception("DisjointDEC::attachLocalField : ICoCo::MEDField pointer is NULL !"); + attachLocalField(field->getField()); } /*! diff --git a/src/ParaMEDMEM/DisjointDEC.hxx b/src/ParaMEDMEM/DisjointDEC.hxx index 77421f359..0cac7c597 100644 --- a/src/ParaMEDMEM/DisjointDEC.hxx +++ b/src/ParaMEDMEM/DisjointDEC.hxx @@ -29,7 +29,7 @@ namespace ICoCo { - class Field; + class MEDField; } namespace ParaMEDMEM @@ -40,16 +40,16 @@ namespace ParaMEDMEM class DisjointDEC : public DEC { public: - DisjointDEC():_local_field(0),_union_group(0),_source_group(0),_target_group(0),_owns_field(false),_owns_groups(false),_icoco_field(0) { } + DisjointDEC():_local_field(0),_union_group(0),_source_group(0),_target_group(0),_owns_field(false),_owns_groups(false) { } DisjointDEC(ProcessorGroup& source_group, ProcessorGroup& target_group); DisjointDEC(const DisjointDEC&); DisjointDEC &operator=(const DisjointDEC& s); DisjointDEC(const std::set& src_ids, const std::set& trg_ids, const MPI_Comm& world_comm=MPI_COMM_WORLD); void setNature(NatureOfField nature); - void attachLocalField( MEDCouplingFieldDouble* field); - void attachLocalField(const ParaFIELD* field, bool ownPt=false); - void attachLocalField(const ICoCo::Field* field); + void attachLocalField( MEDCouplingFieldDouble *field); + void attachLocalField(const ParaFIELD *field, bool ownPt=false); + void attachLocalField(const ICoCo::MEDField *field); virtual void prepareSourceDE() = 0; virtual void prepareTargetDE() = 0; @@ -80,8 +80,6 @@ namespace ParaMEDMEM const CommInterface* _comm_interface; bool _owns_field; bool _owns_groups; - private: - ICoCo::Field* _icoco_field; }; } diff --git a/src/ParaMEDMEM/ExplicitCoincidentDEC.cxx b/src/ParaMEDMEM/ExplicitCoincidentDEC.cxx index 9d055de70..01d4beacb 100644 --- a/src/ParaMEDMEM/ExplicitCoincidentDEC.cxx +++ b/src/ParaMEDMEM/ExplicitCoincidentDEC.cxx @@ -218,7 +218,7 @@ namespace ParaMEDMEM } else { - vector size (group->size()); + vector size2(group->size()); int myworldrank=group->myRank(); for (int iproc=0; iprocsize();iproc++) { @@ -240,7 +240,7 @@ namespace ParaMEDMEM int sendlocal=topotemp->globalToLocal(global); if (sendlocal!=-1) { - size[iproc]++; + size2[iproc]++; _explicit_mapping.pushBackElem(make_pair(iproc,sendlocal)); } } diff --git a/src/ParaMEDMEM/ICoCoField.cxx b/src/ParaMEDMEM/ICoCoField.cxx index 38d58e7f6..3db974ef6 100644 --- a/src/ParaMEDMEM/ICoCoField.cxx +++ b/src/ParaMEDMEM/ICoCoField.cxx @@ -27,22 +27,25 @@ using namespace ICoCo; using std::string; -Field::Field() { - _name=new string; +Field::Field() +{ } -Field::~Field() { - delete _name; +Field::~Field() +{ } -void Field::setName(const string& name) { - *_name=name; +void Field::setName(const string& name) +{ + _name=name; } -const string& Field::getName() const { - return *_name; +const string& Field::getName() const +{ + return _name; } -const char* Field::getCharName() const { - return _name->c_str(); +const char *Field::getCharName() const +{ + return _name.c_str(); } diff --git a/src/ParaMEDMEM/ICoCoField.hxx b/src/ParaMEDMEM/ICoCoField.hxx index 25427b3eb..ce8e24ade 100644 --- a/src/ParaMEDMEM/ICoCoField.hxx +++ b/src/ParaMEDMEM/ICoCoField.hxx @@ -23,21 +23,22 @@ #ifndef _ICoCoField_included_ #define _ICoCoField_included_ -#include - -namespace ICoCo { +#include - class Field { +namespace ICoCo +{ + class Field + { public: Field(); virtual ~Field(); void setName(const std::string& name); const std::string& getName() const; - const char* getCharName() const; - + const char *getCharName() const; private: - std::string* _name; + std::string _name; }; } + #endif diff --git a/src/ParaMEDMEM/ICoCoMEDField.cxx b/src/ParaMEDMEM/ICoCoMEDField.cxx index 76eee2d47..907c2f329 100644 --- a/src/ParaMEDMEM/ICoCoMEDField.cxx +++ b/src/ParaMEDMEM/ICoCoMEDField.cxx @@ -18,7 +18,6 @@ // #include "ICoCoMEDField.hxx" -#include "ICoCoTrioField.hxx" #include "ProcessorGroup.hxx" #include "MEDCouplingUMesh.hxx" #include "MEDCouplingFieldDouble.hxx" @@ -27,132 +26,20 @@ namespace ICoCo { - /*! Constructor directly attaching a MEDCouplingUMesh and a MEDCouplingFieldDouble + /*! Constructor directly attaching a MEDCouplingFieldDouble the object does not take the control the objects pointed by - \a mesh and \a field. + \a field. */ - MEDField::MEDField(ParaMEDMEM::MEDCouplingUMesh* mesh, ParaMEDMEM::MEDCouplingFieldDouble* field): - _mesh(mesh), - _field(field) + MEDField::MEDField(ParaMEDMEM::MEDCouplingFieldDouble *field):_field(field) { - if(_mesh) - _mesh->incrRef(); if(_field) _field->incrRef(); } - - MEDField::MEDField(TrioField& triofield) - { - _mesh = ParaMEDMEM::MEDCouplingUMesh::New(); - _mesh->setMeshDimension(triofield._space_dim); - ParaMEDMEM::DataArrayDouble *myCoords=ParaMEDMEM::DataArrayDouble::New(); - myCoords->alloc(triofield._nbnodes,triofield._space_dim); - _mesh->setCoords(myCoords); - myCoords->decrRef(); - double *ptr=myCoords->getPointer(); - std::copy(triofield._coords,triofield._coords+triofield._space_dim*triofield._nbnodes,ptr); - _mesh->allocateCells(triofield._nb_elems); - INTERP_KERNEL::NormalizedCellType elemtype; - switch (triofield._mesh_dim) - { - case 1: - switch (triofield._nodes_per_elem) - { - case 2: - elemtype=INTERP_KERNEL::NORM_SEG2; - break; - default: - throw INTERP_KERNEL::Exception("incompatible Trio field - wrong nb of nodes per elem"); - } - case 2: - switch (triofield._nodes_per_elem) - { - case 3: - elemtype=INTERP_KERNEL::NORM_TRI3; - break; - case 4 : - elemtype=INTERP_KERNEL::NORM_QUAD4; - break; - default: - throw INTERP_KERNEL::Exception("incompatible Trio field - wrong nb of nodes per elem"); - } - break; - case 3: - switch (triofield._nodes_per_elem) - { - case 4: - elemtype=INTERP_KERNEL::NORM_TETRA4; - break; - case 8 : - elemtype=INTERP_KERNEL::NORM_HEXA8; - break; - default: - throw INTERP_KERNEL::Exception("incompatible Trio field - wrong nb of nodes per elem"); - } - break; - default: - throw INTERP_KERNEL::Exception("incompatible Trio field - wrong mesh dimension"); - } - //creating a connectivity table that complies to MED (1 indexing) - //and passing it to _mesh - int* conn=new int[triofield._nodes_per_elem]; - _mesh->setMeshDimension(triofield._mesh_dim); - for (int i=0; iinsertNextCell(elemtype,triofield._nodes_per_elem,conn); - } - delete[] conn; - - _mesh->finishInsertingCells(); - - //field on the sending end - int nb_case=triofield.nb_values(); - if (triofield._type==0) - { - _field = ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::ONE_TIME); - } - else - { - _field = ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_NODES,ParaMEDMEM::ONE_TIME ); - } - _field->setMesh(_mesh); - _field->setNature(ParaMEDMEM::ConservativeVolumic); - ParaMEDMEM::DataArrayDouble *fieldArr=ParaMEDMEM::DataArrayDouble::New(); - fieldArr->alloc(_field->getNumberOfTuples(),triofield._nb_field_components); - _field->setName(triofield.getName().c_str()); - std::string meshName("SupportOf_"); meshName+=_field->getName(); - _mesh->setName(meshName.c_str()); - _field->setTime(triofield._time1,0,triofield._itnumber); - if (triofield._field!=0) - { - for (int i =0; isetIJ(i,j,triofield._field[i*triofield._nb_field_components+j]); - } - } - //field on the receiving end - else - { - // the trio field points to the pointer inside the MED field - triofield._field=const_cast (fieldArr->getPointer()); - for (int i=0; isetArray(fieldArr); - fieldArr->decrRef(); - } MEDField::~MEDField() { if(_field) _field->decrRef(); - if(_mesh) - _mesh->decrRef(); } } diff --git a/src/ParaMEDMEM/ICoCoMEDField.hxx b/src/ParaMEDMEM/ICoCoMEDField.hxx index 1cebec3f0..95b873a53 100644 --- a/src/ParaMEDMEM/ICoCoMEDField.hxx +++ b/src/ParaMEDMEM/ICoCoMEDField.hxx @@ -33,15 +33,13 @@ namespace ICoCo class MEDField : public ICoCo::Field { public: - MEDField():_mesh(0),_field(0) { } - MEDField(ParaMEDMEM::MEDCouplingUMesh* mesh, ParaMEDMEM::MEDCouplingFieldDouble* field); - MEDField(TrioField&); + MEDField():_field(0) { } + MEDField(ParaMEDMEM::MEDCouplingFieldDouble* field); virtual ~MEDField(); - ParaMEDMEM::MEDCouplingFieldDouble* getField() const { return _field; } - ParaMEDMEM::MEDCouplingUMesh* getMesh()const { return _mesh; } + ParaMEDMEM::MEDCouplingFieldDouble *getField() const { return _field; } + const ParaMEDMEM::MEDCouplingMesh *getMesh() const { return _field->getMesh(); } private: - ParaMEDMEM::MEDCouplingUMesh* _mesh; - ParaMEDMEM::MEDCouplingFieldDouble* _field; + ParaMEDMEM::MEDCouplingFieldDouble *_field; }; } diff --git a/src/ParaMEDMEM/ICoCoTrioField.cxx b/src/ParaMEDMEM/ICoCoTrioField.cxx index 604d66ac8..ea0b81e4a 100644 --- a/src/ParaMEDMEM/ICoCoTrioField.cxx +++ b/src/ParaMEDMEM/ICoCoTrioField.cxx @@ -22,6 +22,12 @@ // version 1.2 10/05/2010 #include + +#include "ICoCoMEDField.hxx" +#include "MEDCouplingUMesh.hxx" +#include "MEDCouplingFieldDouble.hxx" +#include "MEDCouplingAutoRefCountObjectPtr.hxx" + #include #include #include @@ -272,5 +278,118 @@ TrioField& TrioField::operator=(const TrioField& NewField){ } +/*! + * This method is non const only due to this->_field that can be modified (to point to the same zone than returned object). + * So \b warning, to access to \a this->_field only when the returned object is alive. + */ +MEDField *TrioField::build_medfield() +{ + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr mesh(ParaMEDMEM::MEDCouplingUMesh::New("",_mesh_dim)); + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr coo(ParaMEDMEM::DataArrayDouble::New()); coo->alloc(_nbnodes,_space_dim); + mesh->setCoords(coo); + double *ptr(coo->getPointer()); + std::copy(_coords,_coords+_space_dim*_nbnodes,ptr); + mesh->allocateCells(_nb_elems); + INTERP_KERNEL::NormalizedCellType elemtype; + switch(_mesh_dim) + { + case 1: + { + switch (_nodes_per_elem) + { + case 2: + elemtype=INTERP_KERNEL::NORM_SEG2; + break; + default: + throw INTERP_KERNEL::Exception("incompatible Trio field - wrong nb of nodes per elem"); + } + break; + } + case 2: + { + switch (_nodes_per_elem) + { + case 3: + elemtype=INTERP_KERNEL::NORM_TRI3; + break; + case 4 : + elemtype=INTERP_KERNEL::NORM_QUAD4; + break; + default: + throw INTERP_KERNEL::Exception("incompatible Trio field - wrong nb of nodes per elem"); + } + break; + } + case 3: + { + switch (_nodes_per_elem) + { + case 4: + elemtype=INTERP_KERNEL::NORM_TETRA4; + break; + case 8 : + elemtype=INTERP_KERNEL::NORM_HEXA8; + break; + default: + throw INTERP_KERNEL::Exception("incompatible Trio field - wrong nb of nodes per elem"); + } + break; + default: + throw INTERP_KERNEL::Exception("incompatible Trio field - wrong mesh dimension"); + } + } + //creating a connectivity table that complies to MED (1 indexing) + //and passing it to _mesh + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr field; + int *conn(new int[_nodes_per_elem]); + for (int i=0; i<_nb_elems;i++) + { + for(int j=0;j<_nodes_per_elem;j++) + { + conn[j]=_connectivity[i*_nodes_per_elem+j]; + } + mesh->insertNextCell(elemtype,_nodes_per_elem,conn); + } + delete [] conn; + mesh->finishInsertingCells(); + // + //field on the sending end + int nb_case=nb_values(); + if (_type==0) + { + field = ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::ONE_TIME); + } + else + { + field = ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_NODES,ParaMEDMEM::ONE_TIME ); + } + field->setMesh(mesh); + field->setNature(ParaMEDMEM::ConservativeVolumic); + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr fieldArr(ParaMEDMEM::DataArrayDouble::New()); + fieldArr->alloc(field->getNumberOfTuplesExpected(),_nb_field_components); + field->setName(getName().c_str()); + std::string meshName("SupportOf_"); meshName+=getName(); + mesh->setName(meshName.c_str()); + field->setTime(_time1,0,_itnumber); + if (_field!=0) + { + for (int i =0; isetIJ(i,j,_field[i*_nb_field_components+j]); + } + } + //field on the receiving end + else + { + // the trio field points to the pointer inside the MED field + _field=fieldArr->getPointer(); + for (int i=0; i<_nb_field_components*nb_case;i++) + _field[i]=0.0; + } + field->setArray(fieldArr); + return new MEDField(field); +} + diff --git a/src/ParaMEDMEM/ICoCoTrioField.hxx b/src/ParaMEDMEM/ICoCoTrioField.hxx index a9de213c9..c0b81b128 100644 --- a/src/ParaMEDMEM/ICoCoTrioField.hxx +++ b/src/ParaMEDMEM/ICoCoTrioField.hxx @@ -26,7 +26,7 @@ #include namespace ICoCo { - + class MEDField; ////////////////////////////////////////////////////////////////////////////// // // .DESCRIPTION @@ -52,7 +52,7 @@ namespace ICoCo { void save(std::ostream& os) const; void restore(std::istream& in); int nb_values() const ; - + MEDField *build_medfield(); public: int _type ; // 0 elem 1 nodes int _mesh_dim; diff --git a/src/ParaMEDMEMTest/ParaMEDMEMTest_InterpKernelDEC.cxx b/src/ParaMEDMEMTest/ParaMEDMEMTest_InterpKernelDEC.cxx index cb51ac753..e2687395c 100644 --- a/src/ParaMEDMEMTest/ParaMEDMEMTest_InterpKernelDEC.cxx +++ b/src/ParaMEDMEMTest/ParaMEDMEMTest_InterpKernelDEC.cxx @@ -494,7 +494,7 @@ void ParaMEDMEMTest::testInterpKernelDEC_2D_(const char *srcMeth, const char *ta ParaMEDMEM::MEDCouplingUMesh* mesh; ParaMEDMEM::ParaMESH* paramesh; ParaMEDMEM::ParaFIELD* parafield; - ICoCo::Field* icocofield ; + ICoCo::MEDField* icocofield ; string filename_xml1 = getResourceFile("square1_split"); string filename_xml2 = getResourceFile("square2_split"); @@ -539,7 +539,7 @@ void ParaMEDMEMTest::testInterpKernelDEC_2D_(const char *srcMeth, const char *ta value[ielem]=1.0; // ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield); - icocofield=new ICoCo::MEDField((MEDCouplingUMesh *)paramesh->getCellMesh(),parafield->getField()); + icocofield=new ICoCo::MEDField(parafield->getField()); dec.setMethod(srcMeth); dec.attachLocalField(icocofield); } @@ -574,7 +574,7 @@ void ParaMEDMEMTest::testInterpKernelDEC_2D_(const char *srcMeth, const char *ta for(int ielem=0; ielemgetCellMesh(),parafield->getField()); + icocofield=new ICoCo::MEDField(parafield->getField()); dec.setMethod(targetMeth); dec.attachLocalField(icocofield); } @@ -857,7 +857,7 @@ void ParaMEDMEMTest::testInterpKernelDEC_3D_(const char *srcMeth, const char *ta ParaMEDMEM::MEDCouplingUMesh* mesh; ParaMEDMEM::ParaMESH* paramesh; ParaMEDMEM::ParaFIELD* parafield; - ICoCo::Field* icocofield ; + ICoCo::MEDField* icocofield ; string tmp_dir = getenv("TMP"); if (tmp_dir == "") @@ -905,7 +905,7 @@ void ParaMEDMEMTest::testInterpKernelDEC_3D_(const char *srcMeth, const char *ta value[ielem]=1.0; // ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield); - icocofield=new ICoCo::MEDField((MEDCouplingUMesh *)paramesh->getCellMesh(),parafield->getField()); + icocofield=new ICoCo::MEDField(parafield->getField()); dec.setMethod(srcMeth); dec.attachLocalField(icocofield); } @@ -940,7 +940,7 @@ void ParaMEDMEMTest::testInterpKernelDEC_3D_(const char *srcMeth, const char *ta for(int ielem=0; ielemgetCellMesh(),parafield->getField()); + icocofield=new ICoCo::MEDField(parafield->getField()); dec.setMethod(targetMeth); dec.attachLocalField(icocofield); } @@ -2106,7 +2106,7 @@ void ParaMEDMEMTest::testAsynchronousInterpKernelDEC_2D(double dtA, double tmaxA ParaMEDMEM::ParaMESH* paramesh; ParaMEDMEM::ParaFIELD* parafield; - ICoCo::Field* icocofield ; + ICoCo::MEDField* icocofield ; string tmp_dir = getenv("TMP"); if (tmp_dir == "") @@ -2155,7 +2155,7 @@ void ParaMEDMEMTest::testAsynchronousInterpKernelDEC_2D(double dtA, double tmaxA value[ielem]=0.0; // ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield); - icocofield=new ICoCo::MEDField((MEDCouplingUMesh *)paramesh->getCellMesh(),parafield->getField()); + icocofield=new ICoCo::MEDField(parafield->getField()); dec.attachLocalField(icocofield); @@ -2194,7 +2194,7 @@ void ParaMEDMEMTest::testAsynchronousInterpKernelDEC_2D(double dtA, double tmaxA for(int ielem=0; ielemgetCellMesh(),parafield->getField()); + icocofield=new ICoCo::MEDField(parafield->getField()); dec.attachLocalField(icocofield); } diff --git a/src/ParaMEDMEMTest/test_perf.cxx b/src/ParaMEDMEMTest/test_perf.cxx index 6a5d646ea..74695d6b2 100644 --- a/src/ParaMEDMEMTest/test_perf.cxx +++ b/src/ParaMEDMEMTest/test_perf.cxx @@ -149,7 +149,7 @@ void testInterpKernelDEC_2D(const string& filename_xml1, const string& meshname1 ParaMEDMEM::MEDCouplingUMesh* mesh; ParaMEDMEM::ParaMESH* paramesh; ParaMEDMEM::ParaFIELD* parafield; - ICoCo::Field* icocofield ; + ICoCo::MEDField* icocofield ; // To remove tmp files from disk ParaMEDMEMTest_TmpFilesRemover aRemover; @@ -187,7 +187,7 @@ void testInterpKernelDEC_2D(const string& filename_xml1, const string& meshname1 for(int ielem=0; ielemgetCellMesh(),parafield->getField()); + icocofield=new ICoCo::MEDField(parafield->getField()); dec.attachLocalField(icocofield); } @@ -219,7 +219,7 @@ void testInterpKernelDEC_2D(const string& filename_xml1, const string& meshname1 double *value=parafield->getField()->getArray()->getPointer(); for(int ielem=0; ielemgetCellMesh(),parafield->getField()); + icocofield=new ICoCo::MEDField(parafield->getField()); dec.attachLocalField(icocofield); } -- 2.39.2