PAPRECA hybrid off-lattice kMC/MD simulator  2.0.0 (17 September 2024)
equilibration.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 EQUILIBRATION_H
25 #define EQUILIBRATION_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 "papreca_config.h"
41 #include "lammps_wrappers.h"
42 #include "sim_clock.h"
43 #include "utilities.h"
44 
45 namespace PAPRECA{
46 
47  //Delete desorbed atoms
48  void fillDelidsLocalVec( LAMMPS_NS::LAMMPS *lmp , const double &desorb_cut , std::vector< LAMMPS_NS::tagint > &delids_local , ATOM2BONDS_MAP &atomID2bonds );
49  bool delidsLocalVectorsAreEmpty( std::vector< LAMMPS_NS::tagint > &delids_local );
50  void gatherAndTrimDelIdsOnDriverProc( const int &proc_id , const int &nprocs , std::vector< LAMMPS_NS::tagint > &delids_local , std::vector< LAMMPS_NS::tagint > &delids_global );
51  int fillDelidsVec( LAMMPS_NS::LAMMPS *lmp , const int &proc_id , const double &desorb_cut , std::vector< LAMMPS_NS::tagint > &delids , ATOM2BONDS_MAP &atomID2bonds );
52  void broadcastDelidsFromMasterProc( LAMMPS_NS::LAMMPS *lmp , const int &proc_id , int &delids_num , std::vector< LAMMPS_NS::tagint > &delids );
53 
54  //Equilibration
55  void equilibrateFluidAtoms( LAMMPS_NS::LAMMPS *lmp , PaprecaConfig &papreca_config , double &time );
56  void equilibrate( LAMMPS_NS::LAMMPS *lmp , int &proc_id , const int &nprocs , double &time , PaprecaConfig &papreca_config , double &film_height , int &zero_rate , const int &KMC_loopid , ATOM2BONDS_MAP &atomID2bonds );
57 
58 }//end of PAPRECA namespace
59 
60 
61 #endif
Declarations for PAPRECA::Bond.
Declarations for LAMMPS wrapper functions.
Definition: bond.cpp:26
void gatherAndTrimDelIdsOnDriverProc(const int &proc_id, const int &nprocs, std::vector< LAMMPS_NS::tagint > &delids_local, std::vector< LAMMPS_NS::tagint > &delids_global)
Definition: equilibration.cpp:77
int fillDelidsVec(LAMMPS_NS::LAMMPS *lmp, const int &proc_id, const double &desorb_cut, std::vector< LAMMPS_NS::tagint > &delids, ATOM2BONDS_MAP &atomID2bonds)
Definition: equilibration.cpp:142
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 equilibrateFluidAtoms(LAMMPS_NS::LAMMPS *lmp, PaprecaConfig &papreca_config, double &time)
Definition: equilibration.cpp:286
bool delidsLocalVectorsAreEmpty(std::vector< LAMMPS_NS::tagint > &delids_local)
Definition: equilibration.cpp:61
void equilibrate(LAMMPS_NS::LAMMPS *lmp, int &proc_id, const int &nprocs, double &time, PaprecaConfig &papreca_config, double &film_height, int &zero_rate, const int &KMC_loopid, ATOM2BONDS_MAP &atomID2bonds)
Definition: equilibration.cpp:308
void fillDelidsLocalVec(LAMMPS_NS::LAMMPS *lmp, const double &desorb_cut, std::vector< LAMMPS_NS::tagint > &delids_local, ATOM2BONDS_MAP &atomID2bonds)
Definition: equilibration.cpp:28
void broadcastDelidsFromMasterProc(LAMMPS_NS::LAMMPS *lmp, const int &proc_id, int &delids_num, std::vector< LAMMPS_NS::tagint > &delids)
Definition: equilibration.cpp:198
Declarations for PAPRECA::PaprecaConfig class storing settings and global variables.
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...