Exemplo n.º 1
0
        // this prints the right hand side and left hand side system stencil matrices
        public void printMatrix(CompressedColumnStorage <double> Id_csc, CompressedColumnStorage <double> rhsMarray, CompressedColumnStorage <double> lhsMarray, CompressedColumnStorage <double> chlR, string strPath, int kSim)
        {
            var rhsMatrix = new StreamWriter(strPath + @"\rhsMatrix_" + kSim + ".txt", true);
            var lhsMatrix = new StreamWriter(strPath + @"\lhsMatrix_" + kSim + ".txt", true);
            var permId    = new StreamWriter(strPath + @"\permIdMatrix_" + kSim + ".txt", true);
            var chlMatrix = new StreamWriter(strPath + @"\chlLmat_" + kSim + ".txt", true);

            for (int q = 0; q < NeuronCell.vertCount; q++)
            {
                for (int j = 0; j < NeuronCell.vertCount; j++)
                {
                    rhsMatrix.Write(rhsMarray.At(q, j) + " ");
                    lhsMatrix.Write(lhsMarray.At(q, j) + " ");
                    permId.Write(Id_csc.At(q, j) + " ");
                    chlMatrix.Write(chlR.At(q, j) + " ");
                }
                rhsMatrix.Write(Environment.NewLine);
                lhsMatrix.Write(Environment.NewLine);
                permId.Write(Environment.NewLine);
                chlMatrix.Write(Environment.NewLine);
            }
            rhsMatrix.Close();
            lhsMatrix.Close();
            permId.Close();
            chlMatrix.Close();
        }