← Back to team overview

dolfin team mailing list archive

Re: [Question #101686]: cell.intersects() functionality in 0.9.7? (i.e. GTS dependencies)

 

Question #101686 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/101686

Andre Massing posted a new comment:
Attachments seems to be filtered out when replying via email. Manually
copied here for convenience, patch also available on the ml.

=== modified file 'dolfin/mesh/PrimitiveIntersector.cpp'
--- dolfin/mesh/PrimitiveIntersector.cpp	2010-02-11 00:47:11 +0000
+++ dolfin/mesh/PrimitiveIntersector.cpp	2010-02-19 18:39:14 +0000
@@ -6,7 +6,7 @@
 // Modified by André Massing, 2010
 //
 // First added:  2010-02-09
-// Last changed: 2010-02-11
+// Last changed: 2010-02-19
 // 
 //Author:  André Massing (am), massing@xxxxxxxxx
 //Company:  Simula Research Laboratory, Fornebu, Norway
@@ -26,13 +26,22 @@
 {
   return PrimitiveIntersector::do_intersect_with_kernel<SCK>(entity_1, entity_2);
 }
-
+//-----------------------------------------------------------------------------
+bool PrimitiveIntersector::do_intersect(const MeshEntity & entity, const Point & point)
+{
+  return PrimitiveIntersector::do_intersect_with_kernel<SCK>(PrimitiveTraits<PointPrimitive,SCK>::datum(point), entity);
+}
+//-----------------------------------------------------------------------------
 bool PrimitiveIntersector::do_intersect_exact(const MeshEntity & entity_1, const MeshEntity & entity_2)
 {
-
   return PrimitiveIntersector::do_intersect_with_kernel<EPICK>(entity_1, entity_2);
 }
 //-----------------------------------------------------------------------------
+bool PrimitiveIntersector::do_intersect_exact(const MeshEntity & entity, const Point & point)
+{
+  return PrimitiveIntersector::do_intersect_with_kernel<EPICK>(PrimitiveTraits<PointPrimitive,EPICK>::datum(point), entity);
+}
+//-----------------------------------------------------------------------------
 template <typename K, typename T, typename U >
 bool PrimitiveIntersector::do_intersect_with_kernel(const T & entity_1, const U & entity_2)
 {

=== modified file 'dolfin/mesh/PrimitiveIntersector.h'
--- dolfin/mesh/PrimitiveIntersector.h	2010-02-10 12:25:51 +0000
+++ dolfin/mesh/PrimitiveIntersector.h	2010-02-19 18:17:44 +0000
@@ -6,7 +6,7 @@
 // Modified by André Massing, 2010
 //
 // First added:  2010-02-09
-// Last changed: 2010-02-10
+// Last changed: 2010-02-19
 // 
 //Author:  André Massing (am), massing@xxxxxxxxx
 //Company:  Simula Research Laboratory, Fornebu, Norway
@@ -19,6 +19,7 @@
 namespace dolfin
 {
   class MeshEntity;
+  class Point;
 
   /// This class implements an intersection detection, detecting whether two given (arbitrary) meshentities intersect.
   class PrimitiveIntersector
@@ -28,10 +29,12 @@
       ///kernel which is faster but may suffer from floating point precision
       //issues.
       static bool do_intersect(const MeshEntity & entity_1, const MeshEntity & entity_2);
+      static bool do_intersect(const MeshEntity  & entity_1, const Point & point);
 
       ///Computes whether two mesh entities intersect. Uses an exact geometry
       ///kernel which is slower but detects intersection always correctly.
       static bool do_intersect_exact(const MeshEntity & entity_1, const MeshEntity & entity_2);
+      static bool do_intersect_exact(const MeshEntity & entity_1, const Point & point);
     private:
      
       //@{

You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.



References