Returns a random output uniformly distributed in a user-specified range. More...
#include <Spacetime_func.hpp>
Public Member Functions | |
Random_func (std::vector< double > means, std::vector< double > variations, int granularity=1e5) | |
int | n_var (int n_dim) const override |
number of output variables when called on n_dim -dimensional input | |
std::vector< double > | operator() (std::vector< double > pos, double time) const override |
![]() | |
std::vector< double > | operator() (std::vector< double > pos, double time, std::vector< double > state) const override |
![]() | |
std::vector< double > | operator() (Element &, const Basis &, int i_qpoint, double time) const override |
std::vector< double > | operator() (std::vector< double > pos, double time, std::vector< double > state, std::vector< double > outward_normal) const override |
normal is surface unit normal vector pointing out of the surface (into the domain). | |
![]() | |
virtual std::string | variable_name (int n_dim, int i_var) const |
name of i_var th variable (for plotting) when called on n_dim -dimensional input | |
![]() | |
std::vector< double > | operator() (Boundary_connection &, int i_fqpoint, double time) const override |
Returns a random output uniformly distributed in a user-specified range.
hexed::Random_func::Random_func | ( | std::vector< double > | means, |
std::vector< double > | variations, | ||
int | granularity = 1e5 ) |
means | The mean of each variable. The size of means determines the number of output variables. |
variations | The size of the range for each variable. Must be the same size as means . |
granularity | Results will be divisible by 1./granularity . |
Output variable i
will be in the range [means[i] - variations[i]/2, means[i] + variations[i]/2]
.
|
inlineoverridevirtual |
number of output variables when called on n_dim
-dimensional input
Implements hexed::Output_data.
|
overridevirtual |
Implements hexed::Spacetime_func.