5#include <vtkSmartPointer.h>
6#include <vtkUnstructuredGrid.h>
7#include <vtkXMLUnstructuredGridReader.h>
9#include <vtkInformation.h>
14#define ErrorReadingFile(fname) \
15 std::runtime_error("Failed to open file: " + options.file_name + \
16 " in call to " + #fname + ".")
37 reader->SetFileName(options.
file_name.c_str());
39 if (not reader->CanReadFile(options.
file_name.c_str()))
40 throw std::logic_error(
"Unable to read file-type with this routine");
41 reader->UpdateInformation();
48 std::vector<vtkUGridPtrAndName> grid_blocks = {{ugrid_main,
""}};
53 std::vector<vtkUGridPtrAndName> domain_grid_blocks =
55 std::vector<vtkUGridPtrAndName> bndry_grid_blocks =
72 switch (max_dimension)
LogStream Log(LOG_LVL level=LOG_0)
void ComputeCentroidsAndCheckQuality()
vtkSmartPointer< vtkUnstructuredGrid > vtkUGridPtr
void ReadFromVTU(const Options &options)
void BuildMeshConnectivity()
void CopyUGridCellsAndPoints(vtkUnstructuredGrid &ugrid, double scale, int dimension_to_copy)
void SetMaterialIDsFromList(const std::vector< int > &material_ids)
MeshAttributes attributes_
std::vector< int > BuildCellMaterialIDsFromField(vtkUGridPtr &ugrid, const std::string &field_name, const std::string &file_name)
vtkUGridPtr ConsolidateGridBlocks(std::vector< vtkUGridPtrAndName > &ugrid_blocks, const std::string &block_id_array_name="BlockID")
int FindHighestDimension(std::vector< vtkUGridPtrAndName > &ugrid_blocks)
std::vector< vtkUGridPtrAndName > GetBlocksOfDesiredDimension(std::vector< vtkUGridPtrAndName > &ugrid_blocks, int desired_dimension)
std::string material_id_fieldname
#define ErrorReadingFile(fname)