<commit_before>/****************************************************************/
/*               DO NOT MODIFY THIS HEADER                      */
/* MOOSE - Multiphysics Object Oriented Simulation Environment  */
/*                                                              */
/*           (c) 2010 Battelle Energy Alliance, LLC             */
/*                   ALL RIGHTS RESERVED                        */
/*                                                              */
/*          Prepared by Battelle Energy Alliance, LLC           */
/*            Under Contract No. DE-AC07-05ID14517              */
/*            With the U. S. Department of Energy               */
/*                                                              */
/*            See COPYRIGHT for full restrictions               */
/****************************************************************/

#include "NodalVariableValue.h"
#include "MooseMesh.h"
#include "SubProblem.h"

// libMesh
#include "libmesh/boundary_info.h"

template<>
InputParameters validParams<NodalVariableValue>()
{
  InputParameters params = validParams<GeneralPostprocessor>();
  params.addRequiredParam<VariableName>("variable", "The variable to be monitored");
  params.addRequiredParam<unsigned int>("nodeid", "The ID of the node where we monitor");
  return params;
}

NodalVariableValue::NodalVariableValue(const std::string & name, InputParameters parameters) :
    GeneralPostprocessor(name, parameters),
    _mesh(_subproblem.mesh()),
    _var_name(parameters.get<VariableName>("variable")),
    _node_ptr(_mesh._mesh.node_ptr(getParam<unsigned int>("nodeid")))
{
  if (_node_ptr == NULL)
    mooseError("Node ID: " << getParam<unsigned int>("nodeid") << " not found in the mesh!");
}

Real
NodalVariableValue::getValue()
{
  Real value = 0;

  if(_node_ptr->processor_id() == libMesh::processor_id())
    value = _subproblem.getVariable(_tid, _var_name).getNodalValue(*_node_ptr);

  gatherSum(value);

  return value;
}<commit_msg>Closes #2090<commit_after>/****************************************************************/
/*               DO NOT MODIFY THIS HEADER                      */
/* MOOSE - Multiphysics Object Oriented Simulation Environment  */
/*                                                              */
/*           (c) 2010 Battelle Energy Alliance, LLC             */
/*                   ALL RIGHTS RESERVED                        */
/*                                                              */
/*          Prepared by Battelle Energy Alliance, LLC           */
/*            Under Contract No. DE-AC07-05ID14517              */
/*            With the U. S. Department of Energy               */
/*                                                              */
/*            See COPYRIGHT for full restrictions               */
/****************************************************************/

#include "NodalVariableValue.h"
#include "MooseMesh.h"
#include "SubProblem.h"

// libMesh
#include "libmesh/boundary_info.h"

template<>
InputParameters validParams<NodalVariableValue>()
{
  InputParameters params = validParams<GeneralPostprocessor>();
  params.addRequiredParam<VariableName>("variable", "The variable to be monitored");
  params.addRequiredParam<unsigned int>("nodeid", "The ID of the node where we monitor");
  return params;
}

NodalVariableValue::NodalVariableValue(const std::string & name, InputParameters parameters) :
    GeneralPostprocessor(name, parameters),
    _mesh(_subproblem.mesh()),
    _var_name(parameters.get<VariableName>("variable")),
    _node_ptr(_mesh._mesh.query_node_ptr(getParam<unsigned int>("nodeid")))
{
  if (_node_ptr == NULL)
    mooseError("Node #" << getParam<unsigned int>("nodeid") << " specified in '" << name << "' not found in the mesh!");
}

Real
NodalVariableValue::getValue()
{
  Real value = 0;

  if(_node_ptr->processor_id() == libMesh::processor_id())
    value = _subproblem.getVariable(_tid, _var_name).getNodalValue(*_node_ptr);

  gatherSum(value);

  return value;
}
{'fraction_non_alphanumeric': 0.173019801980198, 'fraction_numerical': 0.007920792079207921, 'mean_word_length': 2.2071428571428573, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '408481', 'n_tokens_mistral': 1035, 'n_tokens_neox': 972, 'n_words': 227}