Page 488 - Advanced Mine Ventilation
P. 488

Appendix C: Ventilation Network Analyzer in Cþþ With Input and Output  457

              void toPrintMeshTable()
              {
                          0;
                    je ¼
                    cout << endl << setw(10) << "MESH" << setw(20) << "NO. OF
           BRANCHES" << setw(20) << "SUMNVP" << endl;
                    for(int i¼1; i<¼nm; iþþ)
                    {
                        js ¼ jeþ1;
                        je ¼ me[i];
                        sumnvp[i] ¼  0;
                        k  ¼ abs(na[nb]);

                       for (int j¼js; j<¼je; jþþ)
                        {
                           (na[j] <   0)  ?   (sumnvp[i]  ¼ sumnvp[i]-nvp[k])  :
           (sumnvp[i]  ¼  sumnvp[i]þnvp[k]);


                        }
                        l  ¼ je - js þ  1;
                        cout << endl << setw(10)     <<    i  << setw(20)    <<
           l  << setw(20) << sumnvp[i] << endl << setw(60) ;

                       for (int j¼js; j<¼je; jþþ)
                        {
                          cout << na[j] << setw(5);
                        }
                }
                cout << endl << setw(40) << "TOTAL ¼ " << je << endl;
              }

              void toReadPrintNVP()
              {
                for(int i¼1; i<¼nb; iþþ)
                {
                  nvp[i]¼0;
                }
                if(nbwnvp>0)
                {
                  //Read and Print Natural Ventilation Pressure
                  for(int j¼1; j<¼nbwnvp; jþþ)
                  {
                    cin  >> j  >> nvp[j] ;
                  }
                  cout << branch << endl << nvp << endl;
                }
              }
   483   484   485   486   487   488   489   490   491   492   493