<p><b>dwj07@fsu.edu</b> 2011-10-26 14:50:04 -0600 (Wed, 26 Oct 2011)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Adding capability of writing meshDensity field to mpas grid.<br>
<br>
        New Save* files represent a quasi-unifort 42 cell SCVT, with constant density of 1.0.<br>
</p><hr noshade><pre><font color="gray">Added: branches/tools/points-mpas/SaveDensity
===================================================================
--- branches/tools/points-mpas/SaveDensity                                (rev 0)
+++ branches/tools/points-mpas/SaveDensity        2011-10-26 20:50:04 UTC (rev 1147)
@@ -0,0 +1,42 @@
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1

Modified: branches/tools/points-mpas/SaveTriangles
===================================================================
--- branches/tools/points-mpas/SaveTriangles        2011-10-26 20:33:19 UTC (rev 1146)
+++ branches/tools/points-mpas/SaveTriangles        2011-10-26 20:50:04 UTC (rev 1147)
@@ -1,80 +1,80 @@
-22 41 31
-12 23 41
-9 23 12
-10 19 18
-7 24 22
-8 22 40
-0 21 33
-16 20 25
-6 30 19
-11 18 30
-5 16 25
-11 23 18
-14 38 27
-0 13 36
-8 12 41
-9 12 29
-18 23 37
-7 32 24
-7 31 15
-5 25 21
-6 27 15
-5 38 14
-17 35 29
-12 39 29
-2 40 24
-28 39 40
-6 14 27
-4 35 17
-4 33 25
-24 32 34
-4 20 35
-6 15 30
-0 36 21
-2 24 34
-15 27 32
-7 15 32
-1 32 27
-9 37 23
-8 41 22
-1 34 32
-13 34 36
-3 39 28
-2 13 28
-7 22 31
-1 27 38
-4 17 33
-3 17 29
-1 38 36
-21 25 33
-18 19 30
-3 28 26
-9 35 37
-2 28 40
-15 31 30
-3 26 17
-5 14 16
-21 36 38
-10 37 20
-10 18 37
-1 36 34
-10 20 16
-2 34 13
-20 37 35
-0 26 13
-0 33 26
-4 25 20
-11 41 23
-14 19 16
-5 21 38
-17 26 33
-13 26 28
-9 29 35
-11 30 31
-3 29 39
-6 19 14
-8 39 12
-11 31 41
-8 40 39
-10 16 19
-22 24 40
+11 26 25
+0 6 10
+8 27 41
+11 25 36
+4 14 40
+5 29 32
+9 28 27
+32 35 37
+5 13 18
+23 30 31
+0 34 16
+12 36 35
+13 33 27
+16 30 23
+3 6 17
+35 36 37
+8 9 27
+0 28 34
+16 34 30
+15 23 31
+2 15 31
+3 12 21
+6 18 10
+3 17 7
+10 13 28
+24 40 38
+3 7 11
+0 10 28
+19 32 37
+8 39 9
+19 37 24
+30 39 31
+4 8 14
+1 15 2
+21 35 29
+6 21 18
+7 16 23
+2 31 4
+3 21 6
+7 23 26
+27 33 41
+1 40 24
+4 39 8
+13 27 28
+22 24 37
+7 17 16
+4 31 39
+18 21 29
+14 38 40
+20 41 33
+12 35 21
+7 26 11
+22 36 25
+0 16 17
+29 35 32
+5 33 13
+5 18 29
+1 24 22
+14 41 38
+19 24 38
+11 36 12
+19 38 20
+15 25 26
+0 17 6
+9 34 28
+3 11 12
+15 26 23
+19 20 32
+5 32 20
+2 4 40
+10 18 13
+8 41 14
+5 20 33
+1 2 40
+22 37 36
+1 25 15
+1 22 25
+9 39 34
+20 38 41
+30 34 39

Modified: branches/tools/points-mpas/SaveVertices
===================================================================
--- branches/tools/points-mpas/SaveVertices        2011-10-26 20:33:19 UTC (rev 1146)
+++ branches/tools/points-mpas/SaveVertices        2011-10-26 20:50:04 UTC (rev 1147)
@@ -1,42 +1,42 @@
-0.1563072040384713 -0.0962758804584656 -0.9830050929713554
--0.4072397669120782 0.6987500161062452 -0.5881361978631465
--0.7846511913697883 -0.2819815773113404 -0.5520950080728684
-0.0189018261147366 -0.9325259815061092 -0.3606078407156394
-0.8929363271403706 -0.3538529410719103 -0.2783034526696073
-0.6295663386297677 0.6543310704843933 -0.4189237107911852
--0.0189018261148352 0.9325259815061259 0.3606078407155913
--0.8929363271403882 0.3538529410718601 0.2783034526696146
--0.6295663386296628 -0.6543310704844766 0.4189237107912129
-0.4072397669121988 -0.6987500161062059 0.5881361978631097
-0.7846511913697121 0.2819815773114498 0.5520950080729208
--0.1563072040385062 0.0962758804584336 0.9830050929713530
--0.1306802800482702 -0.7953211078538781 0.5919349624820160
--0.3693313291199989 -0.2223341552467363 -0.9023092001864855
-0.3589395945546560 0.9327311726563537 -0.0342772084050387
--0.5359650189610209 0.7561145595512165 0.3755426357749311
-0.8312562076671715 0.5503507659093060 0.0782761245708598
-0.5359650189609594 -0.7561145595512457 -0.3755426357749599
-0.3693313291199290 0.2223341552467790 0.9023092001865036
-0.4500961838491371 0.7138696318707015 0.5364732742432123
-0.9860612028101775 -0.0422449276805475 0.1609306384682893
-0.4619248785472341 0.3280166106625165 -0.8240330756156564
--0.8949046135156228 -0.1766166131051672 0.4098198441799928
-0.1474944597771114 -0.3541254118214183 0.9234936800202637
--0.9860612028101833 0.0422449276805802 -0.1609306384682460
-0.8949046135156530 0.1766166131050846 -0.4098198441799624
-0.1029852839925218 -0.6047145619938074 -0.7897558672106321
--0.2504797437696364 0.9588399738152266 -0.1337378128096654
--0.4500961838492435 -0.7138696318706331 -0.5364732742432141
-0.2504797437696580 -0.9588399738152272 0.1337378128096201
--0.1029852839926024 0.6047145619938111 0.7897558672106186
--0.6167298736902294 0.2645790829272963 0.7413785617182255
--0.7642243334672891 0.6187044947487504 -0.1821151183020540
-0.6167298736902037 -0.2645790829273468 -0.7413785617182289
--0.7005759276188255 0.2449703419446037 -0.6702110870528524
-0.7642243334673138 -0.6187044947487278 0.1821151183020281
--0.1474944597770587 0.3541254118214171 -0.9234936800202724
-0.7005759276188496 -0.2449703419445155 0.6702110870528596
-0.1306802800484028 0.7953211078538522 -0.5919349624820214
--0.3589395945546398 -0.9327311726563604 0.0342772084050255
--0.8312562076671763 -0.5503507659093050 -0.0782761245708147
--0.4619248785471858 -0.3280166106625792 0.8240330756156585
+-0.8648509131649686 -0.4676066941781162 -0.1826933976845735
+0.7838328507802397 0.0057258667596523 0.6209454698180615
+0.7749152796745788 -0.4974490738405992 0.3899368259885176
+-0.8000212550492383 0.2510204814894237 0.5449355093423988
+0.6965021635640756 -0.7094165300762993 -0.1077632729879007
+-0.1785526573042889 0.6522570279134935 -0.7366679836310476
+-0.9824983531689141 0.1818875101993956 -0.0401736188790197
+-0.5884335508768328 -0.2735456448524480 0.7608670950860866
+0.4395191466451540 -0.6097749643464200 -0.6595433363992376
+-0.0892521448423984 -0.7714974540899782 -0.6299410551581105
+-0.8517337350071063 -0.0396330618674812 -0.5224737936565366
+-0.3174574963697685 0.2657015589638944 0.9102875477357660
+-0.4588058490111791 0.6867323879342486 0.5638225077763886
+-0.4495287118111457 0.1130098240977311 -0.8860884362832029
+0.8450007333752771 -0.3024096813753165 -0.4410466474260102
+0.4045711260275048 -0.4273342411317883 0.8085218923079048
+-0.6272528048469359 -0.7027793385692050 0.3356413563491284
+-0.9218191887081043 -0.2346724543336001 0.3085096797615546
+-0.7121249741793706 0.4956252648732559 -0.4972259224631652
+0.6599191760357339 0.7193668980961053 -0.2168362216602788
+0.4351579840112149 0.5572104483309417 -0.7072156992192170
+-0.7383254197947582 0.6677960227043536 0.0944671717854435
+0.5898337223352208 0.5243275056313401 0.6141472517520490
+-0.1421953213859883 -0.7018653247311629 0.6979724611443882
+0.8932135657521285 0.4151163564378642 0.1727655537835020
+0.2962531449458656 0.1706549793817015 0.9397398321460653
+-0.0818336671964101 -0.2277332583389454 0.9702787300356090
+-0.0032904823203013 -0.3153098557809833 -0.9489830702248988
+-0.5393565239769830 -0.4581745551851394 -0.7065200754574252
+-0.3887203953104806 0.8817717803995312 -0.2671609656381423
+-0.1593375985433969 -0.9665368465560965 0.2010424182599784
+0.3516228657752858 -0.8543797477302530 0.3826180954063260
+0.1599739220352282 0.9335055629739452 -0.3208982832072563
+0.0818336672000706 0.2277332583425850 -0.9702787300344461
+-0.4627515554301417 -0.8535598842060700 -0.2393669192288378
+-0.1444658207207003 0.9659725476397274 0.2145382573106927
+0.0720776411654946 0.6889007795904868 0.7212631485967086
+0.4085407089736979 0.8803273337629192 0.2410773206694028
+0.8717291316499741 0.2503306501431092 -0.4212159619859039
+0.2038181602532415 -0.9567928530755625 -0.2073779010755705
+0.9908174637273420 -0.1237238092171543 0.0545268063040038
+0.5434759650929845 -0.0407787721821897 -0.8384336390589074

Modified: branches/tools/points-mpas/points-mpas.cpp
===================================================================
--- branches/tools/points-mpas/points-mpas.cpp        2011-10-26 20:33:19 UTC (rev 1146)
+++ branches/tools/points-mpas/points-mpas.cpp        2011-10-26 20:50:04 UTC (rev 1147)
@@ -118,6 +118,7 @@
 int outputVertexParameters(const string outputFilename);
 int outputEdgeParameters(const string outputFilename);
 int outputInitialConditions(const string outputFilename);
+int outputMeshDensity(const string outputFilename);
 int outputVordrawArrays(const string outputFilename);
 int writeGraphFile();
 double coriolisParameter(const pnt &amp;p);
@@ -194,6 +195,11 @@
                 cout &lt;&lt; &quot;Error - &quot; &lt;&lt; error_code &lt;&lt; endl;
                 exit(error_code);
         }
+        cout &lt;&lt; &quot;Reading and writing meshDensity&quot; &lt;&lt; endl;
+        if(error_code = outputMeshDensity(name)){
+                cout &lt;&lt; &quot;Error - &quot; &lt;&lt; error_code &lt;&lt; endl;
+                exit(error_code);
+        }
         if(vordraw){
                 cout &lt;&lt; &quot;Writing arrays for Vordraw&quot; &lt;&lt; endl;
                 if(error_code = outputVordrawArrays(name)){
@@ -1873,6 +1879,59 @@
 
         return 0;
 }/*}}}*/
+int outputMeshDensity( const string outputFilename) {/*{{{*/
+        /***************************************************************************
+         *
+         * This function writes the meshDensity variable. Read in from the file SaveDensity
+         *
+         * *************************************************************************/
+        // Return this code to the OS in case of failure.
+        static const int NC_ERR = 2;
+        
+        // set error behaviour (matches fortran behaviour)
+        NcError err(NcError::verbose_nonfatal);
+        
+        // open the scvtmesh file
+        NcFile grid(outputFilename.c_str(), NcFile::Write);
+        
+        // check to see if the file was opened
+        if(!grid.is_valid()) return NC_ERR;
+
+        // fetch dimensions
+        NcDim *nCellsDim = grid.get_dim( &quot;nCells&quot; );
+
+        NcVar *cDensVar;
+
+        int nCells = nCellsDim-&gt;size();
+        int i, j, k;
+        int junk_int;
+        double junk_dbl;
+
+        vector&lt;double&gt; dbl_tmp_arr;
+
+
+        //Build and write meshDensity
+        dbl_tmp_arr.resize(nCells);
+        ifstream celldens_in(&quot;SaveDensity&quot;);
+
+        if(!celldens_in){
+                for(i = 0 ; i &lt; nCells; i++){
+                        dbl_tmp_arr.at(i) = 1;
+                }
+        } else {
+                for(i = 0; i &lt; nCells; i++){
+                        celldens_in &gt;&gt; dbl_tmp_arr.at(i);
+                        
+                }
+        }
+
+        celldens_in.close();
+
+        if (!(cDensVar = grid.add_var(&quot;meshDensity&quot;, ncDouble, nCellsDim))) return NC_ERR;
+        if (!cDensVar-&gt;put(&amp;dbl_tmp_arr.at(0),nCells)) return NC_ERR;
+
+        return 0;
+}/*}}}*/
 int outputVordrawArrays( const string outputFilename) {/*{{{*/
         /***************************************************************************
          *

</font>
</pre>