$extrastylesheet
mesh_communication.h
Go to the documentation of this file.
00001 // The libMesh Finite Element Library.
00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
00003 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 
00019 
00020 #ifndef LIBMESH_MESH_COMMUNICATION_H
00021 #define LIBMESH_MESH_COMMUNICATION_H
00022 
00023 
00024 
00025 // Local Includes -----------------------------------
00026 #include "libmesh/libmesh_common.h"
00027 #include "libmesh/mesh_tools.h"
00028 
00029 // C++ Includes   -----------------------------------
00030 
00031 namespace libMesh
00032 {
00033 
00034 // Forward declarations
00035 class MeshBase;
00036 class ParallelMesh;
00037 class BoundaryInfo;
00038 
00039 
00040 
00050 // ------------------------------------------------------------
00051 // MeshCommunication class definition
00052 class MeshCommunication
00053 {
00054 public:
00055 
00059   MeshCommunication () {}
00060 
00064   ~MeshCommunication () {}
00065 
00069   void clear ();
00070 
00071   //   /**
00072   //    * Finds all the processors that may contain
00073   //    * elements that neighbor my elements.  This list
00074   //    * is guaranteed to include all processors that border
00075   //    * any of my elements, but may include additional ones as
00076   //    * well.  This method computes bounding boxes for the
00077   //    * elements on each processor and checks for overlaps.
00078   //    */
00079   //   void find_neighboring_processors(const MeshBase &);
00080 
00087   void broadcast (MeshBase &) const;
00088 
00100   void redistribute (ParallelMesh &) const;
00101 
00105   void gather_neighboring_elements (ParallelMesh &) const;
00106 
00117   void gather (const processor_id_type root_id, ParallelMesh &) const;
00118 
00127   void allgather (ParallelMesh &mesh) const
00128   { MeshCommunication::gather(DofObject::invalid_processor_id, mesh); }
00129 
00144   void delete_remote_elements (ParallelMesh &, const std::set<Elem *> &) const;
00145 
00156   void assign_global_indices (MeshBase &) const;
00157 
00158 
00163   template <typename ForwardIterator>
00164   void find_global_indices (const Parallel::Communicator &communicator,
00165                             const MeshTools::BoundingBox &,
00166                             const ForwardIterator &,
00167                             const ForwardIterator &,
00168                             std::vector<dof_id_type> &) const;
00169 
00173   void make_elems_parallel_consistent (MeshBase &);
00174 
00180   void make_node_ids_parallel_consistent (MeshBase &);
00181 
00187   void make_node_proc_ids_parallel_consistent (MeshBase &);
00188 
00195   void make_nodes_parallel_consistent (MeshBase &);
00196 };
00197 
00198 
00199 
00200 //--------------------------------------------------------------
00201 // MeshCommunication inline members
00202 
00203 
00204 } // namespace libMesh
00205 
00206 #endif // LIBMESH_MESH_COMMUNICATION_H