OGS
anonymous_namespace{CreateOutput.cpp} Namespace Reference

Functions

int convertVtkDataMode (std::string_view const &data_mode)
 
bool areOutputNamesUnique (std::vector< ProcessLib::Output > const &outputs)
 

Function Documentation

◆ areOutputNamesUnique()

bool anonymous_namespace{CreateOutput.cpp}::areOutputNamesUnique ( std::vector< ProcessLib::Output > const & outputs)

Definition at line 44 of file CreateOutput.cpp.

45{
46 std::vector<std::string> output_names;
47 for (auto const& output : outputs)
48 {
49 auto output_mesh_names = output.getFileNamesForOutput();
50 output_names.insert(output_names.end(), output_mesh_names.begin(),
51 output_mesh_names.end());
52 }
53 std::sort(output_names.begin(), output_names.end());
54 auto const last = std::unique(output_names.begin(), output_names.end());
55 return last == output_names.end();
56}

◆ convertVtkDataMode()

int anonymous_namespace{CreateOutput.cpp}::convertVtkDataMode ( std::string_view const & data_mode)

Converts a vtkXMLWriter's data mode string to an int. See OutputVTKFormat::data_mode.

Definition at line 27 of file CreateOutput.cpp.

28{
29 using namespace std::string_view_literals;
30 constexpr std::array data_mode_lookup_table{"Ascii"sv, "Binary"sv,
31 "Appended"sv};
32 auto res = ranges::find(begin(data_mode_lookup_table),
33 end(data_mode_lookup_table), data_mode);
34 if (res == data_mode_lookup_table.end())
35 {
37 "Unsupported vtk output file data mode '{:s}'. Expected Ascii, "
38 "Binary, or Appended.",
39 data_mode);
40 }
41 return static_cast<int>(std::distance(begin(data_mode_lookup_table), res));
42}
#define OGS_FATAL(...)
Definition Error.h:26

References OGS_FATAL.