X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FMEDFileField.txx;h=d08370c773d46b3689e2db6e7bafbc2edfda39fa;hb=de0118467e24e50424bd949ee38e5b7a19f62f45;hp=f0070f5decb623a1914ef7bc8ea38e0b7e174e31;hpb=b4634cfcaa239b987c02485ba0b9b5e6a666676f;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/MEDFileField.txx b/src/MEDLoader/MEDFileField.txx index f0070f5de..d08370c77 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-2019 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 @@ -682,16 +682,32 @@ namespace MEDCoupling * \throw If the data array of \a this is already allocated but has different number of * components than \a field. * \throw If elements in \a mesh are not in the order suitable for writing to the MED file. - * \sa setFieldNoProfileSBT() + * \sa setFieldNoProfileSBT, setFieldProfileFlatly */ template void MEDFileTemplateField1TS::setFieldProfile(const typename Traits::FieldType *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) + { + setFieldProfileGeneral(field,mesh,meshDimRelToMax,profile,true); + } + + /*! + * Same as setFieldProfile except that here profile will be created unconditionally + * \sa setFieldProfile + */ + template + void MEDFileTemplateField1TS::setFieldProfileFlatly(const typename Traits::FieldType *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *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) { setFileName(""); MCAuto ft(MEDCouplingFieldTemplate::NewWithoutCheck(*field)); - contentNotNull()->setFieldProfile(field->timeDiscrSafe(),ft,field->getArray(),mesh,meshDimRelToMax,profile,*this,*contentNotNull()); + contentNotNull()->setFieldProfile(field->timeDiscrSafe(),ft,field->getArray(),mesh,meshDimRelToMax,profile,*this,*contentNotNull(),smartPflKiller); } - + /*! * Return an extraction of \a this using \a extractDef map to specify the extraction. * The keys of \a extractDef is level relative to max ext of \a mm mesh. @@ -1222,18 +1238,33 @@ namespace MEDCoupling * \throw If the data array of \a this is already allocated but has different number of * components than \a field. * \throw If elements in \a mesh are not in the order suitable for writing to the MED file. - * \sa setFieldNoProfileSBT() + * \sa setFieldNoProfileSBT, appendFieldProfileFlatly */ template void MEDFileTemplateFieldMultiTS::appendFieldProfile(const typename Traits::FieldType *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) + { + appendFieldProfileGeneral(field,mesh,meshDimRelToMax,profile,true); + } + + /*! + * 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) + { + 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) { const typename Traits::ArrayType *arr(NULL); if(field) arr=field->getArray(); MCAuto field2(MEDFileTemplateField1TS::ToFieldTemplateWithTime(field)); - contentNotNull()->appendFieldProfile(field2,arr,mesh,meshDimRelToMax,profile,*this); + contentNotNull()->appendFieldProfile(field2,arr,mesh,meshDimRelToMax,profile,*this,smartPflKiller); } - + template const typename MLFieldTraits::FMTSWSDAType *MEDFileTemplateFieldMultiTS::contentNotNull() const {