fix sumreduce
This commit is contained in:
1 parent
074d61860f
commit
fbb2dd67b2
5 files changed
+96
-96
No files matched your search
@@ -1,8 +1,7 @@
|
||||
#include "analysis/ElectroChemistry.h"
|
||||
|
||||
ElectroChemistryAnalyzer::ElectroChemistryAnalyzer(std::shared_ptr <Domain> dm):
|
||||
Dm(dm),
|
||||
fillData(dm->Comm,dm->rank_info,{dm->Nx-2,dm->Ny-2,dm->Nz-2},{1,1,1},0,1)
|
||||
Dm(dm)
|
||||
{
|
||||
|
||||
Nx=dm->Nx; Ny=dm->Ny; Nz=dm->Nz;
|
||||
@@ -130,7 +129,10 @@ void ElectroChemistryAnalyzer::Basic(ScaLBL_IonModel &Ion, ScaLBL_Poisson &Poiss
|
||||
void ElectroChemistryAnalyzer::WriteVis( ScaLBL_IonModel &Ion, ScaLBL_Poisson &Poisson, ScaLBL_StokesModel &Stokes, std::shared_ptr<Database> input_db, int timestep){
|
||||
|
||||
auto vis_db = input_db->getDatabase( "Visualization" );
|
||||
char VisName[40];
|
||||
char VisName[40];
|
||||
|
||||
std::vector<IO::MeshDataStruct> visData;
|
||||
fillHalo<double> fillData(Dm->Comm,Dm->rank_info,{Dm->Nx-2,Dm->Ny-2,Dm->Nz-2},{1,1,1},0,1);
|
||||
|
||||
IO::initialize("","silo","false");
|
||||
// Create the MeshDataStruct
|
||||
@@ -216,7 +218,7 @@ void ElectroChemistryAnalyzer::WriteVis( ScaLBL_IonModel &Ion, ScaLBL_Poisson &P
|
||||
}
|
||||
|
||||
if (vis_db->getWithDefault<bool>( "write_silo", true ))
|
||||
IO::writeData( timestep, visData, Dm->Comm.comm );
|
||||
IO::writeData( timestep, visData, Dm->Comm );
|
||||
|
||||
/* if (vis_db->getWithDefault<bool>( "save_8bit_raw", true )){
|
||||
char CurrentIDFilename[40];
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
|
||||
#include <vector>
|
||||
#include "common/Domain.h"
|
||||
#include "common/Utilities.h"
|
||||
#include "common/MPI_Helpers.h"
|
||||
#include "common/Communication.h"
|
||||
#include "analysis/analysis.h"
|
||||
#include "analysis/distance.h"
|
||||
#include "analysis/Minkowski.h"
|
||||
#include "common/Utilities.h"
|
||||
#include "common/MPI_Helpers.h"
|
||||
#include "IO/MeshDatabase.h"
|
||||
#include "IO/Reader.h"
|
||||
#include "IO/Writer.h"
|
||||
@@ -49,8 +49,6 @@ public:
|
||||
void WriteVis( ScaLBL_IonModel &Ion, ScaLBL_Poisson &Poisson, ScaLBL_StokesModel &Stokes, std::shared_ptr<Database> input_db, int timestep);
|
||||
|
||||
private:
|
||||
std::vector<IO::MeshDataStruct> visData;
|
||||
fillHalo<double> fillData;
|
||||
FILE *TIMELOG;
|
||||
};
|
||||
#endif
|
||||
|
||||
+76
-76
@@ -229,25 +229,25 @@ void SubPhase::Basic(){
|
||||
}
|
||||
}
|
||||
}
|
||||
gwb.V=sumReduce( Dm->Comm, wb.V);
|
||||
gnb.V=sumReduce( Dm->Comm, nb.V);
|
||||
gwb.M=sumReduce( Dm->Comm, wb.M);
|
||||
gnb.M=sumReduce( Dm->Comm, nb.M);
|
||||
gwb.Px=sumReduce( Dm->Comm, wb.Px);
|
||||
gwb.Py=sumReduce( Dm->Comm, wb.Py);
|
||||
gwb.Pz=sumReduce( Dm->Comm, wb.Pz);
|
||||
gnb.Px=sumReduce( Dm->Comm, nb.Px);
|
||||
gnb.Py=sumReduce( Dm->Comm, nb.Py);
|
||||
gnb.Pz=sumReduce( Dm->Comm, nb.Pz);
|
||||
gwb.V=Dm->Comm.sumReduce( wb.V);
|
||||
gnb.V=Dm->Comm.sumReduce( nb.V);
|
||||
gwb.M=Dm->Comm.sumReduce( wb.M);
|
||||
gnb.M=Dm->Comm.sumReduce( nb.M);
|
||||
gwb.Px=Dm->Comm.sumReduce( wb.Px);
|
||||
gwb.Py=Dm->Comm.sumReduce( wb.Py);
|
||||
gwb.Pz=Dm->Comm.sumReduce( wb.Pz);
|
||||
gnb.Px=Dm->Comm.sumReduce( nb.Px);
|
||||
gnb.Py=Dm->Comm.sumReduce( nb.Py);
|
||||
gnb.Pz=Dm->Comm.sumReduce( nb.Pz);
|
||||
|
||||
count_w=sumReduce( Dm->Comm, count_w);
|
||||
count_n=sumReduce( Dm->Comm, count_n);
|
||||
count_w=Dm->Comm.sumReduce( count_w);
|
||||
count_n=Dm->Comm.sumReduce( count_n);
|
||||
if (count_w > 0.0)
|
||||
gwb.p=sumReduce( Dm->Comm, wb.p) / count_w;
|
||||
gwb.p=Dm->Comm.sumReduce( wb.p) / count_w;
|
||||
else
|
||||
gwb.p = 0.0;
|
||||
if (count_n > 0.0)
|
||||
gnb.p=sumReduce( Dm->Comm, nb.p) / count_n;
|
||||
gnb.p=Dm->Comm.sumReduce( nb.p) / count_n;
|
||||
else
|
||||
gnb.p = 0.0;
|
||||
|
||||
@@ -445,14 +445,14 @@ void SubPhase::Full(){
|
||||
nd.X -= nc.X;
|
||||
|
||||
// compute global entities
|
||||
gnc.V=sumReduce( Dm->Comm, nc.V);
|
||||
gnc.A=sumReduce( Dm->Comm, nc.A);
|
||||
gnc.H=sumReduce( Dm->Comm, nc.H);
|
||||
gnc.X=sumReduce( Dm->Comm, nc.X);
|
||||
gnd.V=sumReduce( Dm->Comm, nd.V);
|
||||
gnd.A=sumReduce( Dm->Comm, nd.A);
|
||||
gnd.H=sumReduce( Dm->Comm, nd.H);
|
||||
gnd.X=sumReduce( Dm->Comm, nd.X);
|
||||
gnc.V=Dm->Comm.sumReduce( nc.V);
|
||||
gnc.A=Dm->Comm.sumReduce( nc.A);
|
||||
gnc.H=Dm->Comm.sumReduce( nc.H);
|
||||
gnc.X=Dm->Comm.sumReduce( nc.X);
|
||||
gnd.V=Dm->Comm.sumReduce( nd.V);
|
||||
gnd.A=Dm->Comm.sumReduce( nd.A);
|
||||
gnd.H=Dm->Comm.sumReduce( nd.H);
|
||||
gnd.X=Dm->Comm.sumReduce( nd.X);
|
||||
gnd.Nc = nd.Nc;
|
||||
// wetting
|
||||
for (k=0; k<Nz; k++){
|
||||
@@ -492,14 +492,14 @@ void SubPhase::Full(){
|
||||
wd.H -= wc.H;
|
||||
wd.X -= wc.X;
|
||||
// compute global entities
|
||||
gwc.V=sumReduce( Dm->Comm, wc.V);
|
||||
gwc.A=sumReduce( Dm->Comm, wc.A);
|
||||
gwc.H=sumReduce( Dm->Comm, wc.H);
|
||||
gwc.X=sumReduce( Dm->Comm, wc.X);
|
||||
gwd.V=sumReduce( Dm->Comm, wd.V);
|
||||
gwd.A=sumReduce( Dm->Comm, wd.A);
|
||||
gwd.H=sumReduce( Dm->Comm, wd.H);
|
||||
gwd.X=sumReduce( Dm->Comm, wd.X);
|
||||
gwc.V=Dm->Comm.sumReduce( wc.V);
|
||||
gwc.A=Dm->Comm.sumReduce( wc.A);
|
||||
gwc.H=Dm->Comm.sumReduce( wc.H);
|
||||
gwc.X=Dm->Comm.sumReduce( wc.X);
|
||||
gwd.V=Dm->Comm.sumReduce( wd.V);
|
||||
gwd.A=Dm->Comm.sumReduce( wd.A);
|
||||
gwd.H=Dm->Comm.sumReduce( wd.H);
|
||||
gwd.X=Dm->Comm.sumReduce( wd.X);
|
||||
gwd.Nc = wd.Nc;
|
||||
|
||||
/* Set up geometric analysis of interface region */
|
||||
@@ -527,20 +527,20 @@ void SubPhase::Full(){
|
||||
iwn.A = morph_i->A();
|
||||
iwn.H = morph_i->H();
|
||||
iwn.X = morph_i->X();
|
||||
giwn.V=sumReduce( Dm->Comm, iwn.V);
|
||||
giwn.A=sumReduce( Dm->Comm, iwn.A);
|
||||
giwn.H=sumReduce( Dm->Comm, iwn.H);
|
||||
giwn.X=sumReduce( Dm->Comm, iwn.X);
|
||||
giwn.V=Dm->Comm.sumReduce( iwn.V);
|
||||
giwn.A=Dm->Comm.sumReduce( iwn.A);
|
||||
giwn.H=Dm->Comm.sumReduce( iwn.H);
|
||||
giwn.X=Dm->Comm.sumReduce( iwn.X);
|
||||
// measure only the connected part
|
||||
iwnc.Nc = morph_i->MeasureConnectedPathway();
|
||||
iwnc.V = morph_i->V();
|
||||
iwnc.A = morph_i->A();
|
||||
iwnc.H = morph_i->H();
|
||||
iwnc.X = morph_i->X();
|
||||
giwnc.V=sumReduce( Dm->Comm, iwnc.V);
|
||||
giwnc.A=sumReduce( Dm->Comm, iwnc.A);
|
||||
giwnc.H=sumReduce( Dm->Comm, iwnc.H);
|
||||
giwnc.X=sumReduce( Dm->Comm, iwnc.X);
|
||||
giwnc.V=Dm->Comm.sumReduce( iwnc.V);
|
||||
giwnc.A=Dm->Comm.sumReduce( iwnc.A);
|
||||
giwnc.H=Dm->Comm.sumReduce( iwnc.H);
|
||||
giwnc.X=Dm->Comm.sumReduce( iwnc.X);
|
||||
giwnc.Nc = iwnc.Nc;
|
||||
|
||||
double vol_nc_bulk = 0.0;
|
||||
@@ -631,46 +631,46 @@ void SubPhase::Full(){
|
||||
}
|
||||
}
|
||||
|
||||
gnd.M=sumReduce( Dm->Comm, nd.M);
|
||||
gnd.Px=sumReduce( Dm->Comm, nd.Px);
|
||||
gnd.Py=sumReduce( Dm->Comm, nd.Py);
|
||||
gnd.Pz=sumReduce( Dm->Comm, nd.Pz);
|
||||
gnd.K=sumReduce( Dm->Comm, nd.K);
|
||||
gnd.M=Dm->Comm.sumReduce( nd.M);
|
||||
gnd.Px=Dm->Comm.sumReduce( nd.Px);
|
||||
gnd.Py=Dm->Comm.sumReduce( nd.Py);
|
||||
gnd.Pz=Dm->Comm.sumReduce( nd.Pz);
|
||||
gnd.K=Dm->Comm.sumReduce( nd.K);
|
||||
|
||||
gwd.M=sumReduce( Dm->Comm, wd.M);
|
||||
gwd.Px=sumReduce( Dm->Comm, wd.Px);
|
||||
gwd.Py=sumReduce( Dm->Comm, wd.Py);
|
||||
gwd.Pz=sumReduce( Dm->Comm, wd.Pz);
|
||||
gwd.K=sumReduce( Dm->Comm, wd.K);
|
||||
gwd.M=Dm->Comm.sumReduce( wd.M);
|
||||
gwd.Px=Dm->Comm.sumReduce( wd.Px);
|
||||
gwd.Py=Dm->Comm.sumReduce( wd.Py);
|
||||
gwd.Pz=Dm->Comm.sumReduce( wd.Pz);
|
||||
gwd.K=Dm->Comm.sumReduce( wd.K);
|
||||
|
||||
gnc.M=sumReduce( Dm->Comm, nc.M);
|
||||
gnc.Px=sumReduce( Dm->Comm, nc.Px);
|
||||
gnc.Py=sumReduce( Dm->Comm, nc.Py);
|
||||
gnc.Pz=sumReduce( Dm->Comm, nc.Pz);
|
||||
gnc.K=sumReduce( Dm->Comm, nc.K);
|
||||
gnc.M=Dm->Comm.sumReduce( nc.M);
|
||||
gnc.Px=Dm->Comm.sumReduce( nc.Px);
|
||||
gnc.Py=Dm->Comm.sumReduce( nc.Py);
|
||||
gnc.Pz=Dm->Comm.sumReduce( nc.Pz);
|
||||
gnc.K=Dm->Comm.sumReduce( nc.K);
|
||||
|
||||
gwc.M=sumReduce( Dm->Comm, wc.M);
|
||||
gwc.Px=sumReduce( Dm->Comm, wc.Px);
|
||||
gwc.Py=sumReduce( Dm->Comm, wc.Py);
|
||||
gwc.Pz=sumReduce( Dm->Comm, wc.Pz);
|
||||
gwc.K=sumReduce( Dm->Comm, wc.K);
|
||||
gwc.M=Dm->Comm.sumReduce( wc.M);
|
||||
gwc.Px=Dm->Comm.sumReduce( wc.Px);
|
||||
gwc.Py=Dm->Comm.sumReduce( wc.Py);
|
||||
gwc.Pz=Dm->Comm.sumReduce( wc.Pz);
|
||||
gwc.K=Dm->Comm.sumReduce( wc.K);
|
||||
|
||||
giwn.Mn=sumReduce( Dm->Comm, iwn.Mn);
|
||||
giwn.Pnx=sumReduce( Dm->Comm, iwn.Pnx);
|
||||
giwn.Pny=sumReduce( Dm->Comm, iwn.Pny);
|
||||
giwn.Pnz=sumReduce( Dm->Comm, iwn.Pnz);
|
||||
giwn.Kn=sumReduce( Dm->Comm, iwn.Kn);
|
||||
giwn.Mw=sumReduce( Dm->Comm, iwn.Mw);
|
||||
giwn.Pwx=sumReduce( Dm->Comm, iwn.Pwx);
|
||||
giwn.Pwy=sumReduce( Dm->Comm, iwn.Pwy);
|
||||
giwn.Pwz=sumReduce( Dm->Comm, iwn.Pwz);
|
||||
giwn.Kw=sumReduce( Dm->Comm, iwn.Kw);
|
||||
giwn.Mn=Dm->Comm.sumReduce( iwn.Mn);
|
||||
giwn.Pnx=Dm->Comm.sumReduce( iwn.Pnx);
|
||||
giwn.Pny=Dm->Comm.sumReduce( iwn.Pny);
|
||||
giwn.Pnz=Dm->Comm.sumReduce( iwn.Pnz);
|
||||
giwn.Kn=Dm->Comm.sumReduce( iwn.Kn);
|
||||
giwn.Mw=Dm->Comm.sumReduce( iwn.Mw);
|
||||
giwn.Pwx=Dm->Comm.sumReduce( iwn.Pwx);
|
||||
giwn.Pwy=Dm->Comm.sumReduce( iwn.Pwy);
|
||||
giwn.Pwz=Dm->Comm.sumReduce( iwn.Pwz);
|
||||
giwn.Kw=Dm->Comm.sumReduce( iwn.Kw);
|
||||
|
||||
// pressure averaging
|
||||
gnc.p=sumReduce( Dm->Comm, nc.p);
|
||||
gnd.p=sumReduce( Dm->Comm, nd.p);
|
||||
gwc.p=sumReduce( Dm->Comm, wc.p);
|
||||
gwd.p=sumReduce( Dm->Comm, wd.p);
|
||||
gnc.p=Dm->Comm.sumReduce( nc.p);
|
||||
gnd.p=Dm->Comm.sumReduce( nd.p);
|
||||
gwc.p=Dm->Comm.sumReduce( wc.p);
|
||||
gwd.p=Dm->Comm.sumReduce( wd.p);
|
||||
|
||||
if (vol_wc_bulk > 0.0)
|
||||
wc.p = wc.p /vol_wc_bulk;
|
||||
@@ -681,10 +681,10 @@ void SubPhase::Full(){
|
||||
if (vol_nd_bulk > 0.0)
|
||||
nd.p = nd.p /vol_nd_bulk;
|
||||
|
||||
vol_wc_bulk=sumReduce( Dm->Comm, vol_wc_bulk);
|
||||
vol_wd_bulk=sumReduce( Dm->Comm, vol_wd_bulk);
|
||||
vol_nc_bulk=sumReduce( Dm->Comm, vol_nc_bulk);
|
||||
vol_nd_bulk=sumReduce( Dm->Comm, vol_nd_bulk);
|
||||
vol_wc_bulk=Dm->Comm.sumReduce( vol_wc_bulk);
|
||||
vol_wd_bulk=Dm->Comm.sumReduce( vol_wd_bulk);
|
||||
vol_nc_bulk=Dm->Comm.sumReduce( vol_nc_bulk);
|
||||
vol_nd_bulk=Dm->Comm.sumReduce( vol_nd_bulk);
|
||||
|
||||
if (vol_wc_bulk > 0.0)
|
||||
gwc.p = gwc.p /vol_wc_bulk;
|
||||
|
||||
Reference in new issue
Block a user