Skip to content
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

Combine NPMC, GMC, LGMC #11

Merged
merged 295 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
295 commits
Select commit Hold shift + click to select a range
f41ed56
Primarily changes to lgmc parameters
espottesmith Jul 19, 2022
bd9c84e
Restructuring; changes to SQL types (needs testing)
espottesmith Jul 19, 2022
6b5c360
(i think) working BV (need to test)
espottesmith Jul 20, 2022
bbd94b9
Propensity math
espottesmith Jul 20, 2022
ea42298
Tiny changes
espottesmith Jul 20, 2022
53b1d25
Got rid of a namespace; made SQL types work; still one weird small error
espottesmith Jul 20, 2022
b59261e
More restructuring
espottesmith Jul 20, 2022
d4aa493
Added BV kinetics to homogeneous propensity calculation
espottesmith Jul 20, 2022
ac7d0c0
Merge branch 'benchmark' into main
espottesmith Jul 20, 2022
9ea0a3c
Small fix to phase interpretation
espottesmith Jul 20, 2022
a58b6df
debugging ...
Jul 21, 2022
3edfc18
debugging ...
Jul 25, 2022
9e03b23
debugged
Jul 27, 2022
98669c7
hash added
Jul 28, 2022
1e2e274
SEI testing
Aug 3, 2022
811c662
fix floating pointer error
Aug 4, 2022
ea9c4e2
add ability to start lattice with species
Aug 4, 2022
03291ee
destructor added for lattice
Aug 4, 2022
7729c14
lattice fill added
Aug 4, 2022
a7b76f9
lattice fill update
Aug 4, 2022
03f8884
update for dynamic lattice
Aug 4, 2022
53d3bc2
compile errors fixed
Aug 4, 2022
d9077ed
fill lattice tested
Aug 4, 2022
8f58730
working on deletion
Aug 4, 2022
04eb6f9
deletion of sites allowed
lrzichi Oct 27, 2022
83bd88d
updated testing files
lrzichi Jan 6, 2023
d4e1bc1
add inheritance to simulation
Feb 3, 2023
f8bf33a
fixing templating issues
Feb 3, 2023
cf393a6
updating templating
Feb 4, 2023
5ef1cb1
fixed compile errors
Feb 10, 2023
8e7d9f6
fixing compile errors with state in simulation
Feb 10, 2023
54ac853
GMC checkpointing done
Feb 16, 2023
1606aae
LGMC sql_types fixed
Feb 16, 2023
fac5485
checkpointing added to reaction_network
Feb 16, 2023
ed0fab3
fixing compile errors
Feb 16, 2023
f4ec6d2
checkpointing added to LGMC
Feb 16, 2023
94334fe
checkpointing done for GMC, NPMC
Feb 17, 2023
19cac52
resize seed maps
Feb 17, 2023
48e7f4d
resize seed states
Feb 17, 2023
23e0b8f
checkpoint output finished
Feb 17, 2023
010dd50
unified
Mar 9, 2023
e10410a
removed pointers to vectors
Mar 9, 2023
f1dc608
debugging
Mar 10, 2023
68b3a0e
debugging
Mar 10, 2023
8adb46d
changed name of homogeneous site
Mar 11, 2023
7e88439
updated lattice state
Mar 13, 2023
35ea840
problem with state
Mar 23, 2023
acbfb9e
testing
Mar 27, 2023
177ade7
test files for GMC and NPMC updated
Mar 27, 2023
85fb7ca
lattice bug fixed
Apr 1, 2023
1fc9bca
fixed bug in compute propensities
Apr 1, 2023
dd4cc1b
debugging
Apr 8, 2023
a27eff8
fixed SQL error
Apr 8, 2023
e6d0488
fix latsolver
May 3, 2023
aedfbf0
fixed propensity sum
May 3, 2023
56d32ac
fixed updated function
May 5, 2023
1bca98a
fixed lattice checkpointing
May 5, 2023
3e2b1c4
fixed dynamic lattice read state
May 5, 2023
e595f32
checkpointing fixed
May 5, 2023
7c19079
moved implementations to .cpp files
May 11, 2023
2f92cee
updated cutoff packet for lattice
May 12, 2023
13b3b51
fixed makefiles
May 24, 2023
2dd11f0
updated testing
May 28, 2023
53836e3
fixed compile error for NPMC
May 30, 2023
a60a66b
fixed warnings in GMC
May 30, 2023
25337df
fixed LGMC compile warnings
May 30, 2023
20ab25d
updated lattice test for gtest framework
May 30, 2023
022c7eb
rename files; fixed makefiles; moved LGMC main
Jun 5, 2023
1120e92
moved main for testing
Jun 5, 2023
34aa6b3
fixed linker errors
Jun 5, 2023
02e5b54
updated GMC testing; fixed bug in GMC/LGMC
Jun 6, 2023
5543565
fixed bug in LGMC
Jun 7, 2023
f229fba
fixed LGMC main; fixed style
Jun 11, 2023
fc1d9a8
Create _config.yml
lzichi Jun 12, 2023
1da460c
Update _config.yml
lzichi Jun 12, 2023
3561941
Update _config.yml
lzichi Jun 12, 2023
b620ebf
adding documentation
Jun 12, 2023
bde4c30
Merge branch 'main' of https://github.com/lzichi/RNMC
Jun 12, 2023
55c610b
cleaning files; fixed makefile warnings
Jun 15, 2023
d16fb5e
fixed compile warnings
Jun 15, 2023
08172a1
fixed NPMC input file
Jun 15, 2023
5c7a1fa
Merge branch 'main' of https://github.com/lzichi/RNMC
Jun 15, 2023
c0f3156
fixed error in NPMC
Jun 15, 2023
a340e7a
updated LGMC command line args
Jun 15, 2023
4dac407
updated LGMC command line
Jun 15, 2023
ed59a6e
fixed LGMC error
Jun 15, 2023
2980e36
added Python
Jun 16, 2023
4b171e6
ran dynamic LGMC
Jun 16, 2023
7b31213
fixed signalHandler error
Jun 20, 2023
e7b7fb4
fixed std::move warning
Jun 20, 2023
25b622b
GMC example added
Jun 21, 2023
2b4cf9f
added simple example for NPMC
Jun 22, 2023
42356de
fixing nix error
Jun 22, 2023
db10829
updated testing for LGMC, NPMC
Jun 23, 2023
f92dda7
homogeneous catalysis example finished
Jun 26, 2023
e43c4a1
GMC example
Jun 26, 2023
18553bb
updating examples
Jun 27, 2023
9ecae47
updated NPMC testing
Jun 27, 2023
dfe84f7
removed option to fill
Jun 27, 2023
514c359
added default constructor
Jun 27, 2023
3e51f82
updating test
Jun 27, 2023
4f12fdf
updating NPMC testing; fixed error
Jun 28, 2023
e036a20
updating LGMC unit tests
Jun 28, 2023
84e4907
updating LGMC tests
Jun 28, 2023
2a743b1
updated example; fixed bug in lattice
Jun 29, 2023
8b1bef5
fixing memory leak
Jun 29, 2023
97cb036
fixed all memory leaks
Jun 30, 2023
1a7a92c
fixed errors
Jun 30, 2023
1382d52
testing lattice copy constructor
Jun 30, 2023
7b34441
updating examples
Jun 30, 2023
3472ec9
updating examples
Jun 30, 2023
54b86e1
added example
Jun 30, 2023
d9aaa16
updating examples
Jun 30, 2023
831f413
updated example
Jul 6, 2023
cccea0f
optimizing lattice
Jul 7, 2023
196d2c0
fixing style
Jul 9, 2023
6a71edf
updated style
Jul 10, 2023
4a8c411
added energy barrier
Aug 27, 2023
fb8b82c
updated GMC SEI example python
Aug 29, 2023
1ed0627
updated energy budget
Aug 29, 2023
53d5dce
moved files for GMC SEI example
Aug 29, 2023
8f1822b
fixed complie issues
Aug 30, 2023
ab12c54
GMC test passes
Sep 3, 2023
7e13028
added test as action
Sep 3, 2023
32209e8
updated .yml
Sep 3, 2023
4306ea2
fixing .cpp files
Sep 4, 2023
b018024
adding trajectory test
Sep 4, 2023
3106eaf
updating test trajectories
Sep 4, 2023
d61bab1
updating test trajectories
Sep 4, 2023
bd4b0e8
fixed compile errors for GCC-7.4
Oct 24, 2023
3a12d62
fixed compile errors for GCC 7.4
Oct 24, 2023
1f05886
fixed energy budget seg fault
Nov 6, 2023
6a86e5f
added checkpoint flag
Dec 2, 2023
9fdb695
added checkpoint flag
Dec 2, 2023
c665d9f
updating README
Dec 2, 2023
d235f3e
updated README
Dec 2, 2023
816fbc7
fix README link
Dec 2, 2023
0744182
updated README links
Dec 2, 2023
aa8b0d0
added energy budget
Dec 2, 2023
1bd7493
fixed NPMC test
Dec 2, 2023
ef117b6
added checkpoint flag
Dec 7, 2023
c163aeb
checkpoint added to LGMC help
Jan 14, 2024
04fc1a2
end to end test
Jan 14, 2024
0233137
core solver as unit test
Jan 14, 2024
7039080
end to end test
Jan 14, 2024
1f28345
end to end test
Jan 14, 2024
0f93d6e
updated tests
Jan 15, 2024
969dd10
updated tests
Jan 15, 2024
4213835
add energy budget to checkpoint
Jan 15, 2024
d966aff
fixed energy budget checkpoint
Jan 15, 2024
b3aee46
NPMC example
Jan 19, 2024
5b1f940
NPMC example update
Jan 19, 2024
b92d343
NPMC compile error fixed
Jan 25, 2024
fb2fdf9
NPMC compile error fixed
Jan 25, 2024
4e3a1c2
LGMC compile error
Jan 25, 2024
1b8b6c9
fixed LGMC compile
Jan 25, 2024
cb11fe5
fixed LGMC compile errors
Jan 25, 2024
1d28003
updated GMC
Jan 25, 2024
6d0a3af
updated GMC
Jan 25, 2024
5b2a0ca
fixed LGMC memory; fixed threading logic error
Jan 30, 2024
f59c318
fixed GMC
Feb 1, 2024
8c341f2
updating GMC example
Feb 3, 2024
6b7116f
fixed GMC example
Feb 3, 2024
53fb012
fixed NPMC example
Feb 3, 2024
0678ce9
updated include errors to compile on nersc
Feb 3, 2024
e9e85b4
new GMC initial_state
Feb 3, 2024
7e09526
updated GMC SEI example
Feb 3, 2024
a2e6aef
spparks benchmark example
Feb 3, 2024
0a92f20
fixed nersc compile errors
Feb 4, 2024
d144c9b
fixed LGMC compile error
Feb 4, 2024
a20977b
fixed LGMC input file example
Feb 4, 2024
0c6d3b9
makefile changes for nersc
Feb 4, 2024
317ad51
LGMC exammple initial state
Feb 4, 2024
e148d3f
updated makefile for nersc
Feb 5, 2024
53fa091
fixed NPMC example; time global tests
Feb 5, 2024
99e4af9
time global tests
Feb 5, 2024
8266293
fixed unit tests
Feb 5, 2024
2cb5834
small spparks example
Feb 5, 2024
4c4b1ed
example
Feb 5, 2024
1e1e3cc
merge
Feb 5, 2024
88da71a
Merge branch 'main' of https://github.com/lzichi/RNMC
Feb 5, 2024
8dad8fb
reset GMC example
Feb 5, 2024
ec6dc7d
removed unused functions
Feb 5, 2024
bff4158
removed print function
Feb 5, 2024
e2bd1df
removed print function
Feb 5, 2024
12de95e
removed print function
Feb 5, 2024
7fee378
fixed LatticeState copy constructor
Feb 5, 2024
7f7c44f
updated LatticeState constructor
Feb 5, 2024
3622e73
changed constructor
Feb 5, 2024
6d9b0d7
fixing LGMC valgrind error
Feb 5, 2024
c550dde
fixing error
Feb 5, 2024
c88559c
fix memory leak
Feb 6, 2024
3ff0817
fix valgrind error
Feb 6, 2024
0ea47a5
shared instead of unique
Feb 6, 2024
f626e40
fix error
Feb 6, 2024
2dbcf95
removed std::move
Feb 6, 2024
29baddb
update store checkpoint
Feb 6, 2024
7ff5ca3
new small example
Feb 8, 2024
5bbd4a6
update example
Feb 8, 2024
959cd55
unique instead of smart pointers
Feb 8, 2024
0c40286
updated copy const
Feb 8, 2024
068fb16
removed new and delete
Feb 8, 2024
a8e7c87
unique pointer; reset
Feb 8, 2024
78079f2
fix LGMC error; pass by ref model
Feb 10, 2024
43153ba
seed_state_map by ref
Feb 10, 2024
be47c78
move constructor LGMC
Feb 10, 2024
cecb8a1
updated GMC compute prop
Feb 11, 2024
c30d9b8
new initial state
Feb 11, 2024
474a4ac
new GMC initial state
Feb 11, 2024
c9c0dc4
fixed prop checkpoint
Feb 11, 2024
d0eb596
fixed copy constructor error
Feb 11, 2024
ba6c614
fixed syntax LGMC copy constructor
Feb 11, 2024
5db81fd
GMC examples for benchmarking
Feb 12, 2024
a06808b
check spparks vs. gmc
Feb 13, 2024
42a6682
check spparks vs GMC
Feb 13, 2024
f7a6a46
example with unique reaction rates
Apr 1, 2024
790bfc9
fixed unique example
Apr 1, 2024
68d7de8
updated rn unique example
Apr 1, 2024
796b65a
add .build.sh for nix
lzichi Jul 21, 2024
65df57c
fix permission
lzichi Jul 21, 2024
ad1d8dc
fix path
lzichi Jul 21, 2024
5585a37
fix path
lzichi Jul 21, 2024
197bc6a
fix path
lzichi Jul 21, 2024
1d40fbf
fix path
lzichi Jul 21, 2024
d5efd1f
added NPMC tests
lzichi Jul 21, 2024
09783d9
print pwd
lzichi Jul 21, 2024
e0c40e5
fix makefile
lzichi Jul 21, 2024
52ebf8a
fix makefile paths
lzichi Jul 21, 2024
293e7d0
added comments
lzichi Jul 29, 2024
368f85d
updated format
lzichi Jul 29, 2024
957cf59
Merge branch 'main' of https://github.com/lzichi/RNMC
Jul 30, 2024
f448ba2
updated examples
lzichi Jul 30, 2024
524c28d
updated .gitignore
lzichi Jul 30, 2024
4ce84c8
fixed examples; fix energy budget checkpoint
lzichi Aug 5, 2024
952c014
fixed sqlite tables
lzichi Aug 5, 2024
2fb73eb
fixed sqlite tables
lzichi Aug 5, 2024
775afc2
fix LGMC examples
lzichi Aug 5, 2024
23f6335
clean NPMC examples
lzichi Aug 5, 2024
bd62e33
updated example
lzichi Aug 5, 2024
4ddd04b
fixed unit tests
lzichi Aug 5, 2024
04d2109
fixed names
lzichi Aug 5, 2024
6002bf3
added cutoff to end-to-end-test
lzichi Aug 5, 2024
e8f514c
update docs link
lzichi Aug 23, 2024
3f8c2f8
Merge branch 'main' into main
espottesmith Aug 23, 2024
2301247
Miscellaneous changes necessary to get things to compile and tests to
espottesmith Aug 23, 2024
6e4163d
Merge remote-tracking branch 'blau/main' into zichi_main
espottesmith Aug 23, 2024
39ad57b
Trying to fix flake...
espottesmith Aug 23, 2024
4ed6c7c
Why isn't g++ showing up...?
espottesmith Aug 23, 2024
c288704
Was clang the issue all along???
espottesmith Aug 23, 2024
8d83126
Progress!
espottesmith Aug 23, 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
4 changes: 2 additions & 2 deletions GMC/reaction_network.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ struct Reaction {
double rate;
};



// parameters passed to the ReactionNetwork constructor
// by the dispatcher which are model specific
struct ReactionNetworkParameters {
Expand All @@ -38,6 +36,8 @@ struct ReactionNetwork {
// maps species to the reactions which involve that species
std::vector<std::vector<int>> dependents;

ReactionNetwork();

ReactionNetwork(
SqlConnection &reaction_network_database,
SqlConnection &initial_state_database,
Expand Down
45 changes: 0 additions & 45 deletions GMC/sql_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,51 +46,6 @@ void ReactionSql::action(ReactionSql &r, sqlite3_stmt *stmt) {
r.rate = sqlite3_column_double(stmt, 7);
};

struct LatticeReactionSql {
unsigned long int reaction_id;
int number_of_reactants;
int number_of_products;
int reactant_1;
int reactant_2;
int product_1;
int product_2;
double rate;
double dG;
double reorganization;
char phase_reactant_1;
char phase_reactant_2;
char phase_product_1;
char phase_product_2;
char type;
static std::string sql_statement;
static void action(LatticeReactionSql &r, sqlite3_stmt *stmt);
};

std::string LatticeReactionSql::sql_statement =
"SELECT reaction_id, number_of_reactants, number_of_products, "
"reactant_1, reactant_2, product_1, product_2, rate, dG, "
"reorganization, phase_reactant_1, phase_reactant_2, "
"phase_product_1, phase_product_2, type FROM reactions;";


void LatticeReactionSql::action(LatticeReactionSql &r, sqlite3_stmt *stmt) {
r.reaction_id = sqlite3_column_int(stmt, 0);
r.number_of_reactants = sqlite3_column_int(stmt, 1);
r.number_of_products = sqlite3_column_int(stmt, 2);
r.reactant_1 = sqlite3_column_int(stmt, 3);
r.reactant_2 = sqlite3_column_int(stmt, 4);
r.product_1 = sqlite3_column_int(stmt, 5);
r.product_2 = sqlite3_column_int(stmt, 6);
r.rate = sqlite3_column_double(stmt, 7);
r.dG = sqlite3_column_double(stmt, 8);
r.reorganization = sqlite3_column_double(stmt, 9);
r.phase_reactant_1 = sqlite3_column_double(stmt, 10);
r.phase_reactant_2 = sqlite3_column_double(stmt, 11);
r.phase_product_1 = sqlite3_column_double(stmt, 12);
r.phase_product_2 = sqlite3_column_double(stmt, 13);
r.type = sqlite3_column_double(stmt, 14);
};


struct InitialStateSql {
int species_id;
Expand Down
34 changes: 24 additions & 10 deletions LGMC/LGMC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void print_usage() {
<< "number_of_simulations\n"
<< "base_seed\n"
<< "step_cutoff\n"
<< "lattice_parameters\n";
<< "parameters\n";

} // print_usage()

Expand All @@ -34,6 +34,7 @@ void print_usage_LGMC_parameters() {
<< "Periodicity in z dimension (T/F)\n"
<< "Temperature\n"
<< "Electron free energy\n"
<< "Charge transfer style (M/B)\n"
<< "Is Add Site (T/F)\n";
}

Expand All @@ -54,7 +55,7 @@ int main(int argc, char **argv) {
//{"thread_count", required_argument, NULL, 5},
{"step_cutoff", optional_argument, NULL, 6},
{"time_cutoff", optional_argument, NULL, 7},
{"lattice_parameters", required_argument, NULL, 8},
{"parameters", required_argument, NULL, 8},
{NULL, 0, NULL, 0}
// last element of options array needs to be filled with zeros
};
Expand Down Expand Up @@ -145,13 +146,15 @@ int main(int argc, char **argv) {
float g_e;
bool is_add_site;
char add_site;
ChargeTransferStyle charge_transfer_style;
char ct_style;


std::cin >> latconst >> boxxlo >> boxxhi >> boxylo >> boxyhi >> boxzlo >> boxzhi
>> xperiod >> yperiod >> zperiod >> temperature >> g_e >> add_site;
>> xperiod >> yperiod >> zperiod >> temperature >> g_e >> add_site >> ct_style;

if(std::cin.fail()) {
std::cout << "Incorrect lattice file arguments.\n";
std::cout << "Incorrect parameter file arguments.\n";
exit(EXIT_FAILURE);
}

Expand All @@ -161,7 +164,7 @@ int main(int argc, char **argv) {
else if (xperiod == 'F') {
is_add_site = false;
}else {
std::cout << "Incorrect lattice file argument for add site.\n";
std::cout << "Incorrect parameter file argument for add site.\n";
exit(EXIT_FAILURE);
}

Expand All @@ -171,7 +174,7 @@ int main(int argc, char **argv) {
else if (xperiod == 'F') {
xperiodic = false;
}else {
std::cout << "Incorrect lattice file argument for x periodicity.\n";
std::cout << "Incorrect parameter file argument for x periodicity.\n";
exit(EXIT_FAILURE);
}

Expand All @@ -181,7 +184,7 @@ int main(int argc, char **argv) {
else if (yperiod == 'F') {
yperiodic = false;
}else {
std::cout << "Incorrect lattice file argument for y periodicity.\n";
std::cout << "Incorrect parameter file argument for y periodicity.\n";
exit(EXIT_FAILURE);
}

Expand All @@ -191,19 +194,30 @@ int main(int argc, char **argv) {
else if (zperiod == 'F') {
zperiodic = false;
}else {
std::cout << "Incorrect lattice file argument for z periodicity.\n";
std::cout << "Incorrect parameter file argument for z periodicity.\n";
exit(EXIT_FAILURE);
}

if(ct_style == 'M') {
charge_transfer_style = ChargeTransferStyle::MARCUS;
}
else if (ct_style == 'B') {
charge_transfer_style = ChargeTransferStyle::BUTLER_VOLMER;
}else {
std::cout << "Incorrect parameter file argument for charge transfer style.\n";
exit(EXIT_FAILURE);
}


LGMCParameters parameters{.latconst = latconst, .boxxlo = boxxlo, .boxxhi = boxxhi,
.boxylo = boxyhi, .boxzlo = boxzlo, .boxzhi = boxzhi,
.xperiodic = xperiodic, .yperiodic = yperiodic, .zperiodic = zperiodic,
.temperature = temperature, .g_e = g_e, .is_add_sites = is_add_site};
.temperature = temperature, .g_e = g_e, .is_add_sites = is_add_site,
.charge_transfer_style = charge_transfer_style};

Dispatcher<
LatSolver,
LGMC_NS::LatticeReactionNetwork,
LatticeReactionNetwork,
LGMCParameters,
TrajectoriesSql
>
Expand Down
Loading