1 // Copyright (C) 2007-2008 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.
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
19 #ifndef __ELEMENTLOCATOR_HXX__
20 #define __ELEMENTLOCATOR_HXX__
22 #include "InterpolationOptions.hxx"
23 #include "MEDCouplingUMesh.hxx"
33 class InterpolationMatrix;
36 class ElementLocator : public INTERP_KERNEL::InterpolationOptions
39 ElementLocator(const ParaMESH& sourceMesh, const ProcessorGroup& distant_group);
41 virtual ~ElementLocator();
42 void exchangeMesh(int idistantrank,
43 MEDCouplingUMesh*& target_mesh,
45 void exchangeMethod(const std::string& sourceMeth, int idistantrank, std::string& targetMeth);
47 const ParaMESH& _local_para_mesh ;
48 MEDCouplingUMesh* _local_cell_mesh;
49 MEDCouplingUMesh* _local_face_mesh;
50 std::vector<MEDCouplingUMesh*> _distant_cell_meshes;
51 std::vector<MEDCouplingUMesh*> _distant_face_meshes;
52 double* _domain_bounding_boxes;
53 const ProcessorGroup& _distant_group;
54 const ProcessorGroup& _local_group;
55 ProcessorGroup* _union_group;
56 std::vector<int> _distant_proc_ids;
58 void _computeBoundingBoxes();
59 bool _intersectsBoundingBox(int irank);
60 bool _intersectsBoundingBox(double* bb1, double* bb2, int dim);
61 void _exchangeMesh(MEDCouplingUMesh* local_mesh, MEDCouplingUMesh*& distant_mesh,
62 int iproc_distant, const int* distant_ids_send,
63 int*& distant_ids_recv);
64 MEDCouplingUMesh* _meshFromElems(std::set<int>& elems);