1 // Copyright (C) 2020-2022 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 : Anthony Geay (EDF R&D)
21 #include "MEDCouplingFieldInt64.hxx"
22 #include "MEDCouplingFieldT.txx"
23 #include "MEDCouplingFieldDouble.hxx"
24 #include "MEDCouplingFieldTemplate.hxx"
25 #include "MEDCouplingMesh.hxx"
26 #include "MEDCouplingMemArray.txx"
28 using namespace MEDCoupling;
30 template class MEDCoupling::MEDCouplingFieldT<Int64>;
32 MEDCouplingFieldInt64 *MEDCouplingFieldInt64::New(TypeOfField type, TypeOfTimeDiscretization td)
34 return new MEDCouplingFieldInt64(type,td);
37 MEDCouplingFieldInt64 *MEDCouplingFieldInt64::New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td)
39 return new MEDCouplingFieldInt64(ft,td);
42 MEDCouplingFieldInt64::MEDCouplingFieldInt64(TypeOfField type, TypeOfTimeDiscretization td):MEDCouplingFieldT<Int64>(type,MEDCouplingTimeDiscretizationInt64::New(td))
46 MEDCouplingFieldInt64::MEDCouplingFieldInt64(const MEDCouplingFieldInt64& other, bool deepCpy):MEDCouplingFieldT<Int64>(other,deepCpy)
50 MEDCouplingFieldInt64::MEDCouplingFieldInt64(NatureOfField n, MEDCouplingTimeDiscretizationInt64 *td, MEDCouplingFieldDiscretization *type):MEDCouplingFieldT<Int64>(type,n,td)
55 * ** WARINING : This method do not deeply copy neither mesh nor spatial discretization. Only a shallow copy (reference) is done for mesh and spatial discretization ! **
57 MEDCouplingFieldInt64::MEDCouplingFieldInt64(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td):MEDCouplingFieldT<Int64>(ft,MEDCouplingTimeDiscretizationInt64::New(td),false)
61 MEDCouplingFieldInt64 *MEDCouplingFieldInt64::deepCopy() const
63 return cloneWithMesh(true);
66 MEDCouplingFieldInt64 *MEDCouplingFieldInt64::clone(bool recDeepCpy) const
68 return new MEDCouplingFieldInt64(*this,recDeepCpy);
71 MEDCouplingFieldDouble *MEDCouplingFieldInt64::convertToDblField() const
73 MCAuto<MEDCouplingFieldTemplate> tmp(MEDCouplingFieldTemplate::New(*this));
75 double t0(getTime(t1,t2));
76 MCAuto<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(*tmp,getTimeDiscretization()));
77 ret->setTime(t0,t1,t2);
80 MCAuto<DataArrayDouble> arr(getArray()->convertToDblArr());