www.mooseframework.org
RandomICBase.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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
17 class InputParameters;
18 namespace libMesh
19 {
20 class Point;
21 }
22 
23 template <typename T>
25 
30 {
31 public:
38 
39  void initialSetup() override;
40 
42 
43 protected:
49 
51  const bool _is_nodal;
52 
54  const bool _use_legacy;
55 
56 private:
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 };
std::map< dof_id_type, Real > _node_numbers
Random numbers per node (currently limited to a single value at a time)
Definition: RandomICBase.h:73
std::unique_ptr< RandomData > _node_random_data
RandomData node object, we cannot inherit from RandomInterface in an InitialCondition.
Definition: RandomICBase.h:61
InputParameters validParams()
Real generateRandom()
Generate a uniformly distributed random number on the interval from 0 to 1.
Definition: RandomICBase.C:90
MooseRandom * _elem_random_generator
Elemental random number generator.
Definition: RandomICBase.h:64
This is a template class that implements the workhorse compute and computeNodal methods.
void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job...
Definition: RandomICBase.C:80
MooseRandom * _node_random_generator
Nodal random number generator.
Definition: RandomICBase.h:67
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
RandomICBase(const InputParameters &parameters)
Constructor.
Definition: RandomICBase.C:47
std::map< dof_id_type, Real > _elem_numbers
Random numbers per element (currently limited to a single value at a time)
Definition: RandomICBase.h:70
const bool _use_legacy
Boolean to indicate whether we want to use the old (deprecated) generation pattern.
Definition: RandomICBase.h:54
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const bool _is_nodal
Determines whether a variable basis is elemental or nodal.
Definition: RandomICBase.h:51
const InputParameters & parameters() const
Get the parameters of the object.
static InputParameters validParams()
Definition: RandomICBase.C:34
std::unique_ptr< RandomData > _elem_random_data
RandomData element object, we cannot inherit from RandomInterface in an InitialCondition.
Definition: RandomICBase.h:58
Base class for randomly generated initial conditions.
Definition: RandomICBase.h:29
This class encapsulates a useful, consistent, cross-platform random number generator with multiple ut...
Definition: MooseRandom.h:36