www.mooseframework.org
NodalL2Norm.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #include "NodalL2Norm.h"
16 
17 template <>
20 {
22  params.set<bool>("unique_node_execute") = true;
23  return params;
24 }
25 
27  : NodalVariablePostprocessor(parameters), _sum_of_squares(0.0)
28 {
29 }
30 
31 void
33 {
34  _sum_of_squares = 0.0;
35 }
36 
37 void
39 {
40  Real val = _u[_qp];
41  _sum_of_squares += val * val;
42 }
43 
44 Real
46 {
48  return std::sqrt(_sum_of_squares);
49 }
50 
51 void
53 {
54  const NodalL2Norm & pps = static_cast<const NodalL2Norm &>(y);
56 }
This is a base class for other classes which compute post-processed values based on nodal solution va...
virtual Real getValue() override
This will get called to actually grab the final value the postprocessor has calculated.
Definition: NodalL2Norm.C:45
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
const VariableValue & _u
Holds the solution at current quadrature points.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void execute() override
Execute method.
Definition: NodalL2Norm.C:38
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
Definition: UserObject.h:119
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
Definition: NodalL2Norm.C:32
InputParameters validParams< NodalL2Norm >()
Definition: NodalL2Norm.C:19
virtual void threadJoin(const UserObject &y) override
Must override.
Definition: NodalL2Norm.C:52
const unsigned int _qp
Quadrature point index.
NodalL2Norm(const InputParameters &parameters)
Definition: NodalL2Norm.C:26
Real _sum_of_squares
Definition: NodalL2Norm.h:42
InputParameters validParams< NodalVariablePostprocessor >()
Base class for user-specific data.
Definition: UserObject.h:42
Computes the "nodal" L2-norm of the coupled variable, which is defined by summing the square of its v...
Definition: NodalL2Norm.h:31