Loading [MathJax]/extensions/tex2jax.js
www.mooseframework.org
Main Page
Classes
Class Index
Class List
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
v
x
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
v
x
Variables
a
c
d
e
g
i
j
m
n
p
t
x
Typedefs
a
b
c
d
e
g
i
j
k
l
m
n
p
r
s
t
v
Enumerations
Enumerator
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
src
postprocessors
NodalSum.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
#include "
NodalSum.h
"
11
#include "
MooseMesh.h
"
12
#include "
SubProblem.h
"
13
14
registerMooseObject
(
"MooseApp"
,
NodalSum
);
15
16
defineLegacyParams
(
NodalSum
);
17
18
InputParameters
19
NodalSum::validParams
()
20
{
21
InputParameters
params =
NodalVariablePostprocessor::validParams
();
22
params.
set
<
bool
>(
"unique_node_execute"
) =
true
;
23
24
params.
addClassDescription
(
"Computes the sum of all of the nodal values of the specified "
25
"variable. Note: This object sets the default \"unique_node_execute\" "
26
"flag to true to avoid double counting nodes between shared blocks."
);
27
return
params;
28
}
29
30
NodalSum::NodalSum
(
const
InputParameters
& parameters)
31
:
NodalVariablePostprocessor
(parameters), _sum(0)
32
{
33
}
34
35
void
36
NodalSum::initialize
()
37
{
38
_sum
= 0;
39
}
40
41
void
42
NodalSum::execute
()
43
{
44
_sum
+=
_u
[
_qp
];
45
}
46
47
Real
48
NodalSum::getValue
()
49
{
50
gatherSum
(
_sum
);
51
52
return
_sum
;
53
}
54
55
void
56
NodalSum::threadJoin
(
const
UserObject
& y)
57
{
58
const
NodalSum
& pps = static_cast<const NodalSum &>(y);
59
_sum
+= pps.
_sum
;
60
}
UserObject::gatherSum
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
Definition:
UserObject.h:107
MooseMesh.h
defineLegacyParams
defineLegacyParams(NodalSum)
NodalUserObject::_qp
const unsigned int _qp
Quadrature point index.
Definition:
NodalUserObject.h:57
registerMooseObject
registerMooseObject("MooseApp", NodalSum)
NodalVariablePostprocessor::validParams
static InputParameters validParams()
Definition:
NodalVariablePostprocessor.C:18
NodalSum::NodalSum
NodalSum(const InputParameters ¶meters)
Definition:
NodalSum.C:30
NodalSum::validParams
static InputParameters validParams()
Definition:
NodalSum.C:19
NodalSum::execute
virtual void execute() override
Execute method.
Definition:
NodalSum.C:42
NodalSum::_sum
Real _sum
Definition:
NodalSum.h:37
InputParameters
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Definition:
InputParameters.h:53
InputParameters::set
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Definition:
InputParameters.h:987
NodalVariablePostprocessor
This is a base class for other classes which compute post-processed values based on nodal solution va...
Definition:
NodalVariablePostprocessor.h:26
UserObject
Base class for user-specific data.
Definition:
UserObject.h:38
NodalSum::getValue
virtual Real getValue() override
This will get called to actually grab the final value the postprocessor has calculated.
Definition:
NodalSum.C:48
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:70
SubProblem.h
NodalSum
Computes a sum of the nodal values of the coupled variable.
Definition:
NodalSum.h:23
NodalSum::initialize
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
Definition:
NodalSum.C:36
NodalSum::threadJoin
void threadJoin(const UserObject &y) override
Must override.
Definition:
NodalSum.C:56
NodalVariablePostprocessor::_u
const VariableValue & _u
Holds the solution at current quadrature points.
Definition:
NodalVariablePostprocessor.h:35
NodalSum.h
Generated on Sat Jan 25 2020 11:56:11 for www.mooseframework.org by
1.8.16