1 // Copyright (C) 2007-2024 CEA, EDF
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #include "MEDCouplingPointSet.hxx"
23 #include "ProcessorGroup.hxx"
24 #include "MEDCouplingMemArray.hxx"
36 * \anchor ParaMESH-det
38 * Parallel representation of an unstructured mesh.
40 * This class is very specific to the requirement of parallel code computations.
41 * Two main constructors are available:
42 * - the most simple one, taking directly a \ref meshes "MEDCoupling mesh" object
43 * - the second one (for an advanced usage), which can be used to specify an explicit topology
44 * in a parallel computation.
49 ParaMESH( MEDCouplingPointSet *mesh,
50 const ProcessorGroup& proc_group, const std::string& name);
51 ParaMESH( MEDCouplingPointSet *subdomain_mesh,
52 MEDCouplingPointSet *subdomain_face,
53 DataArrayIdType *CorrespElt_local2global,
54 DataArrayIdType *CorrespFace_local2global,
55 DataArrayIdType *CorrespNod_local2global,
56 const ProcessorGroup& proc_group ) ;
61 void setNodeGlobal(DataArrayIdType *nodeGlobal);
62 void setCellGlobal(DataArrayIdType *cellGlobal);
63 Topology* getTopology() const { return _explicit_topology; }
64 bool isStructured() const { return _cell_mesh->isStructured(); }
65 MEDCouplingPointSet *getCellMesh() const { return _cell_mesh.iAmATrollConstCast(); }
66 MEDCouplingPointSet *getFaceMesh() const { return _face_mesh.iAmATrollConstCast(); }
67 BlockTopology* getBlockTopology() const { return _block_topology; }
69 DataArrayIdType* getGlobalNumberingNodeDA() const { return _node_global.retnConstCast(); }
70 DataArrayIdType* getGlobalNumberingFaceDA() const { return _face_global.retnConstCast(); }
71 DataArrayIdType* getGlobalNumberingCellDA() const { return _cell_global.retnConstCast(); }
72 const mcIdType* getGlobalNumberingNode() const { if(_node_global) return _node_global->getConstPointer(); return nullptr; }
73 const mcIdType* getGlobalNumberingFace() const { if(_face_global) return _face_global->getConstPointer(); return nullptr; }
74 const mcIdType* getGlobalNumberingCell() const { if(_cell_global) return _cell_global->getConstPointer(); return nullptr; }
77 //mesh object underlying the ParaMESH object
78 MCAuto<MEDCouplingPointSet> _cell_mesh ;
79 MCAuto<MEDCouplingPointSet> _face_mesh ;
81 //id of the local grid
84 //global topology of the cells
85 BlockTopology* _block_topology;
86 Topology* _explicit_topology;
87 // pointers to global numberings
88 MCAuto<DataArrayIdType> _node_global;
89 MCAuto<DataArrayIdType> _face_global;
90 MCAuto<DataArrayIdType> _cell_global;