MCAuto(const MCAuto& other):_ptr(0) { referPtr(other._ptr); }
MCAuto(T *ptr=0):_ptr(ptr) { }
~MCAuto() { destroyPtr(); }
+ void checkNotNull() const { if(!_ptr) throw INTERP_KERNEL::Exception("Pointer is nullptr !"); }
bool isNull() const { return _ptr==0; }
bool isNotNull() const { return !isNull(); }
void nullify() { destroyPtr(); _ptr=0; }
template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayTuple<double>;
template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayTuple<float>;
+void MEDCoupling::DACheckNbOfTuplesAndComp(const DataArray *da, mcIdType nbOfTuples, std::size_t nbOfCompo, const std::string& msg)
+{
+ if(!da)
+ throw INTERP_KERNEL::Exception("DACheckNbOfTuplesAndComp : null input object !");
+ da->checkNbOfTuplesAndComp(nbOfTuples,nbOfCompo,msg);
+}
+
template<mcIdType SPACEDIM>
void DataArrayDouble::findCommonTuplesAlg(const double *bbox, mcIdType nbNodes, mcIdType limitNodeId, double prec, DataArrayIdType *c, DataArrayIdType *cI) const
{
static mcIdType GetPosOfItemGivenBESRelativeNoThrow(T value, T begin, T end, T step);
};
+ class DataArray;
class DataArrayByte;
+ MEDCOUPLING_EXPORT void DACheckNbOfTuplesAndComp(const DataArray *da, mcIdType nbOfTuples, std::size_t nbOfCompo, const std::string& msg);
+
class MEDCOUPLING_EXPORT DataArray : public RefCountObject, public TimeLabel
{
public:
-# Copyright (C) 2012-2019 CEA/DEN, EDF R&D
+# Copyright (C) 2012-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
ProcessorGroup.cxx
MPIProcessorGroup.cxx
ParaMESH.cxx
+ ParaUMesh.cxx
ComponentTopology.cxx
MPIAccess.cxx
InterpolationMatrix.cxx
--- /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 "ParaUMesh.hxx"
+#include "ProcessorGroup.hxx"
+#include "MPIProcessorGroup.hxx"
+#include "Topology.hxx"
+#include "BlockTopology.hxx"
+#include "MEDCouplingMemArray.hxx"
+
+#include <fstream>
+#include <vector>
+
+using namespace std;
+using namespace MEDCoupling;
+
+ParaUMesh::ParaUMesh(MEDCouplingUMesh *mesh, DataArrayIdType *globalCellIds, DataArrayIdType *globalNodeIds)
+{
+ _mesh.takeRef(mesh);
+ _cell_global.takeRef(globalCellIds);
+ _node_global.takeRef(globalNodeIds);
+ _mesh.checkNotNull();
+ _cell_global.checkNotNull();
+ _node_global.checkNotNull();
+ _mesh->checkConsistencyLight();
+}
+
+MCAuto<DataArrayIdType> ParaUMesh::getCellIdsLyingOnNodes(DataArrayIdType *globalNodeIds, bool fullyIn) const
+{
+ DACheckNbOfTuplesAndComp(globalNodeIds,_mesh->getNumberOfNodes(),1,"ParaUMesh::getCellIdsLyingOnNodes");
+ if(fullyIn)
+ throw INTERP_KERNEL::Exception("ParaUMesh::getCellIdsLyingOnNodes : not implemented yet for fullyIn == True !");
+ MCAuto<DataArrayIdType> local;
+}
--- /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 "MEDCouplingUMesh.hxx"
+#include "ProcessorGroup.hxx"
+#include "MEDCouplingMemArray.hxx"
+
+#include <string>
+#include <vector>
+
+namespace MEDCoupling
+{
+ /*!
+ * Parallel representation of an unstructured mesh.
+ *
+ * This class is very specific to the requirement of parallel code computations.
+ */
+ class ParaUMesh
+ {
+ public:
+ ParaUMesh(MEDCouplingUMesh *mesh, DataArrayIdType *globalCellIds, DataArrayIdType *globalNodeIds);
+ MCAuto<DataArrayIdType> getCellIdsLyingOnNodes(DataArrayIdType *globalNodeIds, bool fullyIn) const;
+ virtual ~ParaUMesh() { }
+ private:
+ MCAuto<MEDCouplingUMesh> _mesh;
+ MCAuto<DataArrayIdType> _cell_global;
+ MCAuto<DataArrayIdType> _node_global;
+ };
+}