00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D 00002 // 00003 // This library is free software; you can redistribute it and/or 00004 // modify it under the terms of the GNU Lesser General Public 00005 // License as published by the Free Software Foundation; either 00006 // version 2.1 of the License. 00007 // 00008 // This library is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 // Lesser General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU Lesser General Public 00014 // License along with this library; if not, write to the Free Software 00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00016 // 00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00018 // 00019 00020 #ifndef __PARAMESH_HXX__ 00021 #define __PARAMESH_HXX__ 00022 00023 #include "MEDCouplingPointSet.hxx" 00024 #include "ProcessorGroup.hxx" 00025 #include "MEDCouplingMemArray.hxx" 00026 00027 #include <string> 00028 #include <vector> 00029 00030 namespace ParaMEDMEM 00031 { 00032 class Topology; 00033 class BlockTopology; 00034 class DataArrayInt; 00035 00036 class ParaMESH 00037 { 00038 public: 00039 ParaMESH( MEDCouplingPointSet *subdomain_mesh, 00040 MEDCouplingPointSet *subdomain_face, 00041 DataArrayInt *CorrespElt_local2global, 00042 DataArrayInt *CorrespFace_local2global, 00043 DataArrayInt *CorrespNod_local2global, 00044 const ProcessorGroup& proc_group ) ; 00045 ParaMESH( MEDCouplingPointSet *mesh, 00046 const ProcessorGroup& proc_group, const std::string& name); 00047 00048 virtual ~ParaMESH(); 00049 void setNodeGlobal(DataArrayInt *nodeGlobal); 00050 void setCellGlobal(DataArrayInt *cellGlobal); 00051 Topology* getTopology() const { return _explicit_topology; } 00052 bool isStructured() const { return _cell_mesh->isStructured(); } 00053 MEDCouplingPointSet *getCellMesh() const { return _cell_mesh; } 00054 MEDCouplingPointSet *getFaceMesh() const { return _face_mesh; } 00055 BlockTopology* getBlockTopology() const { return _block_topology; } 00056 00057 DataArrayInt* getGlobalNumberingNodeDA() const { if(_node_global) _node_global->incrRef(); return _node_global; } 00058 DataArrayInt* getGlobalNumberingFaceDA() const { if(_face_global) _face_global->incrRef(); return _face_global; } 00059 DataArrayInt* getGlobalNumberingCellDA() const { if(_cell_global) _cell_global->incrRef(); return _cell_global; } 00060 const int* getGlobalNumberingNode() const { if(_node_global) return _node_global->getConstPointer(); return 0; } 00061 const int* getGlobalNumberingFace() const { if(_face_global) return _face_global->getConstPointer(); return 0; } 00062 const int* getGlobalNumberingCell() const { if(_cell_global) return _cell_global->getConstPointer(); return 0; } 00063 00064 private: 00065 //mesh object underlying the ParaMESH object 00066 MEDCouplingPointSet *_cell_mesh ; 00067 MEDCouplingPointSet *_face_mesh ; 00068 00069 //id of the local grid 00070 int _my_domain_id; 00071 00072 //global topology of the cells 00073 ParaMEDMEM::BlockTopology* _block_topology; 00074 Topology* _explicit_topology; 00075 // pointers to global numberings 00076 DataArrayInt* _node_global; 00077 DataArrayInt* _face_global; 00078 DataArrayInt* _cell_global; 00079 }; 00080 } 00081 00082 #endif