https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NumRelationshipManagers.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
12#include "RelationshipManager.h"
13#include "MooseApp.h"
14
16
19{
21 MooseEnum rm_type("GEOMETRIC ALGEBRAIC COUPLING ALL", "ALL");
22 params.addParam<MooseEnum>(
23 "rm_type",
24 rm_type,
25 "The type of relationship managers to include in the relationship manager count");
26
27 params.addClassDescription("Return the number of relationship managers active.");
28 return params;
29}
30
32 : GeneralPostprocessor(parameters), _rm_type(getParam<MooseEnum>("rm_type"))
33{
34}
35
36Real
38{
39 const auto & rms = _app.relationshipManagers();
40
41 if (_rm_type == "ALL")
42 return rms.size();
43
44 unsigned int count = 0;
45 if (_rm_type == "GEOMETRIC")
46 {
47 for (const auto & rm : rms)
49 ++count;
50 }
51 else if (_rm_type == "ALGEBRAIC")
52 {
53 for (const auto & rm : rms)
55 ++count;
56 }
57 else if (_rm_type == "COUPLING")
58 {
59 for (const auto & rm : rms)
61 ++count;
62 }
63 else
64 mooseError("Invalid relationship manager type ", _rm_type);
65
66 return count;
67}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
unsigned int count
Definition MortarUtils.C:53
registerMooseObject("MooseApp", NumRelationshipManagers)
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 addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
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.
const std::set< std::shared_ptr< RelationshipManager > > & relationshipManagers() const
Return the container of relationship managers.
Definition MooseApp.h:1063
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
MooseApp & _app
The MOOSE application this is associated with.
Definition MooseBase.h:375
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
static InputParameters validParams()
NumRelationshipManagers(const InputParameters &parameters)