Пример #1
0
        public static void Plot(IGrid grid)
        {
            EdgeMask boundaryEdges = EdgeMask.GetFullMask(grid.iGridData, MaskType.Logical);

            boundaryEdges.SaveToTextFile(
                "edges.txt",
                false,
                (double[] CoordGlobal, int LogicalItemIndex, int GeomItemIndex) => grid.iGridData.iGeomEdges.EdgeTags[GeomItemIndex]);
            Tecplot          plt1  = new Tecplot(grid.iGridData, true, false, 0);
            Basis            b     = new Basis(grid.iGridData, 0);
            SinglePhaseField field = new SinglePhaseField(b, "u");

            plt1.PlotFields("grid", 0, field);
        }
Пример #2
0
        /// <summary>
        /// Saves the sum of weights of each edge rule in the given
        /// <paramref name="compositeRule"/> together with the coordinates of
        /// the corresponding edge center into a text file.
        /// </summary>
        public static void SumOfWeightsToTextFileEdge(this ICompositeQuadRule <QuadRule> compositeRule, IGridData g, string filename)
        {
            int E     = g.iLogicalEdges.Count;
            var bMask = new System.Collections.BitArray(E);

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

            var mask = new EdgeMask(g, bMask);

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