www.mooseframework.org
DiscreteNucleationInserter.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 #ifndef DISCRETENUCLEATIONINSERTER_H
8 #define DISCRETENUCLEATIONINSERTER_H
9 
10 #include "ElementUserObject.h"
11 
13 
14 template <>
16 
23 class DiscreteNucleationInserter : public ElementUserObject
24 {
25 public:
26  DiscreteNucleationInserter(const InputParameters & parameters);
27 
28  virtual void initialize();
29  virtual void execute();
30  virtual void threadJoin(const UserObject & y);
31  virtual void finalize();
32 
34  typedef std::pair<Real, Point> NucleusLocation;
35 
37  typedef std::vector<NucleusLocation> NucleusList;
38 
39  const NucleusList & getNucleusList() const { return _global_nucleus_list; }
40  bool isMapUpdateRequired() const { return _changes_made > 0; }
41 
42 protected:
44  const MaterialProperty<Real> & _probability;
45 
47  Real _hold_time;
48 
50  unsigned int _changes_made;
51 
53  NucleusList & _global_nucleus_list;
54 
56  NucleusList & _local_nucleus_list;
57 
60 };
61 
62 #endif // DISCRETENUCLEATIONINSERTER_H
const MaterialProperty< Real > & _probability
Nucleation rate density (should be a material property implementing nucleation theory) ...
unsigned int _changes_made
count the number of nucleus deletions and insertions
This UserObject manages the insertion and expiration of nuclei in the simulation domain it manages a ...
DiscreteNucleationInserter(const InputParameters &parameters)
virtual void threadJoin(const UserObject &y)
std::vector< NucleusLocation > NucleusList
Every MPI task should keep a full list of nuclei (in case they cross domains with their finite radii)...
std::pair< Real, Point > NucleusLocation
A nucleus has an expiration time and a location.
NucleusList & _local_nucleus_list
the local nucleus list of nuclei centered in the domain of the current processor
Real _hold_time
Duration of time each nucleus is kept active after insertion.
bool _insert_test
insert test location
InputParameters validParams< DiscreteNucleationInserter >()
NucleusList & _global_nucleus_list
the global list of all nuclei over all processors
const NucleusList & getNucleusList() const