Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/functions/optics/permittivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ void CalcOptPermit::at_k(FracCoord k_frac) {


void CalcOptPermit::save_data() {
// Only the root rank output data!
if (!UtilsMPI::i_am_root_rank()) return;
// Check and prepare
UtilsMisc::check_output_directory_is_ok();
std::ofstream outputFile(PERMITTIVITY_OUT);
// Check if the file open with no error
if (!outputFile) UtilsMPI::Abort() << "Fail to create the output file.";
// Only the root rank output data!
if (!UtilsMPI::i_am_root_rank()) return;
// Write the data to file
for (size_t i_w=0; i_w<omega_num; ++i_w) {
outputFile << omega_list[i_w] << " " << global_optics_values[i_w].real() << " " << global_optics_values[i_w].imag() << std::endl;
Expand Down