diff --git a/.gitignore b/.gitignore index 7baa0e4..a604f40 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,5 @@ # Visual Studio files *.vcxproj* .vs* +x64* *.sln diff --git a/CHANGELOG.md b/CHANGELOG.md index 983ecb4..b458155 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 -------------------------------------------------------------------------------------------------------------------------------- -## [Unreleased] +## [v2.0.0] - 2019-01-22 + +### Added +- .gitignore - Ignore statement for the Visual Studio x64 build directory +- paper.bib - Missing reference info to several of the book chapter bibtex entries +- Parameters_Lattice - Default values for all parameters +- Parameters_Simulation - Default values for all parameters +- test.cpp (SimulationTest) - Test that default parameters object has invalid parameters +- test.cpp (LatticeTest) - Test that default parameters object has invalid parameters + +### Changed +- README.md - Current status to note release of stable v2.0.0 + +### Fixed +- docs - Several spelling mistakes and typos in the documentation +- test.cpp - Copyright years in the Doxygen documentation block +- test_mpi.cpp - Copyright years in the Doxygen documentation block +- paper.md - Typos and formatting issues +- paper.bib - Formatting problems in bibtex entries ## [v2.0.0-rc.2] - 2019-01-07 - Release Candidate 2 @@ -64,13 +82,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Utils (createGaussianDOSVector) - Refactored code to use generate function for filling the output data vector - Utils (MPI_*) - Refactored functions by replacing for loops with copy, assign, and accumulate functions to make code more concise - test.cpp (main) - Re-enabled command line output during the tests to make it easier to see when errors occur -- test.cpp (CalculateProbabilityHistTests) - Replaced generic unform_real_distribution by specifying use of the double version +- test.cpp (CalculateProbabilityHistTests) - Replaced generic uniform_real_distribution by specifying use of the double version - test.cpp (CalculateProbabilityHistTests) - Increasing the number of entries in the data vectors to increase statistical accuracy and reduce likelihood of test failure - test.cpp (CalculateProbabilityHistTests) - Refactored tests to use the generate function for filling a vector with random numbers ### Fixed -- Event - Corrected the copyright years in the Doxygen documentation block for the class -- Lattice - Corrected the copyright years in the Doxygen documentation block for the class -- Object - Corrected the copyright years in the Doxygen documentation block for the class -- Simulation - Corrected the copyright years in the Doxygen documentation block for the class -- Site - Corrected the copyright years in the Doxygen documentation block for the class +- Event - Copyright years in the Doxygen documentation block for the class +- Lattice - Copyright years in the Doxygen documentation block for the class +- Object - Copyright years in the Doxygen documentation block for the class +- Simulation - Copyright years in the Doxygen documentation block for the class +- Site - Copyright years in the Doxygen documentation block for the class diff --git a/README.md b/README.md index 81bff33..a99843b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# KMC_Lattice +# KMC_Lattice ## General Information @@ -25,8 +25,7 @@ For further reading about kinetic Monte Carlo simulations, nice overviews of the ## Current Status -The current release is KMC_Lattice [![GitHub (pre-)release](https://img.shields.io/github/release/MikeHeiber/KMC_Lattice/all.svg?style=flat-square)](https://github.com/MikeHeiber/KMC_Lattice/releases). -All major planned features that are to be included in v2.0 are now implemented and have undergone significant testing. +The latest stable release is KMC_Lattice v2.0.0. Please report any remaining bugs or submit feature requests for future releases in the [Issues](https://github.com/MikeHeiber/KMC_Lattice/issues) section. To keep track of upcoming changes or review prior changes to the codebase, please see the [Changelog](./CHANGELOG.md). @@ -133,4 +132,4 @@ If you find KMC_Lattice to be helpful for your research, please cite the forthco ## Acknowledgments -Development of v2.0 is supported by financial assistance award 70NANB14H012 from U.S. Department of Commerce, National Institute of Standards and Technology as part of the Center for Hierarchical Materials Design (CHiMaD). +Development of v2.0.0 was supported by financial assistance award 70NANB14H012 from U.S. Department of Commerce, National Institute of Standards and Technology as part of the Center for Hierarchical Materials Design (CHiMaD). diff --git a/docs/_event_8h_source.html b/docs/_event_8h_source.html index a605124..8b54605 100644 --- a/docs/_event_8h_source.html +++ b/docs/_event_8h_source.html @@ -108,12 +108,12 @@
KMC_Lattice::Event::getExecutionTime
double getExecutionTime() const
Gets the currently planned execution time of the event.
Definition: Event.cpp:43
KMC_Lattice::Event::getObjectTargetPtr
Object * getObjectTargetPtr() const
Gets a pointer to the Object object that is designated as the target of the event.
Definition: Event.cpp:51
KMC_Lattice::Event::setRateConstant
void setRateConstant(double val)
Sets the value of the rate constant for the event.
Definition: Event.cpp:81
-
KMC_Lattice::Event::sim_ptr
Simulation * sim_ptr
Points to the Simulation object that the Event is asociated with.
Definition: Event.h:109
+
KMC_Lattice::Event::sim_ptr
Simulation * sim_ptr
Points to the Simulation object that the Event is associated with.
Definition: Event.h:109
KMC_Lattice::Event::~Event
virtual ~Event()
Default virtual destructor needed by the base class.
Definition: Event.cpp:15
KMC_Lattice::Event::calculateRateConstant
void calculateRateConstant(const double input_rate)
Default virtual function that can be overloaded by derived Event classes.
Definition: Event.cpp:31
KMC_Lattice::Event::getEventType
virtual std::string getEventType() const
Gets the name of event class.
Definition: Event.cpp:39
KMC_Lattice::Event::Event
Event()
The default constructor that creates an empty Event object.
Definition: Event.cpp:19
-
KMC_Lattice::Event::setDestCoords
void setDestCoords(const Coords &coords)
Sets the desination coordinates of the event.
Definition: Event.cpp:59
+
KMC_Lattice::Event::setDestCoords
void setDestCoords(const Coords &coords)
Sets the destination coordinates of the event.
Definition: Event.cpp:59
KMC_Lattice
Definition: Event.cpp:10
diff --git a/docs/_parameters___lattice_8h_source.html b/docs/_parameters___lattice_8h_source.html index f80cd68..d5c0690 100644 --- a/docs/_parameters___lattice_8h_source.html +++ b/docs/_parameters___lattice_8h_source.html @@ -91,7 +91,7 @@
Parameters_Lattice.h
-Go to the documentation of this file.
1 // Copyright (c) 2017-2019 Michael C. Heiber
2 // This source file is part of the KMC_Lattice project, which is subject to the MIT License.
3 // For more information, see the LICENSE file that accompanies this software.
4 // The KMC_Lattice project can be found on Github at https://github.com/MikeHeiber/KMC_Lattice
5 
6 #ifndef KMC_LATTICE_PARAMETERS_LATTICE_H
7 #define KMC_LATTICE_PARAMETERS_LATTICE_H
8 
9 #include <iostream>
10 
11 namespace KMC_Lattice {
12 
18  public:
19  // Member variables
27  int Length;
29  int Width;
31  int Height;
33  double Unit_size; // nm
34 
35  // Functions
37  virtual ~Parameters_Lattice();
38 
41 
45  bool checkParameters() const;
46  };
47 }
48 
49 #endif // KMC_LATTICE_PARAMETERS_LATTICE_H
bool Enable_periodic_y
Determines whether the y-direction periodic boundaries will be enabled.
Definition: Parameters_Lattice.h:23
+Go to the documentation of this file.
1 // Copyright (c) 2017-2019 Michael C. Heiber
2 // This source file is part of the KMC_Lattice project, which is subject to the MIT License.
3 // For more information, see the LICENSE file that accompanies this software.
4 // The KMC_Lattice project can be found on Github at https://github.com/MikeHeiber/KMC_Lattice
5 
6 #ifndef KMC_LATTICE_PARAMETERS_LATTICE_H
7 #define KMC_LATTICE_PARAMETERS_LATTICE_H
8 
9 #include <iostream>
10 
11 namespace KMC_Lattice {
12 
18  public:
19  // Member variables
21  bool Enable_periodic_x = true;
23  bool Enable_periodic_y = true;
25  bool Enable_periodic_z = true;
27  int Length = 0;
29  int Width = 0;
31  int Height = 0;
33  double Unit_size = 0.0; // nm
34 
35  // Functions
37  virtual ~Parameters_Lattice();
38 
41 
45  bool checkParameters() const;
46  };
47 }
48 
49 #endif // KMC_LATTICE_PARAMETERS_LATTICE_H
bool Enable_periodic_y
Determines whether the y-direction periodic boundaries will be enabled.
Definition: Parameters_Lattice.h:23
Parameters_Lattice()
Default constructor that creates an empty object.
Definition: Parameters_Lattice.cpp:16
bool Enable_periodic_z
Determines whether the z-direction periodic boundaries will be enabled.
Definition: Parameters_Lattice.h:25
double Unit_size
Defines the desired lattice unit size, which is used to convert lattice units into real space units.
Definition: Parameters_Lattice.h:33
diff --git a/docs/_parameters___simulation_8h_source.html b/docs/_parameters___simulation_8h_source.html index 14e08d2..573febb 100644 --- a/docs/_parameters___simulation_8h_source.html +++ b/docs/_parameters___simulation_8h_source.html @@ -91,7 +91,7 @@
Parameters_Simulation.h
-Go to the documentation of this file.
1 // Copyright (c) 2017-2019 Michael C. Heiber
2 // This source file is part of the KMC_Lattice project, which is subject to the MIT License.
3 // For more information, see the LICENSE file that accompanies this software.
4 // The KMC_Lattice project can be found on Github at https://github.com/MikeHeiber/KMC_Lattice
5 
6 #ifndef KMC_LATTICE_PARAMETERS_SIMULATION_H
7 #define KMC_LATTICE_PARAMETERS_SIMULATION_H
8 
9 #include "Parameters_Lattice.h"
10 #include <fstream>
11 #include <iostream>
12 
13 namespace KMC_Lattice {
14 
20  public:
21  // Member variables
28  bool Enable_FRM;
36  std::ofstream* Logfile = nullptr;
37 
38  // Functions
40  virtual ~Parameters_Simulation();
41 
44 
48  bool checkParameters() const;
49  };
50 }
51 
52 #endif // KMC_LATTICE_PARAMETERS_SIMULATION_H
bool Enable_logging
Determines whether logging to a logfile during the simulation will be enabled or not.
Definition: Parameters_Simulation.h:24
+Go to the documentation of this file.
1 // Copyright (c) 2017-2019 Michael C. Heiber
2 // This source file is part of the KMC_Lattice project, which is subject to the MIT License.
3 // For more information, see the LICENSE file that accompanies this software.
4 // The KMC_Lattice project can be found on Github at https://github.com/MikeHeiber/KMC_Lattice
5 
6 #ifndef KMC_LATTICE_PARAMETERS_SIMULATION_H
7 #define KMC_LATTICE_PARAMETERS_SIMULATION_H
8 
9 #include "Parameters_Lattice.h"
10 #include <fstream>
11 #include <iostream>
12 
13 namespace KMC_Lattice {
14 
20  public:
21  // Member variables
24  bool Enable_logging = false;
26  int Temperature = 0;
28  bool Enable_FRM = false;
32  int Recalc_cutoff = 0;
34  bool Enable_full_recalc = false;
36  std::ofstream* Logfile = nullptr;
37 
38  // Functions
40  virtual ~Parameters_Simulation();
41 
44 
48  bool checkParameters() const;
49  };
50 }
51 
52 #endif // KMC_LATTICE_PARAMETERS_SIMULATION_H
bool Enable_logging
Determines whether logging to a logfile during the simulation will be enabled or not.
Definition: Parameters_Simulation.h:24
int Recalc_cutoff
Defines the desired event recalculation cutoff radius for the simulation in nm.
Definition: Parameters_Simulation.h:32
Parameters_Simulation()
Default constructor that creates an empty object.
Definition: Parameters_Simulation.cpp:16
bool Enable_full_recalc
Determines whether the full recalculation method will be used or not.
Definition: Parameters_Simulation.h:34
diff --git a/docs/_utils_8cpp.html b/docs/_utils_8cpp.html index b88ba0f..bd8b5d5 100644 --- a/docs/_utils_8cpp.html +++ b/docs/_utils_8cpp.html @@ -179,7 +179,7 @@  Uses MPI to gather vectors from separate processors to build one big vector containing all of the data. More...
  std::string KMC_Lattice::removeWhitespace (const std::string &str) - Removes all spaces and ta characters in a string. More...
+ Removes all spaces and tab characters in a string. More...
  int KMC_Lattice::round_int (const double num)  Rounds the input double value to the nearest integer value. More...
diff --git a/docs/_utils_8h.html b/docs/_utils_8h.html index 56a1cc1..6230757 100644 --- a/docs/_utils_8h.html +++ b/docs/_utils_8h.html @@ -200,7 +200,7 @@  Uses MPI to gather vectors from separate processors to build one big vector containing all of the data. More...
  std::string KMC_Lattice::removeWhitespace (const std::string &str) - Removes all spaces and ta characters in a string. More...
+ Removes all spaces and tab characters in a string. More...
  int KMC_Lattice::round_int (const double num)  Rounds the input double value to the nearest integer value. More...
@@ -238,7 +238,7 @@   template<typename T > void KMC_Lattice::removeDuplicates (std::vector< T > &vec) - This template function efficienctly removes the duplicate entries from an input vector. More...
+ This template function efficiently removes the duplicate entries from an input vector. More...
  template<typename T , typename A > double KMC_Lattice::vector_avg (const std::vector< T, A > &data) diff --git a/docs/_utils_8h_source.html b/docs/_utils_8h_source.html index 797fc3d..6bedc3e 100644 --- a/docs/_utils_8h_source.html +++ b/docs/_utils_8h_source.html @@ -104,9 +104,9 @@
int x
The x Cartesian coordinate.
Definition: Utils.h:31
std::vector< std::pair< double, double > > MPI_calculateProbHistAvg(const std::vector< std::pair< double, int >> &input_hist)
Uses MPI to calculate the average probability histogram from separate histograms coming from differen...
Definition: Utils.cpp:371
int array_which_median(const T data[], const int array_size)
This template function determines which element in the data array has the median value of the dataset...
Definition: Utils.h:342
-
std::string removeWhitespace(const std::string &str_input)
Removes all spaces and ta characters in a string.
Definition: Utils.cpp:618
+
std::string removeWhitespace(const std::string &str_input)
Removes all spaces and tab characters in a string.
Definition: Utils.cpp:618
double array_stdev(const T data[], const int array_size)
This template function calculates and returns the standard deviation in double format when given an a...
Definition: Utils.h:327
-
void removeDuplicates(std::vector< T > &vec)
This template function efficienctly removes the duplicate entries from an input vector.
Definition: Utils.h:405
+
void removeDuplicates(std::vector< T > &vec)
This template function efficiently removes the duplicate entries from an input vector.
Definition: Utils.h:405
std::vector< std::pair< double, double > > calculateProbabilityHist(const std::vector< std::pair< double, int >> hist)
Calculates the probability histogram for the input histogram data vector. The function outputs bin-ce...
Definition: Utils.cpp:80
std::vector< double > MPI_gatherVectors(const std::vector< double > &input_vector)
Uses MPI to gather vectors from separate processors to build one big vector containing all of the dat...
Definition: Utils.cpp:536
double interpolateData(const std::vector< std::pair< double, double >> &data, const double x_val)
Linearly interpolates an x-y data set to determine the interpolated y-value corresponding to an input...
Definition: Utils.cpp:361
diff --git a/docs/class_k_m_c___lattice_1_1_event.html b/docs/class_k_m_c___lattice_1_1_event.html index d85f4eb..09a24e5 100644 --- a/docs/class_k_m_c___lattice_1_1_event.html +++ b/docs/class_k_m_c___lattice_1_1_event.html @@ -136,7 +136,7 @@  Gets the stored rate constant of the event. More...
  void setDestCoords (const Coords &coords) - Sets the desination coordinates of the event. More...
+ Sets the destination coordinates of the event. More...
  bool setExecutionTime (const double time)  Sets the execution time of the event. More...
@@ -154,7 +154,7 @@

Protected Attributes

Simulationsim_ptr = nullptr - Points to the Simulation object that the Event is asociated with. More...
+ Points to the Simulation object that the Event is associated with. More...
  double rate_constant = -1.0  Stores the rate constant of the particular event. More...
@@ -227,7 +227,7 @@

-

Constructor that creates an empty Event object pre-initilized with the Simulation pointer.

Parameters
+

Constructor that creates an empty Event object pre-initialized with the Simulation pointer.

Parameters
sim_ptris a pointer to the Simulation object that the Event is associated with.
@@ -436,7 +436,7 @@

-

Sets the desination coordinates of the event.

+

Sets the destination coordinates of the event.

Parameters
@@ -598,7 +598,7 @@

-

Points to the Simulation object that the Event is asociated with.

+

Points to the Simulation object that the Event is associated with.

The pointer is used to access the current time in the simulation and the random number generator.

diff --git a/docs/class_k_m_c___lattice_1_1_lattice.html b/docs/class_k_m_c___lattice_1_1_lattice.html index 1c6ab5a..9630548 100644 --- a/docs/class_k_m_c___lattice_1_1_lattice.html +++ b/docs/class_k_m_c___lattice_1_1_lattice.html @@ -204,7 +204,7 @@

coordsis the Coords struct that designates the input coordinates.

Detailed Description

This class contains the properties of a three-dimensional lattice and the functions needed to interact with it.

-

The class makes use of the Parameters_Lattice struct to load the neccessary input parameters, the Coords struct to record the Cartesian coordinates of each lattice site, and the Site class to assign properties to each site.

+

The class makes use of the Parameters_Lattice struct to load the necessary input parameters, the Coords struct to record the Cartesian coordinates of each lattice site, and the Site class to assign properties to each site.

Author
Michael C. Heiber
Date
2017-2019

Constructor & Destructor Documentation

@@ -274,9 +274,9 @@

Calculates the destination coordinates when given the starting coordinates and the displacement vector (i,j,k).

-

When the starting coordinates are near one or more of the lattice boundaries and periodic boundary conditions are enabled, the function detemines the destination coordinates across the periodic boundary and assigns the calculated Coords struct to the input coords_dest argument.

Parameters
+

When the starting coordinates are near one or more of the lattice boundaries and periodic boundary conditions are enabled, the function determines the destination coordinates across the periodic boundary and assigns the calculated Coords struct to the input coords_dest argument.

Parameters
- + @@ -1028,7 +1028,7 @@

Returns
true if the specificed site is occupied
+
Returns
true if the specified site is occupied
false if the specified site is unoccupied
diff --git a/docs/class_k_m_c___lattice_1_1_parameters___lattice.html b/docs/class_k_m_c___lattice_1_1_parameters___lattice.html index c9cde74..9530d2d 100644 --- a/docs/class_k_m_c___lattice_1_1_parameters___lattice.html +++ b/docs/class_k_m_c___lattice_1_1_parameters___lattice.html @@ -115,25 +115,25 @@

coords_initialis the Coords struct tht designates the starting coordinates.
coords_initialis the Coords struct that designates the starting coordinates.
iis the displacement in the x-direction.
jis the displacement in the y-direction.
kis the displacement in the z-direction.
- + - + - + - + - + - + - +

Public Attributes

bool Enable_periodic_x
bool Enable_periodic_x = true
 Determines whether the x-direction periodic boundaries will be enabled. More...
 
bool Enable_periodic_y
bool Enable_periodic_y = true
 Determines whether the y-direction periodic boundaries will be enabled. More...
 
bool Enable_periodic_z
bool Enable_periodic_z = true
 Determines whether the z-direction periodic boundaries will be enabled. More...
 
int Length
int Length = 0
 Defines the desired x-direction size of the lattice. More...
 
int Width
int Width = 0
 Defines the desired y-direction size of the lattice. More...
 
int Height
int Height = 0
 Defines the desired z-direction size of the lattice. More...
 
double Unit_size
double Unit_size = 0.0
 Defines the desired lattice unit size, which is used to convert lattice units into real space units. More...
 
@@ -217,7 +217,7 @@

- +
bool KMC_Lattice::Parameters_Lattice::Enable_periodic_xbool KMC_Lattice::Parameters_Lattice::Enable_periodic_x = true

diff --git a/docs/class_k_m_c___lattice_1_1_parameters___simulation.html b/docs/class_k_m_c___lattice_1_1_parameters___simulation.html index c53ef25..b5566b6 100644 --- a/docs/class_k_m_c___lattice_1_1_parameters___simulation.html +++ b/docs/class_k_m_c___lattice_1_1_parameters___simulation.html @@ -117,22 +117,22 @@ Public Attributes Parameters_Lattice Params_lattice   -bool Enable_logging +bool Enable_logging = false  Determines whether logging to a logfile during the simulation will be enabled or not. More...
  -int Temperature +int Temperature = 0  Defines the desired temperature of the simulation in Kelvin. More...
  -bool Enable_FRM +bool Enable_FRM = false  Determines whether the first reaction method will be used or not. More...
  -bool Enable_selective_recalc +bool Enable_selective_recalc = false  Determines whether the selective recalculation method will be used or not. More...
  -int Recalc_cutoff +int Recalc_cutoff = 0  Defines the desired event recalculation cutoff radius for the simulation in nm. More...
  -bool Enable_full_recalc +bool Enable_full_recalc = false  Determines whether the full recalculation method will be used or not. More...
  std::ofstream * Logfile = nullptr @@ -219,7 +219,7 @@

- +
bool KMC_Lattice::Parameters_Simulation::Enable_FRMbool KMC_Lattice::Parameters_Simulation::Enable_FRM = false

@@ -915,7 +915,7 @@

Removes the Object pointer from the base simulation class.

-

The Object objects are allocated and maintained by the derived Simulation class and only the Object pointers are stored in the base class. Removing the Object pointer does not delete the Object from the derived class. This function also calls the removeEvent function to remove the Event pointer associated with the Object and also communites with the Lattice object to clear the occupancy of the Site where the Object was located.

Parameters
+

The Object objects are allocated and maintained by the derived Simulation class and only the Object pointers are stored in the base class. Removing the Object pointer does not delete the Object from the derived class. This function also calls the removeEvent function to remove the Event pointer associated with the Object and also communities with the Lattice object to clear the occupancy of the Site where the Object was located.

Parameters
object_ptris the Object pointer to be removed from the simulation.
diff --git a/docs/namespace_k_m_c___lattice.html b/docs/namespace_k_m_c___lattice.html index 8efced6..7a4a78b 100644 --- a/docs/namespace_k_m_c___lattice.html +++ b/docs/namespace_k_m_c___lattice.html @@ -204,7 +204,7 @@  Uses MPI to gather vectors from separate processors to build one big vector containing all of the data. More...
  std::string removeWhitespace (const std::string &str) - Removes all spaces and ta characters in a string. More...
+ Removes all spaces and tab characters in a string. More...
  int round_int (const double num)  Rounds the input double value to the nearest integer value. More...
@@ -242,7 +242,7 @@   template<typename T > void removeDuplicates (std::vector< T > &vec) - This template function efficienctly removes the duplicate entries from an input vector. More...
+ This template function efficiently removes the duplicate entries from an input vector. More...
  template<typename T , typename A > double vector_avg (const std::vector< T, A > &data) @@ -869,11 +869,11 @@

Creates a vector of doubles that has a custom asymmetric distribution with an exponential tail.

-

The created distribution is Gaussian in the positive direction relative to the mode and exponential in the negative direction. On the Gaussian side, the standard deviation is calculated relative to the urbach energy chosen for the exponential side, so that the distribution function is continuous.

Parameters
+

The created distribution is Gaussian in the positive direction relative to the mode and exponential in the negative direction. On the Gaussian side, the standard deviation is calculated relative to the Urbach energy chosen for the exponential side, so that the distribution function is continuous.

Parameters
- +
datais the data vector where the random numbers will be placed, which must be preallocated to the desired size.
modeis the value of the peak of the distribution.
urbach_energyis the parameter that detemines the shape of the exponential tail side of the distribution.
urbach_energyis the parameter that determines the shape of the exponential tail side of the distribution.
genis a Mersenne twister random number generator used to randomly draw numbers from the distribution.
@@ -920,11 +920,11 @@

Creates a vector of floats that has a custom asymmetric distribution with an exponential tail.

-

The created distribution is Gaussian in the positive direction relative to the mode and exponential in the negative direction. On the Gaussian side, the standard deviation is calculated relative to the urbach energy chosen for the exponential side, so that the distribution function is continuous.

Parameters
+

The created distribution is Gaussian in the positive direction relative to the mode and exponential in the negative direction. On the Gaussian side, the standard deviation is calculated relative to the Urbach energy chosen for the exponential side, so that the distribution function is continuous.

Parameters
- +
datais the data vector where the random numbers will be placed, which must be preallocated to the desired size.
modeis the value of the peak of the distribution.
urbach_energyis the parameter that detemines the shape of the exponential tail side of the distribution.
urbach_energyis the parameter that determines the shape of the exponential tail side of the distribution.
genis a Mersenne twister random number generator used to randomly draw numbers from the distribution.
@@ -1159,7 +1159,7 @@

Parameters
+

Upon function return, processor 0 receives the average probability histogram and all of the other processors receive an empty probability histogram.

Parameters
input_histis the input histogram data from the processor calling the function.
@@ -1500,7 +1500,7 @@

-

This template function efficienctly removes the duplicate entries from an input vector.

+

This template function efficiently removes the duplicate entries from an input vector.

This algorithm allow efficient removal of duplicate vector objects when > or < comparison operators do not exist.

Parameters
@@ -1526,7 +1526,7 @@

-

Removes all spaces and ta characters in a string.

+

Removes all spaces and tab characters in a string.

Parameters

vecis the input vector to be operated on.
@@ -1589,7 +1589,7 @@

Returns
true if the input string is "true".
-flase if the input string is "flase".
+false if the input string is "false". diff --git a/papers/v2_paper/paper.bib b/papers/v2_paper/paper.bib index 79f117f..f8cbd76 100644 --- a/papers/v2_paper/paper.bib +++ b/papers/v2_paper/paper.bib @@ -31,7 +31,7 @@ @article {gillespie1976jcp publisher = "Elsevier", } -@article {gillespie2007arcp, +@article {gillespie2007arpc, author = "Daniel T. Gillespie", title = "Stochastic Simulation of Chemical Kinetics", year = "2007", @@ -43,7 +43,7 @@ @article {gillespie2007arcp } @misc {heiber2018excimontec, -author = {Michael C. Heiber} +author = {Michael C. Heiber}, title = {Excimontec}, YEAR = {2018}, howpublished = {\url{https://github.com/MikeHeiber/Excimontec}}, @@ -60,19 +60,19 @@ @incollection {heiber2019chapter year = "2019", chapter = "10", pages = "309-347", -address = "", +doi = "10.1016/B978-0-08-102284-9.00010-3", } @misc{hoffmann2013kmos, author = "Max K. Hoffmann", -title = "kmos", +title = "{kmos}", year = "2013", howpublished = "\url{https://github.com/mhoffman/kmos}", } @article{hoffmann2014cpc, author = "Max K. Hoffmann and Sebastian Matera and Karsten Reuter", -title = "kmos: A lattice kinetic {M}onte {C}arlo framework", +title = "{kmos}: A lattice kinetic {M}onte {C}arlo framework", journal = "Comput. Phys. Commun.", year = "2014", volume = "185", @@ -119,7 +119,7 @@ @techreport{plimpton2009report institution = "Sandia National Laboratories", } -@misc{plimpton2009ssparks +@misc{plimpton2009ssparks, author = "Steve Plimpton and Aidan Thompson and Alex Slepoy", title = "SSPARKS", year = "2009", @@ -143,6 +143,8 @@ @incollection {turner2015chapter editor = "Abby L. Parrill and Kenny B. Lipkowitz", booktitle = "Reviews in Computational Chemistry", publisher = "John Wiley & Sons", +edition = "1", +volume = "28", year = "2015", chapter = "5", pages = "175-204", @@ -155,8 +157,10 @@ @incollection {voter2007chapter year = "2007", chapter = "1", pages = "1-23", -series = "{NATO} Science Series" +series = "{NATO} Science Series", volume = "235", publisher = "Springer", -editor = "K. E. Sickafus and E. A. Kotomin" +address = "Dordrecht", +editor = "K. E. Sickafus and E. A. Kotomin and B. P. Uberuaga", +doi = "10.1007/978-1-4020-5295-8_1", } diff --git a/papers/v2_paper/paper.md b/papers/v2_paper/paper.md index 82fb0ba..9329f53 100644 --- a/papers/v2_paper/paper.md +++ b/papers/v2_paper/paper.md @@ -18,7 +18,7 @@ bibliography: paper.bib # Summary -Kinetic Monte Carlo (KMC) simulations are a powerful method for investigating the dynamics on non-equilibrium systems[@voter2007chapter] and have been used to help solve problems in a wide variety of scientific domains, including atomic simulations of epitaxial growth,[@martin-bragado2018pms] vacancy diffusion and grain growth in solids,[@plimpton2009report] opto-electronic mechanisms in disordered organic electronic devices,[@heiber2019chapter] chemical and ionic diffusion and reactions for heterogeneous catalysis[@stamatakis2015jpcm] and electrochemical systems,[@turner2015chapter] complex chemical reaction networks,[@gillespie2007arpc] and predator-prey population dynamics.[@dobramysl2018jpa] To tackle this diverse range of problems there are numerous open-source software tools with different levels of quality, flexibility, documentation, testing, and support. Of these, ``SPPARKS``,[@plimpton2009report,@plimpton2009ssparks] ``kmos``,[@hoffmann2014cpc,@hoffmann2013kmos] and ``KMCLib``[@leetmaa2014cpc,@leetma2014kmclib] and are several other examples of high-quality general KMC framework software tools for particle simulations. There are also numerous closed-source tools that have been developed by various research groups and companies around the world. However, the ``KMC_Lattice`` library is uniquely designed to be a lightweight and flexible object-oriented C\texttt{++} library that allows developers to more easily create custom KMC simulation software packages for use with high performance computing resources. With detailed API documentation using ``Doxygen``, rigorous testing using ``googletest``, and continuous integration testing using ``TravisCI``, ``KMC_Lattice`` is built to be a reliable and scalable package that can be used by a wide variety of other open-source KMC software tools in the future. Currently, I am using the ``KMC_Lattice`` library as the foundation for a new KMC software package called ``Excimontec``, which is designed to simulate disordered organic electronic devices.[@heiber2018excimontec] +Kinetic Monte Carlo (KMC) simulations are a powerful method for investigating the dynamics of non-equilibrium systems [@voter2007chapter] and have been used to help solve problems in a wide variety of scientific domains, including atomic simulations of epitaxial growth [@martin-bragado2018pms], vacancy diffusion and grain growth in solids [@plimpton2009report], opto-electronic mechanisms in disordered organic electronic devices [@heiber2019chapter], chemical and ionic diffusion and reactions for heterogeneous catalysis [@stamatakis2015jpcm] and electrochemical systems [@turner2015chapter], complex chemical reaction networks [@gillespie2007arpc], and predator-prey population dynamics [@dobramysl2018jpa]. To tackle this diverse range of problems there are numerous open-source software tools with different levels of quality, flexibility, documentation, testing, and support. Of these, ``SPPARKS`` [@plimpton2009report,@plimpton2009ssparks], ``kmos`` [@hoffmann2014cpc,@hoffmann2013kmos], and ``KMCLib`` [@leetmaa2014cpc,@leetmaa2014kmclib] are several other examples of high-quality general KMC framework software tools for particle simulations. There are also numerous closed-source tools that have been developed by various research groups and companies around the world. However, the ``KMC_Lattice`` library is uniquely designed to be a lightweight and flexible object-oriented C\texttt{++} library that allows developers to more easily create custom KMC simulation software packages for use with high performance computing resources. With detailed API documentation using ``Doxygen``, rigorous testing using ``googletest``, and continuous integration testing using ``TravisCI``, ``KMC_Lattice`` is built to be a reliable and scalable package that can be used by a wide variety of other open-source KMC software tools in the future. Currently, I am using the ``KMC_Lattice`` library as the foundation for a new KMC software package called ``Excimontec``, which is designed to simulate disordered organic electronic devices [@heiber2018excimontec]. The ``KMC_Lattice`` library contains a number of base (parent) classes that must be extended to create derived (child) classes to implement a user's simulation model of choice. Users must define the object entities in the simulation model and all of the events (transitions) possible for each object type. For each event, users must define the conditions under which each event occurs and can also define custom rate constant functions. Custom rate constant calculation functions can allow complex interactions between objects or between the objects and the simulation environment (lattice sites). ``KMC_Lattice`` v2.0 allows users to create simulation models on a cubic lattice and combines the the rejection-free Bortz, Kalos, and Lebowitz (BKL) algorithm [@bortz1975jcp] and several variations of Gillespie's first-reaction method [@gillespie1976jcp] to efficiently propagate the simulation. It is also designed to use MPI functionality to efficiently parallelize calculations for gathering statistics of the behavior of the stochastic simulation and contains a number of utility functions for gathering and analyzing the data generated by the simulation. The source code for all releases is archived with Zenodo. diff --git a/src/Event.h b/src/Event.h index c2d833c..93534e4 100644 --- a/src/Event.h +++ b/src/Event.h @@ -31,7 +31,7 @@ namespace KMC_Lattice { //! The default constructor that creates an empty Event object. Event(); - //! Constructor that creates an empty Event object pre-initilized with the Simulation pointer. + //! Constructor that creates an empty Event object pre-initialized with the Simulation pointer. //! \param sim_ptr is a pointer to the Simulation object that the Event is associated with. Event(Simulation* sim_ptr); @@ -80,7 +80,7 @@ namespace KMC_Lattice { //! \return the stored rate constant of the event in units of inverse seconds. double getRateConstant() const; - //! \brief Sets the desination coordinates of the event. + //! \brief Sets the destination coordinates of the event. //! \param coords is the Coords struct that designates the input coordinates. void setDestCoords(const Coords& coords); @@ -104,7 +104,7 @@ namespace KMC_Lattice { protected: // Variables - //! \brief Points to the Simulation object that the Event is asociated with. + //! \brief Points to the Simulation object that the Event is associated with. //! \details The pointer is used to access the current time in the simulation and the random number generator. Simulation* sim_ptr = nullptr; diff --git a/src/Lattice.h b/src/Lattice.h index 6be1f53..eb20dc9 100644 --- a/src/Lattice.h +++ b/src/Lattice.h @@ -15,7 +15,7 @@ namespace KMC_Lattice { //! \brief This class contains the properties of a three-dimensional lattice and the functions needed to interact with it. - //! \details The class makes use of the Parameters_Lattice struct to load the neccessary input parameters, the Coords struct + //! \details The class makes use of the Parameters_Lattice struct to load the necessary input parameters, the Coords struct //! to record the Cartesian coordinates of each lattice site, and the Site class to assign properties to each site. //! \copyright MIT License. For more information, see the LICENSE file that accompanies this software package. //! \author Michael C. Heiber @@ -34,9 +34,9 @@ namespace KMC_Lattice { //! \brief Calculates the destination coordinates when given the starting coordinates and the displacement vector (i,j,k). //! \details When the starting coordinates are near one or more of the lattice boundaries and periodic boundary conditions are enabled, - //! the function detemines the destination coordinates across the periodic boundary and assigns the calculated Coords struct to the input + //! the function determines the destination coordinates across the periodic boundary and assigns the calculated Coords struct to the input //! coords_dest argument. - //! \param coords_initial is the Coords struct tht designates the starting coordinates. + //! \param coords_initial is the Coords struct that designates the starting coordinates. //! \param i is the displacement in the x-direction. //! \param j is the displacement in the y-direction. //! \param k is the displacement in the z-direction. @@ -179,7 +179,7 @@ namespace KMC_Lattice { //! \brief Checks whether the site located at the input coordinates is occupied or not. //! \param coords is a Coords struct that represents the input coordinates. - //! \return true if the specificed site is occupied + //! \return true if the specified site is occupied //! \return false if the specified site is unoccupied bool isOccupied(const Coords& coords) const; diff --git a/src/Parameters_Lattice.h b/src/Parameters_Lattice.h index 6228aa4..10e73be 100644 --- a/src/Parameters_Lattice.h +++ b/src/Parameters_Lattice.h @@ -18,19 +18,19 @@ namespace KMC_Lattice { public: // Member variables //! Determines whether the x-direction periodic boundaries will be enabled. - bool Enable_periodic_x; + bool Enable_periodic_x = true; //! Determines whether the y-direction periodic boundaries will be enabled. - bool Enable_periodic_y; + bool Enable_periodic_y = true; //! Determines whether the z-direction periodic boundaries will be enabled. - bool Enable_periodic_z; + bool Enable_periodic_z = true; //! Defines the desired x-direction size of the lattice. - int Length; + int Length = 0; //! Defines the desired y-direction size of the lattice. - int Width; + int Width = 0; //! Defines the desired z-direction size of the lattice. - int Height; + int Height = 0; //! Defines the desired lattice unit size, which is used to convert lattice units into real space units. - double Unit_size; // nm + double Unit_size = 0.0; // nm // Functions //! Default virtual destructor. diff --git a/src/Parameters_Simulation.h b/src/Parameters_Simulation.h index c7dd2d0..5fd2d8f 100644 --- a/src/Parameters_Simulation.h +++ b/src/Parameters_Simulation.h @@ -21,17 +21,17 @@ namespace KMC_Lattice { // Member variables Parameters_Lattice Params_lattice; //! Determines whether logging to a logfile during the simulation will be enabled or not. - bool Enable_logging; + bool Enable_logging = false; //! Defines the desired temperature of the simulation in Kelvin. - int Temperature; + int Temperature = 0; //! Determines whether the first reaction method will be used or not. - bool Enable_FRM; + bool Enable_FRM = false; //! Determines whether the selective recalculation method will be used or not. - bool Enable_selective_recalc; + bool Enable_selective_recalc = false; //! Defines the desired event recalculation cutoff radius for the simulation in nm. - int Recalc_cutoff; + int Recalc_cutoff = 0; //! Determines whether the full recalculation method will be used or not. - bool Enable_full_recalc; + bool Enable_full_recalc = false; //! Defines the desired output file stream pointer to the logfile. std::ofstream* Logfile = nullptr; diff --git a/src/Simulation.h b/src/Simulation.h index bed445b..71bcba5 100644 --- a/src/Simulation.h +++ b/src/Simulation.h @@ -53,7 +53,7 @@ namespace KMC_Lattice { //! \brief Executes the next event in the simulation. //! \details This is a pure virtual function in the base class that must be defined by any derived class. - //! \return true if the next event is succesfully executed. + //! \return true if the next event is successfully executed. //! \return false if execution of the next event is unsuccessful. virtual bool executeNextEvent() = 0; @@ -77,7 +77,7 @@ namespace KMC_Lattice { long int getN_objects_created() const; //! \brief Gets the processor ID number for the processor that is running the simulation. - //! \details This is primarly used with MPI to differentiate between different simualtions running on + //! \details This is primarily used with MPI to differentiate between different simulations running on //! different cores. int getId() const; @@ -163,7 +163,7 @@ namespace KMC_Lattice { //! \details The Object objects are allocated and maintained by the derived Simulation class and only the Object //! pointers are stored in the base class. Removing the Object pointer does not delete the Object from the derived //! class. This function also calls the removeEvent function to remove the Event pointer associated with the - //! Object and also communites with the Lattice object to clear the occupancy of the Site where the Object was located. + //! Object and also communities with the Lattice object to clear the occupancy of the Site where the Object was located. //! \param object_ptr is the Object pointer to be removed from the simulation. void removeObject(Object* object_ptr); diff --git a/src/Utils.cpp b/src/Utils.cpp index bbf6d05..50ac0c0 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -404,7 +404,7 @@ namespace KMC_Lattice { } // Add up the counts from all processors auto counts_sum = MPI_calculateVectorSum(counts); - // Create output probablilty histogram + // Create output probability histogram vector> prob_hist; if (procid == 0) { prob_hist.reserve(final_size); @@ -450,7 +450,7 @@ namespace KMC_Lattice { MPI_Comm_rank(MPI_COMM_WORLD, &procid); // Get the size of the input data int data_size = (int)input_vector.size(); - // Copt the input data into an array + // Copy the input data into an array double* data = new double[data_size]; copy(input_vector.begin(), input_vector.end(), data); // Allocate array memory for the sum data diff --git a/src/Utils.h b/src/Utils.h index 0314589..eabdc9e 100644 --- a/src/Utils.h +++ b/src/Utils.h @@ -163,21 +163,21 @@ namespace KMC_Lattice { //! \brief Creates a vector of doubles that has a custom asymmetric distribution with an exponential tail. //! \details The created distribution is Gaussian in the positive direction relative to the mode and exponential in - //! the negative direction. On the Gaussian side, the standard deviation is calculated relative to the urbach energy + //! the negative direction. On the Gaussian side, the standard deviation is calculated relative to the Urbach energy //! chosen for the exponential side, so that the distribution function is continuous. //! \param data is the data vector where the random numbers will be placed, which must be preallocated to the desired size. //! \param mode is the value of the peak of the distribution. - //! \param urbach_energy is the parameter that detemines the shape of the exponential tail side of the distribution. + //! \param urbach_energy is the parameter that determines the shape of the exponential tail side of the distribution. //! \param gen is a Mersenne twister random number generator used to randomly draw numbers from the distribution. void createExponentialDOSVector(std::vector& data, const double mode, const double urbach_energy, std::mt19937_64& gen); //! \brief Creates a vector of floats that has a custom asymmetric distribution with an exponential tail. //! \details The created distribution is Gaussian in the positive direction relative to the mode and exponential in - //! the negative direction. On the Gaussian side, the standard deviation is calculated relative to the urbach energy + //! the negative direction. On the Gaussian side, the standard deviation is calculated relative to the Urbach energy //! chosen for the exponential side, so that the distribution function is continuous. //! \param data is the data vector where the random numbers will be placed, which must be preallocated to the desired size. //! \param mode is the value of the peak of the distribution. - //! \param urbach_energy is the parameter that detemines the shape of the exponential tail side of the distribution. + //! \param urbach_energy is the parameter that determines the shape of the exponential tail side of the distribution. //! \param gen is a Mersenne twister random number generator used to randomly draw numbers from the distribution. void createExponentialDOSVector(std::vector& data, const double mode, const double urbach_energy, std::mt19937_64& gen); @@ -210,7 +210,7 @@ namespace KMC_Lattice { //! \brief Uses MPI to calculate the average probability histogram from separate histograms coming from different processors. //! \details Each processor calls this function and sends an input histogram. Each input histogram must have the same bin size. - //! Upon function return, processor 0 receives the average probabiliy histogram and all of the other processors receive an empty probability histogram. + //! Upon function return, processor 0 receives the average probability histogram and all of the other processors receive an empty probability histogram. //! \param input_hist is the input histogram data from the processor calling the function. //! \return A pair vector that is the average probability histogram of all input histograms from each processor, when called on processor 0. //! \return An empty vector when called on other processors. @@ -273,7 +273,7 @@ namespace KMC_Lattice { //! \return An empty vector when called on other processors. std::vector MPI_gatherVectors(const std::vector& input_vector); - //! \brief Removes all spaces and ta characters in a string. + //! \brief Removes all spaces and tab characters in a string. //! \param str is the input string //! \returns a new string that will have the whitespace removed. std::string removeWhitespace(const std::string& str); @@ -287,7 +287,7 @@ namespace KMC_Lattice { //! Throws an invalid_argument exception if the input string is not "true" or "false". //! \param input is the input string. //! \return true if the input string is "true". - //! \return flase if the input string is "flase". + //! \return false if the input string is "false". bool str2bool(const std::string& input); // Template functions @@ -398,7 +398,7 @@ namespace KMC_Lattice { outfile.close(); } - //! \brief This template function efficienctly removes the duplicate entries from an input vector. + //! \brief This template function efficiently removes the duplicate entries from an input vector. //! \details This algorithm allow efficient removal of duplicate vector objects when > or < comparison operators do not exist. //! \param vec is the input vector to be operated on. template diff --git a/test/test.cpp b/test/test.cpp index 0e1d296..638cfa7 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2018 Michael C. Heiber +// Copyright (c) 2017-2019 Michael C. Heiber // This source file is part of the KMC_Lattice project, which is subject to the MIT License. // For more information, see the LICENSE file that accompanies this software. // The KMC_Lattice project can be found on Github at https://github.com/MikeHeiber/KMC_Lattice @@ -231,8 +231,11 @@ namespace SimulationTests { }; TEST_F(SimulationTest, CheckParameters) { + // Check for invalid default parameters object + Parameters_Simulation params; + EXPECT_FALSE(params.checkParameters()); // Check for invalid lattice params - auto params = params_base; + params = params_base; params.Params_lattice.Height = 0; EXPECT_FALSE(params.checkParameters()); // Check for invalid temp @@ -1129,8 +1132,11 @@ namespace LatticeTests { }; TEST_F(LatticeTest, CheckParameters) { + // Check for invalid default params object + Parameters_Lattice params; + EXPECT_FALSE(params.checkParameters()); // Check for invalid lattice dimensions - auto params = params_lattice; + params = params_lattice; params.Height = 0; EXPECT_FALSE(params.checkParameters()); // Check for invalid unit size diff --git a/test/test_mpi.cpp b/test/test_mpi.cpp index 51b5021..6937f4b 100644 --- a/test/test_mpi.cpp +++ b/test/test_mpi.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2018 Michael C. Heiber +// Copyright (c) 2017-2019 Michael C. Heiber // This source file is part of the KMC_Lattice project, which is subject to the MIT License. // For more information, see the LICENSE file that accompanies this software. // The KMC_Lattice project can be found on Github at https://github.com/MikeHeiber/KMC_Lattice

stris the input string