<commit_before>#include "Pressure.h"

#include "Function.h"
#include "Moose.h"

template<>
InputParameters validParams<Pressure>()
{
  InputParameters params = validParams<IntegratedBC>();
  params.addRequiredParam<int>("component", "The component for the Pressure");
  params.addParam<Real>("factor", 1.0, "The factor to use in computing the pressure");
  params.addParam<std::string>("function", "", "The function that describes the pressure");
  params.set<bool>("use_displaced_mesh") = true;
  return params;
}

Pressure::Pressure(const std::string & name, InputParameters parameters)
  :IntegratedBC(name, parameters),
   _component(getParam<int>("component")),
   _factor(getParam<Real>("factor")),
   _has_function(getParam<std::string>("function") != ""),
   _function( _has_function ? &getFunction("function") : NULL )
{
  if(_component < 0)
  {
    std::cout << "Must select a component for "
              << name
              << "." << std::endl;
    libmesh_error();
  }
  else if ( _component > 2 )
  {

    std::cout << "Invalid component given ("
              << _component
              << ") for "
              << name
              << "." << std::endl;

    libmesh_error();
  }

  if (_has_function && !_function)
  {
    std::cout << "Unable to find function in pressure bc." << std::endl;
    libmesh_error();
  }
}

Real
Pressure::computeQpResidual()
{
  Real factor = _factor;

  if (_has_function)
    factor *= _function->value(_t, _q_point[_qp]);

  return factor * (_normals[_qp](_component) * _phi[_i][_qp]);
}<commit_msg>Contact convergence problems<commit_after>#include "Pressure.h"

#include "Function.h"
#include "Moose.h"

template<>
InputParameters validParams<Pressure>()
{
  InputParameters params = validParams<IntegratedBC>();
  params.addRequiredParam<int>("component", "The component for the Pressure");
  params.addParam<Real>("factor", 1.0, "The factor to use in computing the pressure");
  params.addParam<std::string>("function", "", "The function that describes the pressure");
  params.set<bool>("use_displaced_mesh") = true;
  return params;
}

Pressure::Pressure(const std::string & name, InputParameters parameters)
  :IntegratedBC(name, parameters),
   _component(getParam<int>("component")),
   _factor(getParam<Real>("factor")),
   _has_function(getParam<std::string>("function") != ""),
   _function( _has_function ? &getFunction("function") : NULL )
{
  if(_component < 0)
  {
    std::cout << "Must select a component for "
              << name
              << "." << std::endl;
    libmesh_error();
  }
  else if ( _component > 2 )
  {

    std::cout << "Invalid component given ("
              << _component
              << ") for "
              << name
              << "." << std::endl;

    libmesh_error();
  }

  if (_has_function && !_function)
  {
    std::cout << "Unable to find function in pressure bc." << std::endl;
    libmesh_error();
  }
}

Real
Pressure::computeQpResidual()
{
  Real factor = _factor;

  if (_has_function)
  {
    factor *= _function->value(_t, _q_point[_qp]);
  }

  return factor * (_normals[_qp](_component) * _phi[_i][_qp]);
}
{'fraction_non_alphanumeric': 0.16097093580325775, 'fraction_numerical': 0.0025550942190993293, 'mean_word_length': 3.62629246676514, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5000570', 'n_tokens_mistral': 985, 'n_tokens_neox': 973, 'n_words': 210}