From 3070ce63fd38ff96af9eb52c5f806cd4d338b060 Mon Sep 17 00:00:00 2001 From: James E McClure Date: Wed, 20 Mar 2019 22:12:13 -0400 Subject: [PATCH] adding subphase write --- analysis/SubPhase.cpp | 25 ++++++++++++++++++++++--- analysis/SubPhase.h | 1 + 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/analysis/SubPhase.cpp b/analysis/SubPhase.cpp index 93b318df..145689ed 100644 --- a/analysis/SubPhase.cpp +++ b/analysis/SubPhase.cpp @@ -34,7 +34,7 @@ SubPhase::SubPhase(std::shared_ptr dm): // If timelog is empty, write a short header to list the averages //fprintf(TIMELOG,"--------------------------------------------------------------------------------------\n"); fprintf(TIMELOG,"time rn rw nun nuw Fx Fy Fz iftwn "); - fprintf(TIMELOG,"pnc pnd pni pwc pwd pwi "); // pressures + fprintf(TIMELOG,"pwc pwd pnc pnd "); // pressures fprintf(TIMELOG,"Mwc Mwd Mwi Mnc Mnd Mni "); // mass fprintf(TIMELOG,"Pwc_x Pwd_x Pwi_x Pnc_x Pnd_x Pni_x "); // momentum fprintf(TIMELOG,"Pwc_y Pwd_y Pwi_y Pnc_y Pnd_y Pni_y "); @@ -45,7 +45,7 @@ SubPhase::SubPhase(std::shared_ptr dm): fprintf(TIMELOG,"Vnc Anc Hnc Xnc "); // nc region fprintf(TIMELOG,"Vnd And Hnd Xnd "); // nd region fprintf(TIMELOG,"Vi Ai Hi Xi\n"); // interface region - // stress tensor + // stress tensor? } } @@ -57,7 +57,7 @@ SubPhase::SubPhase(std::shared_ptr dm): TIMELOG = fopen(LocalRankFilename,"a+"); //fprintf(TIMELOG,"--------------------------------------------------------------------------------------\n"); fprintf(TIMELOG,"time rn rw nun nuw Fx Fy Fz iftwn "); - fprintf(TIMELOG,"pnc pnd pni pwc pwd pwi "); // pressures + fprintf(TIMELOG,"pwc pwd pnc pnd "); // pressures fprintf(TIMELOG,"Mwc Mwd Mwi Mnc Mnd Mni "); // mass fprintf(TIMELOG,"Pwc_x Pwd_x Pwi_x Pnc_x Pnd_x Pni_x "); // momentum fprintf(TIMELOG,"Pwc_y Pwd_y Pwi_y Pnc_y Pnd_y Pni_y "); @@ -79,6 +79,25 @@ SubPhase::~SubPhase() } +void SubPhase::Write() +{ + if (Dm->rank()==0){ + fprintf(TIMELOG,"%i %.5g %.5g %.5g %.5g %.5g %.5g %.5g %.5g ",timestep,rho_n,rho_w,nu_n,nu_w,Fx,Fy,Fz,gamma_wn); + fprintf(TIMELOG,"%.5g %.5g %.5g %.5g ",gwc.p, gwd.p, gnc.p, gnd.p); + fprintf(TIMELOG,"%.5g %.5g %.5g %.5g %.5g %.5g ",gwc.M, gwd.M, giwn.Mw, gnc.M, gnd.M, giwn.Mn); + + fflush(TIMELOG); + } + else{ + fprintf(TIMELOG,"%i %.5g %.5g %.5g %.5g %.5g %.5g %.5g %.5g ",timestep,rho_n,rho_w,nu_n,nu_w,Fx,Fy,Fz,gamma_wn); + fprintf(TIMELOG,"%.5g %.5g %.5g %.5g ",wc.p, wd.p, nc.p, nd.p); + fprintf(TIMELOG,"%.5g %.5g %.5g %.5g %.5g %.5g ",wc.M, wd.M, iwn.Mw, nc.M, nd.M, iwn.Mn); + + fflush(TIMELOG); + } + +} + void SubPhase::SetParams(double rhoA, double rhoB, double tauA, double tauB, double force_x, double force_y, double force_z, double alpha, double B) { Fx = force_x; diff --git a/analysis/SubPhase.h b/analysis/SubPhase.h index 5ba595bb..59d6e2a6 100644 --- a/analysis/SubPhase.h +++ b/analysis/SubPhase.h @@ -100,6 +100,7 @@ public: void SetParams(double rhoA, double rhoB, double tauA, double tauB, double force_x, double force_y, double force_z, double alpha, double beta); void Basic(); void Full(); + void Write(); private: FILE *TIMELOG;