https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NumPositions.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10// MOOSE includes
11#include "NumPositions.h"
12#include "Positions.h"
13
15
18{
20 params.addRequiredParam<PositionsName>("positions", "Positions to count the number of");
21
22 params.addClassDescription("Return the number of Positions from a Positions object.");
23 return params;
24}
25
27 : GeneralPostprocessor(parameters),
28 _positions(_fe_problem.getPositionsObject(getParam<PositionsName>("positions")))
29{
30}
31
32Real
34{
36 return _positions.getPositions(/*initial=*/true).size();
37 else
38 return _positions.getPositions(/*initial=*/false).size();
39}
const ExecFlagType EXEC_INITIAL
Definition Moose.C:30
registerMooseObject("MooseApp", NumPositions)
const ExecFlagType & getCurrentExecuteOnFlag() const
Return/set the current execution flag.
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
Counts the number of positions from a Positions object.
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
static InputParameters validParams()
NumPositions(const InputParameters &parameters)
const Positions & _positions
const std::vector< Point > & getPositions(bool initial) const
{ Getters for the positions vector for the desired dimension 1D will be the only one guaranteed to su...
Definition Positions.C:116
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.