https://mooseframework.inl.gov
Loading...
Searching...
No Matches
DiscreteNucleationInserterBase.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "ElementUserObject.h"
13
22{
23public:
25
27
29 // using NucleusLocation = std::tuple<Real, Point, Real>;
31 {
32 Real time;
33 Point center;
34 Real radius;
35 };
36
38 using NucleusList = std::vector<NucleusLocation>;
39
40 // counter pair to track insertions and deletion in the current timestep
41 using NucleusChanges = std::pair<unsigned int, unsigned int>;
42
43 virtual bool isMapUpdateRequired() const { return _update_required; }
44 virtual const NucleusList & getNucleusList() const { return _global_nucleus_list; }
45 virtual const NucleusChanges & getInsertionsAndDeletions() const { return _changes_made; }
46
47 virtual const Real & getRate() const = 0;
48
49protected:
52
55
58};
59
60// Used for Restart
61template <>
62void dataStore(std::ostream & stream,
64 void * context);
65template <>
66void dataLoad(std::istream & stream,
68 void * context);
void dataLoad(std::istream &stream, DiscreteNucleationInserterBase::NucleusLocation &nl, void *context)
void dataStore(std::ostream &stream, DiscreteNucleationInserterBase::NucleusLocation &nl, void *context)
This UserObject manages the insertion and expiration of nuclei in the simulation domain it manages a ...
bool _update_required
is a map update required
virtual const NucleusList & getNucleusList() const
NucleusChanges _changes_made
count the number of nucleus insertions and deletions
virtual const Real & getRate() const =0
std::pair< unsigned int, unsigned int > NucleusChanges
NucleusList & _global_nucleus_list
the global list of all nuclei over all processors
virtual const NucleusChanges & getInsertionsAndDeletions() const
std::vector< NucleusLocation > NucleusList
Every MPI task should keep a full list of nuclei (in case they cross domains with their finite radii)
const InputParameters & parameters() const
A nucleus has an expiration time, a location, and a size.