Exemplo n.º 1
0
Real
SolutionUserObject::pointValue(Real t, const Point & p, const std::string & var_name) const
{
  // Create copy of point
  Point pt(p);

  // Apply scaling and factor
  for (unsigned int i=0; i<LIBMESH_DIM; ++i)
    pt(i) = (pt(i) - _factor[i])/_scale[i];

  // Extract the value at the current point
  Real val = evalMeshFunction(pt, var_name, 1);

  // Interplolate
  if (_file_type == 1 && _interpolate_times)
  {
    mooseAssert(t == _interpolation_time,"Time passed into value() must match time at last call to timestepSetup()");
    Real val2 = evalMeshFunction(pt, var_name, 2);
    val = val + (val2 - val)*_interpolation_factor;
  }
  return val;
}
Exemplo n.º 2
0
Real
SolutionUserObject::pointValue(Real t, const Point & p, const std::string & var_name) const
{
  // Create copy of point
  Point pt(p);

  // do the transformations
  for (unsigned int trans_num = 0 ; trans_num < _transformation_order.size() ; ++trans_num)
  {
    if (_transformation_order[trans_num] == "rotation0")
      pt = _r0*pt;
    else if (_transformation_order[trans_num] == "translation")
      for (unsigned int i=0; i<LIBMESH_DIM; ++i)
        pt(i) -= _translation[i];
    else if (_transformation_order[trans_num] == "scale")
      for (unsigned int i=0; i<LIBMESH_DIM; ++i)
        pt(i) /= _scale[i];
    else if (_transformation_order[trans_num] == "scale_multiplier")
      for (unsigned int i=0; i<LIBMESH_DIM; ++i)
        pt(i) *= _scale_multiplier[i];
    else if (_transformation_order[trans_num] == "rotation1")
      pt = _r1*pt;
  }

  // Extract the value at the current point
  Real val = evalMeshFunction(pt, var_name, 1);

  // Interplolate
  if (_file_type == 1 && _interpolate_times)
  {
    mooseAssert(t == _interpolation_time, "Time passed into value() must match time at last call to timestepSetup()");
    Real val2 = evalMeshFunction(pt, var_name, 2);
    val = val + (val2 - val)*_interpolation_factor;
  }

  return val;
}