https://mooseframework.inl.gov
Loading...
Searching...
No Matches
src
postprocessors
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
11
#include "
NumRelationshipManagers.h
"
12
#include "
RelationshipManager.h
"
13
#include "
MooseApp.h
"
14
15
registerMooseObject
(
"MooseApp"
,
NumRelationshipManagers
);
16
17
InputParameters
18
NumRelationshipManagers::validParams
()
19
{
20
InputParameters
params =
GeneralPostprocessor::validParams
();
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
31
NumRelationshipManagers::NumRelationshipManagers
(
const
InputParameters
& parameters)
32
:
GeneralPostprocessor
(parameters), _rm_type(getParam<
MooseEnum
>(
"rm_type"
))
33
{
34
}
35
36
Real
37
NumRelationshipManagers::getValue
()
const
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)
48
if
(rm->isType(
Moose::RelationshipManagerType::GEOMETRIC
))
49
++
count
;
50
}
51
else
if
(
_rm_type
==
"ALGEBRAIC"
)
52
{
53
for
(
const
auto
& rm : rms)
54
if
(rm->isType(
Moose::RelationshipManagerType::ALGEBRAIC
))
55
++
count
;
56
}
57
else
if
(
_rm_type
==
"COUPLING"
)
58
{
59
for
(
const
auto
& rm : rms)
60
if
(rm->isType(
Moose::RelationshipManagerType::COUPLING
))
61
++
count
;
62
}
63
else
64
mooseError
(
"Invalid relationship manager type "
,
_rm_type
);
65
66
return
count
;
67
}
MooseApp.h
mooseError
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition
MooseError.h:311
count
unsigned int count
Definition
MortarUtils.C:53
registerMooseObject
registerMooseObject("MooseApp", NumRelationshipManagers)
NumRelationshipManagers.h
RelationshipManager.h
GeneralPostprocessor
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
Definition
GeneralPostprocessor.h:22
GeneralPostprocessor::validParams
static InputParameters validParams()
Definition
GeneralPostprocessor.C:13
InputParameters
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Definition
InputParameters.h:68
InputParameters::addParam
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.
Definition
InputParameters.h:1832
InputParameters::addClassDescription
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.
Definition
InputParameters.C:81
MooseApp::relationshipManagers
const std::set< std::shared_ptr< RelationshipManager > > & relationshipManagers() const
Return the container of relationship managers.
Definition
MooseApp.h:1063
MooseEnum
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition
MooseEnum.h:55
MooseObject::_app
MooseApp & _app
The MOOSE application this is associated with.
Definition
MooseBase.h:375
NumRelationshipManagers
Definition
NumRelationshipManagers.h:15
NumRelationshipManagers::getValue
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
Definition
NumRelationshipManagers.C:37
NumRelationshipManagers::validParams
static InputParameters validParams()
Definition
NumRelationshipManagers.C:18
NumRelationshipManagers::NumRelationshipManagers
NumRelationshipManagers(const InputParameters ¶meters)
Definition
NumRelationshipManagers.C:31
NumRelationshipManagers::_rm_type
const MooseEnum _rm_type
Definition
NumRelationshipManagers.h:27
Moose::RelationshipManagerType::GEOMETRIC
@ GEOMETRIC
Moose::RelationshipManagerType::COUPLING
@ COUPLING
Moose::RelationshipManagerType::ALGEBRAIC
@ ALGEBRAIC
Generated on Mon Aug 24 2026 19:02:13 for https://mooseframework.inl.gov by
1.9.8