https://mooseframework.inl.gov
Loading...
Searching...
No Matches
GradientOperator.h
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#pragma once
11
12#include "Moose.h"
13#include "MooseTypes.h"
14#include "libmesh/vector_value.h"
15#include "RankTwoTensor.h"
16
17template <class C>
18class GradientOperator : public C
19{
20protected:
23 gradOp(unsigned int component, const RealVectorValue & g, const Real & v, const Point & p)
24 {
26 this->addGradOp(G, component, g, v, p);
27 return G;
28 }
29};
30
32{
34{
35protected:
38 unsigned int component,
39 const RealVectorValue & g,
40 const Real & /*v*/,
41 const Point & /*p*/)
42 {
43 for (auto j : make_range(3))
44 G(component, j) += g(j);
45 }
46};
47
49{
50protected:
53 unsigned int component,
54 const RealVectorValue & g,
55 const Real & v,
56 const Point & p)
57 {
58 for (auto j : make_range(2))
59 G(component, j) += g(j);
60
61 // R
62 if (component == 0)
63 G(2, 2) += v / p(0);
64 }
65};
66
68{
69protected:
72 unsigned int /*component*/,
73 const RealVectorValue & g,
74 const Real & v,
75 const Point & p)
76 {
77 G(0, 0) += g(0);
78 G(1, 1) += v / p(0);
79 G(2, 2) += v / p(0);
80 }
81};
82}
83
const Real p
const double v
GradientOperator< GradientOperatorCoordinates::Cartesian > GradientOperatorCartesian
GradientOperator< GradientOperatorCoordinates::CentrosymmetricSpherical > GradientOperatorCentrosymmetricSpherical
GradientOperator< GradientOperatorCoordinates::AxisymmetricCylindrical > GradientOperatorAxisymmetricCylindrical
void addGradOp(RankTwoTensor &G, unsigned int component, const RealVectorValue &g, const Real &v, const Point &p)
Accumulate the contribution of the gradient operator in a given direction for a given tensor.
void addGradOp(RankTwoTensor &G, unsigned int component, const RealVectorValue &g, const Real &, const Point &)
Accumulate the contribution of the gradient operator in a given direction for a given tensor.
void addGradOp(RankTwoTensor &G, unsigned int, const RealVectorValue &g, const Real &v, const Point &p)
Accumulate the contribution of the gradient operator in a given direction for a given tensor.
RankTwoTensor gradOp(unsigned int component, const RealVectorValue &g, const Real &v, const Point &p)
Returns the gradient operator in a given direction.