https://mooseframework.inl.gov
Loading...
Searching...
No Matches
RandomICBase.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 "InitialCondition.h"
13#include "RandomData.h"
14#include "MooseRandom.h"
15
16// Forward Declarations
17class InputParameters;
18namespace libMesh
19{
20class Point;
21}
22
23template <typename T>
25
30{
31public:
38
39 void initialSetup() override;
40
42
43protected:
48 Real generateRandom();
49
51 const bool _is_nodal;
52
54 const bool _use_legacy;
55
56private:
58 std::unique_ptr<RandomData> _elem_random_data;
59
61 std::unique_ptr<RandomData> _node_random_data;
62
65
68
70 std::map<dof_id_type, Real> _elem_numbers;
71
73 std::map<dof_id_type, Real> _node_numbers;
74};
InputParameters validParams()
This is a template class that implements the workhorse compute and computeNodal methods.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
This class encapsulates a useful, consistent, cross-platform random number generator with multiple ut...
Definition MooseRandom.h:38
Base class for randomly generated initial conditions.
std::map< dof_id_type, Real > _elem_numbers
Random numbers per element (currently limited to a single value at a time)
void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job.
std::map< dof_id_type, Real > _node_numbers
Random numbers per node (currently limited to a single value at a time)
const bool _is_nodal
Determines whether a variable basis is elemental or nodal.
MooseRandom * _elem_random_generator
Elemental random number generator.
const bool _use_legacy
Boolean to indicate whether we want to use the old (deprecated) generation pattern.
std::unique_ptr< RandomData > _node_random_data
RandomData node object, we cannot inherit from RandomInterface in an InitialCondition.
static InputParameters validParams()
MooseRandom * _node_random_generator
Nodal random number generator.
std::unique_ptr< RandomData > _elem_random_data
RandomData element object, we cannot inherit from RandomInterface in an InitialCondition.
Real generateRandom()
Generate a uniformly distributed random number on the interval from 0 to 1.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...