www.mooseframework.org
NodalL2Norm.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 "NodalL2Norm.h"
11 
12 registerMooseObject("MooseApp", NodalL2Norm);
13 
14 template <>
17 {
19  params.set<bool>("unique_node_execute") = true;
20  return params;
21 }
22 
24  : NodalVariablePostprocessor(parameters), _sum_of_squares(0.0)
25 {
26 }
27 
28 void
30 {
31  _sum_of_squares = 0.0;
32 }
33 
34 void
36 {
37  Real val = _u[_qp];
38  _sum_of_squares += val * val;
39 }
40 
41 Real
43 {
45  return std::sqrt(_sum_of_squares);
46 }
47 
48 void
50 {
51  const NodalL2Norm & pps = static_cast<const NodalL2Norm &>(y);
53 }
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:42
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:35
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
Definition: UserObject.h:103
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
Definition: NodalL2Norm.C:29
InputParameters validParams< NodalL2Norm >()
Definition: NodalL2Norm.C:16
virtual void threadJoin(const UserObject &y) override
Must override.
Definition: NodalL2Norm.C:49
const unsigned int _qp
Quadrature point index.
NodalL2Norm(const InputParameters &parameters)
Definition: NodalL2Norm.C:23
Real _sum_of_squares
Definition: NodalL2Norm.h:36
InputParameters validParams< NodalVariablePostprocessor >()
registerMooseObject("MooseApp", NodalL2Norm)
Base class for user-specific data.
Definition: UserObject.h:37
Computes the "nodal" L2-norm of the coupled variable, which is defined by summing the square of its v...
Definition: NodalL2Norm.h:25