Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
566dc8e
Add multiplier method
nedtaylor Aug 15, 2024
621d9eb
Add explicit type and limits
nedtaylor Aug 15, 2024
4215098
Remove associate
nedtaylor Aug 15, 2024
942f148
Fix associate
nedtaylor Aug 15, 2024
6779f7f
Set up multipler evaluator method
nedtaylor Aug 16, 2024
f56a090
Make lowtol and uptol variables
nedtaylor Aug 16, 2024
bdd89f7
Add property getter to allocate_species
nedtaylor Aug 16, 2024
389be9c
Fix example rangle
nedtaylor Aug 16, 2024
525015e
Allocate pair_index
nedtaylor Aug 16, 2024
bf6fbfd
Fix default bond radius
nedtaylor Aug 16, 2024
bb925b3
Fix defaults
nedtaylor Aug 16, 2024
d067219
Add graphite
nedtaylor Aug 16, 2024
94e0562
Allow handling of basis_type extended types
nedtaylor Aug 16, 2024
4c3b26e
Fix association
nedtaylor Aug 16, 2024
07d119d
Update test cases
nedtaylor Aug 16, 2024
8ad1e43
Fix counting of bonds
nedtaylor Aug 17, 2024
a2b4f7c
Fix unit cell inclusion
nedtaylor Aug 17, 2024
87ffdaa
Add value checks
nedtaylor Aug 17, 2024
c474c98
Centre grid
nedtaylor Aug 17, 2024
565c06e
Convert to using get_viable_gridpoints procedure
nedtaylor Aug 17, 2024
fb4e748
Add grid shift
nedtaylor Aug 17, 2024
a15c452
Fix array temporary
nedtaylor Aug 17, 2024
5508d35
Increase default width and sigma
nedtaylor Aug 17, 2024
5a8e25a
Get seed if not provided
nedtaylor Aug 17, 2024
bc1a2e6
Use cartesian coordinates
nedtaylor Aug 17, 2024
b220f38
Fix angle point order
nedtaylor Aug 17, 2024
76e64c0
Set 3-body upper distance tolerance to 2.5
nedtaylor Aug 18, 2024
089f3eb
Remove commented line
nedtaylor Aug 18, 2024
5bc64c2
Improve error printing
nedtaylor Aug 18, 2024
1135d2f
Add new example
nedtaylor Aug 18, 2024
01eb343
Add function width setting
nedtaylor Aug 18, 2024
a0510cc
Update size
nedtaylor Aug 18, 2024
2ac1e86
Fix lattice order
nedtaylor Aug 19, 2024
d71b755
Add more test cases
nedtaylor Aug 19, 2024
39568ab
Update grid handling
nedtaylor Aug 20, 2024
e414098
Add new host
nedtaylor Aug 20, 2024
e07ebca
Shift host basis
nedtaylor Aug 20, 2024
e06cc7e
Handle grid offset
nedtaylor Aug 20, 2024
4c37a7e
Set default basis name
nedtaylor Aug 20, 2024
12600d2
Fix missing grid_offset handling
nedtaylor Aug 20, 2024
cc18e57
Make ignore_list optional
nedtaylor Aug 23, 2024
3295779
Optimise distribution function calculator
nedtaylor Aug 23, 2024
20dbd66
Add comments
nedtaylor Aug 23, 2024
5e4c458
Add comments
nedtaylor Aug 23, 2024
a8dd280
Fix 4-body do concurrent
nedtaylor Aug 23, 2024
d86449e
Fix basis extension cutoff
nedtaylor Aug 23, 2024
ee2b29c
Add comments
nedtaylor Aug 23, 2024
af066f1
Add comments
nedtaylor Aug 23, 2024
db27653
Improve comments
nedtaylor Aug 23, 2024
dbe9ff6
Improve comments
nedtaylor Aug 23, 2024
80e3392
Update README
nedtaylor Aug 23, 2024
b53e14f
Fix indentation
nedtaylor Aug 23, 2024
e1e6a6c
Add comments
nedtaylor Aug 23, 2024
77caed9
Add comments
nedtaylor Aug 23, 2024
6c082d8
Add set difference procedure
nedtaylor Sep 5, 2024
5b1f3d0
Add kbT scaling
nedtaylor Sep 5, 2024
0690457
Handle normalisation zero division
nedtaylor Sep 5, 2024
a18581d
Handle normalisation zero division
nedtaylor Sep 5, 2024
778eb6a
Combine distributino functions using set difference
nedtaylor Sep 5, 2024
5bd4222
Move weight scale to inside set difference
nedtaylor Sep 5, 2024
a7f1199
Handle kbT in wrapper
nedtaylor Sep 6, 2024
f8a1510
Remove incorrect renormalisation
nedtaylor Sep 6, 2024
b0a9c82
Change kbT name for python
nedtaylor Sep 6, 2024
b4f1abc
Fix array temporaries
nedtaylor Sep 6, 2024
2535bf3
Add local power law
nedtaylor Sep 6, 2024
07b8482
Update test
nedtaylor Sep 6, 2024
0187d36
Remove unnecessary comments
nedtaylor Sep 6, 2024
3ccad73
Update examples
nedtaylor Sep 6, 2024
ae656e1
Improve atom handling
nedtaylor Sep 6, 2024
97ed277
Fix update_images procedure
nedtaylor Sep 6, 2024
cf3d845
Add viability default
nedtaylor Sep 6, 2024
ed7d9e2
Add image testing
nedtaylor Sep 6, 2024
bbedfbf
Use offset
nedtaylor Sep 6, 2024
4a253a3
Change kbT default
nedtaylor Sep 6, 2024
28ea6b9
Add unit test
nedtaylor Sep 7, 2024
4ad677d
Add error handling
nedtaylor Sep 7, 2024
c91482f
Fix indentation
nedtaylor Sep 7, 2024
cfd1d70
Add normalisation deallocation
nedtaylor Sep 7, 2024
06ebce4
Remove unused files
nedtaylor Sep 7, 2024
0ce2c16
Fix allocated check
nedtaylor Sep 7, 2024
ffa9847
Change host
nedtaylor Sep 7, 2024
1092ac3
Add brew gcov installation handling
nedtaylor Sep 7, 2024
1ace634
Update ignore list
nedtaylor Sep 7, 2024
01ce153
Add uniform error handling
nedtaylor Sep 7, 2024
c3f8f73
Add evolver test
nedtaylor Sep 7, 2024
1c7e332
Update evolver to use uniform error handling
nedtaylor Sep 7, 2024
d8d782c
Add unit test
nedtaylor Sep 7, 2024
6c61e1b
Add implicit none
nedtaylor Sep 7, 2024
290049b
Add default handling
nedtaylor Sep 7, 2024
a13a0e2
Add unit tests
nedtaylor Sep 7, 2024
2f2e0f9
Add unit tests
nedtaylor Sep 7, 2024
5be4a98
Add unit test
nedtaylor Sep 7, 2024
41a7a48
Fix printing
nedtaylor Sep 7, 2024
21eb85c
Remove blank line
nedtaylor Sep 7, 2024
622ecfc
Add unit tests
nedtaylor Sep 7, 2024
2104252
Fix printing
nedtaylor Sep 7, 2024
5c93ad0
Add unit tests
nedtaylor Sep 7, 2024
03d1c43
Fix quicksort duplicate catching
nedtaylor Sep 7, 2024
0c3c2c2
Improve optional argument handling
nedtaylor Sep 7, 2024
20630d2
Add unit tests
nedtaylor Sep 7, 2024
dd63bb0
Add unit tests
nedtaylor Sep 7, 2024
8fed760
Add unit tests
nedtaylor Sep 8, 2024
0770854
Fix plane projection cycling
nedtaylor Sep 8, 2024
a4e6ddb
Add unit tests
nedtaylor Sep 8, 2024
a504338
Fix grid offset in void method
nedtaylor Sep 8, 2024
44f17fe
Fix comments
nedtaylor Sep 8, 2024
579b4b6
Add grid offset
nedtaylor Sep 8, 2024
506f78d
Remove commented sections
nedtaylor Sep 8, 2024
ee31ca3
Add unit tests
nedtaylor Sep 8, 2024
c718448
Remove unused variables
nedtaylor Sep 8, 2024
093b274
Add unit tests
nedtaylor Sep 8, 2024
a742ae5
Reformat variables
nedtaylor Sep 8, 2024
5eb0163
Use custom error handling
nedtaylor Sep 8, 2024
6a414cb
Remove debug printing
nedtaylor Sep 8, 2024
6b05106
Replace unused host example files
nedtaylor Sep 9, 2024
2715b05
Rename example
nedtaylor Sep 9, 2024
6626796
Add separate graphite example
nedtaylor Sep 9, 2024
93143cc
Use custom error handling
nedtaylor Sep 9, 2024
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ settings.json
example/example_files/database*
**/POSCAR*
iteration/
*.traj
*.traj
*.png
*.param
fort.*
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ set(FORTRAN_SRC_DIR ${SRC_DIR}/fortran)
set(LIB_DIR ${FORTRAN_SRC_DIR}/lib)

set(LIB_FILES
mod_error_handling.f90
mod_constants.f90
mod_misc.f90
mod_misc_maths.f90
Expand Down
64 changes: 51 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,67 @@ Then, the path to the install directory (`${HOME}/.local/raffle`) needs to be ad

### Fortran

For Fortran, CMake is required (fpm in the future, hopefully). The Python library installation can be turned off.
For Fortran, either fpm or cmake are required.

#### fpm

fpm installation is as follows:

```
mkdir build
cd build
cmake -DBUILD_PYTHON=Off ..
make install
fpm build --profile release
```

This is a quick how-to guide for using RAFFLE.
This will install both the Fortran library and the Fortran application for RAFFLE.
The library can then be called from other fpm-built Fortran programs through normal means (usually referencing the location of RAFFLE in the program's own `fpm.toml` file).
The application can be run using **(NOTE: The application is not a priority for development, so is less likely to work)**:
```
fpm run
```

First, compile using
```
make
The library can be tested to ensure compilation was successful **(NOTE: Unit tests currently only provide minimal code coverage)**:
```
fpm test --profile release
```

## Using
#### cmake

First, you need to ensure that the following file exists in the directory in which you run RAFFLE:
cmake installation is as follows:
```
mkdir build
cd build
cmake [-DBUILD_PYTHON=Off] ..
make install
```
chem.in
The optional filed (dentoted with `[...]`) can be used to turn off installation of the Python library.
This will build the library in the build/ directory. All library files will then be found in:
```
${HOME}/.local/raffle
```
Inside this directory, the following files will be generated:
```
include/raffle.mod
lib/libraffle.a
```

To check whether RAFFLE has installed correctly and that the compilation works as expected, the following command can be run:
```
ctest
```
This runs the unit tests (found in the `test` directory) to ensure procedures output as expected.


## Examples

After the library has been installed, a set of example programs can be found in the `example` directory (note, the `test` directory is for unit tests to ensure each procedure in the library produces expected outputs after compilation, they are not really needed to be looked at by potential users).

The `example/executable` example uses a shell script to run the Fortran installed application.
It uses a user-editable input file `param.in` in the same directory to change values of the RAFFLE generator and provided database.

The `example/wrapper` directory contains a set of `run_*.py` files that show how RAFFLE can be called using Python to implement it into existing random structure search workflows.
These examples are the recommended ones to run.
To successfully run them, follow the above installation instructions for Python, then go to the `example/wrapper` directory and run one of the scripts.


Each of these files should follow the format found in the current repository. They should each have a header line that starts with "#" and contains the word "element". The example headers should then be followed for filling in data. For the elements.dat, the energy provided can be whatever you want to use as a reference energy. This energy is used for calculating formation energy. The example uses energy/atom of the bulk phase of the element.
<!--
Next, after the code is compiled, the way to run it is as follows:
```
Expand Down
8 changes: 5 additions & 3 deletions app/inputs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module inputs
private

public :: vdW, volvar
public :: bins, method_probab
public :: grid, grid_spacing, method_probab
public :: seed
public :: num_structures, task
public :: stoich
Expand Down Expand Up @@ -40,7 +40,8 @@ module inputs
character(3), dimension(:), allocatable :: element_symbols
character(3), dimension(:,:), allocatable :: bond_pairs

integer, dimension(3) :: bins
integer, dimension(3) :: grid = [0, 0, 0]
real(real12) :: grid_spacing = 0._real12
real(real12), dimension(3) :: method_probab = [1._real12, 1._real12, 1._real12]

character(1024), dimension(:), allocatable :: database_list ! list of directories containing input database
Expand Down Expand Up @@ -197,7 +198,8 @@ subroutine read_input_file(file_name)
!---------------------------------------------------------------------------
! set up namelists for input file
!---------------------------------------------------------------------------
namelist /setup/ task, filename_host, seed, method_probab, bins, &
namelist /setup/ task, filename_host, seed, method_probab, grid, &
grid_spacing, &
database_format, database, verbose, output_dir
namelist /structure/ num_structures,stoichiometry
namelist /volume/ vdW, volvar
Expand Down
12 changes: 9 additions & 3 deletions app/main.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
program raffle_program
use constants, only: real12
use error_handling, only: stop_program
use misc_raffle, only: touch
use inputs
use read_structures, only: get_evolved_gvectors_from_data
Expand Down Expand Up @@ -48,8 +49,7 @@ program raffle_program
case(2)
write(*,*) "Running HOST_RSS"
case default
write(*,*) "Invalid option"
stop 1
call stop_program("Invalid option")
end select


Expand Down Expand Up @@ -103,7 +103,13 @@ program raffle_program
open(newunit=unit, file=filename_host, status='old')
call geom_read(unit, generator%host)
close(unit)
generator%bins = bins
if(grid_spacing.gt.1.E-6.and.all(grid.ne.0))then
call stop_program('Cannot specify grid spacing and grid at the same time')
elseif(grid_spacing.gt.1.E-6)then
call generator%set_grid(grid_spacing = grid_spacing)
elseif(all(grid.ne.0))then
call generator%set_grid(grid = grid)
end if


!-----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion cmake/CodeCoverage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ include(CMakeParseArguments)
option(CODE_COVERAGE_VERBOSE "Verbose information" FALSE)

# Check prereqs
find_program( GCOV_PATH gcov )
find_program( GCOV_PATH gcov-14 gcov )
find_program( LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl)
find_program( FASTCOV_PATH NAMES fastcov fastcov.py )
find_program( GENHTML_PATH NAMES genhtml genhtml.perl genhtml.bat )
Expand Down
15 changes: 15 additions & 0 deletions example/example_files/POSCAR_graphite_missing_layer
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
C
1.000000000
1.233645631 -2.136736911 0.000000000
1.233645631 2.136736911 0.000000000
0.000000000 0.000000000 15.606146000
C
6
Direct
0.000000000 0.000000000 0.125000000
0.000000000 0.000000000 0.375000000
0.000000000 0.000000000 0.875000000
0.333333333 0.666666667 0.125000000
0.666666667 0.333333333 0.375000000
0.666666667 0.333333333 0.875000000

10 changes: 0 additions & 10 deletions example/example_files/POSCAR_host

This file was deleted.

13 changes: 13 additions & 0 deletions example/example_files/POSCAR_host_BaTiO3
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
BaTiO3
1.0
4.01 0.00 0.00
0.00 4.01 0.00
0.00 0.00 8.02
Ba Ti O
1 1 3
Direct
0.0 0.0 0.0
0.5 0.5 0.25
0.5 0.5 0.0
0.5 0.0 0.25
0.0 0.5 0.25
16 changes: 16 additions & 0 deletions example/example_files/POSCAR_host_diamond
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
C8
1.000000000
3.560745109 0.000000000 0.000000000
0.000000000 3.560745109 0.000000000
0.000000000 0.000000000 7.121490218
C
8
Direct
0.000000000 0.000000000 0.000000000
0.500000000 0.500000000 0.000000000
0.500000000 0.000000000 0.250000000
0.000000000 0.500000000 0.250000000
0.250000000 0.250000000 0.125000000
0.750000000 0.750000000 0.125000000
0.750000000 0.250000000 0.375000000
0.250000000 0.750000000 0.375000000
26 changes: 26 additions & 0 deletions example/example_files/POSCAR_host_graphene
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
C4
1.000000000
3.700936892 -6.410210733 0.000000000
3.700936892 6.410210733 0.000000000
0.000000000 0.000000000 7.803073000
C
18
Direct
0.000000000 0.000000000 0.250000000
0.333333333 0.000000000 0.250000000
0.666666667 0.000000000 0.250000000
0.000000000 0.333333333 0.250000000
0.333333333 0.333333333 0.250000000
0.666666667 0.333333333 0.250000000
0.000000000 0.666666667 0.250000000
0.333333333 0.666666667 0.250000000
0.666666667 0.666666667 0.250000000
0.111111111 0.222222222 0.250000000
0.444444444 0.222222222 0.250000000
0.777777778 0.222222222 0.250000000
0.111111111 0.555555556 0.250000000
0.444444444 0.555555556 0.250000000
0.777777778 0.555555556 0.250000000
0.111111111 0.888888889 0.250000000
0.444444444 0.888888889 0.250000000
0.777777778 0.888888889 0.250000000
44 changes: 44 additions & 0 deletions example/example_files/POSCAR_host_graphite_vacancy
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
C4
1.000000000
3.700936892 -6.410210733 0.000000000
3.700936892 6.410210733 0.000000000
0.000000000 0.000000000 7.803073000
C
35
Direct
0.000000000 0.000000000 0.250000000
0.333333333 0.000000000 0.250000000
0.666666667 0.000000000 0.250000000
0.000000000 0.333333333 0.250000000
0.333333333 0.333333333 0.250000000
0.666666667 0.333333333 0.250000000
0.000000000 0.666666667 0.250000000
0.333333333 0.666666667 0.250000000
0.666666667 0.666666667 0.250000000
0.000000000 0.000000000 0.750000000
0.333333333 0.000000000 0.750000000
0.666666667 0.000000000 0.750000000
0.000000000 0.333333333 0.750000000
0.333333333 0.333333333 0.750000000
0.666666667 0.333333333 0.750000000
0.000000000 0.666666667 0.750000000
0.333333333 0.666666667 0.750000000
0.666666667 0.666666667 0.750000000
0.111111111 0.222222222 0.250000000
0.444444444 0.222222222 0.250000000
0.777777778 0.222222222 0.250000000
0.111111111 0.555555556 0.250000000
0.444444444 0.555555556 0.250000000
0.777777778 0.555555556 0.250000000
0.111111111 0.888888889 0.250000000
0.444444444 0.888888889 0.250000000
0.777777778 0.888888889 0.250000000
0.222222222 0.111111111 0.750000000
0.555555556 0.111111111 0.750000000
0.888888889 0.111111111 0.750000000
0.222222222 0.444444444 0.750000000
0.555555556 0.444444444 0.750000000
0.888888889 0.444444444 0.750000000
0.222222222 0.777777778 0.750000000
0.555555556 0.777777778 0.750000000

88 changes: 0 additions & 88 deletions example/example_files/POSCAR_host_perovskites_undefected

This file was deleted.

Loading