//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
const DataArrayDouble *otherArr(other._arrs[i].first);
if(!thisArr || !otherArr)
throw INTERP_KERNEL::Exception("DataArrayDoubleCollection::copyFrom : empty DataArray !");
const DataArrayDouble *otherArr(other._arrs[i].first);
if(!thisArr || !otherArr)
throw INTERP_KERNEL::Exception("DataArrayDoubleCollection::copyFrom : empty DataArray !");
const DataArrayDouble *DataArrayDoubleCollection::getFieldWithName(const std::string& name) const
{
std::vector<std::string> vec;
const DataArrayDouble *DataArrayDoubleCollection::getFieldWithName(const std::string& name) const
{
std::vector<std::string> vec;
DataArrayDouble *DataArrayDoubleCollection::getFieldWithName(const std::string& name)
{
std::vector<std::string> vec;
DataArrayDouble *DataArrayDoubleCollection::getFieldWithName(const std::string& name)
{
std::vector<std::string> vec;
_arrs[i].first->alloc(0,info.second);
_arrs[i].first->setName(info.first);
names[i]=info.second;
_arrs[i].first->alloc(0,info.second);
_arrs[i].first->setName(info.first);
names[i]=info.second;
}
}
std::size_t DataArrayDoubleCollection::getHeapMemorySizeWithoutChildren() const
{
std::size_t ret(sizeof(DataArrayDoubleCollection));
}
}
std::size_t DataArrayDoubleCollection::getHeapMemorySizeWithoutChildren() const
{
std::size_t ret(sizeof(DataArrayDoubleCollection));
return ret;
}
std::vector<const BigMemoryObject *> DataArrayDoubleCollection::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
return ret;
}
std::vector<const BigMemoryObject *> DataArrayDoubleCollection::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
ret.push_back((const DataArrayDouble *)(*it).first);
return ret;
}
void DataArrayDoubleCollection::updateTime() const
{
ret.push_back((const DataArrayDouble *)(*it).first);
return ret;
}
void DataArrayDoubleCollection::updateTime() const
{
{
return new MEDCouplingGridCollection(*this,newGf,oldGf);
}
void MEDCouplingGridCollection::alloc(int ghostLev)
{
{
return new MEDCouplingGridCollection(*this,newGf,oldGf);
}
void MEDCouplingGridCollection::alloc(int ghostLev)
{
{
int nbTuples((*it).first->getNumberOfCellsAtCurrentLevelGhost(ghostLev));
DataArrayDoubleCollection *dadc((*it).second);
{
int nbTuples((*it).first->getNumberOfCellsAtCurrentLevelGhost(ghostLev));
DataArrayDoubleCollection *dadc((*it).second);
(*it).second->spillInfoOnComponents(compNames);
}
void MEDCouplingGridCollection::spillNatures(const std::vector<NatureOfField>& nfs)
{
(*it).second->spillInfoOnComponents(compNames);
}
void MEDCouplingGridCollection::spillNatures(const std::vector<NatureOfField>& nfs)
{
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::const_iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++,ret++)
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::const_iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++,ret++)
{
std::vector<int> deltaThis,deltaOther;
std::vector< std::pair<int,int> > rgThis((*it).first->positionRelativeToGodFather(deltaThis));
std::vector<int> thisSt((*it).first->getImageMesh()->getCellGridStructure());
std::transform(thisSt.begin(),thisSt.end(),thisSt.begin(),std::bind2nd(std::plus<int>(),2*ghostLev));
{
std::vector<int> deltaThis,deltaOther;
std::vector< std::pair<int,int> > rgThis((*it).first->positionRelativeToGodFather(deltaThis));
std::vector<int> thisSt((*it).first->getImageMesh()->getCellGridStructure());
std::transform(thisSt.begin(),thisSt.end(),thisSt.begin(),std::bind2nd(std::plus<int>(),2*ghostLev));
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::const_iterator it2=other._map_of_dadc.begin();it2!=other._map_of_dadc.end();it2++)
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::const_iterator it2=other._map_of_dadc.begin();it2!=other._map_of_dadc.end();it2++)
{
std::vector< std::pair<int,int> > rgOther((*it2).first->positionRelativeToGodFather(deltaOther));
if(MEDCouplingStructuredMesh::AreRangesIntersect(rgThis,rgOther))
{
std::vector< std::pair<int,int> > rgOther((*it2).first->positionRelativeToGodFather(deltaOther));
if(MEDCouplingStructuredMesh::AreRangesIntersect(rgThis,rgOther))
{
const DataArrayDouble *otherArr((*it2).second->at(i));
DataArrayDouble *thisArr((*it).second->at(i));
{
const DataArrayDouble *otherArr((*it2).second->at(i));
DataArrayDouble *thisArr((*it).second->at(i));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> partOfOther(MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(otherSt,otherArr,pOther));
+ MCAuto<DataArrayDouble> partOfOther(MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(otherSt,otherArr,pOther));
MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(thisSt,thisArr,pThis,partOfOther);
}
}
MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(thisSt,thisArr,pThis,partOfOther);
}
}
- const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >& mf(fine->_map_of_dadc);
- const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >& mc(coarse->_map_of_dadc);
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::const_iterator it=mf.begin();it!=mf.end();it++)
+ const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >& mf(fine->_map_of_dadc);
+ const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >& mc(coarse->_map_of_dadc);
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::const_iterator it=mf.begin();it!=mf.end();it++)
{
const MEDCouplingCartesianAMRMeshGen *fineMesh((*it).first);
const MEDCouplingCartesianAMRMeshGen *fatherOfFineMesh(fineMesh->getFather());
bool found(false);
{
const MEDCouplingCartesianAMRMeshGen *fineMesh((*it).first);
const MEDCouplingCartesianAMRMeshGen *fatherOfFineMesh(fineMesh->getFather());
bool found(false);
- const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >& mf(fine->_map_of_dadc);
- const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >& mc(coarse->_map_of_dadc);
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::const_iterator it=mf.begin();it!=mf.end();it++)
+ const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >& mf(fine->_map_of_dadc);
+ const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >& mc(coarse->_map_of_dadc);
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::const_iterator it=mf.begin();it!=mf.end();it++)
{
const MEDCouplingCartesianAMRMeshGen *fineMesh((*it).first);
const MEDCouplingCartesianAMRMeshGen *fatherOfFineMesh(fineMesh->getFather());
bool found(false);
{
const MEDCouplingCartesianAMRMeshGen *fineMesh((*it).first);
const MEDCouplingCartesianAMRMeshGen *fatherOfFineMesh(fineMesh->getFather());
bool found(false);
{
std::vector< std::pair<const MEDCouplingCartesianAMRPatch *,const MEDCouplingCartesianAMRPatch *> > ret;
std::map<const MEDCouplingCartesianAMRMeshGen *,std::vector< const MEDCouplingCartesianAMRMeshGen * > > m;
{
std::vector< std::pair<const MEDCouplingCartesianAMRPatch *,const MEDCouplingCartesianAMRPatch *> > ret;
std::map<const MEDCouplingCartesianAMRMeshGen *,std::vector< const MEDCouplingCartesianAMRMeshGen * > > m;
{
const MEDCouplingCartesianAMRMeshGen *fineMesh((*it).first);
const MEDCouplingCartesianAMRMeshGen *fatherOfFineMesh(fineMesh->getFather());
{
const MEDCouplingCartesianAMRMeshGen *fineMesh((*it).first);
const MEDCouplingCartesianAMRMeshGen *fatherOfFineMesh(fineMesh->getFather());
- const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >& mf(fine->_map_of_dadc);
- const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >& mc(coarse->_map_of_dadc);
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::const_iterator it=mf.begin();it!=mf.end();it++)
+ const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >& mf(fine->_map_of_dadc);
+ const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >& mc(coarse->_map_of_dadc);
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::const_iterator it=mf.begin();it!=mf.end();it++)
{
const MEDCouplingCartesianAMRMeshGen *fineMesh((*it).first);
const MEDCouplingCartesianAMRMeshGen *fatherOfFineMesh(fineMesh->getFather());
bool found(false);
{
const MEDCouplingCartesianAMRMeshGen *fineMesh((*it).first);
const MEDCouplingCartesianAMRMeshGen *fatherOfFineMesh(fineMesh->getFather());
bool found(false);
void MEDCouplingGridCollection::fillIfInTheProgenyOf(const std::string& fieldName, const MEDCouplingCartesianAMRMeshGen *head, std::vector<const DataArrayDouble *>& recurseArrs) const
{
void MEDCouplingGridCollection::fillIfInTheProgenyOf(const std::string& fieldName, const MEDCouplingCartesianAMRMeshGen *head, std::vector<const DataArrayDouble *>& recurseArrs) const
{
_map_of_dadc[i].first=newGf->getMeshAtPosition(pos);
const DataArrayDoubleCollection *dac(other._map_of_dadc[i].second);
if(dac)
_map_of_dadc[i].first=newGf->getMeshAtPosition(pos);
const DataArrayDoubleCollection *dac(other._map_of_dadc[i].second);
if(dac)
}
}
std::size_t MEDCouplingGridCollection::getHeapMemorySizeWithoutChildren() const
{
std::size_t ret(sizeof(MEDCouplingGridCollection));
}
}
std::size_t MEDCouplingGridCollection::getHeapMemorySizeWithoutChildren() const
{
std::size_t ret(sizeof(MEDCouplingGridCollection));
return ret;
}
std::vector<const BigMemoryObject *> MEDCouplingGridCollection::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
return ret;
}
std::vector<const BigMemoryObject *> MEDCouplingGridCollection::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
ret.push_back((const DataArrayDoubleCollection *)(*it).second);
return ret;
}
void MEDCouplingGridCollection::updateTime() const
{
ret.push_back((const DataArrayDoubleCollection *)(*it).second);
return ret;
}
void MEDCouplingGridCollection::updateTime() const
{
ret->spillInfoOnComponents(compNames);
return ret.retn();
}
/*!
* Assign the info on components for all DataArrayDouble instance recursively stored in \a this.
ret->spillInfoOnComponents(compNames);
return ret.retn();
}
/*!
* Assign the info on components for all DataArrayDouble instance recursively stored in \a this.
* The second dim of \a compNames represent the component names component per component corresponding to the field. The size of this 2nd dimension has
* to perfectly fit with those specified in MEDCouplingAMRAttribute::New.
*/
void MEDCouplingAMRAttribute::spillInfoOnComponents(const std::vector< std::vector<std::string> >& compNames)
{
_tlc.checkConst();
* The second dim of \a compNames represent the component names component per component corresponding to the field. The size of this 2nd dimension has
* to perfectly fit with those specified in MEDCouplingAMRAttribute::New.
*/
void MEDCouplingAMRAttribute::spillInfoOnComponents(const std::vector< std::vector<std::string> >& compNames)
{
_tlc.checkConst();
MEDCouplingFieldDouble *MEDCouplingAMRAttribute::buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const
{
const DataArrayDouble *arr(0);
MEDCouplingFieldDouble *MEDCouplingAMRAttribute::buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const
{
const DataArrayDouble *arr(0);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingIMesh> im(mesh->getImageMesh()->buildWithGhost(_ghost_lev));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(ON_CELLS));
+ MCAuto<MEDCouplingIMesh> im(mesh->getImageMesh()->buildWithGhost(_ghost_lev));
+ MCAuto<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(ON_CELLS));
MEDCouplingFieldDouble *MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const
{
const DataArrayDouble *arr(0);
MEDCouplingFieldDouble *MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const
{
const DataArrayDouble *arr(0);
arr2->alloc(mesh->getImageMesh()->getNumberOfCells(),arr->getNumberOfComponents());
std::vector< std::pair<int,int> > cgs2(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(cgs));
MEDCouplingStructuredMesh::ApplyGhostOnCompactFrmt(cgs2,_ghost_lev);
arr2->alloc(mesh->getImageMesh()->getNumberOfCells(),arr->getNumberOfComponents());
std::vector< std::pair<int,int> > cgs2(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(cgs));
MEDCouplingStructuredMesh::ApplyGhostOnCompactFrmt(cgs2,_ghost_lev);
MEDCouplingIMesh::SpreadCoarseToFine(arr,cgsWG,arr2,cgs2,fakeFactors);
arr2->copyStringInfoFrom(*arr);
//
MEDCouplingIMesh::SpreadCoarseToFine(arr,cgsWG,arr2,cgs2,fakeFactors);
arr2->copyStringInfoFrom(*arr);
//
{
std::vector<MEDCouplingCartesianAMRPatchGen *> patches(gf->retrieveGridsAt(i));
std::size_t sz(patches.size());
{
std::vector<MEDCouplingCartesianAMRPatchGen *> patches(gf->retrieveGridsAt(i));
std::size_t sz(patches.size());
const DataArrayDoubleCollection& ddc(_levs[i]->getFieldsAt(tmp));
std::vector<DataArrayDouble *> arrs(ddc.retrieveFields());
std::size_t nbFields(arrs.size());
const DataArrayDoubleCollection& ddc(_levs[i]->getFieldsAt(tmp));
std::vector<DataArrayDouble *> arrs(ddc.retrieveFields());
std::size_t nbFields(arrs.size());
std::vector<int> cgs(mesh->getImageMesh()->getCellGridStructure()),cgsWG(im->getCellGridStructure());
arrs2Safe[pp]=DataArrayDouble::New();
arrs2Safe[pp]->alloc(mesh->getImageMesh()->getNumberOfCells(),arrs[pp]->getNumberOfComponents());
std::vector<int> cgs(mesh->getImageMesh()->getCellGridStructure()),cgsWG(im->getCellGridStructure());
arrs2Safe[pp]=DataArrayDouble::New();
arrs2Safe[pp]->alloc(mesh->getImageMesh()->getNumberOfCells(),arrs[pp]->getNumberOfComponents());
if(!lev0)
throw INTERP_KERNEL::Exception("MEDCouplingAMRAttribute::projectTo : lev0 is NULL !");
std::vector< std::pair < std::string, std::vector<std::string> > > fieldNames(lev0->getInfoOnComponents());
if(!lev0)
throw INTERP_KERNEL::Exception("MEDCouplingAMRAttribute::projectTo : lev0 is NULL !");
std::vector< std::pair < std::string, std::vector<std::string> > > fieldNames(lev0->getInfoOnComponents());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingAMRAttribute> ret(MEDCouplingAMRAttribute::New(targetGF,fieldNames,_ghost_lev));
+ MCAuto<MEDCouplingAMRAttribute> ret(MEDCouplingAMRAttribute::New(targetGF,fieldNames,_ghost_lev));
std::size_t MEDCouplingAMRAttribute::getHeapMemorySizeWithoutChildren() const
{
std::size_t ret(sizeof(MEDCouplingAMRAttribute));
std::size_t MEDCouplingAMRAttribute::getHeapMemorySizeWithoutChildren() const
{
std::size_t ret(sizeof(MEDCouplingAMRAttribute));
return ret;
}
std::vector<const BigMemoryObject *> MEDCouplingAMRAttribute::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
return ret;
}
std::vector<const BigMemoryObject *> MEDCouplingAMRAttribute::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
{
std::vector<MEDCouplingCartesianAMRPatchGen *> patches(gf->retrieveGridsAt(i));
std::size_t sz(patches.size());
{
std::vector<MEDCouplingCartesianAMRPatchGen *> patches(gf->retrieveGridsAt(i));
std::size_t sz(patches.size());
for(std::size_t j=0;j<sz;j++)
patchesSafe[j]=patches[j];
std::vector<const MEDCouplingCartesianAMRMeshGen *> ms(sz);
for(std::size_t j=0;j<sz;j++)
patchesSafe[j]=patches[j];
std::vector<const MEDCouplingCartesianAMRMeshGen *> ms(sz);