$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 // C++ includes 00021 00022 00023 // Local Includes 00024 #include "libmesh/point_locator_base.h" 00025 #include "libmesh/point_locator_tree.h" 00026 #include "libmesh/point_locator_list.h" 00027 00028 namespace libMesh 00029 { 00030 00031 00032 00033 00034 //------------------------------------------------------------------ 00035 // PointLocatorBase methods 00036 PointLocatorBase::PointLocatorBase (const MeshBase& mesh, 00037 const PointLocatorBase* master) : 00038 _verbose (false), 00039 _master (master), 00040 _mesh (mesh), 00041 _initialized (false), 00042 _use_close_to_point_tol (false), 00043 _close_to_point_tol (TOLERANCE) 00044 { 00045 } 00046 00047 00048 00049 00050 00051 PointLocatorBase::~PointLocatorBase () 00052 { 00053 } 00054 00055 00056 00057 bool PointLocatorBase::initialized () const 00058 { 00059 return this->_initialized; 00060 } 00061 00062 00063 00064 UniquePtr<PointLocatorBase> PointLocatorBase::build (PointLocatorType t, 00065 const MeshBase& mesh, 00066 const PointLocatorBase* master) 00067 { 00068 switch (t) 00069 { 00070 case TREE: 00071 return UniquePtr<PointLocatorBase>(new PointLocatorTree(mesh, /*Trees::NODES,*/ master)); 00072 00073 case TREE_ELEMENTS: 00074 return UniquePtr<PointLocatorBase>(new PointLocatorTree(mesh, Trees::ELEMENTS, master)); 00075 00076 case TREE_LOCAL_ELEMENTS: 00077 return UniquePtr<PointLocatorBase>(new PointLocatorTree(mesh, Trees::LOCAL_ELEMENTS, master)); 00078 00079 case LIST: 00080 return UniquePtr<PointLocatorBase>(new PointLocatorList(mesh, master)); 00081 00082 default: 00083 libmesh_error_msg("ERROR: Bad PointLocatorType = " << t); 00084 } 00085 00086 libmesh_error_msg("We'll never get here!"); 00087 return UniquePtr<PointLocatorBase>(); 00088 } 00089 00090 void PointLocatorBase::set_close_to_point_tol (Real close_to_point_tol) 00091 { 00092 _use_close_to_point_tol = true; 00093 _close_to_point_tol = close_to_point_tol; 00094 } 00095 00096 00097 void PointLocatorBase::unset_close_to_point_tol () 00098 { 00099 _use_close_to_point_tol = false; 00100 _close_to_point_tol = TOLERANCE; 00101 } 00102 00103 } // namespace libMesh