<commit_before>// MOOSE includes
#include "ResponseHistoryMean.h"
#include "PostprocessorInterface.h"
#include "VectorPostprocessorInterface.h"
#include "MastodonUtils.h"
#include "ResponseHistoryBuilder.h"

registerMooseObject("MastodonApp", ResponseHistoryMean);

template <>
InputParameters
validParams<ResponseHistoryMean>()
{
  InputParameters params = validParams<GeneralVectorPostprocessor>();
  params.addRequiredParam<VectorPostprocessorName>(
      "response_history",
      "Name of the ResponseHistoryBuilder vectorpostprocessor, for which "
      "response spectra are calculated.");

  // Make sure that csv files are created only at the final timestep
  params.set<bool>("contains_complete_history") = true;
  params.suppressParameter<bool>("contains_complete_history");

  params.set<ExecFlagEnum>("execute_on") = {EXEC_FINAL};
  params.suppressParameter<ExecFlagEnum>("execute_on");

  params.addClassDescription(
      "Calculate the mean acceleration time series given a response history.");
  return params;
}

ResponseHistoryMean::ResponseHistoryMean(const InputParameters & parameters)
  : GeneralVectorPostprocessor(parameters),
    _builder_time(getVectorPostprocessorValue("response_history", "time")),
    _history_time(declareVector("time")),
    _history_mean(declareVector("mean")),
    _builder(getUserObject<ResponseHistoryBuilder>("response_history"))
{
}

void
ResponseHistoryMean::initialize()
{
}

void
ResponseHistoryMean::execute()
{
  // Returning the times when response is recorded as an output.
  _history_time = _builder_time;

  // Calling the "mean" (overloaded) function to compute the mean of response  histories.
  _history_mean = MastodonUtils::mean(_builder.getHistories());
}<commit_msg>Fixed test. All tests pass.<commit_after>// MOOSE includes
#include "ResponseHistoryMean.h"
#include "PostprocessorInterface.h"
#include "VectorPostprocessorInterface.h"
#include "MastodonUtils.h"
#include "ResponseHistoryBuilder.h"

registerMooseObject("MastodonApp", ResponseHistoryMean);

template <>
InputParameters
validParams<ResponseHistoryMean>()
{
  InputParameters params = validParams<GeneralVectorPostprocessor>();
  params.addRequiredParam<VectorPostprocessorName>(
      "response_history",
      "Name of the ResponseHistoryBuilder vectorpostprocessor, for which "
      "response spectra are calculated.");

  // Make sure that csv files are created only at the final timestep
  params.set<bool>("contains_complete_history") = true;
  params.suppressParameter<bool>("contains_complete_history");

  params.set<ExecFlagEnum>("execute_on") = {EXEC_FINAL};
  params.suppressParameter<ExecFlagEnum>("execute_on");

  params.addClassDescription(
      "Calculate the mean acceleration time series given a response history.");
  return params;
}

ResponseHistoryMean::ResponseHistoryMean(const InputParameters & parameters)
  : GeneralVectorPostprocessor(parameters),
    _builder_time(getVectorPostprocessorValue("response_history", "time")),
    _history_time(declareVector("time")),
    _history_mean(declareVector("mean")),
    _builder(getUserObjectByName<ResponseHistoryBuilder>(getParam<VectorPostprocessorName>("response_history")))
{
}

void
ResponseHistoryMean::initialize()
{
}

void
ResponseHistoryMean::execute()
{
  // Returning the times when response is recorded as an output.
  _history_time = _builder_time;

  // Calling the "mean" (overloaded) function to compute the mean of response  histories.
  _history_mean = MastodonUtils::mean(_builder.getHistories());
}
{'fraction_non_alphanumeric': 0.10484556531595353, 'fraction_numerical': 0.0, 'mean_word_length': 6.724288840262582, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, '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': '7581296', 'n_tokens_mistral': 984, 'n_tokens_neox': 953, 'n_words': 212}