Line data Source code
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 "ElementOptimizationReactionFunctionInnerProduct.h" 11 : 12 : registerMooseObject("OptimizationApp", ElementOptimizationReactionFunctionInnerProduct); 13 : 14 : InputParameters 15 100 : ElementOptimizationReactionFunctionInnerProduct::validParams() 16 : { 17 100 : InputParameters params = ElementOptimizationFunctionInnerProduct::validParams(); 18 100 : params.addClassDescription( 19 : "Compute the gradient for reaction material inversion by taking the inner product of the " 20 : "forward and adjoint variables multiplied by the derivative of the optimization function " 21 : "with respect to the controllable parameters."); 22 : 23 200 : params.addRequiredCoupledVar("forward_variable", "Variable from the forward solution"); 24 100 : return params; 25 0 : } 26 : 27 53 : ElementOptimizationReactionFunctionInnerProduct::ElementOptimizationReactionFunctionInnerProduct( 28 53 : const InputParameters & parameters) 29 : : ElementOptimizationFunctionInnerProduct(parameters), 30 53 : _forward_var(coupledValue("forward_variable")) 31 : { 32 53 : } 33 : 34 : Real 35 460890 : ElementOptimizationReactionFunctionInnerProduct::computeQpInnerProduct() 36 : { 37 460890 : return -_var[_qp] * _forward_var[_qp]; 38 : }