Real TwoParticleGrainsIC::value(const Point & p) { //_redius.resize(2); Real radius_left = 5.0; //_radius[0]; Real radius_right = 5.0; //_radius[1]; Point grain_center_left; grain_center_left(0) = _bottom_left(0) + _rangedomain(0)/2.0 - radius_left; grain_center_left(1) = _bottom_left(1) + _rangedomain(1)/2.0; grain_center_left(2) = _bottom_left(2) + _rangedomain(2)/2.0; Point grain_center_right; grain_center_right(0) = _bottom_left(0) + _rangedomain(0)/2.0 + radius_right; grain_center_right(1) = _bottom_left(1) + _rangedomain(1)/2.0; grain_center_right(2) = _bottom_left(2) + _rangedomain(2)/2.0; Real dist_left = (p - grain_center_left).size(); Real dist_right = (p - grain_center_right).size(); if ((dist_left <= radius_left && _op_index == 0) || (dist_right <= radius_right && _op_index == 1)) return 1.0; else return 0.0; }
Real Tricrystal2CircleGrainsIC::value(const Point & p) { Point grain_center_left; grain_center_left(0) = _bottom_left(0) + _range(0)/4.0; grain_center_left(1) = _bottom_left(1) + _range(1)/2.0; grain_center_left(2) = _bottom_left(2) + _range(2)/2.0; Point grain_center_right; grain_center_right(0) = _bottom_left(0) + _range(0)*3.0/4.0; grain_center_right(1) = _bottom_left(1) + _range(1)/2.0; grain_center_right(2) = _bottom_left(2) + _range(2)/2.0; Real radius = _range(0)/5.0; Real dist_left = (p - grain_center_left).size(); Real dist_right = (p - grain_center_right).size(); if ((dist_left <= radius && _op_index == 1) || (dist_right <= radius && _op_index == 2) || (dist_left > radius && dist_right > radius && _op_index == 0)) return 1.0; else return 0.0; }