X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingTimeDiscretization.txx;h=0af09e5d901dbf224c1a8d5680744dc4677289ad;hb=9abc40a840f69fd7f07b356cd31876b64dc81e14;hp=a53e36db243b5d74bb008c630dfd8e7856497145;hpb=bec7037431602509ee55b85e3e54c10b36984153;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingTimeDiscretization.txx b/src/MEDCoupling/MEDCouplingTimeDiscretization.txx index a53e36db2..0af09e5d9 100644 --- a/src/MEDCoupling/MEDCouplingTimeDiscretization.txx +++ b/src/MEDCoupling/MEDCouplingTimeDiscretization.txx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D +// Copyright (C) 2007-2022 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 @@ -60,14 +60,14 @@ namespace MEDCoupling template void MEDCouplingTimeDiscretizationTemplate::copyTinyAttrFrom(const MEDCouplingTimeDiscretizationTemplate& other) { + TimeHolder::copyTinyAttrFrom(other); _time_tolerance=other._time_tolerance; - _time_unit=other._time_unit; } template void MEDCouplingTimeDiscretizationTemplate::copyTinyStringsFrom(const MEDCouplingTimeDiscretizationTemplate& other) { - _time_unit=other._time_unit; + TimeHolder::copyTinyAttrFrom(other); if(_array && other._array) _array->copyStringInfoFrom(*other._array); } @@ -75,7 +75,7 @@ namespace MEDCoupling template std::size_t MEDCouplingTimeDiscretizationTemplate::getHeapMemorySizeWithoutChildren() const { - return _time_unit.capacity(); + return getTimeUnit().capacity(); } template @@ -99,9 +99,9 @@ namespace MEDCoupling bool MEDCouplingTimeDiscretizationTemplate::areStrictlyCompatible(const MEDCouplingTimeDiscretizationTemplate *other, std::string& reason) const { std::ostringstream oss; oss.precision(15); - if(_time_unit!=other->_time_unit) + if(getTimeUnit()!=other->getTimeUnit()) { - oss << "Field discretizations differ : this time unit = \"" << _time_unit << "\" and other time unit = \"" << other->_time_unit << "\" !"; + oss << "Field discretizations differ : this time unit = \"" << getTimeUnit() << "\" and other time unit = \"" << other->getTimeUnit() << "\" !"; reason=oss.str(); return false; } @@ -148,8 +148,8 @@ namespace MEDCoupling return true; if(_array==0 || other->_array==0) return false; - int nbC1(_array->getNumberOfComponents()),nbC2(other->_array->getNumberOfComponents()); - int nbMin(std::min(nbC1,nbC2)); + std::size_t nbC1(_array->getNumberOfComponents()),nbC2(other->_array->getNumberOfComponents()); + std::size_t nbMin(std::min(nbC1,nbC2)); if(nbC1!=nbC2 && nbMin!=1) return false; return true; @@ -164,7 +164,7 @@ namespace MEDCoupling return true; if(_array==0 || other->_array==0) return false; - int nbC1(_array->getNumberOfComponents()),nbC2(other->_array->getNumberOfComponents()); + std::size_t nbC1(_array->getNumberOfComponents()),nbC2(other->_array->getNumberOfComponents()); if(nbC1!=nbC2 && nbC2!=1) return false; return true; @@ -176,7 +176,7 @@ namespace MEDCoupling } template - MEDCouplingTimeDiscretizationTemplate::MEDCouplingTimeDiscretizationTemplate(const MEDCouplingTimeDiscretizationTemplate& other, bool deepCopy):_time_unit(other._time_unit),_time_tolerance(other._time_tolerance) + MEDCouplingTimeDiscretizationTemplate::MEDCouplingTimeDiscretizationTemplate(const MEDCouplingTimeDiscretizationTemplate& other, bool deepCopy):TimeHolder(other),_time_tolerance(other._time_tolerance) { if(other._array) _array=other._array->performCopyOrIncrRef(deepCopy); @@ -225,12 +225,12 @@ namespace MEDCoupling } template - void MEDCouplingTimeDiscretizationTemplate::getTinySerializationIntInformation(std::vector& tinyInfo) const + void MEDCouplingTimeDiscretizationTemplate::getTinySerializationIntInformation(std::vector& tinyInfo) const { if(_array) { tinyInfo.push_back(_array->getNumberOfTuples()); - tinyInfo.push_back(_array->getNumberOfComponents()); + tinyInfo.push_back(ToIdType(_array->getNumberOfComponents())); } else { @@ -248,13 +248,13 @@ namespace MEDCoupling template void MEDCouplingTimeDiscretizationTemplate::getTinySerializationStrInformation(std::vector& tinyInfo) const { - int nbOfCompo(_array->getNumberOfComponents()); - for(int i=0;igetNumberOfComponents()); + for(std::size_t i=0;igetInfoOnComponent(i)); } template - void MEDCouplingTimeDiscretizationTemplate::resizeForUnserialization(const std::vector& tinyInfoI, std::vector::ArrayType *>& arrays) + void MEDCouplingTimeDiscretizationTemplate::resizeForUnserialization(const std::vector& tinyInfoI, std::vector::ArrayType *>& arrays) { arrays.resize(1); if(_array!=0) @@ -270,7 +270,7 @@ namespace MEDCoupling } template - void MEDCouplingTimeDiscretizationTemplate::checkForUnserialization(const std::vector& tinyInfoI, const std::vector::ArrayType *>& arrays) + void MEDCouplingTimeDiscretizationTemplate::checkForUnserialization(const std::vector& tinyInfoI, const std::vector::ArrayType *>& arrays) { static const char MSG[]="MEDCouplingTimeDiscretization::checkForUnserialization : arrays in input is expected to have size one !"; if(arrays.size()!=1) @@ -289,11 +289,11 @@ namespace MEDCoupling } template - void MEDCouplingTimeDiscretizationTemplate::finishUnserialization(const std::vector& tinyInfoI, const std::vector& tinyInfoD, const std::vector& tinyInfoS) + void MEDCouplingTimeDiscretizationTemplate::finishUnserialization(const std::vector& tinyInfoI, const std::vector& tinyInfoD, const std::vector& tinyInfoS) { _time_tolerance=tinyInfoD[0]; - int nbOfCompo=_array->getNumberOfComponents(); - for(int i=0;igetNumberOfComponents(); + for(std::size_t i=0;isetInfoOnComponent(i,tinyInfoS[i]); } @@ -304,7 +304,7 @@ namespace MEDCoupling { std::ostringstream stream; stream << REPR << " Time is defined by iteration=" << _tk.getIteration() << " order=" << _tk.getOrder() << " and time=" << _tk.getTimeValue() << "."; - stream << "\nTime unit is : \"" << this->_time_unit << "\""; + stream << "\nTime unit is : \"" << this->getTimeUnit() << "\""; return stream.str(); }