This repository contains the Fortran source for a Copper-Hydrogen potential from the Jonsson group, extracted from eOn.
It implements the Embedded Atom Method (EAM) for physical chemistry simulations. The project provides C-bindings for integration into broader simulation packages.
To include this potential in a Meson project, create subprojects/fortcuh2.wrap:
[wrap-git]
directory = fortcuh2
url = https://github.com/TheochemUI/fortran_cuh2_src.git
revision = v0.0.2Then, add these lines to your meson.build to link the dependency:
# --------------------- Subprojects
fortcuh2_proj = subproject('fortcuh2')
fortcuh2_dep = fortcuh2_proj.get_variable('fortcuh2_dep')
_deps += [fortcuh2_dep]See potlib as an example.
For CMake projects, use the following pattern in your CMakeLists.txt:
include(FetchContent)
FetchContent_Declare(
fortcuh2
GIT_REPOSITORY https://github.com/TheochemUI/fortran_cuh2_src.git
GIT_TAG v0.0.2
)
FetchContent_MakeAvailable(fortcuh2)
# Link to your application
target_link_libraries(your_target PRIVATE fortcuh2)The project provides a test runner (tmp_run) that processes tmp.con to
compute energy and forces.
The simplest setup for this project:
gfortran eamroutines.f90 eam_dat.f90 eam_isoc.f90 main.f90 -o cuh2f
./cuh2f
❯ ./cuh2f
Energy -697.31345026617748
Max Force 0.20293019483774868 meson setup bbdir
meson compile -C bbdir
❯ ./bbdir/tmp_run
Energy -697.31345026617748
Max Force 0.20293019483774868 cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release
cmake --build build -j
❯ ./build/tmp_run
Energy -697.31345026617748
Max Force 0.20293019483774868 By default all the executables will generate an energy.out and a forces.out file:
cat energy.out
-697.31345026617748
cat forces.out
# too longThis software carries the BSD 3-Clause License.