-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 463 -- Making header files configuration files #467
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Issue 451 - Updated the OpenMP tests
…cfem_setup.hpp also a configuration file
… of constants.h and specfem_setup.hpp
…h etc. are now being configured in the build directory, keeping the src directory clean.
…y. mehsfem2d/3d can also build standalone now. including configuration
icui
approved these changes
Feb 13, 2025
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR tracks progress towards seemless definition of floating point or double precision
computation as part of
meshfem2d
/-3d
andspecfempp
.The use can now specify
during the configuration and the adjustments are propagated throughout the code.
Why?
Currently, all *.h files in meshfem2d/meshfem3d as well as the specfem_setup.hpp were hard coded. This has led to inconsistency in the binary IO (see #465).
While
xmeshfem2D
andxmeshfem3D
are only writing double precision values to the binary files,xgenerate_databases
writes base onCUSTOM_REAL
that is usually defined within the configuration ofSPECFEM2D/3D/3D_GLOBE
.This required quite a bit of change in the IO related functions and the cmake compilation.
What needed to change?
TODO:
include/specfem_setup.hpp
fromsetup/specfem_setup.hpp.in
via CMakeinclude/constants.hpp
fromsetup/constants.hpp.in
via CMakefortran/meshfem2d/*.h
fromfortran/meshfem2d/setup*.h.in
via CMakefortran/meshfem3d/setup/*.h
fromfortran/meshfem3d/setup*.h.in
via CMakesrc/IO/fortranio/fortran_io.cpp
to read "old" mesh files correctly.fortran_read_value(type_real *value, ...)
indicated that the readable input isalways dependent on specfempp's definition of type_real, when in reality meshfem2d
only writes double precision values, and
fortran_read_value(type_real *value, ...)
reads a double and converts it type_real. Not great.
fortran_read_value(float *value, ...)
fortran_read_value(double *value, ...)
read_2d_mesh
functions to explicitly read double precision valuesand then convert them into
type_real
after the fact.specfem::testing::array2d/3d
)that invoked
type_real
reads to readdouble
s instead.The most difficult part of this was figuring out how to create the
config.h
files. Part of which I'm not 100% confident whether it is required, but it works. Please see thefortran/meshfem?d/setup/config.h.in
and the correspondingfortran/meshfem?d/setup/CMakeLists.txt
for generation of the necessary files.Issue Number
Closes #463
Closes #465
Checklist
Please make sure to check developer documentation on specfem docs.