Daniel and Kevin,
Thanks for the note. I looked at this and am not 100% sure either.
I basically implemented what is described here:
http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/841/pdf/imm841.pdf
which does not mention this subtlety.
I experimented with a little patch to update the far point in the
second order stencil. This is not 100% correct because it causes some
of the tests to fail. I will give this some more thought.
patch below.
From f7f5c35868ca4caa8edb5b8df23e46765eeb2ef6 Mon Sep 17 00:00:00 2001
From: Jason Furtney <
jkfu...@gmail.com>
Date: Tue, 16 Oct 2012 09:35:58 -0500
Subject: [PATCH] testing second order fix
---
skfmm/base_marcher.cpp | 32 ++++++++++++++++++++++++++++----
1 file changed, 28 insertions(+), 4 deletions(-)
diff --git a/skfmm/base_marcher.cpp b/skfmm/base_marcher.cpp
index 9b7913c..45d5aea 100644
--- a/skfmm/base_marcher.cpp
+++ b/skfmm/base_marcher.cpp
@@ -158,11 +158,35 @@ void baseMarcher::solve()
}
}
}
- }
- }
- }
+ //==========================================================
+ // update the far point in the second order stencil
+ // "jump" over a Frozen point if needed
+ if (order_ == 2)
+ {
+ int naddr2 = _getN(addr,dim,j*2,Frozen);
+ if (naddr2!=-1 && flag_[naddr2]!=Frozen)
+ {
+ double d = updatePointOrderTwo(naddr2);
+ if (d && flag_[naddr2]==Narrow)
+ {
+ heap_->set(heapptr_[naddr2], fabs(d));
+ distance_[naddr2]=d;
+ }
+ else if (d && flag_[naddr2]==Far)
+ {
+ distance_[naddr2]=d;
+ flag_[naddr2]=Narrow;
+ heapptr_[naddr2] = heap_->push(naddr2,fabs(d));
+ }
+ }
+ }
+ //==========================================================
+ } // for each direction
+ } // for each dimension
+ } // main loop of Fast Marching Method
+
// add back mask here. The python wrapper will look for elements
- // equal to mexDouble and add the mask back
+ // equal to maxDouble and add the mask back
for (int i=0; i<size_; i++)
{
if (flag_[i] == Mask) distance_[i] = maxDouble;
--
1.7.11.msysgit.1
On Mon, Oct 15, 2012 at 4:06 PM, Daniel Wheeler
Jason K. Furtney, PhD
Itasca Consulting Group
111 3rd Ave. South, Suite 450
Minneapolis, MN 55401 USA
(612) 371-4711
www.itascacg.com