Commit 6193e48d authored by gbalduzz's avatar gbalduzz
Browse files

output format fixup

parent e815c2bc
Loading
Loading
Loading
Loading
+5 −22
Original line number Diff line number Diff line
@@ -366,19 +366,6 @@ template <class Parameters>
void DcaData<Parameters>::write(std::string file_name) {
  std::cout << "\n\n\t\t start writing " << file_name << "\n\n";

  const std::string& output_format = parameters_.get_output_format();

  if (output_format == static_cast<const std::string>("JSON")) {
    dca::io::JSONWriter writer;
    writer.open_file(file_name);

    parameters_.write(writer);
    this->write(writer);

    writer.close_file();
  }

  else if (output_format == static_cast<const std::string>("HDF5")) {
  dca::io::HDF5Writer writer;
  writer.open_file(file_name);

@@ -388,10 +375,6 @@ void DcaData<Parameters>::write(std::string file_name) {
  writer.close_file();
}

  else
    throw std::logic_error(__FUNCTION__);
}

template <class Parameters>
template <typename Writer>
void DcaData<Parameters>::write(Writer& writer) {
+15 −39
Original line number Diff line number Diff line
@@ -263,26 +263,6 @@ void EDClusterSolver<device_t, parameters_type, MOMS_type>::finalize(
template <dca::linalg::DeviceType device_t, class parameters_type, class MOMS_type>
void EDClusterSolver<device_t, parameters_type, MOMS_type>::write(std::string file_name) {
  std::cout << "\n\n\t\t start writing " << file_name << "\n\n";

  const std::string& output_format = parameters.get_output_format();

  if (output_format == "JSON") {
    dca::io::JSONWriter writer;
    writer.open_file(file_name);

    parameters.write(writer);
    MOMS_imag.write(writer);
    MOMS_real.write(writer);

    if (parameters.isAccumulatingG4()) {
      std::cout << "\n\n\t\t start writing tp-Greens-function\n\n";
      tp_Greens_function_obj.write(writer);
    }

    writer.close_file();
  }

  else if (output_format == "HDF5") {
  dca::io::HDF5Writer writer;
  writer.open_file(file_name);

@@ -303,12 +283,8 @@ void EDClusterSolver<device_t, parameters_type, MOMS_type>::write(std::string fi
  writer.close_file();
}

  else
    throw std::logic_error(__FUNCTION__);
}

}  // solver
}  // phys
}  // dca
}  // namespace solver
}  // namespace phys
}  // namespace dca

#endif  // DCA_PHYS_DCA_STEP_CLUSTER_SOLVER_EXACT_DIAGONALIZATION_ADVANCED_ED_CLUSTER_SOLVER_HPP