MEDCouplingField.cxx
MEDCouplingFieldFloat.cxx
MEDCouplingFieldDouble.cxx
- MEDCouplingFieldInt.cxx
+ MEDCouplingFieldInt32.cxx
+ MEDCouplingFieldInt64.cxx
MEDCouplingUMesh.cxx
MEDCouplingUMesh_internal.cxx
MEDCouplingUMesh_intersection.cxx
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingFieldTemplate.hxx"
#include "MEDCouplingFieldT.txx"
-#include "MEDCouplingFieldInt.hxx"
+#include "MEDCouplingFieldInt32.hxx"
#include "MEDCouplingFieldFloat.hxx"
#include "MEDCouplingUMesh.hxx"
#include "MEDCouplingTimeDiscretization.hxx"
return ret.retn();
}
-MEDCouplingFieldInt *MEDCouplingFieldDouble::convertToIntField() const
+MEDCouplingFieldInt32 *MEDCouplingFieldDouble::convertToIntField() const
{
return ConvertToUField<int>(this);
}
namespace MEDCoupling
{
class Voronizer;
- class MEDCouplingFieldInt;
+ class MEDCouplingFieldInt32;
class MEDCouplingFieldTemplate;
class MEDCouplingFieldDouble : public MEDCouplingFieldT<double>
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *nodeToCellDiscretization() const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *cellToNodeDiscretization() const;
- MEDCOUPLING_EXPORT MEDCouplingFieldInt *convertToIntField() const;
+ MEDCOUPLING_EXPORT MEDCouplingFieldInt32 *convertToIntField() const;
MEDCOUPLING_EXPORT MEDCouplingFieldFloat *convertToFloatField() const;
MEDCOUPLING_EXPORT double getIJK(mcIdType cellId, int nodeIdInCell, int compoId) const;
MEDCOUPLING_EXPORT double accumulate(int compId) const;
+++ /dev/null
-// Copyright (C) 2007-2020 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, 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
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// Author : Yann Pora (EDF R&D)
-
-#include "MEDCouplingFieldInt.hxx"
-#include "MEDCouplingFieldT.txx"
-#include "MEDCouplingFieldDouble.hxx"
-#include "MEDCouplingFieldTemplate.hxx"
-#include "MEDCouplingMesh.hxx"
-#include "MEDCouplingMemArray.txx"
-
-using namespace MEDCoupling;
-
-template class MEDCoupling::MEDCouplingFieldT<int>;
-
-MEDCouplingFieldInt *MEDCouplingFieldInt::New(TypeOfField type, TypeOfTimeDiscretization td)
-{
- return new MEDCouplingFieldInt(type,td);
-}
-
-MEDCouplingFieldInt *MEDCouplingFieldInt::New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td)
-{
- return new MEDCouplingFieldInt(ft,td);
-}
-
-MEDCouplingFieldInt::MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td):MEDCouplingFieldT<int>(type,MEDCouplingTimeDiscretizationInt::New(td))
-{
-}
-
-MEDCouplingFieldInt::MEDCouplingFieldInt(const MEDCouplingFieldInt& other, bool deepCpy):MEDCouplingFieldT<int>(other,deepCpy)
-{
-}
-
-MEDCouplingFieldInt::MEDCouplingFieldInt(NatureOfField n, MEDCouplingTimeDiscretizationInt *td, MEDCouplingFieldDiscretization *type):MEDCouplingFieldT<int>(type,n,td)
-{
-}
-
-/*!
- * ** WARINING : This method do not deeply copy neither mesh nor spatial discretization. Only a shallow copy (reference) is done for mesh and spatial discretization ! **
- */
-MEDCouplingFieldInt::MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td):MEDCouplingFieldT<int>(ft,MEDCouplingTimeDiscretizationInt::New(td),false)
-{
-}
-
-MEDCouplingFieldInt *MEDCouplingFieldInt::deepCopy() const
-{
- return cloneWithMesh(true);
-}
-
-MEDCouplingFieldInt *MEDCouplingFieldInt::clone(bool recDeepCpy) const
-{
- return new MEDCouplingFieldInt(*this,recDeepCpy);
-}
-
-MEDCouplingFieldDouble *MEDCouplingFieldInt::convertToDblField() const
-{
- MCAuto<MEDCouplingFieldTemplate> tmp(MEDCouplingFieldTemplate::New(*this));
- int t1,t2;
- double t0(getTime(t1,t2));
- MCAuto<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(*tmp,getTimeDiscretization()));
- ret->setTime(t0,t1,t2);
- if(getArray())
- {
- MCAuto<DataArrayDouble> arr(getArray()->convertToDblArr());
- ret->setArray(arr);
- }
- return ret.retn();
-}
-// Copyright (C) 2007-2020 CEA/DEN, EDF R&D
+// Copyright (C) 2020 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
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author : Yann Pora (EDF R&D)
+// Author : Anthony Geay (EDF R&D)
-#ifndef __MEDCOUPLINGFIELDINT_HXX__
-#define __MEDCOUPLINGFIELDINT_HXX__
+#pragma once
-#include "MEDCoupling.hxx"
-#include "MEDCouplingFieldT.hxx"
-#include "MEDCouplingMemArray.hxx"
-
-#include <string>
+#include "MEDCouplingFieldInt32.hxx"
namespace MEDCoupling
{
- class MEDCouplingFieldDouble;
- class MEDCouplingFieldTemplate;
-
- class MEDCouplingFieldInt : public MEDCouplingFieldT<int>
- {
- public:
- MEDCOUPLING_EXPORT static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
- MEDCOUPLING_EXPORT static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
- MEDCOUPLING_EXPORT MEDCouplingFieldInt *deepCopy() const;
- MEDCOUPLING_EXPORT MEDCouplingFieldInt *clone(bool recDeepCpy) const;
- MEDCOUPLING_EXPORT MEDCouplingFieldDouble *convertToDblField() const;
- MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingFieldInt"); }
- protected:
- MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td);
- MEDCouplingFieldInt(const MEDCouplingFieldInt& other, bool deepCopy);
- MEDCouplingFieldInt(NatureOfField n, MEDCouplingTimeDiscretizationInt *td, MEDCouplingFieldDiscretization *type);
- MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td);
- ~MEDCouplingFieldInt() { }
- };
+ using MEDCouplingFieldInt = MEDCouplingFieldInt32;
}
-
-#endif
--- /dev/null
+// Copyright (C) 2007-2020 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, 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
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// Author : Yann Pora (EDF R&D)
+
+#include "MEDCouplingFieldInt32.hxx"
+#include "MEDCouplingFieldT.txx"
+#include "MEDCouplingFieldDouble.hxx"
+#include "MEDCouplingFieldTemplate.hxx"
+#include "MEDCouplingMesh.hxx"
+#include "MEDCouplingMemArray.txx"
+
+using namespace MEDCoupling;
+
+template class MEDCoupling::MEDCouplingFieldT<Int32>;
+
+MEDCouplingFieldInt32 *MEDCouplingFieldInt32::New(TypeOfField type, TypeOfTimeDiscretization td)
+{
+ return new MEDCouplingFieldInt32(type,td);
+}
+
+MEDCouplingFieldInt32 *MEDCouplingFieldInt32::New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td)
+{
+ return new MEDCouplingFieldInt32(ft,td);
+}
+
+MEDCouplingFieldInt32::MEDCouplingFieldInt32(TypeOfField type, TypeOfTimeDiscretization td):MEDCouplingFieldT<Int32>(type,MEDCouplingTimeDiscretizationInt32::New(td))
+{
+}
+
+MEDCouplingFieldInt32::MEDCouplingFieldInt32(const MEDCouplingFieldInt32& other, bool deepCpy):MEDCouplingFieldT<Int32>(other,deepCpy)
+{
+}
+
+MEDCouplingFieldInt32::MEDCouplingFieldInt32(NatureOfField n, MEDCouplingTimeDiscretizationInt32 *td, MEDCouplingFieldDiscretization *type):MEDCouplingFieldT<Int32>(type,n,td)
+{
+}
+
+/*!
+ * ** WARINING : This method do not deeply copy neither mesh nor spatial discretization. Only a shallow copy (reference) is done for mesh and spatial discretization ! **
+ */
+MEDCouplingFieldInt32::MEDCouplingFieldInt32(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td):MEDCouplingFieldT<Int32>(ft,MEDCouplingTimeDiscretizationInt32::New(td),false)
+{
+}
+
+MEDCouplingFieldInt32 *MEDCouplingFieldInt32::deepCopy() const
+{
+ return cloneWithMesh(true);
+}
+
+MEDCouplingFieldInt32 *MEDCouplingFieldInt32::clone(bool recDeepCpy) const
+{
+ return new MEDCouplingFieldInt32(*this,recDeepCpy);
+}
+
+MEDCouplingFieldDouble *MEDCouplingFieldInt32::convertToDblField() const
+{
+ MCAuto<MEDCouplingFieldTemplate> tmp(MEDCouplingFieldTemplate::New(*this));
+ int t1,t2;
+ double t0(getTime(t1,t2));
+ MCAuto<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(*tmp,getTimeDiscretization()));
+ ret->setTime(t0,t1,t2);
+ if(getArray())
+ {
+ MCAuto<DataArrayDouble> arr(getArray()->convertToDblArr());
+ ret->setArray(arr);
+ }
+ return ret.retn();
+}
--- /dev/null
+// Copyright (C) 2007-2020 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, 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
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// Author : Yann Pora (EDF R&D)
+
+#pragma once
+
+#include "MEDCoupling.hxx"
+#include "MEDCouplingFieldT.hxx"
+#include "MEDCouplingMemArray.hxx"
+
+#include <string>
+
+namespace MEDCoupling
+{
+ class MEDCouplingFieldDouble;
+ class MEDCouplingFieldTemplate;
+
+ class MEDCouplingFieldInt32 : public MEDCouplingFieldT<Int32>
+ {
+ public:
+ MEDCOUPLING_EXPORT static MEDCouplingFieldInt32 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
+ MEDCOUPLING_EXPORT static MEDCouplingFieldInt32 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
+ MEDCOUPLING_EXPORT MEDCouplingFieldInt32 *deepCopy() const;
+ MEDCOUPLING_EXPORT MEDCouplingFieldInt32 *clone(bool recDeepCpy) const;
+ MEDCOUPLING_EXPORT MEDCouplingFieldDouble *convertToDblField() const;
+ MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingFieldInt32"); }
+ protected:
+ MEDCouplingFieldInt32(TypeOfField type, TypeOfTimeDiscretization td);
+ MEDCouplingFieldInt32(const MEDCouplingFieldInt32& other, bool deepCopy);
+ MEDCouplingFieldInt32(NatureOfField n, MEDCouplingTimeDiscretizationInt32 *td, MEDCouplingFieldDiscretization *type);
+ MEDCouplingFieldInt32(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td);
+ ~MEDCouplingFieldInt32() { }
+ };
+}
--- /dev/null
+// Copyright (C) 2020 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, 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
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// Author : Anthony Geay (EDF R&D)
+
+#include "MEDCouplingFieldInt64.hxx"
+#include "MEDCouplingFieldT.txx"
+#include "MEDCouplingFieldDouble.hxx"
+#include "MEDCouplingFieldTemplate.hxx"
+#include "MEDCouplingMesh.hxx"
+#include "MEDCouplingMemArray.txx"
+
+using namespace MEDCoupling;
+
+template class MEDCoupling::MEDCouplingFieldT<Int64>;
+
+MEDCouplingFieldInt64 *MEDCouplingFieldInt64::New(TypeOfField type, TypeOfTimeDiscretization td)
+{
+ return new MEDCouplingFieldInt64(type,td);
+}
+
+MEDCouplingFieldInt64 *MEDCouplingFieldInt64::New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td)
+{
+ return new MEDCouplingFieldInt64(ft,td);
+}
+
+MEDCouplingFieldInt64::MEDCouplingFieldInt64(TypeOfField type, TypeOfTimeDiscretization td):MEDCouplingFieldT<Int64>(type,MEDCouplingTimeDiscretizationInt64::New(td))
+{
+}
+
+MEDCouplingFieldInt64::MEDCouplingFieldInt64(const MEDCouplingFieldInt64& other, bool deepCpy):MEDCouplingFieldT<Int64>(other,deepCpy)
+{
+}
+
+MEDCouplingFieldInt64::MEDCouplingFieldInt64(NatureOfField n, MEDCouplingTimeDiscretizationInt64 *td, MEDCouplingFieldDiscretization *type):MEDCouplingFieldT<Int64>(type,n,td)
+{
+}
+
+/*!
+ * ** WARINING : This method do not deeply copy neither mesh nor spatial discretization. Only a shallow copy (reference) is done for mesh and spatial discretization ! **
+ */
+MEDCouplingFieldInt64::MEDCouplingFieldInt64(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td):MEDCouplingFieldT<Int64>(ft,MEDCouplingTimeDiscretizationInt64::New(td),false)
+{
+}
+
+MEDCouplingFieldInt64 *MEDCouplingFieldInt64::deepCopy() const
+{
+ return cloneWithMesh(true);
+}
+
+MEDCouplingFieldInt64 *MEDCouplingFieldInt64::clone(bool recDeepCpy) const
+{
+ return new MEDCouplingFieldInt64(*this,recDeepCpy);
+}
+
+MEDCouplingFieldDouble *MEDCouplingFieldInt64::convertToDblField() const
+{
+ MCAuto<MEDCouplingFieldTemplate> tmp(MEDCouplingFieldTemplate::New(*this));
+ int t1,t2;
+ double t0(getTime(t1,t2));
+ MCAuto<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(*tmp,getTimeDiscretization()));
+ ret->setTime(t0,t1,t2);
+ if(getArray())
+ {
+ MCAuto<DataArrayDouble> arr(getArray()->convertToDblArr());
+ ret->setArray(arr);
+ }
+ return ret.retn();
+}
--- /dev/null
+// Copyright (C) 2020 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, 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
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// Author : Anthony Geay (EDF R&D)
+
+#pragma once
+
+#include "MEDCoupling.hxx"
+#include "MEDCouplingFieldT.hxx"
+#include "MEDCouplingMemArray.hxx"
+
+#include <string>
+
+namespace MEDCoupling
+{
+ class MEDCouplingFieldDouble;
+ class MEDCouplingFieldTemplate;
+
+ class MEDCouplingFieldInt64 : public MEDCouplingFieldT<Int64>
+ {
+ public:
+ MEDCOUPLING_EXPORT static MEDCouplingFieldInt64 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
+ MEDCOUPLING_EXPORT static MEDCouplingFieldInt64 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
+ MEDCOUPLING_EXPORT MEDCouplingFieldInt64 *deepCopy() const;
+ MEDCOUPLING_EXPORT MEDCouplingFieldInt64 *clone(bool recDeepCpy) const;
+ MEDCOUPLING_EXPORT MEDCouplingFieldDouble *convertToDblField() const;
+ MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingFieldInt64"); }
+ protected:
+ MEDCouplingFieldInt64(TypeOfField type, TypeOfTimeDiscretization td);
+ MEDCouplingFieldInt64(const MEDCouplingFieldInt64& other, bool deepCopy);
+ MEDCouplingFieldInt64(NatureOfField n, MEDCouplingTimeDiscretizationInt64 *td, MEDCouplingFieldDiscretization *type);
+ MEDCouplingFieldInt64(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td);
+ ~MEDCouplingFieldInt64() { }
+ };
+}
//
// Author : Anthony Geay (EDF R&D)
-#ifndef __MEDCOUPLINGFIELDT_HXX__
-#define __MEDCOUPLINGFIELDT_HXX__
+#pragma once
#include "MEDCouplingField.hxx"
#include "MEDCouplingTraits.hxx"
MEDCouplingTimeDiscretizationTemplate<T> *_time_discr;
};
}
-
-#endif
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author : Anthony Geay (CEA/DEN)
+// Author : Anthony Geay (EDF R&D)
#include "MEDCouplingFieldTemplate.hxx"
#include "MEDCouplingMesh.hxx"
-#include "MEDCouplingFieldInt.hxx"
+#include "MEDCouplingFieldInt32.hxx"
+#include "MEDCouplingFieldInt64.hxx"
#include "MEDCouplingFieldFloat.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingFieldDiscretization.hxx"
return new MEDCouplingFieldTemplate(f,true);
}
-MEDCouplingFieldTemplate *MEDCouplingFieldTemplate::New(const MEDCouplingFieldInt& f)
+MEDCouplingFieldTemplate *MEDCouplingFieldTemplate::New(const MEDCouplingFieldInt32& f)
+{
+ return new MEDCouplingFieldTemplate(f,true);
+}
+
+MEDCouplingFieldTemplate *MEDCouplingFieldTemplate::New(const MEDCouplingFieldInt64& f)
{
return new MEDCouplingFieldTemplate(f,true);
}
return new MEDCouplingFieldTemplate(f,false);
}
-MEDCouplingFieldTemplate *MEDCouplingFieldTemplate::NewWithoutCheck(const MEDCouplingFieldInt& f)
+MEDCouplingFieldTemplate *MEDCouplingFieldTemplate::NewWithoutCheck(const MEDCouplingFieldInt32& f)
+{
+ return new MEDCouplingFieldTemplate(f,false);
+}
+
+MEDCouplingFieldTemplate *MEDCouplingFieldTemplate::NewWithoutCheck(const MEDCouplingFieldInt64& f)
{
return new MEDCouplingFieldTemplate(f,false);
}
checkConsistencyLight();
}
-MEDCouplingFieldTemplate::MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f, bool isChecked):MEDCouplingField(f,false)
+MEDCouplingFieldTemplate::MEDCouplingFieldTemplate(const MEDCouplingFieldInt32& f, bool isChecked):MEDCouplingField(f,false)
+{
+ forceTimeOfThis(f);
+ if(isChecked)
+ checkConsistencyLight();
+}
+
+MEDCouplingFieldTemplate::MEDCouplingFieldTemplate(const MEDCouplingFieldInt64& f, bool isChecked):MEDCouplingField(f,false)
{
forceTimeOfThis(f);
if(isChecked)
//
// Author : Anthony Geay (EDF R&D)
-#ifndef __PARAMEDMEM_MEDCOUPLINGFIELDTEMPLATE_HXX__
-#define __PARAMEDMEM_MEDCOUPLINGFIELDTEMPLATE_HXX__
+#pragma once
#include "MEDCouplingField.hxx"
namespace MEDCoupling
{
- class MEDCouplingFieldInt;
+ class MEDCouplingFieldInt32;
+ class MEDCouplingFieldInt64;
class MEDCouplingFieldFloat;
class MEDCouplingFieldDouble;
/*!
public:
MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f);
MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f);
- MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f);
+ MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt32& f);
+ MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt64& f);
MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *New(TypeOfField type);
MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *NewWithoutCheck(const MEDCouplingFieldDouble& f);
MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *NewWithoutCheck(const MEDCouplingFieldFloat& f);
- MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *NewWithoutCheck(const MEDCouplingFieldInt& f);
+ MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *NewWithoutCheck(const MEDCouplingFieldInt32& f);
+ MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *NewWithoutCheck(const MEDCouplingFieldInt64& f);
MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingFieldTemplate"); }
MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingFieldTemplate *other, double meshPrec, std::string& reason) const;
MEDCOUPLING_EXPORT bool isEqual(const MEDCouplingFieldTemplate *other, double meshPrec) const;
private:
MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f, bool isChecked=true);
MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f, bool isChecked=true);
- MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f, bool isChecked=true);
+ MEDCouplingFieldTemplate(const MEDCouplingFieldInt32& f, bool isChecked=true);
+ MEDCouplingFieldTemplate(const MEDCouplingFieldInt64& f, bool isChecked=true);
MEDCouplingFieldTemplate(TypeOfField type);
MEDCouplingFieldTemplate(const MEDCouplingFieldTemplate& other, bool deepCopy);
};
}
-
-#endif
////////////////////////
-MEDCouplingTimeDiscretizationInt::MEDCouplingTimeDiscretizationInt(const MEDCouplingTimeDiscretizationInt& other, bool deepCopy):MEDCouplingTimeDiscretizationSimple<int>(other,deepCopy)
+MEDCouplingTimeDiscretizationInt32::MEDCouplingTimeDiscretizationInt32(const MEDCouplingTimeDiscretizationInt32& other, bool deepCopy):MEDCouplingTimeDiscretizationSimple<Int32>(other,deepCopy)
{
}
-MEDCouplingTimeDiscretizationInt *MEDCouplingTimeDiscretizationInt::performCopyOrIncrRef(bool deepCopy) const
+MEDCouplingTimeDiscretizationInt32 *MEDCouplingTimeDiscretizationInt32::performCopyOrIncrRef(bool deepCopy) const
{
- return new MEDCouplingTimeDiscretizationInt(*this,deepCopy);
+ return new MEDCouplingTimeDiscretizationInt32(*this,deepCopy);
}
-MEDCouplingTimeDiscretizationInt *MEDCouplingTimeDiscretizationInt::New(TypeOfTimeDiscretization type)
+MEDCouplingTimeDiscretizationInt32 *MEDCouplingTimeDiscretizationInt32::New(TypeOfTimeDiscretization type)
{
switch(type)
{
- case MEDCouplingTimeDiscretizationInt::DISCRETIZATION:
- return new MEDCouplingTimeDiscretizationInt;
+ case MEDCouplingTimeDiscretizationInt32::DISCRETIZATION:
+ return new MEDCouplingTimeDiscretizationInt32;
default:
throw INTERP_KERNEL::Exception("Time discretization not implemented yet for integers !");
}
}
-bool MEDCouplingTimeDiscretizationInt::isEqualIfNotWhy(const MEDCouplingTimeDiscretizationTemplate<int> *other, int prec, std::string& reason) const
+bool MEDCouplingTimeDiscretizationInt32::isEqualIfNotWhy(const MEDCouplingTimeDiscretizationTemplate<Int32> *other, Int32 prec, std::string& reason) const
{
if(prec!=0)
throw INTERP_KERNEL::Exception("isEqualIfNotWhy : only precision equal to 0 supported for int !");
reason="Time discretization is NULL.";
return false;
}
- const MEDCouplingTimeDiscretizationInt *otherC(dynamic_cast<const MEDCouplingTimeDiscretizationInt *>(other));
+ const MEDCouplingTimeDiscretizationInt32 *otherC(dynamic_cast<const MEDCouplingTimeDiscretizationInt32 *>(other));
if(!otherC)
- throw INTERP_KERNEL::Exception("isEqualIfNotWhy : other is not a MEDCouplingTimeDiscretizationInt !");
- if(!MEDCouplingTimeDiscretizationTemplate<int>::areStrictlyCompatible(other,reason))
+ throw INTERP_KERNEL::Exception("isEqualIfNotWhy : other is not a MEDCouplingTimeDiscretizationInt32 !");
+ if(!MEDCouplingTimeDiscretizationTemplate<Int32>::areStrictlyCompatible(other,reason))
return false;
if(!_tk.isEqualIfNotWhy(otherC->_tk,_time_tolerance,reason))
return false;
return _array->isEqualIfNotWhy(*other->getArray(),reason);
}
-bool MEDCouplingTimeDiscretizationInt::isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationTemplate<int> *other, int prec) const
+bool MEDCouplingTimeDiscretizationInt32::isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationTemplate<Int32> *other, Int32 prec) const
{
if(prec!=0)
- throw INTERP_KERNEL::Exception("MEDCouplingTimeDiscretizationInt::isEqualWithoutConsideringStr : only precision 0 is supported !");
- const MEDCouplingTimeDiscretizationInt *otherC(dynamic_cast<const MEDCouplingTimeDiscretizationInt *>(other));
+ throw INTERP_KERNEL::Exception("MEDCouplingTimeDiscretizationInt32::isEqualWithoutConsideringStr : only precision 0 is supported !");
+ const MEDCouplingTimeDiscretizationInt32 *otherC(dynamic_cast<const MEDCouplingTimeDiscretizationInt32 *>(other));
+ if(!otherC)
+ throw INTERP_KERNEL::Exception("isEqualWithoutConsideringStr : other is not a MEDCouplingTimeDiscretizationInt !");
+ std::string tmp;
+ if(!areStrictlyCompatible(other,tmp))
+ return false;
+ std::string reason;
+ if(!_tk.isEqualIfNotWhy(otherC->_tk,_time_tolerance,reason))
+ return false;
+ if(_array==other->getArray())
+ return true;
+ return _array->isEqualWithoutConsideringStr(*(other->getArray()));
+}
+
+////////////////////////
+
+MEDCouplingTimeDiscretizationInt64::MEDCouplingTimeDiscretizationInt64(const MEDCouplingTimeDiscretizationInt64& other, bool deepCopy):MEDCouplingTimeDiscretizationSimple<Int64>(other,deepCopy)
+{
+}
+
+MEDCouplingTimeDiscretizationInt64 *MEDCouplingTimeDiscretizationInt64::performCopyOrIncrRef(bool deepCopy) const
+{
+ return new MEDCouplingTimeDiscretizationInt64(*this,deepCopy);
+}
+
+MEDCouplingTimeDiscretizationInt64 *MEDCouplingTimeDiscretizationInt64::New(TypeOfTimeDiscretization type)
+{
+ switch(type)
+ {
+ case MEDCouplingTimeDiscretizationInt64::DISCRETIZATION:
+ return new MEDCouplingTimeDiscretizationInt64;
+ default:
+ throw INTERP_KERNEL::Exception("Time discretization not implemented yet for integers !");
+ }
+}
+
+bool MEDCouplingTimeDiscretizationInt64::isEqualIfNotWhy(const MEDCouplingTimeDiscretizationTemplate<Int64> *other, Int64 prec, std::string& reason) const
+{
+ if(prec!=0)
+ throw INTERP_KERNEL::Exception("isEqualIfNotWhy : only precision equal to 0 supported for int !");
+ if(!other)
+ {
+ reason="Time discretization is NULL.";
+ return false;
+ }
+ const MEDCouplingTimeDiscretizationInt64 *otherC(dynamic_cast<const MEDCouplingTimeDiscretizationInt64 *>(other));
+ if(!otherC)
+ throw INTERP_KERNEL::Exception("isEqualIfNotWhy : other is not a MEDCouplingTimeDiscretizationInt64 !");
+ if(!MEDCouplingTimeDiscretizationTemplate<Int64>::areStrictlyCompatible(other,reason))
+ return false;
+ if(!_tk.isEqualIfNotWhy(otherC->_tk,_time_tolerance,reason))
+ return false;
+ if(_array==other->getArray())
+ return true;
+ return _array->isEqualIfNotWhy(*other->getArray(),reason);
+}
+
+bool MEDCouplingTimeDiscretizationInt64::isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationTemplate<Int64> *other, Int64 prec) const
+{
+ if(prec!=0)
+ throw INTERP_KERNEL::Exception("MEDCouplingTimeDiscretizationInt64::isEqualWithoutConsideringStr : only precision 0 is supported !");
+ const MEDCouplingTimeDiscretizationInt64 *otherC(dynamic_cast<const MEDCouplingTimeDiscretizationInt64 *>(other));
if(!otherC)
throw INTERP_KERNEL::Exception("isEqualWithoutConsideringStr : other is not a MEDCouplingTimeDiscretizationInt !");
std::string tmp;
static const TypeOfTimeDiscretization DISCRETIZATION=ONE_TIME;
};
- class MEDCouplingTimeDiscretizationInt : public MEDCouplingTimeDiscretizationSimple<int>
+ class MEDCouplingTimeDiscretizationInt32 : public MEDCouplingTimeDiscretizationSimple<Int32>
{
public:
- MEDCouplingTimeDiscretizationInt() { }
- std::string getClassName() const override { return std::string("MEDCouplingTimeDiscretizationInt"); }
- MEDCouplingTimeDiscretizationInt(const MEDCouplingTimeDiscretizationInt& other, bool deepCopy);
- static MEDCouplingTimeDiscretizationInt *New(TypeOfTimeDiscretization type);
- MEDCouplingTimeDiscretizationInt *performCopyOrIncrRef(bool deepCopy) const;
- bool isEqualIfNotWhy(const MEDCouplingTimeDiscretizationTemplate<int> *other, int prec, std::string& reason) const;
- bool isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationTemplate<int> *other, int prec) const;
+ MEDCouplingTimeDiscretizationInt32() { }
+ std::string getClassName() const override { return std::string("MEDCouplingTimeDiscretizationInt32"); }
+ MEDCouplingTimeDiscretizationInt32(const MEDCouplingTimeDiscretizationInt32& other, bool deepCopy);
+ static MEDCouplingTimeDiscretizationInt32 *New(TypeOfTimeDiscretization type);
+ MEDCouplingTimeDiscretizationInt32 *performCopyOrIncrRef(bool deepCopy) const;
+ bool isEqualIfNotWhy(const MEDCouplingTimeDiscretizationTemplate<Int32> *other, Int32 prec, std::string& reason) const;
+ bool isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationTemplate<Int32> *other, Int32 prec) const;
+ };
+
+ class MEDCouplingTimeDiscretizationInt64 : public MEDCouplingTimeDiscretizationSimple<Int64>
+ {
+ public:
+ MEDCouplingTimeDiscretizationInt64() { }
+ std::string getClassName() const override { return std::string("MEDCouplingTimeDiscretizationInt64"); }
+ MEDCouplingTimeDiscretizationInt64(const MEDCouplingTimeDiscretizationInt64& other, bool deepCopy);
+ static MEDCouplingTimeDiscretizationInt64 *New(TypeOfTimeDiscretization type);
+ MEDCouplingTimeDiscretizationInt64 *performCopyOrIncrRef(bool deepCopy) const;
+ bool isEqualIfNotWhy(const MEDCouplingTimeDiscretizationTemplate<Int64> *other, Int64 prec, std::string& reason) const override;
+ bool isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationTemplate<Int64> *other, Int64 prec) const override;
};
class MEDCouplingTimeDiscretizationFloat : public MEDCouplingTimeDiscretizationSimple<float>
//
// Author : Anthony Geay (EDF R&D)
-#ifndef __MEDCOUPLINGTRAITS_HXX__
-#define __MEDCOUPLINGTRAITS_HXX__
+#pragma once
#include "MEDCoupling.hxx"
#include "MCType.hxx"
class DataArrayInt64;
class MEDCouplingFieldDouble;
class MEDCouplingFieldFloat;
- class MEDCouplingFieldInt;
+ class MEDCouplingFieldInt32;
+ class MEDCouplingFieldInt64;
class DataArrayInt32Tuple;
class DataArrayInt64Tuple;
class DataArrayFloatTuple;
static const char VTKReprStr[];
using ArrayType = DataArrayInt32;
using ArrayTypeCh = DataArrayInt32;
- using FieldType = MEDCouplingFieldInt;
+ using FieldType = MEDCouplingFieldInt32;
using ArrayTuple = DataArrayInt32Tuple;
using IteratorType = DataArrayInt32Iterator;
};
static const char VTKReprStr[];
using ArrayType = DataArrayInt64;
using ArrayTypeCh = DataArrayInt64;
- //using FieldType = MEDCouplingFieldInt64;
+ using FieldType = MEDCouplingFieldInt64;
using ArrayTuple = DataArrayInt64Tuple;
using IteratorType = DataArrayInt64Iterator;
};
using IteratorType = DataArrayByteIterator;
};
}
-
-#endif
#include "MEDCoupling1GTUMesh.hxx"
#include "MEDCouplingField.hxx"
#include "MEDCouplingFieldDouble.hxx"
-#include "MEDCouplingFieldInt.hxx"
+#include "MEDCouplingFieldInt32.hxx"
+#include "MEDCouplingFieldInt64.hxx"
#include "MEDCouplingFieldFloat.hxx"
#include "MEDCouplingFieldTemplate.hxx"
#include "MEDCouplingGaussLocalization.hxx"
%newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
%newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
%newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
-%newobject MEDCoupling::MEDCouplingFieldInt::New;
-%newobject MEDCoupling::MEDCouplingFieldInt::convertToDblField;
-%newobject MEDCoupling::MEDCouplingFieldInt::getArray;
-%newobject MEDCoupling::MEDCouplingFieldInt::deepCopy;
-%newobject MEDCoupling::MEDCouplingFieldInt::clone;
-%newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh;
-%newobject MEDCoupling::MEDCouplingFieldInt::buildSubPart;
-%newobject MEDCoupling::MEDCouplingFieldInt::buildSubPartRange;
-%newobject MEDCoupling::MEDCouplingFieldInt::__getitem__;
+%newobject MEDCoupling::MEDCouplingFieldInt32::New;
+%newobject MEDCoupling::MEDCouplingFieldInt32::convertToDblField;
+%newobject MEDCoupling::MEDCouplingFieldInt32::getArray;
+%newobject MEDCoupling::MEDCouplingFieldInt32::deepCopy;
+%newobject MEDCoupling::MEDCouplingFieldInt32::clone;
+%newobject MEDCoupling::MEDCouplingFieldInt32::cloneWithMesh;
+%newobject MEDCoupling::MEDCouplingFieldInt32::buildSubPart;
+%newobject MEDCoupling::MEDCouplingFieldInt32::buildSubPartRange;
+%newobject MEDCoupling::MEDCouplingFieldInt32::__getitem__;
+%newobject MEDCoupling::MEDCouplingFieldInt64::New;
+%newobject MEDCoupling::MEDCouplingFieldInt64::convertToDblField;
+%newobject MEDCoupling::MEDCouplingFieldInt64::getArray;
+%newobject MEDCoupling::MEDCouplingFieldInt64::deepCopy;
+%newobject MEDCoupling::MEDCouplingFieldInt64::clone;
+%newobject MEDCoupling::MEDCouplingFieldInt64::cloneWithMesh;
+%newobject MEDCoupling::MEDCouplingFieldInt64::buildSubPart;
+%newobject MEDCoupling::MEDCouplingFieldInt64::buildSubPartRange;
+%newobject MEDCoupling::MEDCouplingFieldInt64::__getitem__;
%newobject MEDCoupling::MEDCouplingFieldFloat::New;
%newobject MEDCoupling::MEDCouplingFieldFloat::convertToDblField;
%newobject MEDCoupling::MEDCouplingFieldFloat::getArray;
%feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
%feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
%feature("unref") MEDCouplingFieldFloat "$this->decrRef();"
-%feature("unref") MEDCouplingFieldInt "$this->decrRef();"
+%feature("unref") MEDCouplingFieldInt32 "$this->decrRef();"
+%feature("unref") MEDCouplingFieldInt64 "$this->decrRef();"
%feature("unref") MEDCouplingMultiFields "$this->decrRef();"
%feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
%feature("unref") MEDCouplingMultiFields "$this->decrRef();"
public:
static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f);
static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f);
- static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f);
+ static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt32& f);
+ static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt64& f);
static MEDCouplingFieldTemplate *New(TypeOfField type);
std::string simpleRepr() const;
std::string advancedRepr() const;
return MEDCouplingFieldTemplate::New(f);
}
- MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f)
+ MEDCouplingFieldTemplate(const MEDCouplingFieldInt32& f)
+ {
+ return MEDCouplingFieldTemplate::New(f);
+ }
+
+ MEDCouplingFieldTemplate(const MEDCouplingFieldInt64& f)
{
return MEDCouplingFieldTemplate::New(f);
}
%template(MEDCouplingFieldTfloat) MEDCoupling::MEDCouplingFieldT<float>;
%template(MEDCouplingFieldTint) MEDCoupling::MEDCouplingFieldT<int>;
- class MEDCouplingFieldInt;
+ class MEDCouplingFieldInt32;
+ class MEDCouplingFieldInt64;
class MEDCouplingFieldFloat;
class MEDCouplingFieldDouble : public MEDCouplingFieldT<double>
std::string simpleRepr() const;
std::string advancedRepr() const;
std::string writeVTK(const std::string& fileName, bool isBinary=true) const;
- MEDCouplingFieldInt *convertToIntField() const;
+ MEDCouplingFieldInt32 *convertToIntField() const;
MEDCouplingFieldFloat *convertToFloatField() const;
MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
}
};
- class MEDCouplingFieldInt : public MEDCouplingFieldT<int>
+ class MEDCouplingFieldInt32 : public MEDCouplingFieldT<int>
{
public:
- static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
- static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
- bool isEqual(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const;
- bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const;
+ static MEDCouplingFieldInt32 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
+ static MEDCouplingFieldInt32 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
+ bool isEqual(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const;
+ bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const;
void setTimeUnit(const std::string& unit);
std::string getTimeUnit() const;
void setTime(double val, int iteration, int order);
void setArray(DataArrayInt32 *array);
- MEDCouplingFieldInt *deepCopy() const;
- MEDCouplingFieldInt *clone(bool recDeepCpy) const;
- MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const;
+ MEDCouplingFieldInt32 *deepCopy() const;
+ MEDCouplingFieldInt32 *clone(bool recDeepCpy) const;
+ MEDCouplingFieldInt32 *cloneWithMesh(bool recDeepCpy) const;
MEDCouplingFieldDouble *convertToDblField() const;
- MEDCouplingFieldInt *buildSubPartRange(int begin, int end, int step) const;
+ MEDCouplingFieldInt32 *buildSubPartRange(int begin, int end, int step) const;
%extend {
- MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
+ MEDCouplingFieldInt32(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
{
- return MEDCouplingFieldInt::New(type,td);
+ return MEDCouplingFieldInt32::New(type,td);
}
- MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
+ MEDCouplingFieldInt32(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
{
- return MEDCouplingFieldInt::New(ft,td);
+ return MEDCouplingFieldInt32::New(ft,td);
}
- PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt *other, double meshPrec, int valsPrec) const
+ PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const
{
std::string ret1;
bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
return oss.str();
}
- MEDCouplingFieldInt *buildSubPart(PyObject *li) const
+ MEDCouplingFieldInt32 *buildSubPart(PyObject *li) const
{
return fieldT_buildSubPart(self,li);
}
- MEDCouplingFieldInt *__getitem__(PyObject *li) const
+ MEDCouplingFieldInt32 *__getitem__(PyObject *li) const
{
return fieldT__getitem__(self,li);
}
PyObject *getTinySerializationInformation() const
{
- return field_getTinySerializationInformation<MEDCouplingFieldInt>(self);
+ return field_getTinySerializationInformation<MEDCouplingFieldInt32>(self);
}
PyObject *serialize() const
PyObject *__getstate__() const
{
- return field__getstate__<MEDCouplingFieldInt>(self,MEDCoupling_MEDCouplingFieldInt_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt_serialize);
+ return field__getstate__<MEDCouplingFieldInt32>(self,MEDCoupling_MEDCouplingFieldInt32_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt32_serialize);
}
void __setstate__(PyObject *inp)
}
};
+ class MEDCouplingFieldInt64 : public MEDCouplingFieldT<int>
+ {
+ public:
+ static MEDCouplingFieldInt64 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
+ static MEDCouplingFieldInt64 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
+ bool isEqual(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
+ bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
+ void setTimeUnit(const std::string& unit);
+ std::string getTimeUnit() const;
+ void setTime(double val, int iteration, int order);
+ void setArray(DataArrayInt64 *array);
+ MEDCouplingFieldInt64 *deepCopy() const;
+ MEDCouplingFieldInt64 *clone(bool recDeepCpy) const;
+ MEDCouplingFieldInt64 *cloneWithMesh(bool recDeepCpy) const;
+ MEDCouplingFieldDouble *convertToDblField() const;
+ MEDCouplingFieldInt64 *buildSubPartRange(int begin, int end, int step) const;
+ %extend {
+ MEDCouplingFieldInt64(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
+ {
+ return MEDCouplingFieldInt64::New(type,td);
+ }
+
+ MEDCouplingFieldInt64(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
+ {
+ return MEDCouplingFieldInt64::New(ft,td);
+ }
+
+ PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const
+ {
+ std::string ret1;
+ bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
+ PyObject *ret=PyTuple_New(2);
+ PyObject *ret0Py=ret0?Py_True:Py_False;
+ Py_XINCREF(ret0Py);
+ PyTuple_SetItem(ret,0,ret0Py);
+ PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
+ return ret;
+ }
+
+ std::string __str__() const
+ {
+ return self->simpleRepr();
+ }
+
+ std::string __repr__() const
+ {
+ std::ostringstream oss;
+ self->reprQuickOverview(oss);
+ return oss.str();
+ }
+
+ MEDCouplingFieldInt64 *buildSubPart(PyObject *li) const
+ {
+ return fieldT_buildSubPart(self,li);
+ }
+
+ MEDCouplingFieldInt64 *__getitem__(PyObject *li) const
+ {
+ return fieldT__getitem__(self,li);
+ }
+
+ DataArrayInt64 *getArray()
+ {
+ DataArrayInt64 *ret=self->getArray();
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+
+ PyObject *getTime()
+ {
+ int tmp1,tmp2;
+ double tmp0=self->getTime(tmp1,tmp2);
+ PyObject *res = PyList_New(3);
+ PyList_SetItem(res,0,SWIG_From_double(tmp0));
+ PyList_SetItem(res,1,SWIG_From_int(tmp1));
+ PyList_SetItem(res,2,SWIG_From_int(tmp2));
+ return res;
+ }
+
+ PyObject *getTinySerializationInformation() const
+ {
+ return field_getTinySerializationInformation<MEDCouplingFieldInt64>(self);
+ }
+
+ PyObject *serialize() const
+ {
+ return field_serialize<Int64>(self);
+ }
+
+ PyObject *__getstate__() const
+ {
+ return field__getstate__<MEDCouplingFieldInt64>(self,MEDCoupling_MEDCouplingFieldInt64_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt64_serialize);
+ }
+
+ void __setstate__(PyObject *inp)
+ {
+ field__setstate__<Int64>(self,inp);
+ }
+ }
+ };
+
class MEDCouplingFieldFloat : public MEDCouplingFieldT<float>
{
public:
self.checkConsistencyLight()
d=(self.getTypeOfField(),self.getTimeDiscretization())
return MEDCouplingStdReduceFunct,(MEDCouplingFieldDouble,(d,(self.__getstate__()),))
-def MEDCouplingFieldIntReduce(self):
+def MEDCouplingFieldInt32Reduce(self):
self.checkConsistencyLight()
d=(self.getTypeOfField(),self.getTimeDiscretization())
- return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt,(d,(self.__getstate__()),))
+ return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt32,(d,(self.__getstate__()),))
+def MEDCouplingFieldInt64Reduce(self):
+ self.checkConsistencyLight()
+ d=(self.getTypeOfField(),self.getTimeDiscretization())
+ return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt64,(d,(self.__getstate__()),))
def MEDCouplingFieldFloatReduce(self):
self.checkConsistencyLight()
d=(self.getTypeOfField(),self.getTimeDiscretization())
MEDCouplingUMesh.ExtractFromIndexedArrays = DataArrayInt.ExtractFromIndexedArrays
MEDCouplingUMesh.ExtractFromIndexedArraysSlice = DataArrayInt.ExtractFromIndexedArraysSlice
MEDCouplingUMesh.SetPartOfIndexedArrays = DataArrayInt.SetPartOfIndexedArrays
-##MEDCouplingUMesh.SetPartOfIndexedArraysSlice = DataArrayInt.SetPartOfIndexedArraysSlice
MEDCouplingUMesh.SetPartOfIndexedArraysSameIdx = DataArrayInt.SetPartOfIndexedArraysSameIdx
MEDCouplingUMesh.RemoveIdsFromIndexedArrays = DataArrayInt.RemoveIdsFromIndexedArrays
-##MEDCouplingUMesh.SetPartOfIndexedArraysSameIdxSlice = DataArrayInt.SetPartOfIndexedArraysSameIdxSlice
+MEDCouplingFieldInt = MEDCouplingFieldInt32
+
+if MEDCouplingUse64BitIDs():
+ MEDCouplingFieldID = MEDCouplingFieldInt64
+else:
+ MEDCouplingFieldID = MEDCouplingFieldInt32
%}
MEDCouplingFieldTemplate.__reduce__=MEDCouplingFieldTemplateReduce
-MEDCouplingFieldInt.__reduce__=MEDCouplingFieldIntReduce
+MEDCouplingFieldInt32.__reduce__=MEDCouplingFieldInt32Reduce
+MEDCouplingFieldInt64.__reduce__=MEDCouplingFieldInt64Reduce
MEDCouplingFieldFloat.__reduce__=MEDCouplingFieldFloatReduce
del MEDCouplingFieldDoubleIsub
del MEDCouplingFieldDoubleReduce
del MEDCouplingFieldFloatReduce
-del MEDCouplingFieldIntReduce
+del MEDCouplingFieldInt32Reduce
+del MEDCouplingFieldInt64Reduce
del MEDCouplingFieldTemplateReduce
del MEDCouplingIMeshReduce
del MEDCouplingMappedExtrudedMeshReduce
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author : Anthony Geay (CEA/DEN)
+// Author : Anthony Geay (EDF R&D)
-#ifndef __MEDCOUPLINGTYPEMAPS_I__
-#define __MEDCOUPLINGTYPEMAPS_I__
+#pragma once
#include "MEDCouplingDataArrayTypemaps.i"
#include "MEDCouplingUMesh.hxx"
}
if(dynamic_cast<MEDCoupling::MEDCouplingFieldDouble *>(f))
ret=SWIG_NewPointerObj(reinterpret_cast<void*>(f),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,owner);
- if(dynamic_cast<MEDCoupling::MEDCouplingFieldInt *>(f))
- ret=SWIG_NewPointerObj(reinterpret_cast<void*>(f),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldInt,owner);
+ if(dynamic_cast<MEDCoupling::MEDCouplingFieldInt32 *>(f))
+ ret=SWIG_NewPointerObj(reinterpret_cast<void*>(f),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldInt32,owner);
+ if(dynamic_cast<MEDCoupling::MEDCouplingFieldInt64 *>(f))
+ ret=SWIG_NewPointerObj(reinterpret_cast<void*>(f),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldInt64,owner);
if(dynamic_cast<MEDCoupling::MEDCouplingFieldFloat *>(f))
ret=SWIG_NewPointerObj(reinterpret_cast<void*>(f),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldFloat,owner);
if(!ret)
PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
-
-#endif
}
case MED_INT32:
{
- _fields[i]=MEDFileIntFieldMultiTSWithoutSDA::New(fid,fieldName,meshName,typcha,infos,nbOfStep,dtunit,loadAll,ms,entities);
+ _fields[i]=MEDFileInt32FieldMultiTSWithoutSDA::New(fid,fieldName,meshName,typcha,infos,nbOfStep,dtunit,loadAll,ms,entities);
+ break;
+ }
+ case MED_INT64:
+ {
+ _fields[i]=MEDFileInt64FieldMultiTSWithoutSDA::New(fid,fieldName,meshName,typcha,infos,nbOfStep,dtunit,loadAll,ms,entities);
break;
}
case MED_FLOAT32:
{
if(sizeof(med_int)==sizeof(int))
{
- _fields[i]=MEDFileIntFieldMultiTSWithoutSDA::New(fid,fieldName,meshName,typcha,infos,nbOfStep,dtunit,loadAll,ms,entities);
+ _fields[i]=MEDFileInt32FieldMultiTSWithoutSDA::New(fid,fieldName,meshName,typcha,infos,nbOfStep,dtunit,loadAll,ms,entities);
break;
}
}
default:
{
- std::ostringstream oss; oss << "constructor MEDFileFields(fileName) : file \'" << FileNameFromFID(fid) << "\' at pos #" << i << " field has name \'" << fieldName << "\' but the type of field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32] !";
+ std::ostringstream oss; oss << "constructor MEDFileFields(fileName) : file \'" << FileNameFromFID(fid) << "\' at pos #" << i << " field has name \'" << fieldName << "\' but the type of field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32, MED_INT64] !";
throw INTERP_KERNEL::Exception(oss.str());
}
}
return 0;
MCAuto<MEDFileAnyTypeFieldMultiTS> ret;
const MEDFileFieldMultiTSWithoutSDA *fmtsC(dynamic_cast<const MEDFileFieldMultiTSWithoutSDA *>(fmts));
- const MEDFileIntFieldMultiTSWithoutSDA *fmtsC2(dynamic_cast<const MEDFileIntFieldMultiTSWithoutSDA *>(fmts));
+ const MEDFileInt32FieldMultiTSWithoutSDA *fmtsC2(dynamic_cast<const MEDFileInt32FieldMultiTSWithoutSDA *>(fmts));
+ const MEDFileInt64FieldMultiTSWithoutSDA *fmtsC4(dynamic_cast<const MEDFileInt64FieldMultiTSWithoutSDA *>(fmts));
const MEDFileFloatFieldMultiTSWithoutSDA *fmtsC3(dynamic_cast<const MEDFileFloatFieldMultiTSWithoutSDA *>(fmts));
if(fmtsC)
ret=MEDFileFieldMultiTS::New(*fmtsC,false);
else if(fmtsC2)
- ret=MEDFileIntFieldMultiTS::New(*fmtsC2,false);
+ ret=MEDFileInt32FieldMultiTS::New(*fmtsC2,false);
+ else if(fmtsC4)
+ ret=MEDFileInt64FieldMultiTS::New(*fmtsC4,false);
else if(fmtsC3)
ret=MEDFileFloatFieldMultiTS::New(*fmtsC3,false);
else
{
- std::ostringstream oss; oss << "MEDFileFields::getFieldAtPos : At pos #" << i << " field is neither double (FLOAT64) nor float (FLOAT32) nor integer (INT32) !";
+ std::ostringstream oss; oss << "MEDFileFields::getFieldAtPos : At pos #" << i << " field is neither double (FLOAT64) nor float (FLOAT32) nor integer (INT32) nor integer (INT64) !";
throw INTERP_KERNEL::Exception(oss.str());
}
ret->shallowCpyGlobs(*this);
//
// Author : Anthony Geay (EDF R&D)
-#ifndef __MEDFILEFIELD_HXX__
-#define __MEDFILEFIELD_HXX__
+#pragma once
#include "MEDLoaderDefines.hxx"
#include "MEDLoaderTraits.hxx"
#include "MEDCouplingTraits.hxx"
#include "MEDCouplingRefCountObject.hxx"
-#include "MEDCouplingFieldInt.hxx"
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingPartDefinition.hxx"
int _nb_iter;
};
}
-
-#endif
//
// Author : Anthony Geay (EDF R&D)
-#ifndef __MEDFILEFIELD_TXX__
-#define __MEDFILEFIELD_TXX__
+#pragma once
#include "MEDFileField.hxx"
#include "MEDCouplingTraits.hxx"
-#include "MEDCouplingFieldInt.hxx"
+#include "MEDCouplingFieldInt32.hxx"
+#include "MEDCouplingFieldInt64.hxx"
#include "MEDCouplingFieldFloat.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingFieldTemplate.hxx"
return ret.retn();
}
}
-
-#endif
extern INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO];
-template class MEDCoupling::MEDFileField1TSTemplateWithoutSDA<int>;
+template class MEDCoupling::MEDFileField1TSTemplateWithoutSDA<Int32>;
+template class MEDCoupling::MEDFileField1TSTemplateWithoutSDA<Int64>;
template class MEDCoupling::MEDFileField1TSTemplateWithoutSDA<float>;
template class MEDCoupling::MEDFileField1TSTemplateWithoutSDA<double>;
-template class MEDCoupling::MEDFileField1TSNDTemplateWithoutSDA<int>;
+template class MEDCoupling::MEDFileField1TSNDTemplateWithoutSDA<Int32>;
+template class MEDCoupling::MEDFileField1TSNDTemplateWithoutSDA<Int64>;
template class MEDCoupling::MEDFileField1TSNDTemplateWithoutSDA<float>;
-template class MEDCoupling::MEDFileTemplateField1TS<int>;
+template class MEDCoupling::MEDFileTemplateField1TS<Int32>;
+template class MEDCoupling::MEDFileTemplateField1TS<Int64>;
template class MEDCoupling::MEDFileTemplateField1TS<float>;
template class MEDCoupling::MEDFileTemplateField1TS<double>;
-template class MEDCoupling::MEDFileNDTemplateField1TS<int>;
+template class MEDCoupling::MEDFileNDTemplateField1TS<Int32>;
+template class MEDCoupling::MEDFileNDTemplateField1TS<Int64>;
template class MEDCoupling::MEDFileNDTemplateField1TS<float>;
const char MEDFileField1TSWithoutSDA::TYPE_STR[]="FLOAT64";
-const char MEDFileIntField1TSWithoutSDA::TYPE_STR[]="INT32";
+const char MEDFileInt32Field1TSWithoutSDA::TYPE_STR[]="INT32";
+const char MEDFileInt64Field1TSWithoutSDA::TYPE_STR[]="INT64";
const char MEDFileFloatField1TSWithoutSDA::TYPE_STR[]="FLOAT32";
//= MEDFileAnyTypeField1TSWithoutSDA
return TYPE_STR;
}
-MEDFileIntField1TSWithoutSDA *MEDFileField1TSWithoutSDA::convertToInt() const
+MEDFileInt32Field1TSWithoutSDA *MEDFileField1TSWithoutSDA::convertToInt() const
{
- MCAuto<MEDFileIntField1TSWithoutSDA> ret(new MEDFileIntField1TSWithoutSDA);
+ MCAuto<MEDFileInt32Field1TSWithoutSDA> ret(new MEDFileInt32Field1TSWithoutSDA);
ret->MEDFileAnyTypeField1TSWithoutSDA::operator =(*this);
ret->deepCpyLeavesFrom(*this);
const DataArrayDouble *arr(_arr);
return ret.retn();
}
-//= MEDFileIntField1TSWithoutSDA
+//= MEDFileInt32Field1TSWithoutSDA
-MEDFileIntField1TSWithoutSDA *MEDFileIntField1TSWithoutSDA::New(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos)
+MEDFileInt32Field1TSWithoutSDA *MEDFileInt32Field1TSWithoutSDA::New(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos)
{
- return new MEDFileIntField1TSWithoutSDA(fieldName,meshName,csit,iteration,order,infos);
+ return new MEDFileInt32Field1TSWithoutSDA(fieldName,meshName,csit,iteration,order,infos);
}
-MEDFileIntField1TSWithoutSDA::MEDFileIntField1TSWithoutSDA()
+MEDFileInt32Field1TSWithoutSDA::MEDFileInt32Field1TSWithoutSDA()
{
}
-MEDFileIntField1TSWithoutSDA::MEDFileIntField1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order,
+MEDFileInt32Field1TSWithoutSDA::MEDFileInt32Field1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order,
const std::vector<std::string>& infos):MEDFileField1TSNDTemplateWithoutSDA<int>(fieldName,meshName,csit,iteration,order,infos)
{
DataArrayInt32 *arr(getOrCreateAndGetArrayTemplate());
arr->setInfoAndChangeNbOfCompo(infos);
}
-const char *MEDFileIntField1TSWithoutSDA::getTypeStr() const
+const char *MEDFileInt32Field1TSWithoutSDA::getTypeStr() const
{
return TYPE_STR;
}
* \throw If no field values are available.
* \sa getUndergroundDataArray()
*/
-DataArray *MEDFileIntField1TSWithoutSDA::getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const
+DataArray *MEDFileInt32Field1TSWithoutSDA::getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const
{
return getUndergroundDataArrayIntExt(entries);
}
* \throw If no field values are available.
* \sa getUndergroundDataArray()
*/
-DataArrayInt *MEDFileIntField1TSWithoutSDA::getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const
+DataArrayInt32 *MEDFileInt32Field1TSWithoutSDA::getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const
{
if(_field_per_mesh.size()!=1)
throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutSDA::getUndergroundDataArrayExt : field lies on several meshes, this method has no sense !");
return getUndergroundDataArrayTemplate();
}
-MEDFileIntField1TSWithoutSDA *MEDFileIntField1TSWithoutSDA::shallowCpy() const
+MEDFileInt32Field1TSWithoutSDA *MEDFileInt32Field1TSWithoutSDA::shallowCpy() const
{
- MCAuto<MEDFileIntField1TSWithoutSDA> ret(new MEDFileIntField1TSWithoutSDA(*this));
+ MCAuto<MEDFileInt32Field1TSWithoutSDA> ret(new MEDFileInt32Field1TSWithoutSDA(*this));
ret->deepCpyLeavesFrom(*this);
return ret.retn();
}
-MEDFileIntField1TSWithoutSDA *MEDFileIntField1TSWithoutSDA::deepCopy() const
+MEDFileInt32Field1TSWithoutSDA *MEDFileInt32Field1TSWithoutSDA::deepCopy() const
{
- MCAuto<MEDFileIntField1TSWithoutSDA> ret(shallowCpy());
+ MCAuto<MEDFileInt32Field1TSWithoutSDA> ret(shallowCpy());
+ if(_arr.isNotNull())
+ ret->_arr=_arr->deepCopy();
+ return ret.retn();
+}
+
+//= MEDFileInt64Field1TSWithoutSDA
+
+MEDFileInt64Field1TSWithoutSDA *MEDFileInt64Field1TSWithoutSDA::New(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos)
+{
+ return new MEDFileInt64Field1TSWithoutSDA(fieldName,meshName,csit,iteration,order,infos);
+}
+
+MEDFileInt64Field1TSWithoutSDA::MEDFileInt64Field1TSWithoutSDA()
+{
+}
+
+MEDFileInt64Field1TSWithoutSDA::MEDFileInt64Field1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order,
+ const std::vector<std::string>& infos):MEDFileField1TSNDTemplateWithoutSDA<Int64>(fieldName,meshName,csit,iteration,order,infos)
+{
+ DataArrayInt64 *arr(getOrCreateAndGetArrayTemplate());
+ arr->setInfoAndChangeNbOfCompo(infos);
+}
+
+const char *MEDFileInt64Field1TSWithoutSDA::getTypeStr() const
+{
+ return TYPE_STR;
+}
+
+/*!
+ * Returns a pointer to the underground DataArrayIdType instance and a
+ * sequence describing parameters of a support of each part of \a this field. The
+ * caller should not decrRef() the returned DataArrayIdType. This method allows for a
+ * direct access to the field values. This method is intended for the field lying on one
+ * mesh only.
+ * \param [in,out] entries - the sequence describing parameters of a support of each
+ * part of \a this field. Each item of this sequence consists of two parts. The
+ * first part describes a type of mesh entity and an id of discretization of a
+ * current field part. The second part describes a range of values [begin,end)
+ * within the returned array relating to the current field part.
+ * \return DataArrayIdType * - the pointer to the field values array.
+ * \throw If the number of underlying meshes is not equal to 1.
+ * \throw If no field values are available.
+ * \sa getUndergroundDataArray()
+ */
+DataArray *MEDFileInt64Field1TSWithoutSDA::getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const
+{
+ return getUndergroundDataArrayIntExt(entries);
+}
+
+/*!
+ * Returns a pointer to the underground DataArrayInt instance and a
+ * sequence describing parameters of a support of each part of \a this field. The
+ * caller should not decrRef() the returned DataArrayIdType. This method allows for a
+ * direct access to the field values. This method is intended for the field lying on one
+ * mesh only.
+ * \param [in,out] entries - the sequence describing parameters of a support of each
+ * part of \a this field. Each item of this sequence consists of two parts. The
+ * first part describes a type of mesh entity and an id of discretization of a
+ * current field part. The second part describes a range of values [begin,end)
+ * within the returned array relating to the current field part.
+ * \return DataArrayInt * - the pointer to the field values array.
+ * \throw If the number of underlying meshes is not equal to 1.
+ * \throw If no field values are available.
+ * \sa getUndergroundDataArray()
+ */
+DataArrayInt64 *MEDFileInt64Field1TSWithoutSDA::getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const
+{
+ if(_field_per_mesh.size()!=1)
+ throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutSDA::getUndergroundDataArrayExt : field lies on several meshes, this method has no sense !");
+ if(_field_per_mesh[0]==0)
+ throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutSDA::getUndergroundDataArrayExt : no field specified !");
+ _field_per_mesh[0]->getUndergroundDataArrayExt(entries);
+ return getUndergroundDataArrayTemplate();
+}
+
+MEDFileInt64Field1TSWithoutSDA *MEDFileInt64Field1TSWithoutSDA::shallowCpy() const
+{
+ MCAuto<MEDFileInt64Field1TSWithoutSDA> ret(new MEDFileInt64Field1TSWithoutSDA(*this));
+ ret->deepCpyLeavesFrom(*this);
+ return ret.retn();
+}
+
+MEDFileInt64Field1TSWithoutSDA *MEDFileInt64Field1TSWithoutSDA::deepCopy() const
+{
+ MCAuto<MEDFileInt64Field1TSWithoutSDA> ret(shallowCpy());
if(_arr.isNotNull())
ret->_arr=_arr->deepCopy();
return ret.retn();
}
case MED_INT32:
{
- ret=MEDFileIntField1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector<std::string>());
+ ret=MEDFileInt32Field1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector<std::string>());
+ break;
+ }
+ case MED_INT64:
+ {
+ ret=MEDFileInt64Field1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector<std::string>());
break;
}
case MED_FLOAT32:
{
if(sizeof(med_int)==sizeof(int))
{
- ret=MEDFileIntField1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector<std::string>());
+ ret=MEDFileInt32Field1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector<std::string>());
break;
}
}
default:
{
- std::ostringstream oss; oss << "MEDFileAnyTypeField1TS::BuildContentFrom(fid) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of the first field is not in [MED_FLOAT64, MED_INT32] !";
+ std::ostringstream oss; oss << "MEDFileAnyTypeField1TS::BuildContentFrom(fid) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of the first field is not in [MED_FLOAT64, MED_FLOAT32, MED_INT32, MED_INT64] !";
throw INTERP_KERNEL::Exception(oss.str());
}
}
}
case MED_INT32:
{
- ret=MEDFileIntField1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector<std::string>());
+ ret=MEDFileInt32Field1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector<std::string>());
+ break;
+ }
+ case MED_INT64:
+ {
+ ret=MEDFileInt64Field1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector<std::string>());
break;
}
case MED_FLOAT32:
{
if(sizeof(med_int)==sizeof(int))
{
- ret=MEDFileIntField1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector<std::string>());
+ ret=MEDFileInt32Field1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector<std::string>());
break;
}
}
default:
{
- std::ostringstream oss; oss << "MEDFileAnyTypeField1TS::BuildContentFrom(fid,fieldName) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32] !";
+ std::ostringstream oss; oss << "MEDFileAnyTypeField1TS::BuildContentFrom(fid,fieldName) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32, MED_INT64] !";
throw INTERP_KERNEL::Exception(oss.str());
}
}
ret->_content=c; c->incrRef();
return ret.retn();
}
- if(dynamic_cast<const MEDFileIntField1TSWithoutSDA *>(c))
+ if(dynamic_cast<const MEDFileInt32Field1TSWithoutSDA *>(c))
+ {
+ MCAuto<MEDFileInt32Field1TS> ret(MEDFileInt32Field1TS::New());
+ ret->_content=c; c->incrRef();
+ return ret.retn();
+ }
+ if(dynamic_cast<const MEDFileInt64Field1TSWithoutSDA *>(c))
{
- MCAuto<MEDFileIntField1TS> ret(MEDFileIntField1TS::New());
+ MCAuto<MEDFileInt64Field1TS> ret(MEDFileInt64Field1TS::New());
ret->_content=c; c->incrRef();
return ret.retn();
}
}
case MED_INT32:
{
- ret=MEDFileIntField1TSWithoutSDA::New(fieldName,meshName,-1,iteration,order,std::vector<std::string>());
+ ret=MEDFileInt32Field1TSWithoutSDA::New(fieldName,meshName,-1,iteration,order,std::vector<std::string>());
+ break;
+ }
+ case MED_INT64:
+ {
+ ret=MEDFileInt64Field1TSWithoutSDA::New(fieldName,meshName,-1,iteration,order,std::vector<std::string>());
break;
}
case MED_FLOAT32:
{
if(sizeof(med_int)==sizeof(int))
{
- ret=MEDFileIntField1TSWithoutSDA::New(fieldName,meshName,-1,iteration,order,std::vector<std::string>());
+ ret=MEDFileInt32Field1TSWithoutSDA::New(fieldName,meshName,-1,iteration,order,std::vector<std::string>());
break;
}
}
default:
{
- std::ostringstream oss; oss << "MEDFileAnyTypeField1TS::BuildContentFrom(fid,fieldName,iteration,order) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32] !";
+ std::ostringstream oss; oss << "MEDFileAnyTypeField1TS::BuildContentFrom(fid,fieldName,iteration,order) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32, MED_INT64] !";
throw INTERP_KERNEL::Exception(oss.str());
}
}
*
* \param [in] isDeepCpyGlobs - a boolean that indicates the behaviour concerning globals (profiles and localizations)
* By default (true) the globals are deeply copied.
- * \return MEDFileIntField1TS * - a new object that is the result of the conversion of \a this to int32 field.
+ * \return MEDFileInt32Field1TS * - a new object that is the result of the conversion of \a this to int32 field.
*/
-MEDFileIntField1TS *MEDFileField1TS::convertToInt(bool isDeepCpyGlobs) const
+MEDFileInt32Field1TS *MEDFileField1TS::convertToInt(bool isDeepCpyGlobs) const
{
- MCAuto<MEDFileIntField1TS> ret;
+ MCAuto<MEDFileInt32Field1TS> ret;
const MEDFileAnyTypeField1TSWithoutSDA *content(_content);
if(content)
{
const MEDFileField1TSWithoutSDA *contc=dynamic_cast<const MEDFileField1TSWithoutSDA *>(content);
if(!contc)
throw INTERP_KERNEL::Exception("MEDFileField1TS::convertToInt : the content inside this is not FLOAT64 ! This is incoherent !");
- MCAuto<MEDFileIntField1TSWithoutSDA> newc(contc->convertToInt());
- ret=static_cast<MEDFileIntField1TS *>(MEDFileAnyTypeField1TS::BuildNewInstanceFromContent((MEDFileIntField1TSWithoutSDA *)newc));
+ MCAuto<MEDFileInt32Field1TSWithoutSDA> newc(contc->convertToInt());
+ ret=static_cast<MEDFileInt32Field1TS *>(MEDFileAnyTypeField1TS::BuildNewInstanceFromContent((MEDFileInt32Field1TSWithoutSDA *)newc));
}
else
- ret=MEDFileIntField1TS::New();
+ ret=MEDFileInt32Field1TS::New();
if(isDeepCpyGlobs)
ret->deepCpyGlobs(*this);
else
return contentNotNull()->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
}
-//= MEDFileIntField1TS
+//= MEDFileInt32Field1TS
-MCAuto<MEDCouplingFieldDouble> MEDFileIntField1TS::ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt *f)
+MCAuto<MEDCouplingFieldDouble> MEDFileInt32Field1TS::ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt32 *f)
{
if(!f)
- throw INTERP_KERNEL::Exception("MEDFileIntField1TS::ConvertFieldIntToFieldDouble : null input field !");
+ throw INTERP_KERNEL::Exception("MEDFileInt32Field1TS::ConvertFieldIntToFieldDouble : null input field !");
int t1,t2;
double t0(f->getTime(t1,t2));
std::string tu(f->getTimeUnit());
return ret;
}
-//= MEDFileFloatField1TS
+//= MEDFileInt64Field1TS
+
+MCAuto<MEDCouplingFieldDouble> MEDFileInt64Field1TS::ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt64 *f)
+{
+ if(!f)
+ throw INTERP_KERNEL::Exception("MEDFileInt64Field1TS::ConvertFieldIntToFieldDouble : null input field !");
+ int t1,t2;
+ double t0(f->getTime(t1,t2));
+ std::string tu(f->getTimeUnit());
+ MCAuto<MEDCouplingFieldTemplate> ft(MEDCouplingFieldTemplate::New(*f));
+ MCAuto<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(*ft));
+ ret->setTime(t0,t1,t2); ret->setTimeUnit(tu);
+ return ret;
+}
-//= MEDFileFloatField1TS
mutable mcIdType _nb_of_tuples_to_be_allocated;
};
- class MEDFileIntField1TSWithoutSDA;
+ class MEDFileInt32Field1TSWithoutSDA;
template<class T>
class MEDFileField1TSTemplateWithoutSDA : public MEDFileAnyTypeField1TSWithoutSDA
MEDLOADER_EXPORT MEDFileField1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos);
MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *shallowCpy() const;
MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *deepCopy() const;
- MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *convertToInt() const;
+ MEDLOADER_EXPORT MEDFileInt32Field1TSWithoutSDA *convertToInt() const;
public:
static const char TYPE_STR[];
};
/*!
* SDA is for Shared Data Arrays such as profiles.
*/
- class MEDFileIntField1TSWithoutSDA : public MEDFileField1TSNDTemplateWithoutSDA<int>
+ class MEDFileInt32Field1TSWithoutSDA : public MEDFileField1TSNDTemplateWithoutSDA<Int32>
{
public:
- MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA();
- MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileIntField1TSWithoutSDA"); }
- MEDLOADER_EXPORT static MEDFileIntField1TSWithoutSDA *New(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos);
- MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *deepCopy() const;
- MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *shallowCpy() const;
+ MEDLOADER_EXPORT MEDFileInt32Field1TSWithoutSDA();
+ MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileInt32Field1TSWithoutSDA"); }
+ MEDLOADER_EXPORT static MEDFileInt32Field1TSWithoutSDA *New(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos);
+ MEDLOADER_EXPORT MEDFileInt32Field1TSWithoutSDA *deepCopy() const;
+ MEDLOADER_EXPORT MEDFileInt32Field1TSWithoutSDA *shallowCpy() const;
MEDLOADER_EXPORT const char *getTypeStr() const;
MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const;
- MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const;
+ MEDLOADER_EXPORT DataArrayInt32 *getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const;
protected:
- MEDFileIntField1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos);
+ MEDFileInt32Field1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos);
+ public:
+ MEDLOADER_EXPORT static const char TYPE_STR[];
+ };
+
+ /*!
+ * SDA is for Shared Data Arrays such as profiles.
+ */
+ class MEDFileInt64Field1TSWithoutSDA : public MEDFileField1TSNDTemplateWithoutSDA<Int64>
+ {
+ public:
+ MEDLOADER_EXPORT MEDFileInt64Field1TSWithoutSDA();
+ MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileInt64Field1TSWithoutSDA"); }
+ MEDLOADER_EXPORT static MEDFileInt64Field1TSWithoutSDA *New(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos);
+ MEDLOADER_EXPORT MEDFileInt64Field1TSWithoutSDA *deepCopy() const;
+ MEDLOADER_EXPORT MEDFileInt64Field1TSWithoutSDA *shallowCpy() const;
+ MEDLOADER_EXPORT const char *getTypeStr() const;
+ MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const;
+ MEDLOADER_EXPORT DataArrayInt64 *getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const;
+ protected:
+ MEDFileInt64Field1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos);
public:
MEDLOADER_EXPORT static const char TYPE_STR[];
};
MCAuto<MEDFileAnyTypeField1TSWithoutSDA> _content;
};
- class MEDFileIntField1TS;
+ class MEDFileInt32Field1TS;
template<class T>
class MEDFileTemplateField1TS : public MEDFileAnyTypeField1TS
{
friend class MEDFileTemplateField1TS<double>;
public:
- MEDLOADER_EXPORT MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const;
+ MEDLOADER_EXPORT MEDFileInt32Field1TS *convertToInt(bool isDeepCpyGlobs=true) const;
public:
MEDLOADER_EXPORT MEDFileField1TS *shallowCpy() const;
MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
MEDFileNDTemplateField1TS(const typename MLFieldTraits<T>::F1TSWSDAType& other, bool shallowCopyOfContent):MEDFileTemplateField1TS<T>(other,shallowCopyOfContent) { }
};
- class MEDFileIntField1TS : public MEDFileNDTemplateField1TS<int>
+ class MEDFileInt32Field1TS : public MEDFileNDTemplateField1TS<Int32>
{
- friend class MEDFileTemplateField1TS<int>;
+ friend class MEDFileTemplateField1TS<Int32>;
public:
- MEDLOADER_EXPORT MEDFileIntField1TS *shallowCpy() const { return new MEDFileIntField1TS(*this); }
- MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileIntField1TS"); }
+ MEDLOADER_EXPORT MEDFileInt32Field1TS *shallowCpy() const { return new MEDFileInt32Field1TS(*this); }
+ MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileInt32Field1TS"); }
public:
- MEDLOADER_EXPORT static MCAuto<MEDCouplingFieldDouble> ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt *f);
+ MEDLOADER_EXPORT static MCAuto<MEDCouplingFieldDouble> ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt32 *f);
private:
med_field_type getMEDFileFieldType() const { return MED_INT32; }
private:
- ~MEDFileIntField1TS() { }
- MEDFileIntField1TS() { }
- MEDFileIntField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS<int>(fid,loadAll,ms) { }
- MEDFileIntField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS<int>(fid,fieldName,loadAll,ms) { }
- MEDFileIntField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS<int>(fid,fieldName,iteration,order,loadAll,ms) { }
+ ~MEDFileInt32Field1TS() { }
+ MEDFileInt32Field1TS() { }
+ MEDFileInt32Field1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS<Int32>(fid,loadAll,ms) { }
+ MEDFileInt32Field1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS<Int32>(fid,fieldName,loadAll,ms) { }
+ MEDFileInt32Field1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS<Int32>(fid,fieldName,iteration,order,loadAll,ms) { }
+ /*!
+ * This constructor is a shallow copy constructor. If \a shallowCopyOfContent is true the content of \a other is shallow copied.
+ * If \a shallowCopyOfContent is false, \a other is taken to be the content of \a this.
+ *
+ * \warning this is a shallow copy constructor
+ */
+ MEDFileInt32Field1TS(const MEDFileInt32Field1TSWithoutSDA& other, bool shallowCopyOfContent):MEDFileNDTemplateField1TS<Int32>(other,shallowCopyOfContent) { }
+ };
+
+ class MEDFileInt64Field1TS : public MEDFileNDTemplateField1TS<Int64>
+ {
+ friend class MEDFileTemplateField1TS<Int64>;
+ public:
+ MEDLOADER_EXPORT MEDFileInt64Field1TS *shallowCpy() const { return new MEDFileInt64Field1TS(*this); }
+ MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileInt64Field1TS"); }
+ public:
+ MEDLOADER_EXPORT static MCAuto<MEDCouplingFieldDouble> ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt64 *f);
+ private:
+ med_field_type getMEDFileFieldType() const { return MED_INT64; }
+ private:
+ ~MEDFileInt64Field1TS() { }
+ MEDFileInt64Field1TS() { }
+ MEDFileInt64Field1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS<Int64>(fid,loadAll,ms) { }
+ MEDFileInt64Field1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS<Int64>(fid,fieldName,loadAll,ms) { }
+ MEDFileInt64Field1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS<Int64>(fid,fieldName,iteration,order,loadAll,ms) { }
/*!
* This constructor is a shallow copy constructor. If \a shallowCopyOfContent is true the content of \a other is shallow copied.
* If \a shallowCopyOfContent is false, \a other is taken to be the content of \a this.
*
* \warning this is a shallow copy constructor
*/
- MEDFileIntField1TS(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent):MEDFileNDTemplateField1TS<int>(other,shallowCopyOfContent) { }
+ MEDFileInt64Field1TS(const MEDFileInt64Field1TSWithoutSDA& other, bool shallowCopyOfContent):MEDFileNDTemplateField1TS<Int64>(other,shallowCopyOfContent) { }
};
class MEDFileFloatField1TS : public MEDFileNDTemplateField1TS<float>
DataArrayInt32 *arrI(dynamic_cast<DataArrayInt32 *>(arr));
if(arrI)
{
- int *startFeeding(arrI->getPointer()+_start*nbOfCompo);
+ Int32 *startFeeding(arrI->getPointer()+_start*nbOfCompo);
+ goReadZeValuesInFile(fid,fieldName,nbOfCompo,iteration,order,menti,mgeoti,reinterpret_cast<unsigned char*>(startFeeding));
+ return ;
+ }
+ DataArrayInt64 *arrI64(dynamic_cast<DataArrayInt64 *>(arr));
+ if(arrI64)
+ {
+ Int64 *startFeeding(arrI64->getPointer()+_start*nbOfCompo);
goReadZeValuesInFile(fid,fieldName,nbOfCompo,iteration,order,menti,mgeoti,reinterpret_cast<unsigned char*>(startFeeding));
return ;
}
throw INTERP_KERNEL::Exception("MEDFileFieldPerMeshPerTypePerDisc::writeLL : the array to be written is not allocated !");
const DataArrayDouble *arrD(dynamic_cast<const DataArrayDouble *>(arr));
const DataArrayInt32 *arrI(dynamic_cast<const DataArrayInt32 *>(arr));
+ const DataArrayInt64 *arrI64(dynamic_cast<const DataArrayInt64 *>(arr));
const DataArrayFloat *arrF(dynamic_cast<const DataArrayFloat *>(arr));
const unsigned char *locToWrite=0;
if(arrD)
locToWrite=reinterpret_cast<const unsigned char *>(arrD->getConstPointer()+_start*arr->getNumberOfComponents());
else if(arrI)
locToWrite=reinterpret_cast<const unsigned char *>(arrI->getConstPointer()+_start*arr->getNumberOfComponents());
+ else if(arrI64)
+ locToWrite=reinterpret_cast<const unsigned char *>(arrI64->getConstPointer()+_start*arr->getNumberOfComponents());
else if(arrF)
locToWrite=reinterpret_cast<const unsigned char *>(arrF->getConstPointer()+_start*arr->getNumberOfComponents());
else
- throw INTERP_KERNEL::Exception("MEDFileFieldPerMeshPerTypePerDisc::writeLL : not recognized type of values ! Supported are FLOAT64 FLOAT32 and INT32 !");
+ throw INTERP_KERNEL::Exception("MEDFileFieldPerMeshPerTypePerDisc::writeLL : not recognized type of values ! Supported are FLOAT64 FLOAT32 INT32 and INT64 !");
MEDFILESAFECALLERWR0(MEDfieldValueWithProfileWr,(fid,nasc.getName().c_str(),getIteration(),getOrder(),getTime(),menti,mgeoti,
MED_COMPACT_PFLMODE,_profile.c_str(),_localization.c_str(),MED_FULL_INTERLACE,MED_ALL_CONSTITUENT,ToMedInt(_nval),
locToWrite));
using namespace MEDCoupling;
-template class MEDCoupling::MEDFileTemplateFieldMultiTSWithoutSDA<int>;
+template class MEDCoupling::MEDFileTemplateFieldMultiTSWithoutSDA<Int32>;
+template class MEDCoupling::MEDFileTemplateFieldMultiTSWithoutSDA<Int64>;
template class MEDCoupling::MEDFileTemplateFieldMultiTSWithoutSDA<float>;
template class MEDCoupling::MEDFileTemplateFieldMultiTSWithoutSDA<double>;
-template class MEDCoupling::MEDFileNDTemplateFieldMultiTSWithoutSDA<int>;
+template class MEDCoupling::MEDFileNDTemplateFieldMultiTSWithoutSDA<Int32>;
+template class MEDCoupling::MEDFileNDTemplateFieldMultiTSWithoutSDA<Int64>;
template class MEDCoupling::MEDFileNDTemplateFieldMultiTSWithoutSDA<float>;
-template class MEDCoupling::MEDFileTemplateFieldMultiTS<int>;
+template class MEDCoupling::MEDFileTemplateFieldMultiTS<Int32>;
+template class MEDCoupling::MEDFileTemplateFieldMultiTS<Int64>;
template class MEDCoupling::MEDFileTemplateFieldMultiTS<float>;
template class MEDCoupling::MEDFileTemplateFieldMultiTS<double>;
-template class MEDCoupling::MEDFileNDTemplateFieldMultiTS<int>;
+template class MEDCoupling::MEDFileNDTemplateFieldMultiTS<Int32>;
+template class MEDCoupling::MEDFileNDTemplateFieldMultiTS<Int64>;
template class MEDCoupling::MEDFileNDTemplateFieldMultiTS<float>;
extern INTERP_KERNEL::NormalizedCellType ConvertGeometryType(med_geometry_type geotype);
}
case MED_INT32:
{
- _time_steps[i]=MEDFileIntField1TSWithoutSDA::New(getName(),getMeshName(),i+1,FromMedInt<int>(numdt),FromMedInt<int>(numo),_infos);
+ _time_steps[i]=MEDFileInt32Field1TSWithoutSDA::New(getName(),getMeshName(),i+1,FromMedInt<int>(numdt),FromMedInt<int>(numo),_infos);
+ break;
+ }
+ case MED_INT64:
+ {
+ _time_steps[i]=MEDFileInt64Field1TSWithoutSDA::New(getName(),getMeshName(),i+1,FromMedInt<int>(numdt),FromMedInt<int>(numo),_infos);
break;
}
case MED_FLOAT32:
{
if(sizeof(med_int)==sizeof(int))
{
- _time_steps[i]=MEDFileIntField1TSWithoutSDA::New(getName(),getMeshName(),i+1,FromMedInt<int>(numdt),FromMedInt<int>(numo),_infos);
+ _time_steps[i]=MEDFileInt32Field1TSWithoutSDA::New(getName(),getMeshName(),i+1,FromMedInt<int>(numdt),FromMedInt<int>(numo),_infos);
break;
}
}
default:
- throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTSWithoutSDA::loadStructureOrStructureAndBigArraysRecursively : managed field type are : FLOAT64, INT32, FLOAT32 !");
+ throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTSWithoutSDA::loadStructureOrStructureAndBigArraysRecursively : managed field type are : FLOAT64, INT32, FLOAT32, INT64 !");
}
if(loadAll)
_time_steps[i]->loadStructureAndBigArraysRecursively(fid,*this,ms,entitiesForSubInstances);
void MEDFileAnyTypeFieldMultiTSWithoutSDA::appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArray *arr, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile, MEDFileFieldGlobsReal& glob, bool smartPflKiller)
{
if(!field)
- throw INTERP_KERNEL::Exception("MEDFileIntFieldMultiTSWithoutSDA::appendFieldNoProfileSBT : input field is NULL !");
+ throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTSWithoutSDA::appendFieldNoProfileSBT : input field is NULL !");
if(!_time_steps.empty())
checkCoherencyOfTinyInfo(field,arr);
MCAuto<MEDFileAnyTypeField1TSWithoutSDA> obj(createNew1TSWithoutSDAEmptyInstance());
return myF1TSC->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
}
-MEDFileIntFieldMultiTSWithoutSDA *MEDFileFieldMultiTSWithoutSDA::convertToInt() const
+MEDFileInt32FieldMultiTSWithoutSDA *MEDFileFieldMultiTSWithoutSDA::convertToInt() const
{
- MCAuto<MEDFileIntFieldMultiTSWithoutSDA> ret(new MEDFileIntFieldMultiTSWithoutSDA);
+ MCAuto<MEDFileInt32FieldMultiTSWithoutSDA> ret(new MEDFileInt32FieldMultiTSWithoutSDA);
ret->MEDFileAnyTypeFieldMultiTSWithoutSDA::operator =(*this);
int i=0;
for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,i++)
}
case MED_INT32:
{
- ret=new MEDFileIntFieldMultiTSWithoutSDA(fid,i,loadAll,ms,entities);
+ ret=new MEDFileInt32FieldMultiTSWithoutSDA(fid,i,loadAll,ms,entities);
+ break;
+ }
+ case MED_INT64:
+ {
+ ret=new MEDFileInt64FieldMultiTSWithoutSDA(fid,i,loadAll,ms,entities);
break;
}
case MED_FLOAT32:
{
if(sizeof(med_int)==sizeof(int))
{
- ret=new MEDFileIntFieldMultiTSWithoutSDA(fid,i,loadAll,ms,entities);
+ ret=new MEDFileInt32FieldMultiTSWithoutSDA(fid,i,loadAll,ms,entities);
break;
}
}
default:
{
- std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::BuildContentFrom(fid,fieldName) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32] !";
+ std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::BuildContentFrom(fid,fieldName) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32, MED_INT64] !";
throw INTERP_KERNEL::Exception(oss.str());
}
}
}
case MED_INT32:
{
- ret=new MEDFileIntFieldMultiTSWithoutSDA(fid,0,loadAll,ms,0);
+ ret=new MEDFileInt32FieldMultiTSWithoutSDA(fid,0,loadAll,ms,0);
+ break;
+ }
+ case MED_INT64:
+ {
+ ret=new MEDFileInt64FieldMultiTSWithoutSDA(fid,0,loadAll,ms,0);
break;
}
case MED_FLOAT32:
{
if(sizeof(med_int)==sizeof(int))
{
- ret=new MEDFileIntFieldMultiTSWithoutSDA(fid,0,loadAll,ms,0);
+ ret=new MEDFileInt32FieldMultiTSWithoutSDA(fid,0,loadAll,ms,0);
break;
}
}
default:
{
- std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::BuildContentFrom(fid) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of the first field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32] !";
+ std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::BuildContentFrom(fid) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of the first field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32, MED_INT64] !";
throw INTERP_KERNEL::Exception(oss.str());
}
}
ret->_content=c; c->incrRef();
return ret.retn();
}
- if(dynamic_cast<const MEDFileIntFieldMultiTSWithoutSDA *>(c))
+ if(dynamic_cast<const MEDFileInt32FieldMultiTSWithoutSDA *>(c))
+ {
+ MCAuto<MEDFileInt32FieldMultiTS> ret(MEDFileInt32FieldMultiTS::New());
+ ret->_content=c; c->incrRef();
+ return ret.retn();
+ }
+ if(dynamic_cast<const MEDFileInt64FieldMultiTSWithoutSDA *>(c))
{
- MCAuto<MEDFileIntFieldMultiTS> ret(MEDFileIntFieldMultiTS::New());
+ MCAuto<MEDFileInt64FieldMultiTS> ret(MEDFileInt64FieldMultiTS::New());
ret->_content=c; c->incrRef();
return ret.retn();
}
//= MEDFileAnyTypeFieldMultiTS
/*!
- * Returns a new instance of MEDFileFieldMultiTS or MEDFileIntFieldMultiTS holding data of the first field
+ * Returns a new instance of MEDFileFieldMultiTS or MEDFileInt32FieldMultiTS holding data of the first field
* that has been read from a specified MED file.
* \param [in] fileName - the name of the MED file to read.
- * \return MEDFileFieldMultiTS * - a new instance of MEDFileFieldMultiTS or MEDFileIntFieldMultiTS. The caller
+ * \return MEDFileFieldMultiTS * - a new instance of MEDFileFieldMultiTS or MEDFileInt32FieldMultiTS. The caller
* is to delete this field using decrRef() as it is no more needed.
* \throw If reading the file fails.
*/
}
/*!
- * Returns a new instance of MEDFileFieldMultiTS or MEDFileIntFieldMultiTS holding data of a given field
+ * Returns a new instance of MEDFileFieldMultiTS or MEDFileInt32FieldMultiTS holding data of a given field
* that has been read from a specified MED file.
* \param [in] fileName - the name of the MED file to read.
* \param [in] fieldName - the name of the field to read.
- * \return MEDFileFieldMultiTS * - a new instance of MEDFileFieldMultiTS or MEDFileIntFieldMultiTS. The caller
+ * \return MEDFileFieldMultiTS * - a new instance of MEDFileFieldMultiTS or MEDFileInt32FieldMultiTS. The caller
* is to delete this field using decrRef() as it is no more needed.
* \throw If reading the file fails.
* \throw If there is no field named \a fieldName in the file.
}
/*!
- * Returns a new MEDFileField1TS or MEDFileIntField1TS holding data of a given time step of \a this field.
+ * Returns a new MEDFileField1TS or MEDFileInt32Field1TS holding data of a given time step of \a this field.
* \param [in] iteration - the iteration number of a required time step.
* \param [in] order - the iteration order number of required time step.
- * \return MEDFileField1TS * or MEDFileIntField1TS *- a new instance of MEDFileField1TS or MEDFileIntField1TS. The caller is to
+ * \return MEDFileField1TS * or MEDFileInt32Field1TS *- a new instance of MEDFileField1TS or MEDFileInt32Field1TS. The caller is to
* delete this field using decrRef() as it is no more needed.
* \throw If there is no required time step in \a this field.
*/
}
/*!
- * Returns a new MEDFileField1TS or MEDFileIntField1TS holding data of a given time step of \a this field.
+ * Returns a new MEDFileField1TS or MEDFileInt32Field1TS holding data of a given time step of \a this field.
* \param [in] time - the time of the time step of interest.
* \param [in] eps - a precision used to compare time values.
* \return MEDFileField1TS * - a new instance of MEDFileField1TS. The caller is to
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::Aggregate : input vector is empty !");
std::size_t sz(fmtss.size());
std::vector<const MEDFileFieldMultiTS *> fmtss1;
- std::vector<const MEDFileIntFieldMultiTS *> fmtss2;
+ std::vector<const MEDFileInt32FieldMultiTS *> fmtss2;
+ std::vector<const MEDFileInt64FieldMultiTS *> fmtss3;
for(std::vector<const MEDFileAnyTypeFieldMultiTS *>::const_iterator it=fmtss.begin();it!=fmtss.end();it++)
{
if(!(*it))
fmtss1.push_back(elt1);
continue;
}
- const MEDFileIntFieldMultiTS *elt2(dynamic_cast<const MEDFileIntFieldMultiTS *>(*it));
+ const MEDFileInt32FieldMultiTS *elt2(dynamic_cast<const MEDFileInt32FieldMultiTS *>(*it));
if(elt2)
{
fmtss2.push_back(elt2);
continue;
}
+ const MEDFileInt64FieldMultiTS *elt3(dynamic_cast<const MEDFileInt64FieldMultiTS *>(*it));
+ if(elt3)
+ {
+ fmtss3.push_back(elt3);
+ continue;
+ }
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::Aggregate : not recognized type !");
}
- if(fmtss1.size()!=sz && fmtss2.size()!=sz)
+ if(fmtss1.size()!=sz && fmtss2.size()!=sz && fmtss3.size()!=sz)
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::Aggregate : type of data is not homogeneous !");
if(fmtss1.size()==sz)
return AggregateHelperFMTS<double>(fmtss1,dts);
if(fmtss2.size()!=sz)
- return AggregateHelperFMTS<int>(fmtss2,dts);
+ return AggregateHelperFMTS<Int32>(fmtss2,dts);
+ if(fmtss3.size()!=sz)
+ return AggregateHelperFMTS<Int64>(fmtss3,dts);
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::Aggregate : not implemented yet !");
}
*
* \param [in] isDeepCpyGlobs - a boolean that indicates the behaviour concerning globals (profiles and localizations)
* By default (true) the globals are deeply copied.
- * \return MEDFileIntFieldMultiTS * - a new object that is the result of the conversion of \a this to int32 field.
+ * \return MEDFileInt32FieldMultiTS * - a new object that is the result of the conversion of \a this to int32 field.
*/
-MEDFileIntFieldMultiTS *MEDFileFieldMultiTS::convertToInt(bool isDeepCpyGlobs) const
+MEDFileInt32FieldMultiTS *MEDFileFieldMultiTS::convertToInt(bool isDeepCpyGlobs) const
{
- MCAuto<MEDFileIntFieldMultiTS> ret;
+ MCAuto<MEDFileInt32FieldMultiTS> ret;
const MEDFileAnyTypeFieldMultiTSWithoutSDA *content(_content);
if(content)
{
const MEDFileFieldMultiTSWithoutSDA *contc=dynamic_cast<const MEDFileFieldMultiTSWithoutSDA *>(content);
if(!contc)
throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::convertToInt : the content inside this is not FLOAT64 ! This is incoherent !");
- MCAuto<MEDFileIntFieldMultiTSWithoutSDA> newc(contc->convertToInt());
- ret=static_cast<MEDFileIntFieldMultiTS *>(MEDFileAnyTypeFieldMultiTS::BuildNewInstanceFromContent((MEDFileIntFieldMultiTSWithoutSDA *)newc));
+ MCAuto<MEDFileInt32FieldMultiTSWithoutSDA> newc(contc->convertToInt());
+ ret=static_cast<MEDFileInt32FieldMultiTS *>(MEDFileAnyTypeFieldMultiTS::BuildNewInstanceFromContent((MEDFileInt32FieldMultiTSWithoutSDA *)newc));
}
else
- ret=MEDFileIntFieldMultiTS::New();
+ ret=MEDFileInt32FieldMultiTS::New();
if(isDeepCpyGlobs)
ret->deepCpyGlobs(*this);
else
return 0;
}
-//= MEDFileIntFieldMultiTS
+//= MEDFileInt32FieldMultiTS
//
// Author : Anthony Geay (EDF R&D)
-#ifndef __MEDFILEFIELDMULTITS_HXX__
-#define __MEDFILEFIELDMULTITS_HXX__
+#pragma once
#include "MEDLoaderDefines.hxx"
#include "MEDFileField1TS.hxx"
std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > _time_steps;
};
- class MEDFileIntFieldMultiTSWithoutSDA;
+ class MEDFileInt32FieldMultiTSWithoutSDA;
template<class T>
class MEDFileTemplateFieldMultiTSWithoutSDA : public MEDFileAnyTypeFieldMultiTSWithoutSDA
public:
MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileTemplateFieldMultiTSWithoutSDA<double>(fid,fieldId,loadAll,ms,entities) { }
MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
- MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA *convertToInt() const;
+ MEDLOADER_EXPORT MEDFileInt32FieldMultiTSWithoutSDA *convertToInt() const;
MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const { return new MEDFileFieldMultiTSWithoutSDA(*this); }
MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileFieldMultiTSWithoutSDA"); }
protected:
MEDFileNDTemplateFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileTemplateFieldMultiTSWithoutSDA<T>(fid,fieldName,meshName,fieldTyp,infos,nbOfStep,dtunit,loadAll,ms,entities) { }
};
- class MEDFileIntFieldMultiTSWithoutSDA : public MEDFileNDTemplateFieldMultiTSWithoutSDA<int>
+ class MEDFileInt32FieldMultiTSWithoutSDA : public MEDFileNDTemplateFieldMultiTSWithoutSDA<Int32>
{
- friend class MEDFileTemplateFieldMultiTSWithoutSDA<int>;
+ friend class MEDFileTemplateFieldMultiTSWithoutSDA<Int32>;
public:
- MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileNDTemplateFieldMultiTSWithoutSDA<int>(fid,fieldId,loadAll,ms,entities) { }
- MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const { return new MEDFileIntFieldMultiTSWithoutSDA(*this); }
- MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileIntFieldMultiTSWithoutSDA"); }
+ MEDLOADER_EXPORT MEDFileInt32FieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileNDTemplateFieldMultiTSWithoutSDA<Int32>(fid,fieldId,loadAll,ms,entities) { }
+ MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const { return new MEDFileInt32FieldMultiTSWithoutSDA(*this); }
+ MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileInt32FieldMultiTSWithoutSDA"); }
protected:
- MEDFileIntFieldMultiTSWithoutSDA(const std::string& fieldName, const std::string& meshName):MEDFileNDTemplateFieldMultiTSWithoutSDA<int>(fieldName,meshName) { }
- MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileNDTemplateFieldMultiTSWithoutSDA<int>(fid,fieldName,meshName,fieldTyp,infos,nbOfStep,dtunit,loadAll,ms,entities) { }
+ MEDFileInt32FieldMultiTSWithoutSDA(const std::string& fieldName, const std::string& meshName):MEDFileNDTemplateFieldMultiTSWithoutSDA<Int32>(fieldName,meshName) { }
+ MEDFileInt32FieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileNDTemplateFieldMultiTSWithoutSDA<Int32>(fid,fieldName,meshName,fieldTyp,infos,nbOfStep,dtunit,loadAll,ms,entities) { }
med_field_type getMEDFileFieldType() const { return MED_INT32; }
public:
- MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA() { }
+ MEDLOADER_EXPORT MEDFileInt32FieldMultiTSWithoutSDA() { }
+ };
+
+ class MEDFileInt64FieldMultiTSWithoutSDA : public MEDFileNDTemplateFieldMultiTSWithoutSDA<Int64>
+ {
+ friend class MEDFileTemplateFieldMultiTSWithoutSDA<Int64>;
+ public:
+ MEDLOADER_EXPORT MEDFileInt64FieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileNDTemplateFieldMultiTSWithoutSDA<Int64>(fid,fieldId,loadAll,ms,entities) { }
+ MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const { return new MEDFileInt64FieldMultiTSWithoutSDA(*this); }
+ MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileInt64FieldMultiTSWithoutSDA"); }
+ protected:
+ MEDFileInt64FieldMultiTSWithoutSDA(const std::string& fieldName, const std::string& meshName):MEDFileNDTemplateFieldMultiTSWithoutSDA<Int64>(fieldName,meshName) { }
+ MEDFileInt64FieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileNDTemplateFieldMultiTSWithoutSDA<Int64>(fid,fieldName,meshName,fieldTyp,infos,nbOfStep,dtunit,loadAll,ms,entities) { }
+ med_field_type getMEDFileFieldType() const { return MED_INT64; }
+ public:
+ MEDLOADER_EXPORT MEDFileInt64FieldMultiTSWithoutSDA() { }
};
class MEDFileFloatFieldMultiTSWithoutSDA : public MEDFileNDTemplateFieldMultiTSWithoutSDA<float>
friend class MEDFileTemplateFieldMultiTS<double>;
public:
MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
- MEDLOADER_EXPORT MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
+ MEDLOADER_EXPORT MEDFileInt32FieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileFieldMultiTS"); }
//
MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
/*!
* User class.
*/
- class MEDFileIntFieldMultiTS : public MEDFileNDTemplateFieldMultiTS<int>
+ class MEDFileInt32FieldMultiTS : public MEDFileNDTemplateFieldMultiTS<Int32>
{
- friend class MEDFileTemplateFieldMultiTS<int>;
+ friend class MEDFileTemplateFieldMultiTS<Int32>;
public:
- MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const { return new MEDFileIntFieldMultiTS(*this); }
- MEDLOADER_EXPORT MEDFileIntFieldMultiTS *buildNewEmpty() const { return buildNewEmptyImpl(); }
- MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileIntFieldMultiTS"); }
+ MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const { return new MEDFileInt32FieldMultiTS(*this); }
+ MEDLOADER_EXPORT MEDFileInt32FieldMultiTS *buildNewEmpty() const { return buildNewEmptyImpl(); }
+ MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileInt32FieldMultiTS"); }
private:
- ~MEDFileIntFieldMultiTS() { }
- MEDFileIntFieldMultiTS() { }
- MEDFileIntFieldMultiTS(const MEDFileIntFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent):MEDFileNDTemplateFieldMultiTS<int>(other,shallowCopyOfContent) { }
- MEDFileIntFieldMultiTS(med_idt fid, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateFieldMultiTS<int>(fid,loadAll,ms) { }
- MEDFileIntFieldMultiTS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0):MEDFileNDTemplateFieldMultiTS<int>(fid,fieldName,loadAll,ms,entities) { }
+ ~MEDFileInt32FieldMultiTS() { }
+ MEDFileInt32FieldMultiTS() { }
+ MEDFileInt32FieldMultiTS(const MEDFileInt32FieldMultiTSWithoutSDA& other, bool shallowCopyOfContent):MEDFileNDTemplateFieldMultiTS<Int32>(other,shallowCopyOfContent) { }
+ MEDFileInt32FieldMultiTS(med_idt fid, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateFieldMultiTS<Int32>(fid,loadAll,ms) { }
+ MEDFileInt32FieldMultiTS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0):MEDFileNDTemplateFieldMultiTS<Int32>(fid,fieldName,loadAll,ms,entities) { }
+ };
+
+ /*!
+ * User class.
+ */
+ class MEDFileInt64FieldMultiTS : public MEDFileNDTemplateFieldMultiTS<Int64>
+ {
+ friend class MEDFileTemplateFieldMultiTS<Int64>;
+ public:
+ MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const { return new MEDFileInt64FieldMultiTS(*this); }
+ MEDLOADER_EXPORT MEDFileInt64FieldMultiTS *buildNewEmpty() const { return buildNewEmptyImpl(); }
+ MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileInt64FieldMultiTS"); }
+ private:
+ ~MEDFileInt64FieldMultiTS() { }
+ MEDFileInt64FieldMultiTS() { }
+ MEDFileInt64FieldMultiTS(const MEDFileInt64FieldMultiTSWithoutSDA& other, bool shallowCopyOfContent):MEDFileNDTemplateFieldMultiTS<Int64>(other,shallowCopyOfContent) { }
+ MEDFileInt64FieldMultiTS(med_idt fid, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateFieldMultiTS<Int64>(fid,loadAll,ms) { }
+ MEDFileInt64FieldMultiTS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0):MEDFileNDTemplateFieldMultiTS<Int64>(fid,fieldName,loadAll,ms,entities) { }
};
/*!
int _nb_iter;
};
}
-
-#endif
const char *MEDFileUtilities::GetReadableMEDFieldType(med_field_type ft)
{
static const char medFloat64[]="MED_FLOAT64";
+ static const char medFloat32[]="MED_FLOAT32";
static const char medInt32[]="MED_INT32";
static const char medInt64[]="MED_INT64";
switch(ft)
{
case MED_FLOAT64:
return medFloat64;
+ case MED_FLOAT32:
+ return medFloat32;
case MED_INT32:
return medInt32;
case MED_INT64:
return medInt64;
default:
- throw INTERP_KERNEL::Exception("Non supported field type ! Should be FLOAT64, INT32 or INT64 !");
+ throw INTERP_KERNEL::Exception("Non supported field type ! Should be FLOAT64, FLOAT32, INT32 or INT64 !");
}
}
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingFieldFloat.hxx"
-#include "MEDCouplingFieldInt.hxx"
+#include "MEDCouplingFieldInt32.hxx"
#include "MEDCouplingGaussLocalization.hxx"
#include "MEDCouplingTraits.hxx"
#include "MCAuto.hxx"
}
}
{
- MCAuto<MEDFileIntField1TS> f1(MEDCoupling::DynamicCast<MEDFileAnyTypeField1TS,MEDFileIntField1TS>(f));
+ MCAuto<MEDFileInt32Field1TS> f1(MEDCoupling::DynamicCast<MEDFileAnyTypeField1TS,MEDFileInt32Field1TS>(f));
if(f1.isNotNull())
{
- MCAuto<MEDCoupling::MEDCouplingFieldInt> ret(f1->field(mesh));
- return MEDCoupling::DynamicCast<MEDCouplingFieldInt,MEDCouplingField>(ret);
+ MCAuto<MEDCoupling::MEDCouplingFieldInt32> ret(f1->field(mesh));
+ return MEDCoupling::DynamicCast<MEDCouplingFieldInt32,MEDCouplingField>(ret);
}
}
{
}
}
{
- MCAuto<MEDFileIntField1TS> f1(MEDCoupling::DynamicCast<MEDFileAnyTypeField1TS,MEDFileIntField1TS>(f));
+ MCAuto<MEDFileInt32Field1TS> f1(MEDCoupling::DynamicCast<MEDFileAnyTypeField1TS,MEDFileInt32Field1TS>(f));
if(f1.isNotNull())
{
- MCAuto<MEDCoupling::MEDCouplingFieldInt> ret(ReadFieldCellLikeT<int>(f1,type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
+ MCAuto<MEDCoupling::MEDCouplingFieldInt32> ret(ReadFieldCellLikeT<int>(f1,type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
return ret.retn();
}
}
}
}
{
- MCAuto<MEDFileIntField1TS> f1(MEDCoupling::DynamicCast<MEDFileAnyTypeField1TS,MEDFileIntField1TS>(f));
+ MCAuto<MEDFileInt32Field1TS> f1(MEDCoupling::DynamicCast<MEDFileAnyTypeField1TS,MEDFileInt32Field1TS>(f));
if(f1.isNotNull())
{
- MCAuto<MEDCoupling::MEDCouplingFieldInt> ret(ReadFieldNodeT<int>(f1,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
+ MCAuto<MEDCoupling::MEDCouplingFieldInt32> ret(ReadFieldNodeT<int>(f1,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
return ret.retn();
}
}
}
}
{
- const MEDCoupling::MEDCouplingFieldInt *f1(dynamic_cast<const MEDCoupling::MEDCouplingFieldInt *>(f));
+ const MEDCoupling::MEDCouplingFieldInt32 *f1(dynamic_cast<const MEDCoupling::MEDCouplingFieldInt32 *>(f));
if(f1)
{
WriteFieldT<int>(fileName,f1,writeFromScratch);
return ;
}
{
- const MEDCoupling::MEDCouplingFieldInt *f1(dynamic_cast<const MEDCoupling::MEDCouplingFieldInt *>(f));
+ const MEDCoupling::MEDCouplingFieldInt32 *f1(dynamic_cast<const MEDCoupling::MEDCouplingFieldInt32 *>(f));
if(f1)
WriteFieldUsingAlreadyWrittenMeshT<int>(fileName,f1);
return ;
//
// Author : Anthony Geay (EDF R&D)
-#ifndef __MEDLOADERTRAITS_HXX__
-#define __MEDLOADERTRAITS_HXX__
+#pragma once
#include "MEDLoaderDefines.hxx"
+#include "MCType.hxx"
namespace MEDCoupling
{
class MEDFileFieldMultiTS;
class MEDFileField1TS;
- class MEDFileIntFieldMultiTS;
- class MEDFileIntField1TS;
+ class MEDFileInt32FieldMultiTS;
+ class MEDFileInt64FieldMultiTS;
+ class MEDFileInt32Field1TS;
+ class MEDFileInt64Field1TS;
class MEDFileFloatFieldMultiTS;
class MEDFileFloatField1TS;
class MEDFileField1TSWithoutSDA;
- class MEDFileIntField1TSWithoutSDA;
+ class MEDFileInt32Field1TSWithoutSDA;
+ class MEDFileInt64Field1TSWithoutSDA;
class MEDFileFloatField1TSWithoutSDA;
class MEDFileFieldMultiTSWithoutSDA;
- class MEDFileIntFieldMultiTSWithoutSDA;
+ class MEDFileInt32FieldMultiTSWithoutSDA;
+ class MEDFileInt64FieldMultiTSWithoutSDA;
class MEDFileFloatFieldMultiTSWithoutSDA;
template<>
};
template<>
- struct MEDLOADER_EXPORT MLFieldTraits<int>
+ struct MEDLOADER_EXPORT MLFieldTraits<Int32>
{
- typedef MEDFileIntFieldMultiTSWithoutSDA FMTSWSDAType;
- typedef MEDFileIntFieldMultiTS FMTSType;
- typedef MEDFileIntField1TS F1TSType;
- typedef MEDFileIntField1TSWithoutSDA F1TSWSDAType;
+ typedef MEDFileInt32FieldMultiTSWithoutSDA FMTSWSDAType;
+ typedef MEDFileInt32FieldMultiTS FMTSType;
+ typedef MEDFileInt32Field1TS F1TSType;
+ typedef MEDFileInt32Field1TSWithoutSDA F1TSWSDAType;
+ };
+
+ template<>
+ struct MEDLOADER_EXPORT MLFieldTraits<Int64>
+ {
+ typedef MEDFileInt64FieldMultiTSWithoutSDA FMTSWSDAType;
+ typedef MEDFileInt64FieldMultiTS FMTSType;
+ typedef MEDFileInt64Field1TS F1TSType;
+ typedef MEDFileInt64Field1TSWithoutSDA F1TSWSDAType;
};
template<class T>
static const char ClassName[];
};
}
-
-#endif
%newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
%newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
-%newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
-%newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
-%newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
-%newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
-%newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
-%newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevel;
-%newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtTopLevel;
-%newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
-%newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
+%newobject MEDCoupling::MEDFileInt32FieldMultiTS::New;
+%newobject MEDCoupling::MEDFileInt32FieldMultiTS::field;
+%newobject MEDCoupling::MEDFileInt32FieldMultiTS::LoadSpecificEntities;
+%newobject MEDCoupling::MEDFileInt32FieldMultiTS::getUndergroundDataArray;
+%newobject MEDCoupling::MEDFileInt32FieldMultiTS::convertToDouble;
+%newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtLevel;
+%newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtTopLevel;
+%newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldOnMeshAtLevel;
+%newobject MEDCoupling::MEDFileInt32FieldMultiTS::getFieldAtLevelOld;
+
+%newobject MEDCoupling::MEDFileInt64FieldMultiTS::New;
+%newobject MEDCoupling::MEDFileInt64FieldMultiTS::field;
+%newobject MEDCoupling::MEDFileInt64FieldMultiTS::LoadSpecificEntities;
+%newobject MEDCoupling::MEDFileInt64FieldMultiTS::getUndergroundDataArray;
+%newobject MEDCoupling::MEDFileInt64FieldMultiTS::convertToDouble;
+%newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtLevel;
+%newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtTopLevel;
+%newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldOnMeshAtLevel;
+%newobject MEDCoupling::MEDFileInt64FieldMultiTS::getFieldAtLevelOld;
%newobject MEDCoupling::MEDFileFloatFieldMultiTS::New;
%newobject MEDCoupling::MEDFileFloatFieldMultiTS::field;
%newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
%newobject MEDCoupling::MEDFileField1TS::convertToInt;
-%newobject MEDCoupling::MEDFileIntField1TS::New;
-%newobject MEDCoupling::MEDFileIntField1TS::field;
-%newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevel;
-%newobject MEDCoupling::MEDFileIntField1TS::getFieldAtTopLevel;
-%newobject MEDCoupling::MEDFileIntField1TS::getFieldOnMeshAtLevel;
-%newobject MEDCoupling::MEDFileIntField1TS::getFieldAtLevelOld;
-%newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
-%newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
+%newobject MEDCoupling::MEDFileInt32Field1TS::New;
+%newobject MEDCoupling::MEDFileInt32Field1TS::field;
+%newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtLevel;
+%newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtTopLevel;
+%newobject MEDCoupling::MEDFileInt32Field1TS::getFieldOnMeshAtLevel;
+%newobject MEDCoupling::MEDFileInt32Field1TS::getFieldAtLevelOld;
+%newobject MEDCoupling::MEDFileInt32Field1TS::getUndergroundDataArray;
+%newobject MEDCoupling::MEDFileInt32Field1TS::convertToDouble;
+
+%newobject MEDCoupling::MEDFileInt64Field1TS::New;
+%newobject MEDCoupling::MEDFileInt64Field1TS::field;
+%newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtLevel;
+%newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtTopLevel;
+%newobject MEDCoupling::MEDFileInt64Field1TS::getFieldOnMeshAtLevel;
+%newobject MEDCoupling::MEDFileInt64Field1TS::getFieldAtLevelOld;
+%newobject MEDCoupling::MEDFileInt64Field1TS::getUndergroundDataArray;
+%newobject MEDCoupling::MEDFileInt64Field1TS::convertToDouble;
%newobject MEDCoupling::MEDFileFloatField1TS::New;
%newobject MEDCoupling::MEDFileFloatField1TS::field;
%feature("unref") MEDFileFieldLoc "$this->decrRef();"
%feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
%feature("unref") MEDFileField1TS "$this->decrRef();"
-%feature("unref") MEDFileIntField1TS "$this->decrRef();"
+%feature("unref") MEDFileInt32Field1TS "$this->decrRef();"
+%feature("unref") MEDFileInt64Field1TS "$this->decrRef();"
%feature("unref") MEDFileFloatField1TS "$this->decrRef();"
%feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
%feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
-%feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
+%feature("unref") MEDFileInt32FieldMultiTS "$this->decrRef();"
+%feature("unref") MEDFileInt64FieldMultiTS "$this->decrRef();"
%feature("unref") MEDFileFloatFieldMultiTS "$this->decrRef();"
%feature("unref") MEDFileMeshSupports "$this->decrRef();"
%feature("unref") MEDFileStructureElements "$this->decrRef();"
static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true);
static MEDFileField1TS *New(DataArrayByte *db);
static MEDFileField1TS *New();
- MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const;
+ MEDCoupling::MEDFileInt32Field1TS *convertToInt(bool isDeepCpyGlobs=true) const;
void copyTimeInfoFrom(MEDCouplingFieldDouble *mcf);
MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const;
MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
}
};
- class MEDFileIntField1TS : public MEDFileAnyTypeField1TS
+ class MEDFileInt32Field1TS : public MEDFileAnyTypeField1TS
{
public:
- static MEDFileIntField1TS *New();
- static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true);
- static MEDFileIntField1TS *New(DataArrayByte *db);
- static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
- static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
+ static MEDFileInt32Field1TS *New();
+ static MEDFileInt32Field1TS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileInt32Field1TS *New(DataArrayByte *db);
+ static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
//
- void setFieldNoProfileSBT(const MEDCouplingFieldInt *field);
- void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
- void setFieldProfileFlatly(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
- void copyTimeInfoFrom(MEDCouplingFieldInt *mcf);
- MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const;
- MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
- MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
- MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
- MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
- MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
+ void setFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
+ void setFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
+ void setFieldProfileFlatly(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
+ void copyTimeInfoFrom(MEDCouplingFieldInt32 *mcf);
+ MEDCouplingFieldInt32 *field(const MEDFileMesh *mesh) const;
+ MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
+ MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
+ MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
%extend
{
- MEDFileIntField1TS()
+ MEDFileInt32Field1TS()
{
- return MEDFileIntField1TS::New();
+ return MEDFileInt32Field1TS::New();
}
- MEDFileIntField1TS(const std::string& fileName, bool loadAll=true)
+ MEDFileInt32Field1TS(const std::string& fileName, bool loadAll=true)
{
- return MEDFileIntField1TS::New(fileName,loadAll);
+ return MEDFileInt32Field1TS::New(fileName,loadAll);
}
- MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
+ MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
{
- return MEDFileIntField1TS::New(fileName,fieldName,loadAll);
+ return MEDFileInt32Field1TS::New(fileName,fieldName,loadAll);
}
- MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
+ MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
{
- return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll);
+ return MEDFileInt32Field1TS::New(fileName,fieldName,iteration,order,loadAll);
}
- MEDFileIntField1TS(DataArrayByte *db)
+ MEDFileInt32Field1TS(DataArrayByte *db)
{
- return MEDFileIntField1TS::New(db);
+ return MEDFileInt32Field1TS::New(db);
}
std::string __str__() const
PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
{
- return MEDFileField1TS_getFieldWithProfile<int>(self,type,meshDimRelToMax,mesh);
+ return MEDFileField1TS_getFieldWithProfile<Int32>(self,type,meshDimRelToMax,mesh);
}
DataArrayInt32 *getUndergroundDataArray() const
PyObject *getUndergroundDataArrayExt() const
{
- return MEDFileField1TS_getUndergroundDataArrayExt<int>(self);
+ return MEDFileField1TS_getUndergroundDataArrayExt<Int32>(self);
+ }
+ }
+ };
+
+ class MEDFileInt64Field1TS : public MEDFileAnyTypeField1TS
+ {
+ public:
+ static MEDFileInt64Field1TS *New();
+ static MEDFileInt64Field1TS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileInt64Field1TS *New(DataArrayByte *db);
+ static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
+ MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
+ //
+ void setFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
+ void setFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
+ void setFieldProfileFlatly(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
+ void copyTimeInfoFrom(MEDCouplingFieldInt64 *mcf);
+ MEDCouplingFieldInt64 *field(const MEDFileMesh *mesh) const;
+ MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
+ MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
+ MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
+ %extend
+ {
+ MEDFileInt64Field1TS()
+ {
+ return MEDFileInt64Field1TS::New();
+ }
+
+ MEDFileInt64Field1TS(const std::string& fileName, bool loadAll=true)
+ {
+ return MEDFileInt64Field1TS::New(fileName,loadAll);
+ }
+
+ MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
+ {
+ return MEDFileInt64Field1TS::New(fileName,fieldName,loadAll);
+ }
+
+ MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
+ {
+ return MEDFileInt64Field1TS::New(fileName,fieldName,iteration,order,loadAll);
+ }
+
+ MEDFileInt64Field1TS(DataArrayByte *db)
+ {
+ return MEDFileInt64Field1TS::New(db);
+ }
+
+ std::string __str__() const
+ {
+ return self->simpleRepr();
+ }
+
+ PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
+ {
+ return MEDFileField1TS_getFieldWithProfile<Int64>(self,type,meshDimRelToMax,mesh);
+ }
+
+ DataArrayInt64 *getUndergroundDataArray() const
+ {
+ DataArrayInt64 *ret=self->getUndergroundDataArray();
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+
+ PyObject *getUndergroundDataArrayExt() const
+ {
+ return MEDFileField1TS_getUndergroundDataArrayExt<Int64>(self);
}
}
};
}
};
- class MEDFileIntFieldMultiTS;
+ class MEDFileInt32FieldMultiTS;
+ class MEDFileInt64FieldMultiTS;
class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
{
//
void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
- MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
+ MEDFileInt32FieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
%extend
{
MEDFileFieldMultiTS()
}
};
- class MEDFileIntFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
+ class MEDFileInt32FieldMultiTS : public MEDFileAnyTypeFieldMultiTS
{
public:
- static MEDFileIntFieldMultiTS *New();
- static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
- static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
- static MEDFileIntFieldMultiTS *New(DataArrayByte *db);
+ static MEDFileInt32FieldMultiTS *New();
+ static MEDFileInt32FieldMultiTS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileInt32FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ static MEDFileInt32FieldMultiTS *New(DataArrayByte *db);
//
- void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field);
- void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
+ void appendFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
+ void appendFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
- MEDCouplingFieldInt *field(int iteration, int order, const MEDFileMesh *mesh) const;
- MEDCouplingFieldInt *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
- MEDCouplingFieldInt *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
- MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
- MEDCouplingFieldInt *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
- MEDCouplingFieldInt *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
+ MEDCouplingFieldInt32 *field(int iteration, int order, const MEDFileMesh *mesh) const;
+ MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
+ MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
+ MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
%extend
{
- MEDFileIntFieldMultiTS()
+ MEDFileInt32FieldMultiTS()
{
- return MEDFileIntFieldMultiTS::New();
+ return MEDFileInt32FieldMultiTS::New();
}
- MEDFileIntFieldMultiTS(const std::string& fileName, bool loadAll=true)
+ MEDFileInt32FieldMultiTS(const std::string& fileName, bool loadAll=true)
{
- return MEDFileIntFieldMultiTS::New(fileName,loadAll);
+ return MEDFileInt32FieldMultiTS::New(fileName,loadAll);
}
- MEDFileIntFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
+ MEDFileInt32FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
{
- return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll);
+ return MEDFileInt32FieldMultiTS::New(fileName,fieldName,loadAll);
}
- MEDFileIntFieldMultiTS(DataArrayByte *db)
+ MEDFileInt32FieldMultiTS(DataArrayByte *db)
{
- return MEDFileIntFieldMultiTS::New(db);
+ return MEDFileInt32FieldMultiTS::New(db);
}
- static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
+ static MEDFileInt32FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
{
std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
- return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
+ return MEDFileInt32FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
}
std::string __str__() const
DataArrayIdType *ret1=0;
DataArrayInt32 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<int>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<Int32>::TI, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
return ret;
}
}
};
+ class MEDFileInt64FieldMultiTS : public MEDFileAnyTypeFieldMultiTS
+ {
+ public:
+ static MEDFileInt64FieldMultiTS *New();
+ static MEDFileInt64FieldMultiTS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileInt64FieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ static MEDFileInt64FieldMultiTS *New(DataArrayByte *db);
+ //
+ void appendFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
+ void appendFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
+ MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
+ MEDCouplingFieldInt64 *field(int iteration, int order, const MEDFileMesh *mesh) const;
+ MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
+ MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
+ MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
+ %extend
+ {
+ MEDFileInt64FieldMultiTS()
+ {
+ return MEDFileInt64FieldMultiTS::New();
+ }
+
+ MEDFileInt64FieldMultiTS(const std::string& fileName, bool loadAll=true)
+ {
+ return MEDFileInt64FieldMultiTS::New(fileName,loadAll);
+ }
+
+ MEDFileInt64FieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
+ {
+ return MEDFileInt64FieldMultiTS::New(fileName,fieldName,loadAll);
+ }
+
+ MEDFileInt64FieldMultiTS(DataArrayByte *db)
+ {
+ return MEDFileInt64FieldMultiTS::New(db);
+ }
+
+ static MEDFileInt64FieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
+ {
+ std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
+ std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
+ return MEDFileInt64FieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
+ }
+
+ std::string __str__() const
+ {
+ return self->simpleRepr();
+ }
+
+ PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const
+ {
+ DataArrayIdType *ret1=0;
+ DataArrayInt64 *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
+ PyObject *ret=PyTuple_New(2);
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<Int64>::TI, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+ return ret;
+ }
+
+ DataArrayInt64 *getUndergroundDataArray(int iteration, int order) const
+ {
+ DataArrayInt64 *ret=self->getUndergroundDataArray(iteration,order);
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+ }
+ };
+
class MEDFileFloatFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
{
public:
pass
MEDFileAnyTypeField1TS.__enter__=enter1TS
MEDFileAnyTypeField1TS.__exit__=exit1TS
+MEDFileIntField1TS = MEDFileInt32Field1TS
+MEDFileIntFieldMultiTS = MEDFileInt32FieldMultiTS
+if MEDCouplingUse64BitIDs():
+ MEDFileIDField1TS = MEDFileInt64Field1TS
+ MEDFileIDFieldMultiTS = MEDFileInt64FieldMultiTS
+else:
+ MEDFileIDField1TS = MEDFileInt32Field1TS
+ MEDFileIDFieldMultiTS = MEDFileInt32FieldMultiTS
%}
def testMeshConvertFromMEDFileGeoType(self):
self.assertEqual(MEDFileMesh.ConvertFromMEDFileGeoType(320),NORM_HEXA20)
-
+
+ @WriteInTmpDir
+ def testFieldInt64_0(self):
+ """
+ Small basic test with I/O of field in int64.
+ """
+ fname="Pyfile120.med"
+ arr = DataArrayDouble([0,1])
+ m = MEDCouplingCMesh() ; m.setCoords(arr,arr) ; m.setName("mesh") ; m=m.buildUnstructured()
+ f = MEDCouplingFieldInt64(ON_CELLS) ; f.setName("field")
+ v = 1234567890123456
+ f.setArray(DataArrayInt64([v]))
+ f.setMesh(m)
+ mm = MEDFileUMesh()
+ mm[0] = m
+ f1ts = MEDFileInt64Field1TS()
+ f1ts.setFieldNoProfileSBT(f)
+ fmts = MEDFileInt64FieldMultiTS()
+ fmts.pushBackTimeStep(f1ts)
+ fs = MEDFileFields()
+ fs.pushField(fmts)
+ mm.write(fname,2)
+ fs.write(fname,0)
+ #
+ mm = MEDFileMesh.New(fname)
+ fs = MEDFileFields(fname)
+ f = fs[0][0].field(mm)
+ self.assertTrue( isinstance(f,MEDCouplingFieldInt64) )
+ self.assertEqual( f.getArray().getIJ(0,0) , v )
+
pass
if __name__ == "__main__":
}
if(dynamic_cast<MEDFileField1TS *>(p))
ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileField1TS,owner);
- if(dynamic_cast<MEDFileIntField1TS *>(p))
- ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileIntField1TS,owner);
+ if(dynamic_cast<MEDFileInt32Field1TS *>(p))
+ ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileInt32Field1TS,owner);
+ if(dynamic_cast<MEDFileInt64Field1TS *>(p))
+ ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileInt64Field1TS,owner);
if(dynamic_cast<MEDFileFloatField1TS *>(p))
ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileFloatField1TS,owner);
if(!ret)
}
if(dynamic_cast<MEDFileFieldMultiTS *>(p))
ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileFieldMultiTS,owner);
- if(dynamic_cast<MEDFileIntFieldMultiTS *>(p))
- ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileIntFieldMultiTS,owner);
+ if(dynamic_cast<MEDFileInt32FieldMultiTS *>(p))
+ ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileInt32FieldMultiTS,owner);
+ if(dynamic_cast<MEDFileInt64FieldMultiTS *>(p))
+ ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileInt64FieldMultiTS,owner);
if(dynamic_cast<MEDFileFloatFieldMultiTS *>(p))
ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileFloatFieldMultiTS,owner);
if(!ret)