diff --git a/Examples/Henrys_coefficient/CO2.def b/Examples/Henrys_coefficient/CO2.def new file mode 100644 index 0000000..5d5e243 --- /dev/null +++ b/Examples/Henrys_coefficient/CO2.def @@ -0,0 +1,23 @@ +# critical constants: Temperature [T], Pressure [Pa], and Acentric factor [-] +304.1282 +7377300.0 +0.22394 +#Number Of Atoms + 3 +# Number of groups +1 +# CO2-group +rigid +# number of atoms +3 +# atomic positions +0 C_co2 0.0 0.0 0.0 +1 O_co2 0.0 0.0 1.16 +2 O_co2 0.0 0.0 -1.16 +# Chiral centers Bond BondDipoles Bend UrayBradley InvBend Torsion Imp. Torsion Bond/Bond Stretch/Bend Bend/Bend Stretch/Torsion Bend/Torsion IntraVDW IntraCoulomb + 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 +# Bond stretch: atom n1-n2, type, parameters +0 1 RIGID_BOND +0 2 RIGID_BOND +# Number of config moves +0 diff --git a/Examples/Henrys_coefficient/MgMOF74_charged.cif b/Examples/Henrys_coefficient/MgMOF74_charged.cif new file mode 100644 index 0000000..3d26567 --- /dev/null +++ b/Examples/Henrys_coefficient/MgMOF74_charged.cif @@ -0,0 +1,79 @@ +data_image0 +_cell_length_a 6.87407 +_cell_length_b 15.2145 +_cell_length_c 15.2147 +_cell_angle_alpha 117.779 +_cell_angle_beta 98.6603 +_cell_angle_gamma 98.6614 + +_symmetry_space_group_name_H-M "P 1" +_symmetry_int_tables_number 1 + +loop_ + _symmetry_equiv_pos_as_xyz + 'x, y, z' + +loop_ + _atom_site_label + _atom_site_occupancy + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_thermal_displace_type + _atom_site_B_iso_or_equiv + _atom_site_type_symbol + _atom_site_charge + C1 1.0000 0.30580 0.48194 0.01275 Biso 1.000 C -0.2104684987306805 + C2 1.0000 0.17620 0.46921 0.48198 Biso 1.000 C -0.2104684987306805 + C3 1.0000 0.11487 0.53380 0.44726 Biso 1.000 C -0.1438961439497434 + C4 1.0000 0.29302 0.98723 0.46922 Biso 1.000 C -0.2104684987306805 + C5 1.0000 0.82381 0.53079 0.51802 Biso 1.000 C -0.2104684987306805 + C6 1.0000 0.14810 0.39109 0.82686 Biso 1.000 C 0.6258360669285988 + C7 1.0000 0.32122 0.17314 0.56422 Biso 1.000 C 0.6245620773708138 + C8 1.0000 0.75700 0.43578 0.60891 Biso 1.000 C 0.6245620773708138 + C9 1.0000 0.85191 0.60891 0.17314 Biso 1.000 C 0.6258360669285988 + C10 1.0000 0.67878 0.82686 0.43578 Biso 1.000 C 0.6258360669285988 + C11 1.0000 0.24300 0.56422 0.39109 Biso 1.000 C 0.6245620773708138 + C12 1.0000 0.53267 0.46544 0.89910 Biso 1.000 C 0.3457498194306733 + C13 1.0000 0.63355 0.10091 0.56631 Biso 1.000 C 0.3457498194306733 + C14 1.0000 0.06724 0.43368 0.53458 Biso 1.000 C 0.3457498194306733 + C15 1.0000 0.46734 0.53456 0.10090 Biso 1.000 C 0.3457498194306733 + C16 1.0000 0.36646 0.89909 0.43369 Biso 1.000 C 0.3457498194306733 + C17 1.0000 0.93276 0.56632 0.46542 Biso 1.000 C 0.3457498194306733 + C18 1.0000 0.58108 0.91345 0.46620 Biso 1.000 C -0.1415255444240728 + C19 1.0000 0.66760 0.55276 0.08655 Biso 1.000 C -0.1415255444240728 + C20 1.0000 0.88513 0.46620 0.55274 Biso 1.000 C -0.1438961439497434 + C21 1.0000 0.41893 0.08655 0.53380 Biso 1.000 C -0.1415255444240728 + C22 1.0000 0.33240 0.44724 0.91345 Biso 1.000 C -0.1415255444240728 + C23 1.0000 0.70698 0.01277 0.53078 Biso 1.000 C -0.2104684987306805 + C24 1.0000 0.69422 0.51806 0.98724 Biso 1.000 C -0.2104684987306805 + H1 1.0000 0.84786 0.53293 0.97797 Biso 1.000 H 0.1162825974646878 + H2 1.0000 0.86991 0.02207 0.55490 Biso 1.000 H 0.1162825974646878 + H3 1.0000 0.31502 0.44511 0.46715 Biso 1.000 H 0.1162825974646878 + H4 1.0000 0.15215 0.46707 0.02203 Biso 1.000 H 0.1162825974646878 + H5 1.0000 0.13009 0.97793 0.44510 Biso 1.000 H 0.1162825974646878 + H6 1.0000 0.68498 0.55489 0.53285 Biso 1.000 H 0.1162825974646878 + Mg1 1.0000 0.01746 0.73188 0.40646 Biso 1.000 Mg 1.4261149381623304 + Mg2 1.0000 0.38898 0.40647 0.67457 Biso 1.000 Mg 1.4261149381623304 + Mg3 1.0000 0.71443 0.32546 0.73188 Biso 1.000 Mg 1.4261149381623304 + Mg4 1.0000 0.98254 0.26812 0.59354 Biso 1.000 Mg 1.4261149381623304 + Mg5 1.0000 0.61101 0.59353 0.32543 Biso 1.000 Mg 1.4261149381623304 + Mg6 1.0000 0.28557 0.67454 0.26812 Biso 1.000 Mg 1.4261149381623304 + O1 1.0000 0.60061 0.46926 0.62725 Biso 1.000 O -0.6597980252910617 + O2 1.0000 0.02662 0.62725 0.15801 Biso 1.000 O -0.6597980252910617 + O3 1.0000 0.86864 0.84201 0.46927 Biso 1.000 O -0.6597980252910617 + O4 1.0000 0.39939 0.53074 0.37275 Biso 1.000 O -0.6597980252910617 + O5 1.0000 0.17015 0.36185 0.73519 Biso 1.000 O -0.7279031856225537 + O6 1.0000 0.43493 0.26482 0.62665 Biso 1.000 O -0.7279031856225537 + O7 1.0000 0.80831 0.37336 0.63816 Biso 1.000 O -0.7279031856225537 + O8 1.0000 0.82985 0.63815 0.26481 Biso 1.000 O -0.7279031856225537 + O9 1.0000 0.19169 0.62664 0.36184 Biso 1.000 O -0.7279031856225537 + O10 1.0000 0.13135 0.15800 0.53073 Biso 1.000 O -0.6597980252910617 + O11 1.0000 0.57369 0.43506 0.80662 Biso 1.000 O -0.7728609732971390 + O12 1.0000 0.76704 0.19339 0.62839 Biso 1.000 O -0.7728609732971390 + O13 1.0000 0.13866 0.37160 0.56498 Biso 1.000 O -0.7728609732971390 + O14 1.0000 0.42631 0.56494 0.19338 Biso 1.000 O -0.7728609732971390 + O15 1.0000 0.23296 0.80661 0.37161 Biso 1.000 O -0.7728609732971390 + O16 1.0000 0.86136 0.62839 0.43502 Biso 1.000 O -0.7728609732971390 + O17 1.0000 0.56507 0.73518 0.37335 Biso 1.000 O -0.7279031856225537 + O18 1.0000 0.97338 0.37275 0.84199 Biso 1.000 O -0.6597980252910617 diff --git a/Examples/Henrys_coefficient/force_field.def b/Examples/Henrys_coefficient/force_field.def new file mode 100644 index 0000000..0e7bb78 --- /dev/null +++ b/Examples/Henrys_coefficient/force_field.def @@ -0,0 +1,6 @@ +# rules to overwrite +0 +# number of defined interactions +0 +# mixing rules to overwrite +0 diff --git a/Examples/Henrys_coefficient/force_field_mixing_rules.def b/Examples/Henrys_coefficient/force_field_mixing_rules.def new file mode 100644 index 0000000..8d17dbf --- /dev/null +++ b/Examples/Henrys_coefficient/force_field_mixing_rules.def @@ -0,0 +1,15 @@ +# general rule for shifted vs truncated +truncated +# general rule tailcorrections +no +# number of defined interactions +6 +# type interaction, parameters. IMPORTANT: define shortest matches first, so that more specific ones overwrites these +Mg lennard-jones 55.85 2.69 +O lennard-jones 30.19 3.12 +C lennard-jones 52.83 3.43 +H lennard-jones 22.14 2.57 +C_co2 lennard-jones 27.0 2.800 +O_co2 lennard-jones 79.0 3.050 +# general mixing rule for Lennard-Jones +Lorentz-Berthelot diff --git a/Examples/Henrys_coefficient/pseudo_atoms.def b/Examples/Henrys_coefficient/pseudo_atoms.def new file mode 100644 index 0000000..ceb9ff1 --- /dev/null +++ b/Examples/Henrys_coefficient/pseudo_atoms.def @@ -0,0 +1,9 @@ +#number of pseudo atoms +6 +#type print as chem oxi mass charge pol +Mg yes Mg Mg 0 24.305 0.0 0 +O yes O O 0 15.999 0 0 +C yes C C 0 12.011 0 0 +H yes H H 0 1.008 0.0 0 +C_co2 yes C C 0 12.0 0.7 0.0 +O_co2 yes O O 0 15.9994 -0.35 0.0 diff --git a/Examples/Henrys_coefficient/simulation.input b/Examples/Henrys_coefficient/simulation.input new file mode 100644 index 0000000..e5dddad --- /dev/null +++ b/Examples/Henrys_coefficient/simulation.input @@ -0,0 +1,48 @@ +UseGPUReduction no +Useflag yes + +NumberOfInitializationCycles 0 +NumberOfEquilibrationCycles 0 +NumberOfProductionCycles 10000000 + +UseMaxStep yes +MaxStepPerCycle 1 + +UseChargesFromCIFFile yes + +RestartFile no +RandomSeed 0 + +BMCBiasingMethod LJ_Biasing + +NumberOfTrialPositions 10 +NumberOfTrialOrientations 10 + +NumberOfBlocks 1 +AdsorbateAllocateSpace 10240 +NumberOfSimulations 1 +SingleSimulation yes + +DifferentFrameworks yes +InputFileType cif +FrameworkName MgMOF74_charged +UnitCells 0 5 3 3 + +ChargeMethod Ewald +Temperature 313 +Pressure 1000000 + +OverlapCriteria 1e20 +CutOffVDW 14.0 +CutOffCoulomb 14.0 +EwaldPrecision 1e-6 + +UseDNNforHostGuest no + +Component 0 MoleculeName CO2 + IdealGasRosenbluthWeight 1.0 + FugacityCoefficient 1.0 + WidomProbability 1.0 + CreateNumberOfMolecules 0 + + diff --git a/libtorch-patch/Allegro/PATCH_ALLEGRO_DNN_HostGuest_Energy_Functions.h.txt b/libtorch-patch/Allegro/PATCH_ALLEGRO_DNN_HostGuest_Energy_Functions.h.txt index 062a50a..e16a3e6 100644 --- a/libtorch-patch/Allegro/PATCH_ALLEGRO_DNN_HostGuest_Energy_Functions.h.txt +++ b/libtorch-patch/Allegro/PATCH_ALLEGRO_DNN_HostGuest_Energy_Functions.h.txt @@ -17,17 +17,17 @@ PATCH_ALLEGRO_INSERTION double3* temp_pos; temp_pos = (double3*) malloc(sizeof(double3) * SystemComponents.Moleculesize[SelectedComponent]); cudaMemcpy(temp_pos, Sims.Old.pos, sizeof(double3) * SystemComponents.Moleculesize[SelectedComponent], cudaMemcpyDeviceToHost); Check_DNNAtom_and_copy_pos_to_UCAtoms(temp_pos, SystemComponents.DNN.UCAtoms[SelectedComponent], SystemComponents.ConsiderThisAdsorbateAtom, SystemComponents.Moleculesize[SelectedComponent]); - if(SystemComponents.CURRENTCYCLE <= 30) - { - printf("DNN INSERTION BEFORE CHECK DNN PseudoAtoms\n"); - for(size_t i = 0; i < SystemComponents.Moleculesize[SelectedComponent]; i++) - printf("pos: %f %f %f\n", temp_pos[i].x, temp_pos[i].y, temp_pos[i].z); - - printf("DNN INSERTION AFTER CHECK DNN PseudoAtoms\n"); - for(size_t i = 0; i < SystemComponents.DNN.UCAtoms[SelectedComponent].size; i++) - printf("pos: %f %f %f\n", SystemComponents.DNN.UCAtoms[SelectedComponent].pos[i].x, SystemComponents.DNN.UCAtoms[SelectedComponent].pos[i].y, SystemComponents.DNN.UCAtoms[SelectedComponent].pos[i].z); - } - DNN_New = SystemComponents.DNN.MCEnergyWrapper(SelectedComponent, Initialize, SystemComponents.DNNEnergyConversion); +// if(SystemComponents.CURRENTCYCLE <= 30) +// { +// printf("DNN INSERTION BEFORE CHECK DNN PseudoAtoms\n"); +// for(size_t i = 0; i < SystemComponents.Moleculesize[SelectedComponent]; i++) +// printf("pos: %f %f %f\n", temp_pos[i].x, temp_pos[i].y, temp_pos[i].z); +// +// printf("DNN INSERTION AFTER CHECK DNN PseudoAtoms\n"); +// for(size_t i = 0; i < SystemComponents.DNN.UCAtoms[SelectedComponent].size; i++) +// printf("pos: %f %f %f\n", SystemComponents.DNN.UCAtoms[SelectedComponent].pos[i].x, SystemComponents.DNN.UCAtoms[SelectedComponent].pos[i].y, SystemComponents.DNN.UCAtoms[SelectedComponent].pos[i].z); +// } + DNN_New = SystemComponents.DNN.MCEnergyWrapper(SelectedComponent, Initialize, SystemComponents.DNNEnergyConversion); free(temp_pos); }