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