1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Yann Pora (EDF R&D)
21 #include "MEDCouplingFieldInt.hxx"
23 using namespace MEDCoupling;
25 MEDCouplingFieldInt *MEDCouplingFieldInt::New(TypeOfField type, TypeOfTimeDiscretization td)
27 return new MEDCouplingFieldInt(type,td);
30 void MEDCouplingFieldInt::checkConsistencyLight() const
32 MEDCouplingField::checkConsistencyLight();
34 throw INTERP_KERNEL::Exception("MEDCouplingFieldInt::checkConsistencyLight : array is null !");
35 _type->checkCoherencyBetween(_mesh,getArray());
38 std::string MEDCouplingFieldInt::simpleRepr() const
43 void MEDCouplingFieldInt::reprQuickOverview(std::ostream& stream) const
47 void MEDCouplingFieldInt::setTimeUnit(const std::string& unit)
49 _time_discr->setTimeUnit(unit);
52 std::string MEDCouplingFieldInt::getTimeUnit() const
54 return _time_discr->getTimeUnit();
57 void MEDCouplingFieldInt::setTime(double val, int iteration, int order)
59 _time_discr->setTime(val,iteration,order);
62 double MEDCouplingFieldInt::getTime(int& iteration, int& order) const
64 return _time_discr->getTime(iteration,order);
67 void MEDCouplingFieldInt::setArray(DataArrayInt *array)
69 MCAuto<DataArrayInt> array2(array);
70 if(array2.isNotNull())
73 //_time_discr->setArray(array,this);
76 const DataArrayInt *MEDCouplingFieldInt::getArray() const
81 DataArrayInt *MEDCouplingFieldInt::getArray()
86 MEDCouplingFieldInt::MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td):MEDCouplingField(type),_time_discr(MEDCouplingTimeDiscretization::New(td))
90 MEDCouplingFieldInt::MEDCouplingFieldInt(const MEDCouplingFieldInt& other, bool deepCopy):MEDCouplingField(other,deepCopy),_time_discr(other._time_discr->performCopyOrIncrRef(deepCopy))
92 if(other._array.isNull())
96 _array=other._array->deepCopy();
104 MEDCouplingFieldInt::MEDCouplingFieldInt(NatureOfField n, MEDCouplingTimeDiscretization *td, MEDCouplingFieldDiscretization *type):MEDCouplingField(type,n),_time_discr(td)
108 MEDCouplingFieldInt::~MEDCouplingFieldInt()