Line data Source code
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 "ConservedNoiseInterface.h" 13 : 14 : #include <unordered_map> 15 : 16 : // Forward Declarations 17 : 18 : /** 19 : * This Userobject is the base class of Userobjects that generate one 20 : * random number per timestep and quadrature point in a way that the integral 21 : * over all random numbers is zero. This can be used for a concentration fluctuation 22 : * kernel such as ConservedLangevinNoise, that keeps the total concenration constant. 23 : * 24 : * \see ConservedUniformNoise 25 : * \see ConservedNormalNoise 26 : */ 27 : class ConservedNoiseBase : public ConservedNoiseInterface 28 : { 29 : public: 30 : static InputParameters validParams(); 31 : 32 : ConservedNoiseBase(const InputParameters & parameters); 33 : 34 60 : virtual ~ConservedNoiseBase() {} 35 : 36 : virtual void initialize(); 37 : virtual void execute(); 38 : virtual void threadJoin(const UserObject & y); 39 : virtual void finalize(); 40 : 41 : Real getQpValue(dof_id_type element_id, unsigned int qp) const; 42 : 43 : protected: 44 : std::unordered_map<dof_id_type, std::vector<Real>> _random_data; 45 : };