Skip to content

TheochemUI/fortran_cuh2_src

Repository files navigation

fortcuh2: Copper-Hydrogen EAM Potential

Introduction

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.

Integration Instructions

meson subproject

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.2

Then, 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.

CMake

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)

Development and Testing

The project provides a test runner (tmp_run) that processes tmp.con to compute energy and forces.

System

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

meson setup bbdir
meson compile -C bbdir
❯ ./bbdir/tmp_run
 Energy   -697.31345026617748     
 Max Force  0.20293019483774868 

cmake

cmake -S . -B build \
      -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
❯ ./build/tmp_run
 Energy   -697.31345026617748     
 Max Force  0.20293019483774868 

File I/O integrations

By default all the executables will generate an energy.out and a forces.out file:

cat energy.out
-697.31345026617748
cat forces.out
# too long

License

This software carries the BSD 3-Clause License.

About

Fortran source for a Copper Hydrogen potential

Resources

License

Stars

Watchers

Forks

Packages

No packages published