PAPRECA hybrid off-lattice kMC/MD simulator  2.0.0 (17 September 2024)
event_execute.h
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------------------
2 PAPRECA hybrid off-lattice kinetic Monte Carlo/Molecular dynamics simulator.
3 Copyright (C) 2024 Stavros Ntioudis, James P. Ewen, Daniele Dini, and C. Heath Turner
4 
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 ----------------------------------------------------------------------------------------*/
19 
23 
24 #ifndef EVENT_EXECUTE_H
25 #define EVENT_EXECUTE_H
26 
27 //System Headers
28 #include <vector>
29 #include <mpi.h>
30 
31 
32 //LAMMPS headers
33 #include "lammps.h"
35 #include "pointers.h"
37 
38 //KMC headers
39 #include "bond.h"
40 #include "event.h"
41 #include "event_list.h"
42 #include "event_select.h"
43 #include "sim_clock.h"
44 #include "papreca_config.h"
45 #include "papreca_error.h"
46 #include "utilities.h"
47 
48 namespace PAPRECA{
49 
50  //Formation events
51  void fillFormTransferDataArr( BondForm *bond_form , int *form_data );
52  void deserializeFormTransferDataArr( int *form_data , int &bond_type , int &delete_atoms );
53  void executeBondForm( LAMMPS_NS::LAMMPS *lmp , const int &proc_id , const int &nprocs , const int &event_proc , Event *selected_event );
54 
55  //Bond-breaking events
56  void executeBondBreak( LAMMPS_NS::LAMMPS *lmp , const int &proc_id , const int &nprocs , const int &event_proc , Event *selected_event , ATOM2BONDS_MAP &atomID2bonds );
57 
58  //Deposition events
59  void fillDepoDataTransfArr( double *depo_data , Deposition *depo );
60  void deserializeDepoTransfData( double *depo_data , double *site_pos , double *rot_pos , double &rot_theta , double &insertion_vel );
61  void executeDeposition( LAMMPS_NS::LAMMPS *lmp , PaprecaConfig &papreca_config , const int &proc_id , const int &nprocs , const int &event_proc , Event *selected_event );
62 
63  //Diffusion events
64  void fillIntegerDiffDataTransfArray( int *diff_intdata , Diffusion *diff );
65  void fillDoubleDiffDataTransfArray( double *diff_doubledata , Diffusion *diff );
66  void deserializeIntegerDiffDataArr( int *diff_intdata , int &parent_type , int &is_displacive , int &diffused_type );
67  void deserializeDoubleDiffDataArr( double *diff_doubledata , double *vac_pos , double &insertion_vel );
68  void executeDiffusion( LAMMPS_NS::LAMMPS *lmp , PaprecaConfig &papreca_config , const int &proc_id , const int &nprocs , const int &event_proc , Event *selected_event );
69 
70  //Monoatomic desorption events
71  void executeMonoatomicDesorption( LAMMPS_NS::LAMMPS *lmp , const int &proc_id , const int &nprocs , const int &event_proc , Event *selected_event );
72 
73  //General event execution functions
74  void printStepInfo( PaprecaConfig &papreca_config , const int &KMC_loopid , const double &time , const double &film_height , const double &proc_rates_sum );
75  void executeEvent( LAMMPS_NS::LAMMPS *lmp , PaprecaConfig &papreca_config , const int &proc_id , const int &nprocs , const int &event_proc , const int &event_num , char *event_type , std::vector< Event* > &events_local , ATOM2BONDS_MAP &atomID2bonds );
76  int selectAndExecuteEvent( LAMMPS_NS::LAMMPS *lmp , int &KMC_loopid , double &time , char *event_type , int &proc_id , int &nprocs , PaprecaConfig &papreca_config , std::vector< Event* > &events_local , ATOM2BONDS_MAP &atomID2bonds , double &film_height );
77 
78 }//end of PAPRECA namespace
79 
80 
81 #endif
Declarations for PAPRECA::Bond.
Declarations for PAPRECA:Event class and its children classes.
Declarations of PredefinedEvent classes.
Declarations for functions that (stochastically) select events for execution.
Definition: bond.cpp:26
void executeDeposition(LAMMPS_NS::LAMMPS *lmp, PaprecaConfig &papreca_config, const int &proc_id, const int &nprocs, const int &event_proc, Event *selected_event)
Definition: event_execute.cpp:186
void executeMonoatomicDesorption(LAMMPS_NS::LAMMPS *lmp, const int &proc_id, const int &nprocs, const int &event_proc, Event *selected_event)
Definition: event_execute.cpp:351
void executeDiffusion(LAMMPS_NS::LAMMPS *lmp, PaprecaConfig &papreca_config, const int &proc_id, const int &nprocs, const int &event_proc, Event *selected_event)
Definition: event_execute.cpp:298
void fillFormTransferDataArr(BondForm *bond_form, int *form_data)
Definition: event_execute.cpp:28
std::unordered_map< LAMMPS_NS::tagint, BOND_VECTOR > ATOM2BONDS_MAP
maps atom IDs to their associated PAPRECA::BOND_VECTOR to allow easy access of bonds and bond types.
Definition: bond.h:46
void fillIntegerDiffDataTransfArray(int *diff_intdata, Diffusion *diff)
Definition: event_execute.cpp:244
void deserializeIntegerDiffDataArr(int *diff_intdata, int &parent_type, int &is_displacive, int &diffused_type)
Definition: event_execute.cpp:271
void deserializeDoubleDiffDataArr(double *diff_doubledata, double *vac_pos, double &insertion_vel)
Definition: event_execute.cpp:286
void executeBondBreak(LAMMPS_NS::LAMMPS *lmp, const int &proc_id, const int &nprocs, const int &event_proc, Event *selected_event, ATOM2BONDS_MAP &atomID2bonds)
Definition: event_execute.cpp:99
void executeEvent(LAMMPS_NS::LAMMPS *lmp, PaprecaConfig &papreca_config, const int &proc_id, const int &nprocs, const int &event_proc, const int &event_num, char *event_type, std::vector< Event * > &events_local, ATOM2BONDS_MAP &atomID2bonds)
Definition: event_execute.cpp:402
void fillDoubleDiffDataTransfArray(double *diff_doubledata, Diffusion *diff)
Definition: event_execute.cpp:258
void deserializeDepoTransfData(double *depo_data, double *site_pos, double *rot_pos, double &rot_theta, double &insertion_vel)
Definition: event_execute.cpp:158
void executeBondForm(LAMMPS_NS::LAMMPS *lmp, const int &proc_id, const int &nprocs, const int &event_proc, Event *selected_event)
Definition: event_execute.cpp:55
void deserializeFormTransferDataArr(int *form_data, int &bond_type, int &delete_atoms)
Definition: event_execute.cpp:42
int selectAndExecuteEvent(LAMMPS_NS::LAMMPS *lmp, int &KMC_loopid, double &time, char *event_type, int &proc_id, int &nprocs, PaprecaConfig &papreca_config, std::vector< Event * > &events_local, ATOM2BONDS_MAP &atomID2bonds, double &film_height)
Definition: event_execute.cpp:451
void fillDepoDataTransfArr(double *depo_data, Deposition *depo)
Definition: event_execute.cpp:133
void printStepInfo(PaprecaConfig &papreca_config, const int &KMC_loopid, const double &time, const double &film_height, const double &proc_rates_sum)
Definition: event_execute.cpp:383
Declarations for PAPRECA::PaprecaConfig class storing settings and global variables.
Functions that enable the communication of error/warning messages to the terminal and coordinate the ...
Declarations for functions that (stochastically) advance the simulation time.
Utility functions (e.g., for arrays, strings etc.) and typedefs used in papreca.cpp main and in the o...