<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 "PostprocessorWarehouse.h"
#include "Postprocessor.h"
#include "ElementPostprocessor.h"
#include "InternalSidePostprocessor.h"
#include "SidePostprocessor.h"
#include "NodalPostprocessor.h"
#include "GeneralPostprocessor.h"
#include "MooseMesh.h"
#include "SubProblem.h"
#include "Parser.h"

PostprocessorWarehouse::PostprocessorWarehouse() :
    Warehouse<Postprocessor>()
{
}

PostprocessorWarehouse::~PostprocessorWarehouse()
{
}

void
PostprocessorWarehouse::initialSetup()
{
  for (std::vector<ElementPostprocessor *>::const_iterator i=_all_element_postprocessors.begin();
      i!=_all_element_postprocessors.end();
      ++i)
    (*i)->initialSetup();

  for (std::vector<NodalPostprocessor *>::const_iterator i=_all_nodal_postprocessors.begin();
      i!=_all_nodal_postprocessors.end();
      ++i)
    (*i)->initialSetup();

  for (std::vector<SidePostprocessor *>::const_iterator i=_all_side_postprocessors.begin();
      i!=_all_side_postprocessors.end();
      ++i)
    (*i)->initialSetup();

  for (std::vector<InternalSidePostprocessor *>::const_iterator i=_all_internal_side_postprocessors.begin();
      i!=_all_internal_side_postprocessors.end();
      ++i)
    (*i)->initialSetup();

  for (std::vector<GeneralPostprocessor *>::const_iterator i=_all_generic_postprocessors.begin();
      i!=_all_generic_postprocessors.end();
      ++i)
    (*i)->initialSetup();
}

void
PostprocessorWarehouse::timestepSetup()
{
  for (std::vector<ElementPostprocessor *>::const_iterator i=_all_element_postprocessors.begin();
      i!=_all_element_postprocessors.end();
      ++i)
    (*i)->timestepSetup();

  for (std::vector<NodalPostprocessor *>::const_iterator i=_all_nodal_postprocessors.begin();
      i!=_all_nodal_postprocessors.end();
      ++i)
    (*i)->timestepSetup();

  for (std::vector<SidePostprocessor *>::const_iterator i=_all_side_postprocessors.begin();
      i!=_all_side_postprocessors.end();
      ++i)
    (*i)->timestepSetup();

  for (std::vector<InternalSidePostprocessor *>::const_iterator i=_all_internal_side_postprocessors.begin();
      i!=_all_internal_side_postprocessors.end();
      ++i)
    (*i)->timestepSetup();


  for (std::vector<GeneralPostprocessor *>::const_iterator i=_all_generic_postprocessors.begin();
      i!=_all_generic_postprocessors.end();
      ++i)
    (*i)->timestepSetup();
}

void
PostprocessorWarehouse::residualSetup()
{
  for (std::vector<ElementPostprocessor *>::const_iterator i=_all_element_postprocessors.begin();
      i!=_all_element_postprocessors.end();
      ++i)
    (*i)->residualSetup();

  for (std::vector<NodalPostprocessor *>::const_iterator i=_all_nodal_postprocessors.begin();
      i!=_all_nodal_postprocessors.end();
      ++i)
    (*i)->residualSetup();

  for (std::vector<SidePostprocessor *>::const_iterator i=_all_side_postprocessors.begin();
      i!=_all_side_postprocessors.end();
      ++i)
    (*i)->residualSetup();

  for (std::vector<InternalSidePostprocessor *>::const_iterator i=_all_internal_side_postprocessors.begin();
      i!=_all_internal_side_postprocessors.end();
      ++i)
    (*i)->residualSetup();

  for (std::vector<GeneralPostprocessor *>::const_iterator i=_all_generic_postprocessors.begin();
      i!=_all_generic_postprocessors.end();
      ++i)
    (*i)->residualSetup();
}

void
PostprocessorWarehouse::jacobianSetup()
{
  for (std::vector<ElementPostprocessor *>::const_iterator i=_all_element_postprocessors.begin();
      i!=_all_element_postprocessors.end();
      ++i)
    (*i)->jacobianSetup();

  for (std::vector<NodalPostprocessor *>::const_iterator i=_all_nodal_postprocessors.begin();
      i!=_all_nodal_postprocessors.end();
      ++i)
    (*i)->jacobianSetup();

  for (std::vector<SidePostprocessor *>::const_iterator i=_all_side_postprocessors.begin();
      i!=_all_side_postprocessors.end();
      ++i)
    (*i)->jacobianSetup();

  for (std::vector<InternalSidePostprocessor *>::const_iterator i=_all_internal_side_postprocessors.begin();
      i!=_all_internal_side_postprocessors.end();
      ++i)
    (*i)->jacobianSetup();


  for (std::vector<GeneralPostprocessor *>::const_iterator i=_all_generic_postprocessors.begin();
      i!=_all_generic_postprocessors.end();
      ++i)
    (*i)->jacobianSetup();
}


const std::vector<ElementPostprocessor *> &
PostprocessorWarehouse::elementPostprocessors(SubdomainID block_id) const
{
  std::map<SubdomainID, std::vector<ElementPostprocessor *> >::const_iterator it = _element_postprocessors.find(block_id);

  if (it == _element_postprocessors.end())
    mooseError("No element postprocessors on block: " << block_id);

  return it->second;
}

const std::vector<SidePostprocessor *> &
PostprocessorWarehouse::sidePostprocessors(BoundaryID boundary_id) const
{
  std::map<BoundaryID, std::vector<SidePostprocessor *> >::const_iterator it = _side_postprocessors.find(boundary_id);

  if (it == _side_postprocessors.end())
    mooseError("No side postprocessors on boundary: " << boundary_id);

  return it->second;
}

const std::vector<NodalPostprocessor *> &
PostprocessorWarehouse::nodalPostprocessors(BoundaryID boundary_id) const
{
  std::map<BoundaryID, std::vector<NodalPostprocessor *> >::const_iterator it = _nodal_postprocessors.find(boundary_id);

  if (it == _nodal_postprocessors.end())
    mooseError("No nodal postprocessors on boundary: " << boundary_id);

  return it->second;
}

const std::vector<NodalPostprocessor *> &
PostprocessorWarehouse::blockNodalPostprocessors(SubdomainID block_id) const
{
  std::map<SubdomainID, std::vector<NodalPostprocessor *> >::const_iterator it = _block_nodal_postprocessors.find(block_id);

  if (it == _block_nodal_postprocessors.end())
    mooseError("No block nodal postprocessors on block: " << block_id);

  return it->second;
}

void
PostprocessorWarehouse::addPostprocessor(MooseSharedPointer<Postprocessor> & postprocessor)
{
  _all_ptrs.push_back(postprocessor);

  Postprocessor * raw_ptr = postprocessor.get();

  _all_objects.push_back(raw_ptr);

  if (dynamic_cast<ElementPostprocessor*>(raw_ptr))
  {
    ElementPostprocessor * elem_pp = dynamic_cast<ElementPostprocessor*>(raw_ptr);
    const std::set<SubdomainID> & block_ids = dynamic_cast<ElementPostprocessor*>(elem_pp)->blockIDs();
    _all_element_postprocessors.push_back(elem_pp);
    for (std::set<SubdomainID>::const_iterator it = block_ids.begin(); it != block_ids.end(); ++it)
    {
      _element_postprocessors[*it].push_back(elem_pp);
      _block_ids_with_postprocessors.insert(*it);
    }
  }
  else if (dynamic_cast<SidePostprocessor*>(raw_ptr))
  {
    SidePostprocessor * side_pp = dynamic_cast<SidePostprocessor*>(raw_ptr);
    _all_side_postprocessors.push_back(side_pp);

    const std::set<BoundaryID> & bnds = dynamic_cast<SidePostprocessor*>(side_pp)->boundaryIDs();
    for (std::set<BoundaryID>::const_iterator it = bnds.begin(); it != bnds.end(); ++it)<commit_msg>Remove unused code closes #4347<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 "PostprocessorWarehouse.h"
#include "Postprocessor.h"
#include "ElementPostprocessor.h"
#include "InternalSidePostprocessor.h"
#include "SidePostprocessor.h"
#include "NodalPostprocessor.h"
#include "GeneralPostprocessor.h"
#include "MooseMesh.h"
#include "SubProblem.h"
#include "Parser.h"

PostprocessorWarehouse::PostprocessorWarehouse() :
    Warehouse<Postprocessor>()
{
}

PostprocessorWarehouse::~PostprocessorWarehouse()
{
}

void
PostprocessorWarehouse::addPostprocessor(MooseSharedPointer<Postprocessor> & postprocessor)
{
  _all_ptrs.push_back(postprocessor);

  Postprocessor * raw_ptr = postprocessor.get();

  _all_objects.push_back(raw_ptr);

  if (dynamic_cast<ElementPostprocessor*>(raw_ptr))
  {
    ElementPostprocessor * elem_pp = dynamic_cast<ElementPostprocessor*>(raw_ptr);
    const std::set<SubdomainID> & block_ids = dynamic_cast<ElementPostprocessor*>(elem_pp)->blockIDs();
    _all_element_postprocessors.push_back(elem_pp);
    for (std::set<SubdomainID>::const_iterator it = block_ids.begin(); it != block_ids.end(); ++it)
    {
      _element_postprocessors[*it].push_back(elem_pp);
      _block_ids_with_postprocessors.insert(*it);
    }
  }
  else if (dynamic_cast<SidePostprocessor*>(raw_ptr))
  {
    SidePostprocessor * side_pp = dynamic_cast<SidePostprocessor*>(raw_ptr);
    _all_side_postprocessors.push_back(side_pp);

    const std::set<BoundaryID> & bnds = dynamic_cast<SidePostprocessor*>(side_pp)->boundaryIDs();
    for (std::set<BoundaryID>::const_iterator it = bnds.begin(); it != bnds.end(); ++it)
{'fraction_non_alphanumeric': 0.1567309565556205, 'fraction_numerical': 0.0029222676797194622, 'mean_word_length': 3.8224518553311415, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 87, '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': '3014213', 'n_tokens_mistral': 3154, 'n_tokens_neox': 3061, 'n_words': 458}