From 2a80cb646b37289e05405fbaaa1cf798bc7d6699 Mon Sep 17 00:00:00 2001 From: MDSYN2019 Date: Sun, 14 Jan 2024 20:40:16 +0000 Subject: [PATCH] new --- ...llAnalysis.cxx => C12E2_full_analysis.cxx} | 90 +++++++++++++------ np_paper_work/UNK_12B037.pdb | 35 ++++++++ np_paper_work/input.pdb | 35 ++++++++ token.txt | 1 - 4 files changed, 133 insertions(+), 28 deletions(-) rename np_paper_work/{C12E2FullAnalysis.cxx => C12E2_full_analysis.cxx} (94%) create mode 100644 np_paper_work/UNK_12B037.pdb create mode 100644 np_paper_work/input.pdb delete mode 100644 token.txt diff --git a/np_paper_work/C12E2FullAnalysis.cxx b/np_paper_work/C12E2_full_analysis.cxx similarity index 94% rename from np_paper_work/C12E2FullAnalysis.cxx rename to np_paper_work/C12E2_full_analysis.cxx index f3915ef..d211a0b 100755 --- a/np_paper_work/C12E2FullAnalysis.cxx +++ b/np_paper_work/C12E2_full_analysis.cxx @@ -8,7 +8,7 @@ Version = "0.0.1" - Updated = 11/09/2019 + Updated = 04/04/2023 The papers referenced for this work is: @@ -45,16 +45,49 @@ #include #include #include +#include #define _USE_MATH_DEFINES +template class basic_stopwatch : T { + typedef typename T BaseTimer; +public: + // create, optionally start timing an activity + explicit basic_stopwatch(bool start); + explicit basic_stopwatch(char const* activity = "Stopwatch", + bool start=true); + basic_stopwatch(std::ostream& log, + char const* activity="Stopwatch", + bool start=true); + // stop and destroy a stopwatch + ~basic_stopwatch(); + // get last lap time (time of last stop) + unsigned LapGet() const; + // predicate: return true if the stopwatch is running + bool IsStarted() const; + // show accumulated time, keep running, set/return lap + unsigned Show(char const* event="show"); + // (re)start a stopwatch, set/return lap time + unsigned Start(char const* event_name="start"); + // stop a running stopwatch, set/return lap time + unsigned Stop(char const* event_name="stop"); +private: + // members + char const* m_activity; // "activity" string + unsigned m_lap; + // lap time (time of last stop) + std::ostream& m_log; + // stream on which to log events +}; + + // Constants for use later with analysis -const int NumberOfPolymers = +const int number_of_polymers = 998; // The number of polymers of each type - C12E2 or mimic -const int numberofatoms = 71313; // Total number of beads in the simulation -const int indexCG = 7; -int numberofSS = 100; /*The number of screenshots in the dump file*/ -const int boxdim = 3; +const int number_of_atoms = 71313; // Total number of beads in the simulation +const int index_cg = 7; +const int number_of_snapshots = 100; /*The number of screenshots in the dump file*/ +const int box_dim = 3; typedef struct { int index[7]; @@ -288,7 +321,7 @@ class compute { void storeFile() { - boost::progress_display show_progress(numberofSS); + boost::progress_display show_progress(number_of_snapshots); // open file for reading ipf = fopen("dump.mixed2", "r"); // Needs correction @@ -298,7 +331,7 @@ class compute { exit(1); } // loop over the values - for (int SSno = 0; SSno < numberofSS; SSno++) { + for (int SSno = 0; SSno < number_of_snapshots; SSno++) { l = 0; n = 0; @@ -475,13 +508,15 @@ class compute { } } - void ComputePhi() { // Computes the phi, or the mismatch between the bilayer - // leaflets around the NP + void ComputePhi() { + // std::cout << C12E2IndexVector.size() << " " << C12E2MIndexVector.size() // << " " << inputTotal.size() << std::endl; /* Following Python's comment system """ """ + + Computes the phi, or the mismatch between the bilayer leaflets around the NP We are explcitily ignoring flip-flops in the case of this study */ @@ -584,6 +619,7 @@ class compute { } } } + phiTotal.push_back(phiCount); phiCount.clear(); } @@ -670,7 +706,7 @@ class compute { stdev = std::sqrt(sq_sum / NewNew[it - NewNew.begin()].phimVec.size() - mean * mean) / - (pow(numberofSS, 0.5)); + (pow(number_of_snapshots, 0.5)); } std::cout << " " << it - NewNew.begin() << " " @@ -904,7 +940,6 @@ class compute { void LargePrint() { double sum, mean; - for (unsigned int i = 0; i != ABC.size(); i++) { sum = std::accumulate(ABC[i].VV.begin(), ABC[i].VV.end(), 0.0); // Compute sum @@ -914,6 +949,8 @@ class compute { } void allocateCOM() { + /* + */ CenterOfMass(&C12E2IndexVector, &C12E2MIndexVector, &inputTotal, &C12E2COM, &C12E2MCOM, &C12E2TotalCOMArray, &C12E2MTotalCOMArray); } @@ -953,12 +990,12 @@ class compute { FILE *ipf; /* input file */ int atomtype; int index, l, n; - int nlines = numberofatoms + 9; + int nlines = number_of_atoms + 9; double x, y, z; /*coordinates for the atoms in the box*/ double box1; double box2; double NPX, NPY, NPZ; - double boxlength[boxdim]; + double boxlength[box_dim]; char line[100]; inputCoord inputline; double DistVec1, DistVec2, DistVec3, DistVec4; @@ -981,19 +1018,18 @@ class testClass {}; compute C12E2PhiOrderphobic; int main(int argc, char *argv[]) { - - C12E2PhiOrderphobic.storeFile(); - C12E2PhiOrderphobic.sortVectors(); - C12E2PhiOrderphobic.check(); - C12E2PhiOrderphobic.headGroupVectorFormation(); - C12E2PhiOrderphobic.allocateCOM(); - C12E2PhiOrderphobic.ComputePhi(); - C12E2PhiOrderphobic.PhiPrint(); - C12E2PhiOrderphobic.ComputePhiStandardDev(); - C12E2PhiOrderphobic.ComputeOrderphobic(); - C12E2PhiOrderphobic.OrderphobicSort(); - C12E2PhiOrderphobic.printop(); - C12E2PhiOrderphobic.LargePrint(); + C12E2PhiOrderphobic.storeFile(); // + C12E2PhiOrderphobic.sortVectors(); // + C12E2PhiOrderphobic.check(); // + C12E2PhiOrderphobic.headGroupVectorFormation(); // + C12E2PhiOrderphobic.allocateCOM(); // + C12E2PhiOrderphobic.ComputePhi(); // + C12E2PhiOrderphobic.PhiPrint(); // + C12E2PhiOrderphobic.ComputePhiStandardDev(); // + C12E2PhiOrderphobic.ComputeOrderphobic(); // + C12E2PhiOrderphobic.OrderphobicSort(); // + C12E2PhiOrderphobic.printop(); // + C12E2PhiOrderphobic.LargePrint(); // return 0; } diff --git a/np_paper_work/UNK_12B037.pdb b/np_paper_work/UNK_12B037.pdb new file mode 100644 index 0000000..de08856 --- /dev/null +++ b/np_paper_work/UNK_12B037.pdb @@ -0,0 +1,35 @@ +REMARK LIGPARGEN GENERATED PDB FILE +ATOM 1 S00 UNK 1 1.000 1.000 0.000 +ATOM 2 C01 UNK 1 -0.813 1.000 0.000 +ATOM 3 C02 UNK 1 -1.379 1.000 1.395 +ATOM 4 C03 UNK 1 -1.604 2.208 2.072 +ATOM 5 C04 UNK 1 -2.127 2.208 3.366 +ATOM 6 C05 UNK 1 -2.431 1.002 3.995 +ATOM 7 C06 UNK 1 -2.212 -0.202 3.330 +ATOM 8 C07 UNK 1 -1.689 -0.207 2.038 +ATOM 9 H08 UNK 1 1.146 1.002 -1.332 +ATOM 10 H09 UNK 1 -1.165 0.122 -0.552 +ATOM 11 H0A UNK 1 -1.167 1.879 -0.550 +ATOM 12 H0B UNK 1 -1.370 3.157 1.593 +ATOM 13 H0C UNK 1 -2.296 3.149 3.881 +ATOM 14 H0D UNK 1 -2.838 1.003 5.002 +ATOM 15 H0E UNK 1 -2.448 -1.143 3.821 +ATOM 16 H0F UNK 1 -1.523 -1.156 1.534 +TER +CONECT 1 2 +CONECT 2 3 +CONECT 3 4 +CONECT 4 5 +CONECT 5 6 +CONECT 6 7 +CONECT 3 8 +CONECT 1 9 +CONECT 2 10 +CONECT 2 11 +CONECT 4 12 +CONECT 5 13 +CONECT 6 14 +CONECT 7 15 +CONECT 8 16 +CONECT 7 8 +END \ No newline at end of file diff --git a/np_paper_work/input.pdb b/np_paper_work/input.pdb new file mode 100644 index 0000000..de08856 --- /dev/null +++ b/np_paper_work/input.pdb @@ -0,0 +1,35 @@ +REMARK LIGPARGEN GENERATED PDB FILE +ATOM 1 S00 UNK 1 1.000 1.000 0.000 +ATOM 2 C01 UNK 1 -0.813 1.000 0.000 +ATOM 3 C02 UNK 1 -1.379 1.000 1.395 +ATOM 4 C03 UNK 1 -1.604 2.208 2.072 +ATOM 5 C04 UNK 1 -2.127 2.208 3.366 +ATOM 6 C05 UNK 1 -2.431 1.002 3.995 +ATOM 7 C06 UNK 1 -2.212 -0.202 3.330 +ATOM 8 C07 UNK 1 -1.689 -0.207 2.038 +ATOM 9 H08 UNK 1 1.146 1.002 -1.332 +ATOM 10 H09 UNK 1 -1.165 0.122 -0.552 +ATOM 11 H0A UNK 1 -1.167 1.879 -0.550 +ATOM 12 H0B UNK 1 -1.370 3.157 1.593 +ATOM 13 H0C UNK 1 -2.296 3.149 3.881 +ATOM 14 H0D UNK 1 -2.838 1.003 5.002 +ATOM 15 H0E UNK 1 -2.448 -1.143 3.821 +ATOM 16 H0F UNK 1 -1.523 -1.156 1.534 +TER +CONECT 1 2 +CONECT 2 3 +CONECT 3 4 +CONECT 4 5 +CONECT 5 6 +CONECT 6 7 +CONECT 3 8 +CONECT 1 9 +CONECT 2 10 +CONECT 2 11 +CONECT 4 12 +CONECT 5 13 +CONECT 6 14 +CONECT 7 15 +CONECT 8 16 +CONECT 7 8 +END \ No newline at end of file diff --git a/token.txt b/token.txt deleted file mode 100644 index 2b5c610..0000000 --- a/token.txt +++ /dev/null @@ -1 +0,0 @@ -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