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. It behaves as ConservedNoiseBase but allows 22 : * the user to specify a multiplicator in the form of a MaterialProperty that is 23 : * multiplied on each random number, effectively masking the random number field. 24 : * 25 : * \see ConservedUniformNoise 26 : * \see ConservedNormalNoise 27 : */ 28 : class ConservedMaskedNoiseBase : public ConservedNoiseInterface 29 : { 30 : public: 31 : static InputParameters validParams(); 32 : 33 : ConservedMaskedNoiseBase(const InputParameters & parameters); 34 : 35 24 : virtual ~ConservedMaskedNoiseBase() {} 36 : 37 : virtual void initialize(); 38 : virtual void execute(); 39 : virtual void threadJoin(const UserObject & y); 40 : virtual void finalize(); 41 : 42 : Real getQpValue(dof_id_type element_id, unsigned int qp) const; 43 : 44 : protected: 45 : std::unordered_map<dof_id_type, std::vector<std::pair<Real, Real>>> _random_data; 46 : 47 : const MaterialProperty<Real> & _mask; 48 : };