<p><b>dwj07@fsu.edu</b> 2012-08-09 11:30:35 -0600 (Thu, 09 Aug 2012)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Adding tool for the estimation of starting point number when generation a target grid.<br>
</p><hr noshade><pre><font color="gray">Added: branches/tools/point_num/Makefile
===================================================================
--- branches/tools/point_num/Makefile                                (rev 0)
+++ branches/tools/point_num/Makefile        2012-08-09 17:30:35 UTC (rev 2097)
@@ -0,0 +1,4 @@
+all:
+        g++ -o pointNum pointNum.cpp
+clean:
+        rm -f pointNum

Added: branches/tools/point_num/README
===================================================================
--- branches/tools/point_num/README                                (rev 0)
+++ branches/tools/point_num/README        2012-08-09 17:30:35 UTC (rev 2097)
@@ -0,0 +1,45 @@
+pointNum.cpp
+written by Doug Jacobsen
+
+PURPOSE:
+        This program is intended to estimate the number of grid cells in a target mesh.
+        The assumtion in this program is that the high resolution is radially symmetric
+        and outside of the high resolution region is a low resolution region. Of course
+        this assumtion causes the point estimate to be inexact but it gives at least a 
+        starting place.
+
+
+USE:
+        In order to use, you need a c++ compiler.
+        To get a rough estimate for the number of cells in a target mesh edit the following
+        parameteres in pointNum.cpp:
+
+                R : Radius of the sphere
+                fine_frac : Fraction of the sphere covered by high resolution region
+                fine_res : Target resolution in high resolution region
+                coarse_res : Target resolution in coarse resolution region
+
+        After the parameters are set, the project can be built using make. This provides
+        an executable called pointNum. Running pointNum gives output similar to the following:
+
+                 For a coarse res of 100km and a fine res of 10km.
+                The coarse region must have 39267 and the fine region must have 1963380
+                Leading to a total of -------2002647-------- points
+                The smallest points you can start with based on bisection-projection is:
+                125
+                with 7 bisections. 
+                would get you back to 2015234 points.
+
+        This tells you that to get a target mesh with a high res region covering 1/3 of the sphere
+        with a target high res of 10km and low res of 100km you need 2002647 grid cells.
+
+        Because of the way meshes are generated, it's a bad idea to start with 2002647 random points
+        (the final mesh will be low quality in addition to taking a really long time to generate).
+        To get a good mesh, this number is &quot;un-bisected&quot; using the based on how icosahedral bisection works
+
+        (2x resolution causes point count to increase as N* = 4N - 6)
+
+        A good starting point (based on this output) is 125 points using the target density function.
+        After the 125 point mesh is generated, it can be bisected and converged recursively 7 times to give 
+        a final number of 2015234 cells.
+

Added: branches/tools/point_num/pointNum.cpp
===================================================================
--- branches/tools/point_num/pointNum.cpp                                (rev 0)
+++ branches/tools/point_num/pointNum.cpp        2012-08-09 17:30:35 UTC (rev 2097)
@@ -0,0 +1,70 @@
+#include &lt;iostream&gt;
+#include &lt;cmath&gt;
+
+using namespace std;
+
+double R = 6371.2290; //km
+double fine_frac = 1.0/3.0;
+double fine_res = 10.0; //km
+double coarse_res = 100.0; //km
+
+int main(){
+        int i;
+        int bisections;
+        int prev_lev;
+        double cur_pts;
+        int cur_lev;
+        int small_pts;
+        int pts_fine, pts_coarse, n_pts;
+        double t_fine, t_coarse;
+        double a_fine, a_coarse;
+        double sa_coarse, sa_fine;
+
+        double temp;
+
+        // Area of Earth
+        temp = 4.0*M_PI*R*R;
+
+        t_fine = (sqrt(3.0)/3.0)*fine_res;
+        t_coarse = (sqrt(3.0)/3.0)*coarse_res;
+
+        a_fine = 3.0/2.0 * sqrt(3.0) * t_fine * t_fine;
+        a_coarse = 3.0/2.0 * sqrt(3.0) * t_coarse * t_coarse;
+
+        sa_fine = fine_frac*temp;
+        sa_coarse = (1.0 - fine_frac) * temp;
+
+        pts_fine = sa_fine/a_fine;
+        pts_coarse = sa_coarse/a_coarse;
+
+        n_pts = pts_fine + pts_coarse;
+
+        cur_pts = n_pts;
+        cur_lev = (int)cur_pts;
+        bisections = 0;
+
+        while(cur_lev &gt; 50){
+                prev_lev = (int)cur_pts;
+                cur_pts = (cur_pts + 6.0)/4.0;
+                cur_lev = (int)cur_pts;
+                bisections++;
+        }
+
+        prev_lev++;
+
+        cout &lt;&lt; &quot;For a coarse res of &quot; &lt;&lt; coarse_res &lt;&lt; &quot;km and a fine res of &quot; &lt;&lt; fine_res &lt;&lt; &quot;km.&quot; &lt;&lt; endl;
+        cout &lt;&lt; &quot;The coarse region must have &quot; &lt;&lt; pts_coarse &lt;&lt; &quot; and the fine region must have &quot; &lt;&lt; pts_fine &lt;&lt; endl;
+        cout &lt;&lt; &quot; Leading to a total of -------&quot;&lt;&lt;n_pts&lt;&lt;&quot;-------- points&quot; &lt;&lt; endl;
+
+        cout &lt;&lt; &quot;The smallest points you can start with based on bisection-projection is:&quot;&lt;&lt;endl;
+        cout &lt;&lt; prev_lev &lt;&lt; endl;
+        cout &lt;&lt; &quot;with &quot; &lt;&lt; bisections-1 &lt;&lt; &quot; bisections. &quot; &lt;&lt; endl;
+
+        cur_lev = prev_lev;
+
+        for(i = 0; i &lt; bisections-1; i++){
+                cur_lev = (4*cur_lev)-6;
+        }
+
+        cout &lt;&lt; &quot; would get you back to &quot; &lt;&lt; cur_lev &lt;&lt; &quot; points.&quot; &lt;&lt; endl;
+}

</font>
</pre>