Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
c0b3aaa
EEQ-BC implementation for charges, energies, A matrix and b vector de…
thfroitzheim Nov 27, 2024
e727eef
Merge branch 'grimme-lab:main' into eeq-bc
thfroitzheim Nov 27, 2024
39d0379
Fix dielectric input
thfroitzheim Nov 28, 2024
1eacb53
parameter update for Ac from Dec 13, 2024, 14:55
marcelmbn Dec 13, 2024
fe3daa6
Merge pull request #1 from marcelmbn/params/20241213_1455
thfroitzheim Dec 13, 2024
1770c59
Restructure vrhs derivative with gemm
thfroitzheim Dec 16, 2024
6a25fdb
Update parameter 15.12.24
thfroitzheim Dec 16, 2024
9c25353
Merge branch 'main' into eeq-bc
thfroitzheim Dec 18, 2024
47d4604
prepared main.f90
lmseidler Dec 6, 2024
9943bc6
thanos snapped mchrg_cache
lmseidler Dec 6, 2024
95b223c
mchrg_cache gone
lmseidler Dec 6, 2024
01fafef
readded cache, eeq/eeqbc specific, modified solve
lmseidler Dec 9, 2024
b34dd0c
get_amat_3d eeqbc done
lmseidler Dec 10, 2024
f52124b
refactor
lmseidler Dec 11, 2024
09f4a89
dadr fixed
lmseidler Dec 11, 2024
ab8a4dd
dadL fixed
lmseidler Dec 11, 2024
fb50570
remaining tests fixed
lmseidler Dec 11, 2024
af3370a
fixed remaining details in tests, q derivs now available in solve
lmseidler Dec 11, 2024
95b04c1
fixed build files
lmseidler Dec 11, 2024
8e5aab8
eeqbc fixes
lmseidler Dec 13, 2024
fa2e141
refactor complete
lmseidler Dec 13, 2024
bc517d3
fixed tests, fixed refactors, fixed eqqbc setup
lmseidler Dec 17, 2024
6acd2ba
reactivated tests
lmseidler Dec 17, 2024
14c3787
updated cache pattern to be like tblite
lmseidler Dec 18, 2024
c3c81f1
changes for pr
lmseidler Dec 20, 2024
5091ce2
moved cache file around
lmseidler Dec 20, 2024
8f725b2
reset parameter overwrite, work as reference (FIXME: xvec derivs)
lmseidler Dec 20, 2024
a84afa9
small fixes
lmseidler Dec 20, 2024
99f2a2b
removed prints
lmseidler Dec 20, 2024
fa90810
Merge pull request #2 from lmseidler/eeq-bc
thfroitzheim Dec 20, 2024
181e102
Fix charge and energy derivatives for EEQBC
thfroitzheim Jan 2, 2025
9b0d17e
Fix missing lattice vectors, omp parallelization, and lapack warning.
thfroitzheim Mar 5, 2025
90dd81d
Merge remote-tracking branch 'origin/main' into eeq-bc
thfroitzheim Mar 5, 2025
5b11df2
finished periodic implementation for non-gradient usage
lmseidler Mar 6, 2025
d032db0
forgot ewald self-interaction term
lmseidler Mar 6, 2025
21a1761
removed dir/rec separation in amat
lmseidler Mar 6, 2025
63b3468
more tries
lmseidler Mar 10, 2025
f48c3c9
fixed periodic functions
lmseidler Mar 11, 2025
dca0d86
fixed gettting capacitances
lmseidler Mar 11, 2025
8046921
Merge branch 'no-ewald' into eeq-bc
lmseidler Mar 11, 2025
baa8350
Merge pull request #1 from lmseidler/eeq-bc
lmseidler Mar 11, 2025
de5a550
began implementation of periodic gradients
lmseidler Mar 11, 2025
edfbceb
added dcpair subroutine
lmseidler Mar 12, 2025
0a5fa5f
reintroduced wsc summation + some steps towards fixing 3d amat
lmseidler Mar 17, 2025
fed6620
periodic implementation basically done
lmseidler Mar 19, 2025
29698eb
added self interaction for cmat
lmseidler Mar 19, 2025
d999d48
self interaction properly accounted for
lmseidler Mar 19, 2025
cea737f
work on 3d amat gradient
lmseidler Mar 19, 2025
f6d4daf
gradient calculation executable
lmseidler Mar 19, 2025
cda804e
preliminary version of derivs
lmseidler Mar 20, 2025
7fa3b9d
some small changes
lmseidler Mar 20, 2025
c6ad384
Update CN call
thfroitzheim Mar 26, 2025
95b8d88
Merge branch 'main' into eeq-bc
thfroitzheim Apr 3, 2025
f7532f9
Update to mctc-lib version 0.4.1. Remove dielectric. Add error to solve
thfroitzheim Apr 3, 2025
0e8b2a2
Remove omp reduction to avoid stacksize issues
thfroitzheim Apr 3, 2025
88c4eb7
Cleanup OMP
thfroitzheim Apr 7, 2025
eaf4321
eeq implicit vs explicit test
lmseidler Apr 10, 2025
06fc80f
Merge remote-tracking branch 'origin/main' into eeq-bc
thfroitzheim Apr 22, 2025
e3d2ae0
Move get_charges function from d4 to multicharge
thfroitzheim Apr 23, 2025
fb96ac3
proper periodicicy eeqbc
lmseidler May 2, 2025
433eb53
Merge upstream/eeq-bc into no-ewald
lmseidler May 2, 2025
6728979
solved merge conflicts in eeqbc
lmseidler May 2, 2025
40e9439
xvec derivs periodic hopefully correct
lmseidler May 5, 2025
96ad53c
some resorting of damat
lmseidler May 5, 2025
e1b5e40
dcij terms
lmseidler May 5, 2025
8e388e4
gradients done?
lmseidler May 6, 2025
f5b8b7f
Merge branch 'grimme-lab:main' into eeq-bc
thfroitzheim May 6, 2025
84c37fb
Merge remote-tracking branch 'upstream/eeq-bc' into eeq-bc
lmseidler May 7, 2025
625ba65
test wrap
lmseidler May 7, 2025
cc3fad4
some fixes (compilation, tests) + added dbdr test for pbc
lmseidler May 9, 2025
8741c6d
minor fix (but not done) for dbdr
lmseidler May 10, 2025
03d0e44
added pbc tests for eeqbc gradients + eeq dbdr, dadr + finalized eqqb…
lmseidler May 14, 2025
bf09a7d
added pbc tests for eeqbc gradients + eeq dbdr, dadr + finalized eqqb…
lmseidler May 14, 2025
2c21b16
undo sign changes
lmseidler May 14, 2025
394c838
temporary array allocation fix
lmseidler May 14, 2025
bca3a09
updates to tests
lmseidler May 14, 2025
76804aa
added dbdL test for molecular
lmseidler May 19, 2025
f21d85e
dcdL fix
lmseidler May 26, 2025
03500c9
dxdL fix
lmseidler May 26, 2025
554df9a
uncommented complete xvec calculation
lmseidler May 26, 2025
c7870ae
fixed strain derivs molecular
lmseidler May 27, 2025
9189e7c
added dbdL test pbc
lmseidler May 28, 2025
f6fa1ad
dxdr/dxdL 3d gradient done
lmseidler Jun 4, 2025
57b62c8
start more work on amat 3d gradients
lmseidler Jun 4, 2025
3f296bd
amat 3d gradients almost done
lmseidler Jun 5, 2025
1749e90
added another dadL test for molecular case
lmseidler Jun 10, 2025
bb21853
reactivated all pbc tests, dadr, dadL, dbdr, dbdL, gradient, dqdr pas…
lmseidler Jun 10, 2025
9b462fa
add citation and update eeqbc naming
thfroitzheim Aug 6, 2025
6558221
fix Typo
thfroitzheim Aug 6, 2025
9469b84
pbc tests fixed
lmseidler Aug 13, 2025
045eca1
tests fixed fr now
lmseidler Aug 13, 2025
e17fa79
tests fixed fr fr now
lmseidler Aug 13, 2025
7c38ed1
trying to fix another random fail
lmseidler Aug 13, 2025
90e5ab6
reconsidering thresholds
lmseidler Aug 13, 2025
c1f8386
initial cleanup
lmseidler Aug 13, 2025
ad7ae21
cleaning up debug stuff
lmseidler Aug 14, 2025
affd1f6
implemented proper omp memory management for all loops
lmseidler Aug 14, 2025
c01bd3d
simplified xvec derivs loop
lmseidler Aug 14, 2025
517d1e5
some cleaning
lmseidler Aug 14, 2025
7ee5459
Merge branch 'thfroitzheim:eeq-bc' into eeq-bc
lmseidler Aug 15, 2025
2a95a07
updated constructor name to 2025 in remaining tests
lmseidler Aug 15, 2025
117f616
Update src/multicharge/model/eeqbc.f90
lmseidler Aug 15, 2025
4c5d85f
Update test/unit/test_model.f90
lmseidler Aug 15, 2025
b540986
Update src/multicharge/model/eeqbc.f90
lmseidler Aug 15, 2025
3831426
Update src/multicharge/model/eeqbc.f90
lmseidler Aug 15, 2025
254e1c9
Update src/multicharge/model/eeqbc.f90
lmseidler Aug 15, 2025
462cd0b
Update src/multicharge/model/eeqbc.f90
lmseidler Aug 15, 2025
8fa16e1
cleaned up pbc tests
lmseidler Aug 15, 2025
7602959
cleanup of type.f90
lmseidler Aug 15, 2025
0f662b0
more cleanup
lmseidler Aug 15, 2025
ae0a637
set dadr failure threshold higher for eeqbc
lmseidler Aug 18, 2025
96cef3e
unexposed helper functions in model implementations
lmseidler Aug 18, 2025
7ad5661
set atomic access if necessary, avoided in xvec_derivs
lmseidler Aug 18, 2025
3b9b4cf
undid atomic stuff + readded exposed procedures
lmseidler Aug 18, 2025
b5c9980
cleaned up declarations
lmseidler Aug 18, 2025
bfce4a1
Update src/multicharge/model/eeqbc.f90
thfroitzheim Aug 18, 2025
8a223cc
Merge pull request #3 from lmseidler/eeq-bc
thfroitzheim Aug 18, 2025
6cd8fdb
Merge branch 'grimme-lab:main' into eeq-bc
thfroitzheim Aug 18, 2025
8250cc0
cleanup
thfroitzheim Aug 18, 2025
f478f62
update mctc-lib to head
thfroitzheim Aug 18, 2025
59ca60c
pin mctc-lib 0.4.1
thfroitzheim Aug 18, 2025
cc2c698
Update src/multicharge/param/eeqbc2025.f90
thfroitzheim Aug 18, 2025
0c7e1ba
cleanup format
thfroitzheim Aug 19, 2025
6982d1c
finish rename
thfroitzheim Aug 19, 2025
ebbb68d
format cleanup
lmseidler Aug 21, 2025
eb2f4fd
format cleanup 2
lmseidler Aug 21, 2025
447bf30
Merge branch 'eeq-bc' into eeq-bc
lmseidler Aug 21, 2025
8cd1c3b
small fix in main
lmseidler Aug 21, 2025
f94941c
Merge pull request #4 from lmseidler/eeq-bc
thfroitzheim Aug 22, 2025
294d5ac
change naming
thfroitzheim Aug 22, 2025
96145bf
Update app/main.f90
lmseidler Sep 3, 2025
84d33fe
Update src/multicharge/model/type.F90
lmseidler Sep 3, 2025
bce4d79
Update src/multicharge/model/type.F90
lmseidler Sep 3, 2025
41e8525
Update src/multicharge/model/type.F90
lmseidler Sep 3, 2025
3b4ef76
Update src/multicharge/model/type.F90
lmseidler Sep 3, 2025
7b0406b
Update src/multicharge/model/eeqbc.f90
lmseidler Sep 3, 2025
755b33e
updated signs and comments
lmseidler Sep 3, 2025
828e140
formatting
lmseidler Sep 3, 2025
cf195cf
more fixes
lmseidler Sep 3, 2025
5da5d10
test model fixed
lmseidler Sep 3, 2025
76ac64e
resolving final changes
lmseidler Sep 8, 2025
50dd60b
formatting
lmseidler Sep 8, 2025
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
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![CI](https://github.com/grimme-lab/multicharge/workflows/CI/badge.svg)](https://github.com/grimme-lab/multicharge/actions)
[![codecov](https://codecov.io/gh/grimme-lab/multicharge/branch/main/graph/badge.svg)](https://codecov.io/gh/grimme-lab/multicharge)

Electronegativity equilibration model for atomic partial charges.
Electronegativity equilibration models for atomic partial charges.


## Installation
Expand Down Expand Up @@ -135,6 +135,33 @@ multicharge.git = "https://github.com/grimme-lab/multicharge"

For an overview over all command line arguments use the ``--help`` argument or checkout the [``multicharge(1)``](man/multicharge.1.adoc) manpage.

## Citation

For the electronegativity equilibration model (EEQ):

Eike Caldeweyher, Sebastian Ehlert, Andreas Hansen, Hagen Neugebauer, Sebastian Spicher, Christoph Bannwarth and Stefan Grimme, *J. Chem Phys*, **2019**, 150, 154122.
DOI: [10.1063/1.5090222](https://doi.org/10.1063/1.5090222)
chemrxiv: [10.26434/chemrxiv.7430216](https://doi.org/10.26434/chemrxiv.7430216.v2)

... the EEQ extention to Fr, Ra, and the full Actinide series:

Lukas Wittmann, Igor Gordiy, Marvin Friede, Benjamin Helmich-Paris, Stefan Grimme, Andreas Hansen and Markus Bursch, *Phys. Chem. Chem. Phys.*, **2024**, 26, 21379-21394.
DOI: [10.1039/D4CP01514B](10.1039/D4CP01514B)

... the periodic EEQ implementation:

Eike Caldeweyher, Jan-Michael Mewes, Sebastian Ehlert and Stefan Grimme, *Phys. Chem. Chem. Phys.*, **2020**, 22, 8499-8512.
DOI: [10.1039/D0CP00502A](https://doi.org/10.1039/D0CP00502A)
chemrxiv: [10.26434/chemrxiv.10299428](https://doi.org/10.26434/chemrxiv.10299428.v1)

<br>

For the bond capacity electronegativity equilibration charge model (EEQ<sub>BC</sub>):

Thomas Froitzheim, Marcel Müller, Andreas Hansen, and Stefan Grimme, *J. Chem. Phys.*, **2025**, 162, 214109.
DOI: [10.1039/10.1063/5.0268978](https://doi.org/10.1063/5.0268978)
chemrxiv: [10.26434/chemrxiv-2025-1nxwg](https://doi.org/10.26434/chemrxiv-2025-1nxwg)


## License

Expand Down
105 changes: 69 additions & 36 deletions app/main.f90
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,42 @@
! limitations under the License.

program main
use, intrinsic :: iso_fortran_env, only : output_unit, error_unit, input_unit
use mctc_env, only : error_type, fatal_error, get_argument, wp
use mctc_io, only : structure_type, read_structure, filetype, get_filetype
use multicharge, only : mchrg_model_type, new_eeq2019_model, &
& write_ascii_model, write_ascii_properties, write_ascii_results, &
& get_multicharge_version
use multicharge_output, only : json_results
use, intrinsic :: iso_fortran_env, only: output_unit, error_unit, input_unit
use mctc_env, only: error_type, fatal_error, get_argument, wp
use mctc_io, only: structure_type, read_structure, filetype, get_filetype
use mctc_cutoff, only: get_lattice_points
use multicharge, only: mchrg_model_type, mchrg_model, new_eeq2019_model, &
& new_eeqbc2025_model, get_multicharge_version, &
& write_ascii_model, write_ascii_properties, write_ascii_results
use multicharge_output, only: json_results
implicit none
character(len=*), parameter :: prog_name = "multicharge"
character(len=*), parameter :: json_output = "multicharge.json"

character(len=:), allocatable :: input, chargeinput
integer, allocatable :: input_format
integer :: stat, unit
integer :: stat, unit, model_id
type(error_type), allocatable :: error
type(structure_type) :: mol
type(mchrg_model_type) :: model
class(mchrg_model_type), allocatable :: model
logical :: grad, json, exist
real(wp), parameter :: cn_max = 8.0_wp, cutoff = 25.0_wp
real(wp), allocatable :: cn(:), dcndr(:, :, :), dcndL(:, :, :)
real(wp), allocatable :: cn(:), rcov(:), trans(:, :)
real(wp), allocatable :: qloc(:)
real(wp), allocatable :: dcndr(:, :, :), dcndL(:, :, :), dqlocdr(:, :, :), dqlocdL(:, :, :)
real(wp), allocatable :: energy(:), gradient(:, :), sigma(:, :)
real(wp), allocatable :: qvec(:), dqdr(:, :, :), dqdL(:, :, :)
real(wp), allocatable :: qvec(:)
real(wp), allocatable :: dqdr(:, :, :), dqdL(:, :, :)
real(wp), allocatable :: charge

call get_arguments(input, input_format, grad, charge, json, error)
call get_arguments(input, model_id, input_format, grad, charge, json, error)
if (allocated(error)) then
write(error_unit, '(a)') error%message
error stop
end if

if (input == "-") then
if (.not.allocated(input_format)) input_format = filetype%xyz
if (.not. allocated(input_format)) input_format = filetype%xyz
call read_structure(mol, input_unit, input_format, error)
else
call read_structure(mol, input, error, input_format)
Expand Down Expand Up @@ -76,36 +80,47 @@ program main
end if
end if

call new_eeq2019_model(mol, model, error)
if(allocated(error)) then
if (model_id == mchrg_model%eeq2019) then
call new_eeq2019_model(mol, model, error)
else if (model_id == mchrg_model%eeqbc2025) then
call new_eeqbc2025_model(mol, model, error)
else
call fatal_error(error, "Invalid model was choosen.")
end if
if (allocated(error)) then
write(error_unit, '(a)') error%message
error stop
end if

call write_ascii_model(output_unit, mol, model)

allocate(cn(mol%nat))
if (grad) then
allocate(dcndr(3, mol%nat, mol%nat), dcndL(3, 3, mol%nat))
end if

call model%ncoord%get_cn(mol, cn, dcndr, dcndL)

allocate(energy(mol%nat), qvec(mol%nat))
energy(:) = 0.0_wp

allocate(cn(mol%nat), qloc(mol%nat))
if (grad) then
allocate(gradient(3, mol%nat), sigma(3, 3))
gradient(:, :) = 0.0_wp
sigma(:, :) = 0.0_wp

allocate(dqdr(3, mol%nat, mol%nat), dqdL(3, 3, mol%nat))
dqdr(:, :, :) = 0.0_wp
dqdL(:, :, :) = 0.0_wp

allocate(dcndr(3, mol%nat, mol%nat), dcndL(3, 3, mol%nat))
allocate(dqlocdr(3, mol%nat, mol%nat), dqlocdL(3, 3, mol%nat))
end if

call model%solve(mol, error, cn, dcndr, dcndL, energy, gradient, sigma, &
& qvec, dqdr, dqdL)
call get_lattice_points(mol%periodic, mol%lattice, model%ncoord%cutoff, trans)
call model%ncoord%get_coordination_number(mol, trans, cn, dcndr, dcndL)
call model%local_charge(mol, trans, qloc, dqlocdr, dqlocdL)
call model%solve(mol, error, cn, qloc, dcndr, dcndL, dqlocdr, dqlocdL, &
& energy, gradient, sigma, qvec, dqdr, dqdL)

if (allocated(error)) then
write(error_unit, '(a)') error%message
error stop
end if


call write_ascii_properties(output_unit, mol, model, cn, qvec)
call write_ascii_results(output_unit, mol, energy, gradient, sigma)
Expand All @@ -115,12 +130,11 @@ program main
call json_results(unit, " ", energy=sum(energy), gradient=gradient, charges=qvec, cn=cn)
close(unit)
write(output_unit, '(a)') &
"[Info] JSON dump of results written to '"// json_output //"'"
"[Info] JSON dump of results written to '"//json_output//"'"
end if

contains


subroutine help(unit)
integer, intent(in) :: unit

Expand All @@ -133,7 +147,8 @@ subroutine help(unit)
"higher multipole moments", &
""

write(unit, '(2x, a, t25, a)') &
write(unit, '(2x, a, t35, a)') &
"-m, -model, --model <model>", "Choose the charge model", &
"-i, -input, --input <format>", "Hint for the format of the input file", &
"-c, -charge, --charge <value>", "Set the molecular charge", &
"-g, -grad, --grad", "Evaluate molecular gradient and virial", &
Expand All @@ -145,7 +160,6 @@ subroutine help(unit)

end subroutine help


subroutine version(unit)
integer, intent(in) :: unit
character(len=:), allocatable :: version_string
Expand All @@ -156,12 +170,15 @@ subroutine version(unit)

end subroutine version


subroutine get_arguments(input, input_format, grad, charge, json, error)
subroutine get_arguments(input, model_id, input_format, grad, charge, &
& json, error)

!> Input file name
character(len=:), allocatable :: input

!> ID of choosen model type
integer, intent(out) :: model_id

!> Input file format
integer, allocatable, intent(out) :: input_format

Expand All @@ -180,6 +197,7 @@ subroutine get_arguments(input, input_format, grad, charge, json, error)
integer :: iarg, narg, iostat
character(len=:), allocatable :: arg

model_id = mchrg_model%eeq2019
grad = .false.
json = .false.
iarg = 0
Expand All @@ -195,24 +213,39 @@ subroutine get_arguments(input, input_format, grad, charge, json, error)
call version(output_unit)
stop
case default
if (.not.allocated(input)) then
if (.not. allocated(input)) then
call move_alloc(arg, input)
cycle
end if
call fatal_error(error, "Too many positional arguments present")
exit
case("-m", "-model", "--model")
iarg = iarg + 1
call get_argument(iarg, arg)
if (.not. allocated(arg)) then
call fatal_error(error, "Missing argument for model")
exit
end if
if (arg == "eeq2019" .or. arg == "eeq") then
model_id = mchrg_model%eeq2019
else if (arg == "eeqbc2025" .or. arg == "eeqbc") then
model_id = mchrg_model%eeqbc2025
else
call fatal_error(error, "Invalid model")
exit
end if
case("-i", "-input", "--input")
iarg = iarg + 1
call get_argument(iarg, arg)
if (.not.allocated(arg)) then
if (.not. allocated(arg)) then
call fatal_error(error, "Missing argument for input format")
exit
end if
input_format = get_filetype("."//arg)
case("-c", "-charge", "--charge")
iarg = iarg + 1
call get_argument(iarg, arg)
if (.not.allocated(arg)) then
if (.not. allocated(arg)) then
call fatal_error(error, "Missing argument for charge")
exit
end if
Expand All @@ -229,8 +262,8 @@ subroutine get_arguments(input, input_format, grad, charge, json, error)
end select
end do

if (.not.allocated(input)) then
if (.not.allocated(error)) then
if (.not. allocated(input)) then
if (.not. allocated(error)) then
call help(output_unit)
error stop
end if
Expand Down
9 changes: 6 additions & 3 deletions man/multicharge.1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,21 @@ Electronegativity equilibration model for atomic partial charges.

== Options

*-m, -model, --model* _model_::
Choose the charge model (eeq or eeqbc)

*-i, -input, --input* _format_::
Hint for the format of the input file

*-c, -charge, --charge* _value_::
Provide the molecular charge

*-j, -json, --json*::
Provide output in JSON format to the file 'multicharge.json'

*-g, -grad, --grad*::
Evaluate molecular gradient and virial

*-j, -json, --json*::
Provide output in JSON format to the file 'multicharge.json'

*-v, -version, --version*::
Print program version and exit

Expand Down
4 changes: 2 additions & 2 deletions src/multicharge.f90
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
! limitations under the License.

module multicharge
use multicharge_cutoff, only : get_lattice_points
use multicharge_charge, only : get_charges, get_eeq_charges, get_eeqbc_charges
use multicharge_model, only : mchrg_model_type
use multicharge_output, only : write_ascii_model, write_ascii_properties, &
& write_ascii_results
use multicharge_param, only : new_eeq2019_model
use multicharge_param, only : new_eeq2019_model, new_eeqbc2025_model, mchrg_model
use multicharge_version, only : get_multicharge_version
implicit none
public
Expand Down
6 changes: 4 additions & 2 deletions src/multicharge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.

add_subdirectory("model")
add_subdirectory("param")

set(dir "${CMAKE_CURRENT_SOURCE_DIR}")

list(
APPEND srcs
"${dir}/blas.F90"
"${dir}/cutoff.f90"
"${dir}/charge.f90"
"${dir}/ewald.f90"
"${dir}/lapack.F90"
"${dir}/model.F90"
"${dir}/model.f90"
"${dir}/output.f90"
"${dir}/param.f90"
"${dir}/version.f90"
"${dir}/wignerseitz.f90"
"${dir}/cache.f90"
)

set(srcs "${srcs}" PARENT_SCOPE)
46 changes: 46 additions & 0 deletions src/multicharge/cache.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
! This file is part of multicharge.
! SPDX-Identifier: Apache-2.0
!
! Licensed under the Apache License, Version 2.0 (the "License");
! you may not use this file except in compliance with the License.
! You may obtain a copy of the License at
!
! http://www.apache.org/licenses/LICENSE-2.0
!
! Unless required by applicable law or agreed to in writing, software
! distributed under the License is distributed on an "AS IS" BASIS,
! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! See the License for the specific language governing permissions and
! limitations under the License.

!> @file multicharge/cache.f90
!> Contains the cache baseclass for the charge models and a container for mutable cache data

!> Cache for charge models
module multicharge_model_cache
use mctc_env, only: wp
use mctc_io, only: structure_type
use multicharge_wignerseitz, only: wignerseitz_cell_type
implicit none
private

type, public :: cache_container
!> Mutable data attribute
class(*), allocatable :: raw
end type cache_container

!> Cache for the charge model
type, abstract, public :: model_cache
!> Coordination number array
real(wp), allocatable :: cn(:)
!> Coordination number gradient w.r.t the positions
real(wp), allocatable :: dcndr(:, :, :)
!> Coordination number gradient w.r.t the lattice vectors
real(wp), allocatable :: dcndL(:, :, :)
!> Ewald separation parameter
real(wp) :: alpha
!> Wigner-Seitz cell
type(wignerseitz_cell_type) :: wsc
end type model_cache

end module multicharge_model_cache
Loading
Loading