1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (EDF R&D)
21 #include "MEDFileEquivalence.hxx"
22 #include "MEDFileSafeCaller.txx"
23 #include "MEDCouplingMemArray.hxx"
24 #include "MEDLoaderBase.hxx"
25 #include "MEDFileMesh.hxx"
26 #include "InterpKernelAutoPtr.hxx"
28 extern med_geometry_type typmai[MED_N_CELL_FIXED_GEO];
29 extern INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO];
30 extern med_geometry_type typmai3[34];
31 extern med_geometry_type typmainoeud[1];
33 using namespace MEDCoupling;
35 MEDFileEquivalencePair *MEDFileEquivalencePair::Load(MEDFileEquivalences *father, med_idt fid, const std::string& name, const std::string &desc)
38 throw INTERP_KERNEL::Exception("MEDFileEquivalencePair::Load : father is NULL ! Should not !");
39 MCAuto<MEDFileEquivalencePair> ret(new MEDFileEquivalencePair(father,name,desc));
44 void MEDFileEquivalencePair::write(med_idt fid) const
46 std::string meshName(getFather()->getMeshName());
47 INTERP_KERNEL::AutoPtr<char> meshName2(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
48 INTERP_KERNEL::AutoPtr<char> name(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
49 INTERP_KERNEL::AutoPtr<char> desc(MEDLoaderBase::buildEmptyString(MED_COMMENT_SIZE));
50 MEDLoaderBase::safeStrCpy(meshName.c_str(),MED_NAME_SIZE,meshName2,getFather()->getMesh()->getTooLongStrPolicy());
51 MEDLoaderBase::safeStrCpy(_name.c_str(),MED_NAME_SIZE,name,getFather()->getMesh()->getTooLongStrPolicy());
52 MEDLoaderBase::safeStrCpy(_description.c_str(),MED_COMMENT_SIZE,desc,getFather()->getMesh()->getTooLongStrPolicy());
53 MEDFILESAFECALLERWR0(MEDequivalenceCr,(fid,meshName2,name,desc));
54 const MEDFileEquivalenceCell *cell(_cell);
57 const MEDFileEquivalenceNode *node(_node);
62 const MEDFileMesh *MEDFileEquivalencePair::getMesh() const
64 return getFather()->getMesh();
67 MEDFileMesh *MEDFileEquivalencePair::getMesh()
69 return getFather()->getMesh();
72 MEDFileEquivalencePair *MEDFileEquivalencePair::deepCopy(MEDFileEquivalences *father) const
74 MCAuto<MEDFileEquivalencePair> ret(new MEDFileEquivalencePair(father,_name,_description));
75 const MEDFileEquivalenceCell *cell(_cell);
77 ret->_cell=cell->deepCopy(const_cast<MEDFileEquivalencePair *>(this));
78 const MEDFileEquivalenceNode *node(_node);
80 ret->_node=node->deepCopy(const_cast<MEDFileEquivalencePair *>(this));
84 bool MEDFileEquivalencePair::isEqual(const MEDFileEquivalencePair *other, std::string& what) const
86 if(_name!=other->_name)
88 std::ostringstream oss; oss << "Names differs : " << _name << " != " << other->_name << " !";
92 if(_description!=other->_description)
94 std::ostringstream oss; oss << "Description differs : " << _description << " != " << other->_description << " !";
98 const MEDFileEquivalenceCell *c1(_cell),*c2(other->_cell);
99 if((c1 && !c2) || (!c1 && c2))
101 std::ostringstream oss; oss << "Cell def of Equiv " << _name << " are defined for this and not for other (or reversely) !";
106 if(!c1->isEqual(c2,what))
108 const MEDFileEquivalenceNode *n1(_node),*n2(other->_node);
109 if((n1 && !n2) || (!n1 && n2))
111 std::ostringstream oss; oss << "Node def of Equiv " << _name << " are defined for this and not for other (or reversely) !";
116 if(!n1->isEqual(n2,what))
121 void MEDFileEquivalencePair::getRepr(std::ostream& oss) const
123 const MEDFileEquivalenceNode *node(_node);
124 const MEDFileEquivalenceCell *cell(_cell);
125 oss << std::endl << " name of equivalence : " << _name << std::endl;
126 oss << " description of equivalence : " << _description << std::endl;
129 oss << "None" << std::endl;
134 oss << "None" << std::endl;
139 MEDFileEquivalencePair *MEDFileEquivalencePair::New(MEDFileEquivalences *father, const std::string& name)
141 return new MEDFileEquivalencePair(father,name,std::string());
144 std::vector<const BigMemoryObject *> MEDFileEquivalencePair::getDirectChildrenWithNull() const
146 std::vector<const BigMemoryObject *> ret(2);
147 ret[0]=_cell; ret[1]=_node;
151 void MEDFileEquivalencePair::setArray(int meshDimRelToMaxExt, DataArrayInt *da)
153 if(meshDimRelToMaxExt>1)
154 throw INTERP_KERNEL::Exception("MEDFileEquivalencePair::setArray : meshDimRelToMaxExt must be in [1,0,-1,-2,-3] at most !");
155 if(meshDimRelToMaxExt==1)
157 MEDFileEquivalenceNode *node(_node);
160 _node=new MEDFileEquivalenceNode(this,0);
167 MEDFileEquivalenceCell *cell(_cell);
170 _cell=new MEDFileEquivalenceCell(this);
173 cell->setArray(meshDimRelToMaxExt,da);
178 * The returned pointer is a borrowed pointer.
180 MEDFileEquivalenceCell *MEDFileEquivalencePair::initCell()
182 _cell=new MEDFileEquivalenceCell(this);
187 * The returned pointer is a borrowed pointer.
189 MEDFileEquivalenceNode *MEDFileEquivalencePair::initNode()
191 _node=new MEDFileEquivalenceNode(this,0);
195 std::size_t MEDFileEquivalencePair::getHeapMemorySizeWithoutChildren() const
200 void MEDFileEquivalencePair::load(med_idt fid)
202 std::string meshName(_father->getMeshName());
204 _father->getDtIt(dt,it);
206 MEDFILESAFECALLERRD0(MEDequivalenceCorrespondenceSize,(fid,meshName.c_str(),_name.c_str(),dt,it,MED_NODE,MED_NONE,&ncor));
209 MCAuto<DataArrayInt> da(DataArrayInt::New());
211 MEDFILESAFECALLERRD0(MEDequivalenceCorrespondenceRd,(fid,meshName.c_str(),_name.c_str(),dt,it,MED_NODE,MED_NONE,da->getPointer()));
214 MCAuto<MEDFileEquivalenceNode> node(new MEDFileEquivalenceNode(this,da));
217 _cell=MEDFileEquivalenceCell::Load(fid,this);
220 std::vector<const BigMemoryObject *> MEDFileEquivalences::getDirectChildrenWithNull() const
222 std::size_t sz(_equ.size());
223 std::vector<const BigMemoryObject *> ret(sz);
224 for(std::size_t i=0;i<sz;i++)
229 std::size_t MEDFileEquivalences::getHeapMemorySizeWithoutChildren() const
231 return sizeof(MEDFileEquivalences)+_equ.capacity()*sizeof(MEDFileEquivalencePair);
234 void MEDFileEquivalences::getDtIt(int &dt, int &it) const
236 dt=_owner->getIteration(); it=_owner->getOrder();
239 std::string MEDFileEquivalences::getMeshName() const
241 return _owner->getName();
244 void MEDFileEquivalences::pushEquivalence(MEDFileEquivalencePair *elt)
246 MCAuto<MEDFileEquivalencePair> elta(elt);
249 _equ.push_back(elta);
252 MEDFileEquivalencePair *MEDFileEquivalences::getEquivalence(int i)
257 std::ostringstream oss; oss << "MEDFileEquivalences::getEquivalence : invalid id ! Must be in [0," << sz << ") !";
258 throw INTERP_KERNEL::Exception(oss.str().c_str());
263 MEDFileEquivalencePair *MEDFileEquivalences::getEquivalenceWithName(const std::string& name)
265 for(std::vector< MCAuto<MEDFileEquivalencePair> >::iterator it=_equ.begin();it!=_equ.end();it++)
267 MEDFileEquivalencePair *elt(*it);
270 if(elt->getName()==name)
274 std::ostringstream oss; oss << "MEDFileEquivalences::getEquivalenceWithName : no equivalence with name \"" << name << "\" ! Must be in [ ";
275 std::vector<std::string> eqs(getEquivalenceNames());
276 std::copy(eqs.begin(),eqs.end(),std::ostream_iterator<std::string>(oss,", "));
278 throw INTERP_KERNEL::Exception(oss.str().c_str());
281 int MEDFileEquivalences::size() const
286 std::vector<std::string> MEDFileEquivalences::getEquivalenceNames() const
288 std::vector<std::string> ret;
289 for(std::vector< MCAuto<MEDFileEquivalencePair> >::const_iterator it=_equ.begin();it!=_equ.end();it++)
291 const MEDFileEquivalencePair *elt(*it);
294 ret.push_back(elt->getName());
300 MEDFileEquivalencePair *MEDFileEquivalences::appendEmptyEquivalenceWithName(const std::string& name)
302 MCAuto<MEDFileEquivalencePair> elt(MEDFileEquivalencePair::New(this,name));
307 MEDFileEquivalences *MEDFileEquivalences::deepCopy(MEDFileMesh *owner) const
309 MCAuto<MEDFileEquivalences> ret(new MEDFileEquivalences(owner));
310 ret->deepCpyFrom(*this);
314 bool MEDFileEquivalences::isEqual(const MEDFileEquivalences *other, std::string& what) const
316 std::size_t sz(_equ.size());
317 if(sz!=other->_equ.size())
319 what="Equivalences differs : not same number !";
322 for(std::size_t i=0;i<sz;i++)
324 const MEDFileEquivalencePair *thisp(_equ[i]),*otherp(other->_equ[i]);
325 if(!thisp && !otherp)
329 if(!thisp->isEqual(otherp,what))
331 std::ostringstream oss; oss << "At Eq #" << i << " there is a difference !";
338 std::ostringstream oss; oss << "At Eq #" << i << " defined in this not is other (or reversely) !";
346 void MEDFileEquivalences::getRepr(std::ostream& oss) const
349 for(std::vector< MCAuto<MEDFileEquivalencePair> >::const_iterator it=_equ.begin();it!=_equ.end();it++,ii++)
351 const MEDFileEquivalencePair *elt(*it);
352 oss << "Equivalence #" << ii << " : " ;
356 oss << "None" << std::endl;
360 void MEDFileEquivalences::killEquivalenceWithName(const std::string& name)
362 std::vector< MCAuto<MEDFileEquivalencePair> >::iterator it(_equ.begin());
363 for(;it!=_equ.end();it++)
365 const MEDFileEquivalencePair *elt(*it);
366 if(elt && elt->getName()==name)
371 std::ostringstream oss; oss << "MEDFileEquivalences::killEquivalenceWithName : Equivalence with name \"" << name << "\" not found !";
372 throw INTERP_KERNEL::Exception(oss.str().c_str());
377 void MEDFileEquivalences::killEquivalenceAt(int i)
382 std::ostringstream oss; oss << "MEDFileEquivalences::killEquivalenceAt : Id must be in [0," << sz << ") !";
383 throw INTERP_KERNEL::Exception(oss.str().c_str());
385 std::vector< MCAuto<MEDFileEquivalencePair> >::iterator it(_equ.begin());
386 for(int j=0;j<i;it++,j++);
390 void MEDFileEquivalences::clear()
395 void MEDFileEquivalences::write(med_idt fid) const
397 for(std::vector< MCAuto<MEDFileEquivalencePair> >::const_iterator it=_equ.begin();it!=_equ.end();it++)
399 const MEDFileEquivalencePair *elt(*it);
405 int MEDFileEquivalences::PresenceOfEquivalences(med_idt fid, const std::string& meshName)
407 med_int nequ(MEDnEquivalence(fid,meshName.c_str()));
411 MEDFileEquivalences *MEDFileEquivalences::Load(med_idt fid, int nbOfEq, MEDFileMesh *owner)
413 MCAuto<MEDFileEquivalences> ret(new MEDFileEquivalences(owner));
415 throw INTERP_KERNEL::Exception("MEDFileEquivalences::Load : owner is NULL !");
416 std::string meshName(owner->getName());
417 for(int i=0;i<nbOfEq;i++)
419 INTERP_KERNEL::AutoPtr<char> equ(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
420 INTERP_KERNEL::AutoPtr<char> desc(MEDLoaderBase::buildEmptyString(MED_COMMENT_SIZE));
421 int nstep,nocstpncor;
422 MEDFILESAFECALLERRD0(MEDequivalenceInfo,(fid,meshName.c_str(),i+1,equ,desc,&nstep,&nocstpncor));
423 std::string eqName(MEDLoaderBase::buildStringFromFortran(equ,MED_NAME_SIZE)),eqDescName(MEDLoaderBase::buildStringFromFortran(desc,MED_COMMENT_SIZE));
424 MCAuto<MEDFileEquivalencePair> eqv(MEDFileEquivalencePair::Load(ret,fid,eqName,eqDescName));
425 ret->pushEquivalence(eqv);
430 void MEDFileEquivalences::CheckDataArray(const DataArrayInt *data)
434 data->checkAllocated();
435 if(data->getNumberOfComponents()!=2)
437 std::ostringstream oss; oss << "MEDFileEquivalences::CheckDataArray : Input DataArray must have 2 components !";
438 throw INTERP_KERNEL::Exception(oss.str().c_str());
442 void MEDFileEquivalences::deepCpyFrom(const MEDFileEquivalences& other)
444 for(std::vector< MCAuto<MEDFileEquivalencePair> >::const_iterator it=other._equ.begin();it!=other._equ.end();it++)
446 const MEDFileEquivalencePair *elt(*it);
447 MCAuto<MEDFileEquivalencePair> eltCpy;
450 eltCpy=elt->deepCopy(this);
452 _equ.push_back(eltCpy);
456 MEDFileEquivalenceBase::MEDFileEquivalenceBase(MEDFileEquivalencePair *father):_father(father)
460 MEDFileEquivalenceData::MEDFileEquivalenceData(MEDFileEquivalencePair *owner, DataArrayInt *data):MEDFileEquivalenceBase(owner),_data(data)
466 void MEDFileEquivalenceData::setArray(DataArrayInt *data)
468 MEDFileEquivalences::CheckDataArray(data);
474 std::vector<const BigMemoryObject *> MEDFileEquivalenceData::getDirectChildrenWithNull() const
476 std::vector<const BigMemoryObject *> ret(1);
481 bool MEDFileEquivalenceData::isEqual(const MEDFileEquivalenceData *other, std::string& what) const
483 const DataArrayInt *d1(_data),*d2(other->_data);
484 if((!d1 && d2) || (d1 && !d2))
486 what="Data array is defined in this not in other (or reversely) !";
491 if(!d1->isEqualIfNotWhy(*d2,what))
497 void MEDFileEquivalenceData::writeLL(med_idt fid, med_entity_type medtype, med_geometry_type medgt) const
500 const DataArrayInt *da(getArray());
503 MEDFileEquivalences::CheckDataArray(da);
504 const MEDFileMesh *mesh(getFather()->getMesh());
506 mesh->getTime(dt,it);
507 std::string meshName(mesh->getName());
508 std::string equName(getFather()->getName());
509 INTERP_KERNEL::AutoPtr<char> meshName2(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
510 INTERP_KERNEL::AutoPtr<char> name(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
511 MEDLoaderBase::safeStrCpy(meshName.c_str(),MED_NAME_SIZE,meshName2,getFather()->getMesh()->getTooLongStrPolicy());
512 MEDLoaderBase::safeStrCpy(equName.c_str(),MED_NAME_SIZE,name,getFather()->getMesh()->getTooLongStrPolicy());
513 MCAuto<DataArrayInt> da2(da->deepCopy()); da2->rearrange(1); da2->applyLin(1,1); da2->rearrange(2);
514 MEDFILESAFECALLERWR0(MEDequivalenceCorrespondenceWr,(fid,meshName2,name,dt,it,medtype,medgt,da2->getNumberOfTuples(),da2->begin()));
517 std::size_t MEDFileEquivalenceCellType::getHeapMemorySizeWithoutChildren() const
519 return sizeof(MEDFileEquivalenceCellType);
522 MEDFileEquivalenceCellType *MEDFileEquivalenceCellType::deepCopy(MEDFileEquivalencePair *owner) const
524 MCAuto<DataArrayInt> da;
526 da=getArray()->deepCopy();
527 return new MEDFileEquivalenceCellType(owner,_type,da);
530 bool MEDFileEquivalenceCellType::isEqual(const MEDFileEquivalenceCellType *other, std::string& what) const
532 if(_type!=other->_type)
534 what="Geo types differs !";
537 return MEDFileEquivalenceData::isEqual(other,what);
540 void MEDFileEquivalenceCellType::getRepr(std::ostream& oss) const
542 const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel(_type));
543 const DataArrayInt *da(getArray());
544 oss << cm.getRepr() << ":";
546 oss << da->getNumberOfTuples() << " tuples";
548 oss << "no dataarray";
552 void MEDFileEquivalenceCellType::write(med_idt fid) const
554 writeLL(fid,MED_CELL,typmai3[_type]);
557 std::vector<const BigMemoryObject *> MEDFileEquivalenceCell::getDirectChildrenWithNull() const
559 std::size_t sz(_types.size());
560 std::vector<const BigMemoryObject *> ret(sz);
561 for(std::size_t i=0;i<sz;i++)
566 std::size_t MEDFileEquivalenceCell::getHeapMemorySizeWithoutChildren() const
568 return sizeof(MEDFileEquivalenceCell)+_types.capacity()*sizeof(MEDFileEquivalenceCellType);
571 MEDFileEquivalenceCell *MEDFileEquivalenceCell::Load(med_idt fid, MEDFileEquivalencePair *owner)
573 MCAuto<MEDFileEquivalenceCell> ret(new MEDFileEquivalenceCell(owner));
581 void MEDFileEquivalenceCell::write(med_idt fid) const
583 for(std::vector< MCAuto<MEDFileEquivalenceCellType> >::const_iterator it=_types.begin();it!=_types.end();it++)
585 const MEDFileEquivalenceCellType *ct(*it);
591 MEDFileEquivalenceCell *MEDFileEquivalenceCell::deepCopy(MEDFileEquivalencePair *owner) const
593 MCAuto<MEDFileEquivalenceCell> ret(new MEDFileEquivalenceCell(owner));
594 for(std::vector< MCAuto<MEDFileEquivalenceCellType> >::const_iterator it=_types.begin();it!=_types.end();it++)
596 const MEDFileEquivalenceCellType *elt(*it);
597 MCAuto<MEDFileEquivalenceCellType> eltCpy;
599 eltCpy=elt->deepCopy(owner);
600 ret->_types.push_back(eltCpy);
605 bool MEDFileEquivalenceCell::isEqual(const MEDFileEquivalenceCell *other, std::string& what) const
607 std::size_t sz(_types.size());
608 if(sz!=other->_types.size())
610 std::ostringstream oss; oss << "Nb of geo types differs : " << sz << " != " << other->_types.size();
614 for(std::size_t i=0;i<sz;i++)
616 const MEDFileEquivalenceCellType *ct1(_types[i]),*ct2(other->_types[i]);
617 if((ct1 && !ct2) || (!ct1 && ct2))
619 std::ostringstream oss; oss << "At gt #" << i << " this is defined not other (or reversely !)";
625 if(!ct1->isEqual(ct2,what))
627 std::ostringstream oss; oss << "At gt #" << i << " of Eq " << getFather()->getName() << " it differs !";
636 void MEDFileEquivalenceCell::getRepr(std::ostream& oss) const
638 for(std::vector< MCAuto<MEDFileEquivalenceCellType> >::const_iterator it=_types.begin();it!=_types.end();it++)
640 const MEDFileEquivalenceCellType *elt(*it);
646 DataArrayInt *MEDFileEquivalenceCell::getArray(INTERP_KERNEL::NormalizedCellType type)
648 for(std::vector< MCAuto<MEDFileEquivalenceCellType> >::iterator it=_types.begin();it!=_types.end();it++)
650 MEDFileEquivalenceCellType *elt(*it);
651 if(elt && elt->getType()==type)
652 return elt->getArray();
654 std::ostringstream oss; oss << "MEDFileEquivalenceCell::getArray : In Equivalence \"" << getFather()->getName() << "\" the geotype " << type << " is not available !";
655 throw INTERP_KERNEL::Exception(oss.str().c_str());
658 void MEDFileEquivalenceCell::setArray(int meshDimRelToMax, DataArrayInt *da)
662 MEDFileEquivalences::CheckDataArray(da);
663 MEDFileMesh *mm(getMesh());
664 int totalNbOfCells(mm->getNumberOfCellsAtLevel(meshDimRelToMax));
666 MCAuto<DataArrayInt> tmp(da->deepCopy()); tmp->rearrange(1);
668 tmp->getMinMaxValues(minv,maxv);
669 if((minv<0 || minv>=totalNbOfCells) || (maxv<0 || maxv>=totalNbOfCells))
671 std::ostringstream oss; oss << "MEDFileEquivalenceCell::setArray : Input 2 component DataArray has incorrect values ! all values must be in [0," << totalNbOfCells << ") !";
672 throw INTERP_KERNEL::Exception(oss.str().c_str());
675 std::vector<INTERP_KERNEL::NormalizedCellType> gts(mm->getGeoTypesAtLevel(meshDimRelToMax));
676 int startId(0),endId;
677 std::vector<int> compS(1,0);
678 for(std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator it=gts.begin();it!=gts.end();it++)
680 endId=startId+mm->getNumberOfCellsWithType(*it);
681 MCAuto<DataArrayInt> da0(da->keepSelectedComponents(compS));
682 MCAuto<DataArrayInt> ids(da0->findIdsInRange(startId,endId));
683 MCAuto<DataArrayInt> da1(da->selectByTupleIdSafe(ids->begin(),ids->end()));
684 da1->applyLin(1,-startId);
685 setArrayForType(*it,da1);
690 void MEDFileEquivalenceCell::setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da)
692 for(std::vector< MCAuto<MEDFileEquivalenceCellType> >::iterator it=_types.begin();it!=_types.end();it++)
694 MEDFileEquivalenceCellType *elt(*it);
695 if(elt && elt->getType()==type)
701 MCAuto<MEDFileEquivalenceCellType> newElt(new MEDFileEquivalenceCellType(getFather(),type,da));
702 _types.push_back(newElt);
705 std::vector<INTERP_KERNEL::NormalizedCellType> MEDFileEquivalenceCell::getTypes() const
707 std::vector<INTERP_KERNEL::NormalizedCellType> ret;
708 for(std::vector< MCAuto<MEDFileEquivalenceCellType> >::const_iterator it=_types.begin();it!=_types.end();it++)
710 const MEDFileEquivalenceCellType *elt(*it);
712 ret.push_back(elt->getType());
717 void MEDFileEquivalenceCell::load(med_idt fid)
719 std::string meshName(getFather()->getFather()->getMeshName()),name(getName());
721 getFather()->getFather()->getDtIt(dt,it);
722 for(int i=0;i<MED_N_CELL_FIXED_GEO;i++)
725 MEDFILESAFECALLERRD0(MEDequivalenceCorrespondenceSize,(fid,meshName.c_str(),name.c_str(),dt,it,MED_CELL,typmai[i],&ncor));
728 MCAuto<DataArrayInt> da(DataArrayInt::New());
730 MEDFILESAFECALLERRD0(MEDequivalenceCorrespondenceRd,(fid,meshName.c_str(),name.c_str(),dt,it,MED_CELL,typmai[i],da->getPointer()));
733 MCAuto<MEDFileEquivalenceCellType> ct(new MEDFileEquivalenceCellType(getFather(),typmai2[i],da));
734 _types.push_back(ct);
739 std::size_t MEDFileEquivalenceNode::getHeapMemorySizeWithoutChildren() const
741 return sizeof(MEDFileEquivalenceNode);
744 void MEDFileEquivalenceNode::write(med_idt fid) const
746 writeLL(fid,MED_NODE,MED_NONE);
749 MEDFileEquivalenceNode *MEDFileEquivalenceNode::deepCopy(MEDFileEquivalencePair *owner) const
751 MCAuto<DataArrayInt> da;
753 da=getArray()->deepCopy();
754 MCAuto<MEDFileEquivalenceNode> ret(new MEDFileEquivalenceNode(owner,da));
758 bool MEDFileEquivalenceNode::isEqual(const MEDFileEquivalenceNode *other, std::string& what) const
760 return MEDFileEquivalenceData::isEqual(other,what);
763 void MEDFileEquivalenceNode::getRepr(std::ostream& oss) const
765 const DataArrayInt *da(getArray());
767 oss << " No dataarray defined !" << std::endl;
769 oss << da->getNumberOfTuples() << " tuples in node equivalence." << std::endl;