Skip to content

Commit

Permalink
Added Free surface
Browse files Browse the repository at this point in the history
  • Loading branch information
lsawade committed Feb 21, 2025
1 parent e1e98bc commit fee63b1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/IO/fortranio/fortran_io.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ void fortran_read_line(std::ifstream &stream, Args... values) {
} catch (const std::exception &e) {
std::ostringstream error_message;
error_message << "Error reading fortran line with buffer length: "
<< buffer_length << "\n"
<< e.what() << "(" << __FILE__ << ":" << __LINE__ << ")";
throw std::runtime_error(error_message.str());
}
Expand Down
11 changes: 11 additions & 0 deletions src/IO/mesh/impl/fortran/dim3/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,12 @@ specfem::IO::read_3d_mesh(const std::string mesh_parameters_file,
#endif
}

// Read the number of free surface faces
int num_free_surface_faces;
try_read_line("num_free_surface_faces", stream, &num_free_surface_faces);
check_values("num_free_surface_faces", num_free_surface_faces,
mesh.parameters.num_free_surface_faces);

// Create the free surface object
mesh.free_surface =
specfem::mesh::free_surface<specfem::dimension::type::dim3>(
Expand All @@ -421,6 +427,11 @@ specfem::IO::read_3d_mesh(const std::string mesh_parameters_file,
mesh.free_surface.jacobian2Dw);
try_read_array("free_surface_normal", stream, mesh.free_surface.normal);

#ifndef NDEBUG
// Print the free surface
mesh.free_surface.print();
#endif

stream.close();

return mesh;
Expand Down

0 comments on commit fee63b1

Please sign in to comment.