https://mooseframework.inl.gov
ElementOptimizationDiffusionCoefFunctionInnerProduct.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 
11 
13 
16 {
18  params.addClassDescription(
19  "Compute the gradient for material inversion by taking the inner product of gradients of the "
20  "forward and adjoint variables with material gradient");
21 
22  params.addRequiredCoupledVar("forward_variable", "Variable from the forward solution");
23  return params;
24 }
25 
29  _grad_adjoint(coupledGradient("variable")),
30  _grad_forward(coupledGradient("forward_variable"))
31 {
32 }
33 
34 Real
36 {
37  return -_grad_adjoint[_qp] * _grad_forward[_qp];
38 }
const VariableGradient & _grad_adjoint
Holds gradient of adjoint soln variable at the current quadrature points.
const VariableGradient & _grad_forward
Holds gradient of forward soln variable at the current quadrature points.
registerMooseObject("OptimizationApp", ElementOptimizationDiffusionCoefFunctionInnerProduct)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real computeQpInnerProduct() override
Used to compute the inner product at a certain quadrature point.
void addClassDescription(const std::string &doc_string)