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
11 changes: 8 additions & 3 deletions lib/mito/io/summit/MeshSummitWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ namespace mito::io {
public:
// constructor
MeshSummitWriter(
std::string filename, const mesh_type & mesh, const coord_system_type & coord_system) :
std::string filename, const mesh_type & mesh, const coord_system_type & coord_system,
std::string element_type) :
Writer(filename),
_mesh(mesh),
_coord_system(coord_system),
_points()
_points(),
_element_type(element_type)
{
// index assigned to each point (start counting from 1, summit mesh convention)
auto index = 1;
Expand Down Expand Up @@ -93,7 +95,7 @@ namespace mito::io {
outfile << _points.at(node->point()) << " ";
}
// TOFIX: material label is always 1 for now
outfile << 1 << std::endl;
outfile << 1 << " " << _element_type << std::endl;
}

// close the file
Expand All @@ -112,6 +114,9 @@ namespace mito::io {

// a collection of points in the mesh
points_type _points;

// the type of element
std::string _element_type;
};

} // namespace mito::io
Expand Down
5 changes: 3 additions & 2 deletions lib/mito/io/summit/writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ namespace mito::io::summit {
requires(utilities::same_dim_c<cellT, coordT>)
auto writer(
std::string filename, const mito::mesh::mesh_t<cellT> & mesh,
const geometry::coordinate_system_t<coordT> & coordinate_system) -> void
const geometry::coordinate_system_t<coordT> & coordinate_system,
std::string element_type = "") -> void
{
// create a writer
auto mesh_writer = mesh_writer_t(filename, mesh, coordinate_system);
auto mesh_writer = mesh_writer_t(filename, mesh, coordinate_system, element_type);
// write
return mesh_writer.write();
}
Expand Down
Loading