Point RandomCorrosion::getRandomPoint() { // Generates a random point within the domain const Point & min = _box.min(); const Point & max = _box.max(); Real x = getRandomReal() * (max(0) - min(0)) + min(0); Real y = getRandomReal() * (max(1) - min(1)) + min(1); Real z = getRandomReal() * (max(2) - min(2)) + min(2); return Point(x, y, z); }
void DiscreteNucleationInserter::execute() { // check each qp for potential nucleation // TODO: we might as well place the nuclei at random positions within the element... for (unsigned int qp = 0; qp < _qrule->n_points(); ++qp) if (getRandomReal() < _probability[qp] * _JxW[qp] * _coord[qp] * _fe_problem.dt()) { _local_nucleus_list.push_back( NucleusLocation(_fe_problem.dt() + _fe_problem.time() + _hold_time, _q_point[qp])); _changes_made++; } }
Real RandomAux::computeValue() { if (_random_uo) // Use the coupled UO to return a value return _random_uo->getElementalValue(_current_elem->id()); else if (_generate_ints) // Use the built-in long random number generator directly return getRandomLong(); else // Use the built-in random number generator directly return getRandomReal(); }
void RandomMaterial::computeQpProperties() { _rand_real[_qp] = getRandomReal(); _rand_long[_qp] = getRandomLong(); }