$extrastylesheet
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_SMOOTHER_LAPLACE_H 00021 #define LIBMESH_MESH_SMOOTHER_LAPLACE_H 00022 00023 00024 // forward declarations 00025 00026 // C++ Includes ----------------------------------- 00027 #include <vector> 00028 00029 // Local Includes ----------------------------------- 00030 #include "libmesh/libmesh.h" // libMesh::out/err 00031 #include "libmesh/mesh_smoother.h" 00032 00033 namespace libMesh 00034 { 00035 00036 00050 // ------------------------------------------------------------ 00051 // LaplaceMeshSmoother class definition 00052 class LaplaceMeshSmoother : public MeshSmoother 00053 { 00054 public: 00059 explicit 00060 LaplaceMeshSmoother(UnstructuredMesh& mesh); 00061 00065 virtual ~LaplaceMeshSmoother() {} 00066 00073 virtual void smooth() { this->smooth(1); } 00074 00080 void smooth(unsigned int n_iterations); 00081 00089 void init(); 00090 00095 void print_graph(std::ostream& out = libMesh::out) const; 00096 00097 private: 00102 void allgather_graph(); 00103 00107 bool _initialized; 00108 00112 std::vector<std::vector<dof_id_type> > _graph; 00113 }; 00114 00115 00116 } // namespace libMesh 00117 00118 #endif // LIBMESH_MESH_SMOOTHER_LAPLACE_H