Hi, Libmesh Developers,

It looks there is a bug in this function. if enabling
"_out_of_mesh_mode", the element can't be found, that is "NULL".
"libmesh_assert (this->_element->active());" can't be judged, right?
Thanks

00173 const Elem* PointLocatorTree::operator() (const Point& p) const
00174 {
00175   libmesh_assert (this->_initialized);
00176
00177   // First check the element from last time before asking the tree
00178   if (this->_element==NULL || !(this->_element->contains_point(p)))
00179     {
00180         // ask the tree
00181         this->_element = this->_tree->find_element (p);
00182
00183         if (this->_element == NULL)
00184           {
00185             /* No element seems to contain this point.  If out-of-mesh
00186                mode is enabled, just return NULL.  If not, however, we
00187                have to perform a linear search before we call \p
00188                libmesh_error() since in the case of curved elements, the
00189                bounding box computed in \p TreeNode::insert(const
00190                Elem*) might be slightly inaccurate.  */
00191             if(!_out_of_mesh_mode)
00192               {
00193                 MeshBase::const_element_iterator       pos     =
this->_mesh.active_elements_begin();
00194                 const MeshBase::const_element_iterator end_pos =
this->_mesh.active_elements_end();
00195
00196                 for ( ; pos != end_pos; ++pos)
00197                   if ((*pos)->contains_point(p))
00198                     return this->_element = (*pos);
00199
00200                 if (this->_element == NULL)
00201                   {
00202                     std::cerr << std::endl
00203                               << " ******** Serious Problem.
Could not find an Element "
00204                               << "in the Mesh"
00205                               << std:: endl
00206                               << " ******** that contains the Point "
00207                               << p;
00208                     libmesh_error();
00209                   }
00210               }
00211           }
00212     }
00213
00214   // the element should be active
00215   libmesh_assert (this->_element->active());
00216
00217   // return the element
00218   return this->_element;
00219 }


Regards,
Yujie

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to