Пример #1
0
        public void plotstep(BitArray Accepted_Mutable)
        {
            //Create Subgridmask and save to textfile. This can be portrayed in VisIt via a scatter plot.
            CellMask subgridMask = new CellMask(this.GridData, Accepted_Mutable);

            mapStepNumber(Accepted_Mutable);
            subgridMask.SaveToTextFile("reinit - " + timestepNo + "." + counter_Plotstep + ".txt", true, infoStepNumber);
            //Plot all fields
            Tecplot.Tecplot.PlotFields(this.Fields, "reinit-" + timestepNo + "." + counter_Plotstep, counter_Plotstep + totalSteps, 3);
            ++counter_Plotstep;
        }
Пример #2
0
        /// <summary>
        /// Saves the sum of weights of each volume rule in the given
        /// <paramref name="compositeRule"/> together with the coordinates of
        /// the corresponding cell center into a text file.
        /// </summary>
        public static void SumOfWeightsToTextFileVolume(this ICompositeQuadRule <QuadRule> compositeRule, IGridData g, string filename)
        {
            int J     = g.iLogicalCells.Count;
            var bMask = new System.Collections.BitArray(J);

            double[] wSum = new double[J];
            foreach (IChunkRulePair <QuadRule> crp in compositeRule)
            {
                for (int iCell = crp.Chunk.i0; iCell < crp.Chunk.JE; iCell++)
                {
                    bMask[iCell] = true;
                    wSum[iCell]  = crp.Rule.Weights.Sum();
                }
            }

            var mask = new CellMask(g, bMask);

            mask.SaveToTextFile(filename, false, (X, i, ii) => wSum[i]);
        }