Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
Shtkddud123 committed Jan 14, 2024
1 parent ab0086f commit 2a80cb6
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Version = "0.0.1"
Updated = 11/09/2019
Updated = 04/04/2023
The papers referenced for this work is:
Expand Down Expand Up @@ -45,16 +45,49 @@
#include <tuple>
#include <utility>
#include <vector>
#include <chrono>

#define _USE_MATH_DEFINES

template <typename T> 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];
Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -584,6 +619,7 @@ class compute {
}
}
}

phiTotal.push_back(phiCount);
phiCount.clear();
}
Expand Down Expand Up @@ -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() << " "
Expand Down Expand Up @@ -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
Expand All @@ -914,6 +949,8 @@ class compute {
}

void allocateCOM() {
/*
*/
CenterOfMass(&C12E2IndexVector, &C12E2MIndexVector, &inputTotal, &C12E2COM,
&C12E2MCOM, &C12E2TotalCOMArray, &C12E2MTotalCOMArray);
}
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}
35 changes: 35 additions & 0 deletions np_paper_work/UNK_12B037.pdb
Original file line number Diff line number Diff line change
@@ -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
35 changes: 35 additions & 0 deletions np_paper_work/input.pdb
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion token.txt

This file was deleted.

0 comments on commit 2a80cb6

Please sign in to comment.