X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FMEDFileField.txx;h=254194fe85788205a271169d9d40b48e4ad0c07f;hb=f2ab61e92f55ee52cf5196f7904f625d93c8c2d0;hp=42e3edad307a7b4367193757b3fe70f4a1baa94f;hpb=ffdef130a5a36893d8e58d538884e79413975c7a;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/MEDFileField.txx b/src/MEDLoader/MEDFileField.txx index 42e3edad3..254194fe8 100644 --- a/src/MEDLoader/MEDFileField.txx +++ b/src/MEDLoader/MEDFileField.txx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D +// Copyright (C) 2007-2020 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 @@ -18,12 +18,12 @@ // // Author : Anthony Geay (EDF R&D) -#ifndef __MEDFILEFIELD_TXX__ -#define __MEDFILEFIELD_TXX__ +#pragma once #include "MEDFileField.hxx" #include "MEDCouplingTraits.hxx" -#include "MEDCouplingFieldInt.hxx" +#include "MEDCouplingFieldInt32.hxx" +#include "MEDCouplingFieldInt64.hxx" #include "MEDCouplingFieldFloat.hxx" #include "MEDCouplingFieldDouble.hxx" #include "MEDCouplingFieldTemplate.hxx" @@ -127,7 +127,7 @@ namespace MEDCoupling * \sa getUndergroundDataArrayTemplate() */ template - typename Traits::ArrayType *MEDFileField1TSTemplateWithoutSDA::getUndergroundDataArrayTemplateExt(std::vector< std::pair,std::pair > >& entries) const + typename Traits::ArrayType *MEDFileField1TSTemplateWithoutSDA::getUndergroundDataArrayTemplateExt(std::vector< std::pair,std::pair > >& entries) const { if(this->_field_per_mesh.size()!=1) throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutSDA::getUndergroundDataArrayExt : field lies on several meshes, this method has no sense !"); @@ -151,7 +151,7 @@ namespace MEDCoupling } template - void MEDFileField1TSTemplateWithoutSDA::aggregate(const std::vector::F1TSWSDAType const *>& f1tss, const std::vector< std::vector< std::pair > >& dts) + void MEDFileField1TSTemplateWithoutSDA::aggregate(const std::vector::F1TSWSDAType const *>& f1tss, const std::vector< std::vector< std::pair > >& dts) { if(f1tss.empty()) throw INTERP_KERNEL::Exception("MEDFileField1TSTemplateWithoutSDA::aggregate : empty vector !"); @@ -174,15 +174,15 @@ namespace MEDCoupling setName(refPt->getName()); const DataArray *arr(refPt->getUndergroundDataArray()); - int nbCompo(arr->getNumberOfComponents()); + std::size_t nbCompo(arr->getNumberOfComponents()); for(typename std::vector::F1TSWSDAType const *>::const_iterator it=f1tss.begin();it!=f1tss.end();it++) { const typename Traits::ArrayType *myArr((*it)->getUndergroundDataArrayTemplate()); if(myArr->getNumberOfComponents()!=nbCompo) throw INTERP_KERNEL::Exception("MEDFileField1TSTemplateWithoutSDA::aggregate : arrays must have same number of components !"); } - std::vector > > extractInfo; - int start(0); + std::vector > > extractInfo; + mcIdType start(0); MCAuto fpm(MEDFileFieldPerMesh::Aggregate(start,pms,dts,this,extractInfo)); _field_per_mesh.push_back(fpm); int iteration,order; @@ -191,7 +191,7 @@ namespace MEDCoupling _arr=Traits::ArrayType::New(); _arr->alloc(start,nbCompo); _arr->copyStringInfoFrom(*arr); start=0; - for(std::vector > >::const_iterator it=extractInfo.begin();it!=extractInfo.end();it++) + for(std::vector > >::const_iterator it=extractInfo.begin();it!=extractInfo.end();it++) { const DataArray *zeArr(das[(*it).first]); _arr->setContigPartOfSelectedValuesSlice(start,zeArr,(*it).second.first,(*it).second.second,1); @@ -401,7 +401,7 @@ namespace MEDCoupling * \throw If no field values of the given \a type or given \a meshDimRelToMax are available. */ template - typename Traits::ArrayType *MEDFileTemplateField1TS::getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const + typename Traits::ArrayType *MEDFileTemplateField1TS::getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayIdType *&pfl) const { MCAuto arr(contentNotNull()->getFieldWithProfile(type,meshDimRelToMax,mesh,pfl,this,*contentNotNull())); return ReturnSafelyTypedDataArray(arr); @@ -420,7 +420,7 @@ namespace MEDCoupling } template - typename Traits::ArrayType *MEDFileTemplateField1TS::getUndergroundDataArrayExt(std::vector< std::pair,std::pair > >& entries) const + typename Traits::ArrayType *MEDFileTemplateField1TS::getUndergroundDataArrayExt(std::vector< std::pair,std::pair > >& entries) const { return contentNotNull()->getUndergroundDataArrayTemplateExt(entries); } @@ -685,23 +685,23 @@ namespace MEDCoupling * \sa setFieldNoProfileSBT, setFieldProfileFlatly */ template - void MEDFileTemplateField1TS::setFieldProfile(const typename Traits::FieldType *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) + void MEDFileTemplateField1TS::setFieldProfile(const typename Traits::FieldType *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile) { setFieldProfileGeneral(field,mesh,meshDimRelToMax,profile,true); } /*! - * Same as setFieldProfile except that here profile will be created un + * Same as setFieldProfile except that here profile will be created unconditionally * \sa setFieldProfile */ template - void setFieldProfileFlatly(const typename Traits::FieldType *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) + void MEDFileTemplateField1TS::setFieldProfileFlatly(const typename Traits::FieldType *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile) { setFieldProfileGeneral(field,mesh,meshDimRelToMax,profile,false); } template - void MEDFileTemplateField1TS::setFieldProfileGeneral(const typename Traits::FieldType *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, bool smartPflKiller) + void MEDFileTemplateField1TS::setFieldProfileGeneral(const typename Traits::FieldType *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile, bool smartPflKiller) { setFileName(""); MCAuto ft(MEDCouplingFieldTemplate::NewWithoutCheck(*field)); @@ -716,7 +716,7 @@ namespace MEDCoupling * \sa MEDFileUMesh::deduceNodeSubPartFromCellSubPart , MEDFileUMesh::extractPart */ template - typename MLFieldTraits::F1TSType *MEDFileTemplateField1TS::extractPartImpl(const std::map >& extractDef, MEDFileMesh *mm) const + typename MLFieldTraits::F1TSType *MEDFileTemplateField1TS::extractPartImpl(const std::map >& extractDef, MEDFileMesh *mm) const { if(!mm) throw INTERP_KERNEL::Exception("MEDFileField1TS::extractPart : input mesh is NULL !"); @@ -730,10 +730,10 @@ namespace MEDCoupling getNonEmptyLevels(mm->getName(),levs); for(std::vector::const_iterator lev=levs.begin();lev!=levs.end();lev++) { - std::map >::const_iterator it2(extractDef.find(*lev)); + std::map >::const_iterator it2(extractDef.find(*lev)); if(it2!=extractDef.end()) { - MCAuto t((*it2).second); + MCAuto t((*it2).second); if(t.isNull()) throw INTERP_KERNEL::Exception("MEDFileField1TS::extractPart : presence of a value with null pointer 1 !"); MCAuto::FieldType> f(getFieldOnMeshAtLevel(ON_CELLS,(*lev),mm)); @@ -744,10 +744,10 @@ namespace MEDCoupling } else { - std::map >::const_iterator it2(extractDef.find(1)); + std::map >::const_iterator it2(extractDef.find(1)); if(it2==extractDef.end()) throw INTERP_KERNEL::Exception("MEDFileField1TS::extractPart : presence of a NODE field and no extract array available for NODE !"); - MCAuto t((*it2).second); + MCAuto t((*it2).second); if(t.isNull()) throw INTERP_KERNEL::Exception("MEDFileField1TS::extractPart : presence of a value with null pointer 1 !"); MCAuto::FieldType> f(getFieldOnMeshAtLevel(ON_NODES,0,mm)); @@ -888,7 +888,7 @@ namespace MEDCoupling * \return A new object that the caller is responsible to deallocate. */ template - typename MLFieldTraits::FMTSType *MEDFileTemplateFieldMultiTS::extractPartImpl(const std::map >& extractDef, MEDFileMesh *mm) const + typename MLFieldTraits::FMTSType *MEDFileTemplateFieldMultiTS::extractPartImpl(const std::map >& extractDef, MEDFileMesh *mm) const { if(!mm) throw INTERP_KERNEL::Exception("MEDFileTemplateFieldMultiTS::extractPart : mesh is null !"); @@ -1175,7 +1175,7 @@ namespace MEDCoupling * \param [in] order - the iteration order number of required time step. * \param [in] meshDimRelToMax - a relative dimension of the supporting mesh entities. * \param [in] mesh - the supporting mesh. - * \param [out] pfl - a new instance of DataArrayInt holding ids of mesh entities the + * \param [out] pfl - a new instance of DataArrayIdType holding ids of mesh entities the * field of interest lies on. If the field lies on all entities of the given * dimension, all ids in \a pfl are zero. The caller is to delete this array * using decrRef() as it is no more needed. @@ -1187,7 +1187,7 @@ namespace MEDCoupling * \throw If no field values of the required parameters are available. */ template - typename Traits::ArrayType *MEDFileTemplateFieldMultiTS::getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const + typename Traits::ArrayType *MEDFileTemplateFieldMultiTS::getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayIdType *&pfl) const { const MEDFileAnyTypeField1TSWithoutSDA& myF1TS(contentNotNullBase()->getTimeStepEntry(iteration,order)); const typename MLFieldTraits::F1TSWSDAType *myF1TSC(dynamic_cast::F1TSWSDAType *>(&myF1TS)); @@ -1241,7 +1241,7 @@ namespace MEDCoupling * \sa setFieldNoProfileSBT, appendFieldProfileFlatly */ template - void MEDFileTemplateFieldMultiTS::appendFieldProfile(const typename Traits::FieldType *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) + void MEDFileTemplateFieldMultiTS::appendFieldProfile(const typename Traits::FieldType *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile) { appendFieldProfileGeneral(field,mesh,meshDimRelToMax,profile,true); } @@ -1250,13 +1250,13 @@ namespace MEDCoupling * same as appendFieldProfile except that here profile is created unconditionaly */ template - void MEDFileTemplateFieldMultiTS::appendFieldProfileFlatly(const typename Traits::FieldType *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) + void MEDFileTemplateFieldMultiTS::appendFieldProfileFlatly(const typename Traits::FieldType *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile) { appendFieldProfileGeneral(field,mesh,meshDimRelToMax,profile,false); } template - void MEDFileTemplateFieldMultiTS::appendFieldProfileGeneral(const typename Traits::FieldType *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, bool smartPflKiller) + void MEDFileTemplateFieldMultiTS::appendFieldProfileGeneral(const typename Traits::FieldType *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile, bool smartPflKiller) { const typename Traits::ArrayType *arr(NULL); if(field) @@ -1332,7 +1332,7 @@ namespace MEDCoupling } template - typename Traits::ArrayType *MEDFileTemplateFieldMultiTS::getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair,std::pair > >& entries) const + typename Traits::ArrayType *MEDFileTemplateFieldMultiTS::getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair,std::pair > >& entries) const { DataArray *ret(contentNotNull()->getUndergroundDataArrayExt(iteration,order,entries)); if(!ret) @@ -1397,5 +1397,3 @@ namespace MEDCoupling return ret.retn(); } } - -#endif