https://mooseframework.inl.gov
Loading...
Searching...
No Matches
DiscreteNucleationData.C
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
11
13
16{
18 params.addClassDescription("Output diagnostic data on a DiscreteNucleationInserter");
19 params.addRequiredParam<UserObjectName>("inserter", "DiscreteNucleationInserter user object");
20 MooseEnum valueType("COUNT UPDATE RATE INSERTIONS DELETIONS", "COUNT");
21 params.addRequiredParam<MooseEnum>("value",
22 valueType,
23 "Select to output number of active nuclei, wether a change to "
24 "the nucleus list occurred, the total rate over the entire "
25 "domain, and numbers of insertions and deletions applied to "
26 "the nucleus list.");
27 return params;
28}
29
31 : GeneralPostprocessor(parameters),
32 _inserter(getUserObject<DiscreteNucleationInserterBase>("inserter")),
33 _nucleus_list(_inserter.getNucleusList()),
34 _value_type(getParam<MooseEnum>("value").getEnum<ValueType>())
35{
36}
37
38Real
40{
41 switch (_value_type)
42 {
43 case ValueType::COUNT:
44 return _nucleus_list.size();
45
46 case ValueType::UPDATE:
48
49 case ValueType::RATE:
50 return _inserter.getRate();
51
52 case ValueType::INSERTIONS:
54
55 case ValueType::DELETIONS:
57
58 default:
59 mooseError("Invalid value type");
60 }
61}
registerMooseObject("PhaseFieldApp", DiscreteNucleationData)
Output diagnostic data on a DiscreteNucleationInserter.
static InputParameters validParams()
const DiscreteNucleationInserterBase::NucleusList & _nucleus_list
list of nuclei maintained bu the inserter object
virtual Real getValue() const override
DiscreteNucleationData(const InputParameters &parameters)
enum DiscreteNucleationData::ValueType _value_type
const DiscreteNucleationInserterBase & _inserter
UserObject that manages nucleus insertin and deletion.
ValueType
Type of value to report back.
This UserObject manages the insertion and expiration of nuclei in the simulation domain it manages a ...
virtual const Real & getRate() const =0
virtual const NucleusChanges & getInsertionsAndDeletions() const
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void mooseError(Args &&... args) const