fix issue with vis db

This commit is contained in:
James E McClure 2019-09-18 09:26:22 -04:00
commit 645e76f13b
2 changed files with 16 additions and 9 deletions

View File

@ -167,8 +167,8 @@ void SubPhase::Basic(){
// If inlet/outlet layers exist use these as default // If inlet/outlet layers exist use these as default
if (Dm->inlet_layers_x > 0) imin = Dm->inlet_layers_x; if (Dm->inlet_layers_x > 0) imin = Dm->inlet_layers_x;
if (Dm->inlet_layers_y > 0) jmin = Dm->inlet_layers_y; if (Dm->inlet_layers_y > 0) jmin = Dm->inlet_layers_y;
if (Dm->inlet_layers_z > 0) kmin = Dm->inlet_layers_z; if (Dm->inlet_layers_z > 0 && Dm->kproc() == 0) kmin += Dm->inlet_layers_z;
if (Dm->outlet_layers_z > 0) kmax = Dm->outlet_layers_z; if (Dm->outlet_layers_z > 0 && Dm->kproc() == Dm->nprocz()-1) kmax -= Dm->outlet_layers_z;
nb.reset(); wb.reset(); nb.reset(); wb.reset();
@ -246,9 +246,15 @@ void SubPhase::Basic(){
count_w=sumReduce( Dm->Comm, count_w); count_w=sumReduce( Dm->Comm, count_w);
count_n=sumReduce( Dm->Comm, count_n); count_n=sumReduce( Dm->Comm, count_n);
gwb.p=sumReduce( Dm->Comm, wb.p) / count_w; if (count_w > 0.0)
gnb.p=sumReduce( Dm->Comm, nb.p) / count_n; gwb.p=sumReduce( Dm->Comm, wb.p) / count_w;
else
gwb.p = 0.0;
if (count_n > 0.0)
gnb.p=sumReduce( Dm->Comm, nb.p) / count_n;
else
gnb.p = 0.0;
// check for NaN // check for NaN
bool err=false; bool err=false;
if (gwb.V != gwb.V) err=true; if (gwb.V != gwb.V) err=true;
@ -364,7 +370,8 @@ void SubPhase::Full(){
// If inlet layers exist use these as default // If inlet layers exist use these as default
if (Dm->inlet_layers_x > 0) imin = Dm->inlet_layers_x; if (Dm->inlet_layers_x > 0) imin = Dm->inlet_layers_x;
if (Dm->inlet_layers_y > 0) jmin = Dm->inlet_layers_y; if (Dm->inlet_layers_y > 0) jmin = Dm->inlet_layers_y;
if (Dm->inlet_layers_z > 0) kmin = Dm->inlet_layers_z; if (Dm->inlet_layers_z > 0 && Dm->kproc() == 0) kmin += Dm->inlet_layers_z;
if (Dm->outlet_layers_z > 0 && Dm->kproc() == Dm->nprocz()-1) kmax -= Dm->outlet_layers_z;
nd.reset(); nc.reset(); wd.reset(); wc.reset(); iwn.reset(); iwnc.reset(); nd.reset(); nc.reset(); wd.reset(); wc.reset(); iwn.reset(); iwnc.reset();

View File

@ -218,7 +218,7 @@ public:
auto color_db = input_db->getDatabase( "Color" ); auto color_db = input_db->getDatabase( "Color" );
auto vis_db = input_db->getDatabase( "Visualization" ); auto vis_db = input_db->getDatabase( "Visualization" );
int timestep = color_db->getWithDefault<int>( "timestep", 0 ); int timestep = color_db->getWithDefault<int>( "timestep", 0 );
PROFILE_START("Save Vis",1); PROFILE_START("Save Vis",1);
if (vis_db->getWithDefault<bool>( "save_phase_field", true )){ if (vis_db->getWithDefault<bool>( "save_phase_field", true )){
@ -941,7 +941,7 @@ void runAnalysis::basic( std::shared_ptr<Database> input_db, SubPhase &Averages,
// Check which analysis steps we need to perform // Check which analysis steps we need to perform
auto color_db = input_db->getDatabase( "Color" ); auto color_db = input_db->getDatabase( "Color" );
auto vis_db = input_db->getDatabase( "Visualization" ); //auto vis_db = input_db->getDatabase( "Visualization" );
int timestep = color_db->getWithDefault<int>( "timestep", 0 ); int timestep = color_db->getWithDefault<int>( "timestep", 0 );
auto type = computeAnalysisType( timestep ); auto type = computeAnalysisType( timestep );
@ -1028,7 +1028,7 @@ void runAnalysis::basic( std::shared_ptr<Database> input_db, SubPhase &Averages,
if (timestep%d_visualization_interval==0){ if (timestep%d_visualization_interval==0){
// Write the vis files // Write the vis files
auto work = new IOWorkItem( vis_db, d_meshData, Averages, d_fillData, getComm() ); auto work = new IOWorkItem( input_db, d_meshData, Averages, d_fillData, getComm() );
work->add_dependency(d_wait_analysis); work->add_dependency(d_wait_analysis);
work->add_dependency(d_wait_subphase); work->add_dependency(d_wait_subphase);
work->add_dependency(d_wait_vis); work->add_dependency(d_wait_vis);