Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion applications/SingleLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void run( int argc, char* argv[] )
app.run( exec_space(), db, grid, beam, fd );

// Write the temperature data used by ExaCA/other post-processing
app.writeSolidificationData( grid.getComm() );
app.writeSolidificationData( db.sampling, grid.getComm() );
app.getLowerSolidificationDataBounds( grid.getComm() );
app.getUpperSolidificationDataBounds( grid.getComm() );
}
Expand Down
4 changes: 2 additions & 2 deletions src/Finch_Run.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ class Layer

auto getSolidificationData() { return solidification_data_.get(); }

auto writeSolidificationData( MPI_Comm comm )
auto writeSolidificationData( Sampling sampling_inputs, MPI_Comm comm )
{
return solidification_data_.write( comm );
return solidification_data_.write( sampling_inputs, comm );
}

[[deprecated( "Use of getLowerSolidificationDataBounds() without a "
Expand Down
15 changes: 6 additions & 9 deletions src/Finch_SolidificationData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ class SolidificationData
private:
// Needed for file output
int mpi_rank_;
std::string folder_name_;
double liquidus_;
double dt_;
double cell_size_;
bool enabled_;
std::string format_;

view_int count;

Expand All @@ -72,12 +70,10 @@ class SolidificationData
// constructor
SolidificationData( const Inputs& inputs, Grid<memory_space>& grid )
: mpi_rank_( grid.comm_rank )
, folder_name_( inputs.sampling.directory_name )
, liquidus_( inputs.properties.liquidus )
, dt_( inputs.time.time_step )
, cell_size_( inputs.space.cell_size )
, enabled_( inputs.sampling.enabled )
, format_( inputs.sampling.format )
{
count = view_int( "count", 1 );

Expand Down Expand Up @@ -224,7 +220,7 @@ class SolidificationData
}

// Write the solidification data to separate files for each MPI rank
void write( MPI_Comm comm )
void write( Sampling sampling_inputs, MPI_Comm comm )
{
if ( !enabled_ )
{
Expand All @@ -241,13 +237,14 @@ class SolidificationData
Kokkos::create_mirror_view_and_copy( Kokkos::HostSpace(), count );

// create directory is not present, otherwise overwrite existing files
if ( mkdir( folder_name_.c_str(), 0777 ) != -1 )
if ( mkdir( sampling_inputs.directory_name.c_str(), 0777 ) != -1 )
{
std::cout << "Creating directory: " << folder_name_ << std::endl;
std::cout << "Creating directory: "
<< sampling_inputs.directory_name << std::endl;
}

std::ofstream fout;
std::string filename( folder_name_ + "/data_" +
std::string filename( sampling_inputs.directory_name + "/data_" +
std::to_string( mpi_rank_ ) + ".csv" );

fout.open( filename );
Expand All @@ -259,7 +256,7 @@ class SolidificationData
<< events_host( n, 2 ) << "," << events_host( n, 3 ) << ","
<< events_host( n, 4 ) << "," << events_host( n, 5 );

if ( format_ == "default" )
if ( sampling_inputs.format == "default" )
{
fout << "," << events_host( n, 6 ) << "," << events_host( n, 7 )
<< "," << events_host( n, 8 );
Expand Down