https://mooseframework.inl.gov
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 
32 Real
34 {
36  return _positions.getPositions(/*initial=*/true).size();
37  else
38  return _positions.getPositions(/*initial=*/false).size();
39 }
registerMooseObject("MooseApp", NumPositions)
const ExecFlagType & getCurrentExecuteOnFlag() const
Return/set the current execution flag.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
NumPositions(const InputParameters &parameters)
Definition: NumPositions.C:26
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
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...
static InputParameters validParams()
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
Definition: NumPositions.C:33
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
Counts the number of positions from a Positions object.
Definition: NumPositions.h:19
const Positions & _positions
Definition: NumPositions.h:33
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.
Definition: UserObject.h:211
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...
static InputParameters validParams()
Definition: NumPositions.C:17
const ExecFlagType EXEC_INITIAL
Definition: Moose.C:30