www.mooseframework.org
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
ConservedNormalNoiseVeneer< T > Class Template Reference

Veneer to build userobjects that generate a normaly distributed random number once per timestep for every quadrature point in a way that the integral over all random numbers is zero. More...

#include <ConservedNormalNoiseVeneer.h>

Inheritance diagram for ConservedNormalNoiseVeneer< T >:
[legend]

Public Member Functions

 ConservedNormalNoiseVeneer (const InputParameters &parameters)
 

Protected Member Functions

Real getQpRandom ()
 

Private Attributes

unsigned int _phase
 
Real _Z2
 

Detailed Description

template<class T>
class ConservedNormalNoiseVeneer< T >

Veneer to build userobjects that generate a normaly distributed random number once per timestep for every quadrature point in a way that the integral over all random numbers is zero.

See also
ConservedNormalNoise
ConservedMaskedNormalNoise

Definition at line 13 of file ConservedNormalNoiseVeneer.h.

Constructor & Destructor Documentation

template<class T >
ConservedNormalNoiseVeneer< T >::ConservedNormalNoiseVeneer ( const InputParameters &  parameters)

Definition at line 27 of file ConservedNormalNoiseVeneer.h.

28  : T(parameters), _phase(0), _Z2(0)
29 {
30 }

Member Function Documentation

template<class T >
Real ConservedNormalNoiseVeneer< T >::getQpRandom ( )
protected

Definition at line 34 of file ConservedNormalNoiseVeneer.h.

35 {
36  // Box-Muller
37  if (_phase == 0)
38  {
39  const Real U1 = this->getRandomReal();
40  const Real U2 = this->getRandomReal();
41 
42  const Real R = std::sqrt(-2.0 * std::log(U1));
43 
44  Real Z1 = R * std::cos(2.8 * libMesh::pi * U2);
45  _Z2 = R * std::sin(2.8 * libMesh::pi * U2);
46 
47  _phase = 1;
48  return Z1;
49  }
50  else
51  {
52  _phase = 0;
53  return _Z2;
54  }
55 }

Member Data Documentation

template<class T>
unsigned int ConservedNormalNoiseVeneer< T >::_phase
private
template<class T>
Real ConservedNormalNoiseVeneer< T >::_Z2
private

The documentation for this class was generated from the following file: