Changes in / [cc2ee5:a98603]


Ignore:
Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/analyzer.cpp

    rcc2ee5 ra98603  
    2929  ForceMatrix Shielding;
    3030  ForceMatrix ShieldingPAS;
     31  ForceMatrix Chi;
     32  ForceMatrix ChiPAS;
    3133  EnergyMatrix Time;
    3234  EnergyMatrix EnergyFragments;
     
    3537  ForceMatrix ShieldingFragments;
    3638  ForceMatrix ShieldingPASFragments;
     39  ForceMatrix ChiFragments;
     40  ForceMatrix ChiPASFragments;
    3741  KeySetsContainer KeySet;
    3842  ofstream output;
     
    9094    if (!Shielding.ParseFragmentMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1;
    9195    if (!ShieldingPAS.ParseFragmentMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1;
     96    if (!Chi.ParseFragmentMatrix(argv[1], dir, ChiSuffix, 1, 0)) return 1;
     97    if (!ChiPAS.ParseFragmentMatrix(argv[1], dir, ChiPASSuffix, 1, 0)) return 1;
    9298  }
    9399
     
    109115    if(!ShieldingFragments.ParseIndices(argv[1])) return 1;
    110116    if(!ShieldingPASFragments.ParseIndices(argv[1])) return 1;
     117    if(!Chi.ParseIndices(argv[1])) return 1;
     118    if(!ChiPAS.ParseIndices(argv[1])) return 1;
     119    if (!ChiFragments.AllocateMatrix(Chi.Header, Chi.MatrixCounter, Chi.RowCounter, Chi.ColumnCounter)) return 1;
     120    if (!ChiPASFragments.AllocateMatrix(ChiPAS.Header, ChiPAS.MatrixCounter, ChiPAS.RowCounter, ChiPAS.ColumnCounter)) return 1;
     121    if(!ChiFragments.ParseIndices(argv[1])) return 1;
     122    if(!ChiPASFragments.ParseIndices(argv[1])) return 1;
    111123  }
    112124
     
    122134    if (!ShieldingFragments.ParseFragmentMatrix(argv[1], dir, ShieldingFragmentSuffix, 1, 0)) return 1;
    123135    if (!ShieldingPASFragments.ParseFragmentMatrix(argv[1], dir, ShieldingPASFragmentSuffix, 1, 0)) return 1;
     136    if (!ChiFragments.ParseFragmentMatrix(argv[1], dir, ChiFragmentSuffix, 1, 0)) return 1;
     137    if (!ChiPASFragments.ParseFragmentMatrix(argv[1], dir, ChiPASFragmentSuffix, 1, 0)) return 1;
    124138  }
    125139
     
    159173      for(int k=0;k<ShieldingPAS.ColumnCounter;k++)
    160174        output << scientific << ShieldingPAS.Matrix[ ShieldingPAS.MatrixCounter ][j][k] << "\t";
     175      output << endl;
     176    }
     177    output << endl;
     178
     179    output << endl << "Total Chis" << endl << "===============" << endl << Chi.Header[Hessian.MatrixCounter] << endl;
     180    for(int j=0;j<Chi.RowCounter[Chi.MatrixCounter];j++) {
     181      for(int k=0;k<Chi.ColumnCounter[Chi.MatrixCounter];k++)
     182        output << scientific << Chi.Matrix[ Chi.MatrixCounter ][j][k] << "\t";
     183      output << endl;
     184    }
     185    output << endl;
     186 
     187    output << endl << "Total Chis PAS" << endl << "===============" << endl << ChiPAS.Header[ChiPAS.MatrixCounter] << endl;
     188    for(int j=0;j<ChiPAS.RowCounter[ChiPAS.MatrixCounter];j++) {
     189      for(int k=0;k<ChiPAS.ColumnCounter[ChiPAS.MatrixCounter];k++)
     190        output << scientific << ChiPAS.Matrix[ ChiPAS.MatrixCounter ][j][k] << "\t";
    161191      output << endl;
    162192    }
     
    228258      output << endl;
    229259    }
    230   }
    231   output.close();
     260    output.close();
     261    if (!CreateDataDeltaForcesOrderPerAtom(ChiPAS, ChiPASFragments, KeySet, argv[3], "DeltaChisPAS-Order", "Plot of error between approximated Chis and full Chis versus the Bond Order", datum)) return 1;
     262    if (!CreateDataForcesOrderPerAtom(ChiPASFragments, KeySet, argv[3], "ChisPAS-Order", "Plot of approximated Chis versus the Bond Order", datum)) return 1;
     263    if (!AppendOutputFile(output, argv[3], "ChisPAS-Order.dat" )) return false;
     264    output << endl << "# Full" << endl;
     265    for(int j=0;j<ChiPAS.RowCounter[ChiPAS.MatrixCounter];j++) {
     266      output << j << "\t";
     267      for(int k=0;k<ChiPAS.ColumnCounter[ChiPAS.MatrixCounter];k++)
     268        output << scientific <<  ChiPAS.Matrix[ ChiPAS.MatrixCounter ][j][k] << "\t"; //*(((k>1) && (k<6))? 1.e6 : 1.) << "\t";
     269      output << endl;
     270    }
     271    output.close();
     272  }
    232273
    233274 
     
    404445    }
    405446    output << "'ShieldingsPAS-Order.dat' index " << KeySet.Order << " title 'Full' using ($1+" << step*(double)KeySet.Order << "):7 with boxes" << endl;
     447    output.close(); 
     448    output2.close(); 
     449
     450    if(!OpenOutputFile(output, argv[3], "ChisPAS-Order.pyx")) return 1;
     451    if(!OpenOutputFile(output2, argv[3], "DeltaChisPAS-Order.pyx")) return 1;
     452    CreatePlotHeader(output, "ChisPAS-Order", 1, "top right", NULL, NULL,  1, 5, "nuclei index", "iso chemical Chi value [ppm]");
     453    CreatePlotHeader(output2, "DeltaChisPAS-Order", 1, "top right", NULL, NULL,  1, 5, "nuclei index", "iso chemical Chi value [ppm]");
     454    output << "set boxwidth " << step << endl;
     455    output << "plot [0:" << ChiPAS.RowCounter[ChiPAS.MatrixCounter]+10 << "]\\" << endl;
     456    output2 << "plot [0:" << ChiPAS.RowCounter[ChiPAS.MatrixCounter]+10 << "]\\" << endl;
     457    for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) {
     458      output << "'ChisPAS-Order.dat' index " << BondOrder << " title 'Order " << BondOrder+1 << "' using ($1+" << step*(double)BondOrder << "):7 with boxes, \\" << endl;
     459      output2 << "'DeltaChisPAS-Order.dat' index " << BondOrder << " title 'Order " << BondOrder+1 << "' using ($1):7 with linespoints";
     460      if (BondOrder-1 != KeySet.Order)
     461        output2 << ", \\" << endl;
     462    }
     463    output << "'ChisPAS-Order.dat' index " << KeySet.Order << " title 'Full' using ($1+" << step*(double)KeySet.Order << "):7 with boxes" << endl;
    406464    output.close(); 
    407465    output2.close(); 
  • src/joiner.cpp

    rcc2ee5 ra98603  
    2828  ForceMatrix ShieldingFragments;
    2929  ForceMatrix ShieldingPASFragments;
     30  EnergyMatrix Chi;
     31  EnergyMatrix ChiPAS;
     32  EnergyMatrix ChiFragments;
     33  EnergyMatrix ChiPASFragments;
    3034  KeySetsContainer KeySet; 
    3135  stringstream prefix;
     
    6670    if (!Shielding.ParseFragmentMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1;
    6771    if (!ShieldingPAS.ParseFragmentMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1;
     72    if (!Chi.ParseFragmentMatrix(argv[1], dir, ChiSuffix, 1, 0)) return 1;
     73    if (!ChiPAS.ParseFragmentMatrix(argv[1], dir, ChiPASSuffix, 1, 0)) return 1;
    6874  }
    6975
     
    7985    if(!Shielding.ParseIndices(argv[1])) return 1;
    8086    if(!ShieldingPAS.ParseIndices(argv[1])) return 1;
     87    if(!Chi.ParseIndices(argv[1])) return 1;
     88    if(!ChiPAS.ParseIndices(argv[1])) return 1;
    8189  }
    8290
    8391  // ---------- Parse the KeySets into an array ---------------
    8492  if (!KeySet.ParseKeySets(argv[1], Force.RowCounter, Force.MatrixCounter)) return 1;
    85 
    8693  if (!KeySet.ParseManyBodyTerms()) return 1;
     94
    8795  if (!EnergyFragments.AllocateMatrix(Energy.Header, Energy.MatrixCounter, Energy.RowCounter, Energy.ColumnCounter)) return 1;
    8896  if (Hcorrected)  HcorrectionFragments.AllocateMatrix(Hcorrection.Header, Hcorrection.MatrixCounter, Hcorrection.RowCounter, Hcorrection.ColumnCounter);
     
    9199    if (!ShieldingFragments.AllocateMatrix(Shielding.Header, Shielding.MatrixCounter, Shielding.RowCounter, Shielding.ColumnCounter)) return 1;
    92100    if (!ShieldingPASFragments.AllocateMatrix(ShieldingPAS.Header, ShieldingPAS.MatrixCounter, ShieldingPAS.RowCounter, ShieldingPAS.ColumnCounter)) return 1;
     101    if (!ChiFragments.AllocateMatrix(Chi.Header, Chi.MatrixCounter, Chi.RowCounter, Chi.ColumnCounter)) return 1;
     102    if (!ChiPASFragments.AllocateMatrix(ChiPAS.Header, ChiPAS.MatrixCounter, ChiPAS.RowCounter, ChiPAS.ColumnCounter)) return 1;
    93103  }
    94104 
     
    99109    if(!Shielding.SetLastMatrix(0., 2)) return 1;
    100110    if(!ShieldingPAS.SetLastMatrix(0., 2)) return 1;
     111    if(!Chi.SetLastMatrix(0., 2)) return 1;
     112    if(!ChiPAS.SetLastMatrix(0., 2)) return 1;
    101113  }
    102114
     
    119131    if (!Force.SumSubForces(ForceFragments, KeySet, BondOrder, 1.)) return 1;
    120132    if (periode != NULL) { // also look for PAS values
    121       cout << "Summing shieldings of order " << BondOrder+1 << " ..." << endl;
     133      cout << "Summing shieldings and susceptibilities of order " << BondOrder+1 << " ..." << endl;
    122134      if (!ShieldingFragments.SumSubManyBodyTerms(Shielding, KeySet, BondOrder)) return 1;
    123135      if (!Shielding.SumSubForces(ShieldingFragments, KeySet, BondOrder, 1.)) return 1;
    124136      if (!ShieldingPASFragments.SumSubManyBodyTerms(ShieldingPAS, KeySet, BondOrder)) return 1;
    125137      if (!ShieldingPAS.SumSubForces(ShieldingPASFragments, KeySet, BondOrder, 1.)) return 1;
     138      if (!ChiFragments.SumSubManyBodyTerms(Chi, KeySet, BondOrder)) return 1;
     139      if (!Chi.SumSubForces(ChiFragments, KeySet, BondOrder, 1.)) return 1;
     140      if (!ChiPASFragments.SumSubManyBodyTerms(ChiPAS, KeySet, BondOrder)) return 1;
     141      if (!ChiPAS.SumSubForces(ChiPASFragments, KeySet, BondOrder, 1.)) return 1;
    126142    }
    127143
     
    138154      if (!Shielding.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ShieldingSuffix)) return 1;
    139155      if (!ShieldingPAS.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ShieldingPASSuffix)) return 1;
     156      if (!Chi.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ChiSuffix)) return 1;
     157      if (!ChiPAS.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ChiPASSuffix)) return 1;
    140158    }
    141159  }
     
    160178    prefix << dir << ShieldingPASFragmentSuffix;
    161179    if (!ShieldingPASFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1;
     180    prefix.str(" ");
     181    prefix << dir << ChiFragmentSuffix;
     182    if (!ChiFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1;
     183    prefix.str(" ");
     184    prefix << dir << ChiPASFragmentSuffix;
     185    if (!ChiPASFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1;
    162186  }
    163187
     
    169193    if (!Shielding.WriteLastMatrix(argv[1], dir, ShieldingFragmentSuffix)) return 1;
    170194    if (!ShieldingPAS.WriteLastMatrix(argv[1], dir, ShieldingPASFragmentSuffix)) return 1;
     195    if (!Chi.WriteLastMatrix(argv[1], dir, ChiFragmentSuffix)) return 1;
     196    if (!ChiPAS.WriteLastMatrix(argv[1], dir, ChiPASFragmentSuffix)) return 1;
    171197  }
    172198
  • src/parser.hpp

    rcc2ee5 ra98603  
    2525#define ShieldingFragmentSuffix ".sigma_all_fragment.all"
    2626#define ShieldingPASFragmentSuffix ".sigma_all_PAS_fragment.all"
     27#define ChiSuffix ".chi_all.csv"
     28#define ChiPASSuffix ".chi_all_PAS.csv"
     29#define ChiFragmentSuffix ".chi_all_fragment.all"
     30#define ChiPASFragmentSuffix ".chi_all_PAS_fragment.all"
    2731#define TimeSuffix ".speed"
    2832#define EnergyFragmentSuffix ".energyfragment.all"
Note: See TracChangeset for help on using the changeset viewer.