www.mooseframework.org
NumNodes.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "NumNodes.h"
12 #include "SubProblem.h"
13 #include "MooseMesh.h"
14 
15 registerMooseObject("MooseApp", NumNodes);
16 
19 {
21 
22  params.addClassDescription(
23  "Returns the total number of nodes in a simulation (works with DistributedMesh)");
24  return params;
25 }
26 
28  : GeneralPostprocessor(parameters), _mesh(_subproblem.mesh().getMesh())
29 {
30 }
31 
32 Real
34 {
35  return _mesh.n_nodes();
36 }
NumNodes(const InputParameters &parameters)
Definition: NumNodes.C:27
registerMooseObject("MooseApp", NumNodes)
MeshBase & mesh
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
static InputParameters validParams()
virtual Real getValue() const override
This will return the number of nodes in the system.
Definition: NumNodes.C:33
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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: NumNodes.C:18
const MeshBase & _mesh
Definition: NumNodes.h:30