-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2016 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
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <cmath>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
const double MEDCouplingDefinitionTime::EPS_DFT=1e-15;
if(!f)
throw INTERP_KERNEL::Exception("MEDCouplingDefinitionTimeSlice::New : empty field !");
switch(f->getTimeDiscretization())
- {
+ {
case ONE_TIME:
{
if(arrId.size()!=1)
throw INTERP_KERNEL::Exception("Invalide time discretization ! NO_TIME ! Impossible to build a definition time slice !");
default:
throw INTERP_KERNEL::Exception("Invalide time discretization : Not recognized !");
- }
+ }
}
MEDCouplingDefinitionTimeSlice *MEDCouplingDefinitionTimeSlice::New(TypeOfTimeDiscretization type, const std::vector<int>& tiI, const std::vector<double>& tiD)
{
switch(type)
- {
+ {
case ONE_TIME:
return MEDCouplingDefinitionTimeSliceInst::New(tiI,tiD);
case CONST_ON_TIME_INTERVAL:
return MEDCouplingDefinitionTimeSliceLT::New(tiI,tiD);
default:
throw INTERP_KERNEL::Exception("MEDCouplingDefinitionTimeSlice::New : unrecognized time discretization type !");
- }
+ }
}
bool MEDCouplingDefinitionTimeSlice::isEqual(const MEDCouplingDefinitionTimeSlice& other, double eps) const
return 0;
}
-std::vector<const BigMemoryObject *> MEDCouplingDefinitionTimeSlice::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingDefinitionTimeSlice::getDirectChildrenWithNull() const
{
return std::vector<const BigMemoryObject *>();
}
return _slices.capacity()*(sizeof(MEDCouplingDefinitionTimeSlice)+sizeof(int));
}
-std::vector<const BigMemoryObject *> MEDCouplingDefinitionTime::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingDefinitionTime::getDirectChildrenWithNull() const
{
return std::vector<const BigMemoryObject *>();
}
{
std::vector<int> ids;
int id=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingDefinitionTimeSlice> >::const_iterator it=_slices.begin();it!=_slices.end();it++,id++)
+ for(std::vector< MCAuto<MEDCouplingDefinitionTimeSlice> >::const_iterator it=_slices.begin();it!=_slices.end();it++,id++)
if((*it)->isContaining(tm,_eps))
ids.push_back(id);
if(ids.empty())
std::vector<double> MEDCouplingDefinitionTime::getHotSpotsTime() const
{
std::vector<double> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingDefinitionTimeSlice> >::const_iterator it=_slices.begin();it!=_slices.end();it++)
+ for(std::vector< MCAuto<MEDCouplingDefinitionTimeSlice> >::const_iterator it=_slices.begin();it!=_slices.end();it++)
{
std::vector<double> tmp;
(*it)->getHotSpotsTime(tmp);
void MEDCouplingDefinitionTime::appendRepr(std::ostream& stream) const
{
stream << "Time definition :\n";
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingDefinitionTimeSlice> >::const_iterator it=_slices.begin();it!=_slices.end();it++)
+ for(std::vector< MCAuto<MEDCouplingDefinitionTimeSlice> >::const_iterator it=_slices.begin();it!=_slices.end();it++)
{
stream << " - ";
(*it)->appendRepr(stream);