https://mooseframework.inl.gov
peridynamics
src
postprocessors
NodalFunctionsL2NormPD.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
#include "
NodalFunctionsL2NormPD.h
"
11
#include "
Function.h
"
12
13
registerMooseObject
(
"PeridynamicsApp"
,
NodalFunctionsL2NormPD
);
14
15
InputParameters
16
NodalFunctionsL2NormPD::validParams
()
17
{
18
InputParameters
params =
NodalIntegralPostprocessorBasePD::validParams
();
19
params.
addClassDescription
(
"Class for computing the L2 norm of functions"
);
20
21
params.
addRequiredParam
<std::vector<FunctionName>>(
"functions"
,
"The known functions"
);
22
23
return
params;
24
}
25
26
NodalFunctionsL2NormPD::NodalFunctionsL2NormPD
(
const
InputParameters
& parameters)
27
:
NodalIntegralPostprocessorBasePD
(parameters)
28
{
29
const
std::vector<FunctionName> & func_names(
getParam
<std::vector<FunctionName>>(
"functions"
));
30
31
_n_funcs
= func_names.size();
32
33
for
(
unsigned
int
i = 0; i <
_n_funcs
; ++i)
34
_funcs
.push_back(&
getFunctionByName
(func_names[i]));
35
}
36
37
Real
38
NodalFunctionsL2NormPD::getValue
()
const
39
{
40
return
std::sqrt(
NodalIntegralPostprocessorBasePD::getValue
());
41
}
42
43
Real
44
NodalFunctionsL2NormPD::computeNodalValue
()
45
{
46
Real
func_val = 0;
47
48
for
(
unsigned
int
i = 0; i <
_n_funcs
; ++i)
49
func_val +=
_funcs
[i]->
value
(
_t
, *
_current_node
) *
_funcs
[i]->value(
_t
, *
_current_node
);
50
51
return
func_val;
52
}
NodalIntegralPostprocessorBasePD
Postprocessor class to compute a volume integral of the specified variable Note that specializations ...
Definition:
NodalIntegralPostprocessorBasePD.h:19
NodalFunctionsL2NormPD.h
NodalFunctionsL2NormPD::_funcs
std::vector< const Function * > _funcs
Definition:
NodalFunctionsL2NormPD.h:33
NodalFunctionsL2NormPD::NodalFunctionsL2NormPD
NodalFunctionsL2NormPD(const InputParameters ¶meters)
Definition:
NodalFunctionsL2NormPD.C:26
NodalPostprocessor::_current_node
const Node *const & _current_node
NodalIntegralPostprocessorBasePD::validParams
static InputParameters validParams()
Definition:
NodalIntegralPostprocessorBasePD.C:13
NodalFunctionsL2NormPD
Postprocessor class to compute L2 norm of a given function for peridynamic discretization.
Definition:
NodalFunctionsL2NormPD.h:19
InputParameters::addRequiredParam
void addRequiredParam(const std::string &name, const std::string &doc_string)
InputParameters
value
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
NodalPostprocessor::_t
Real & _t
NodalFunctionsL2NormPD::computeNodalValue
virtual Real computeNodalValue() override
Function to evaluate the given function at each material point.
Definition:
NodalFunctionsL2NormPD.C:44
registerMooseObject
registerMooseObject("PeridynamicsApp", NodalFunctionsL2NormPD)
NodalPostprocessor::getParam
const T & getParam(const std::string &name) const
NodalFunctionsL2NormPD::getValue
virtual Real getValue() const override
Definition:
NodalFunctionsL2NormPD.C:38
NodalFunctionsL2NormPD::_n_funcs
unsigned int _n_funcs
Known functions.
Definition:
NodalFunctionsL2NormPD.h:32
Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
NodalPostprocessor::getFunctionByName
const Function & getFunctionByName(const FunctionName &name) const
Function.h
NodalFunctionsL2NormPD::validParams
static InputParameters validParams()
Definition:
NodalFunctionsL2NormPD.C:16
InputParameters::addClassDescription
void addClassDescription(const std::string &doc_string)
NodalIntegralPostprocessorBasePD::getValue
virtual Real getValue() const override
Definition:
NodalIntegralPostprocessorBasePD.C:40
Generated on Fri Jul 18 2025 13:43:14 for https://mooseframework.inl.gov by
1.8.14