https://mooseframework.inl.gov
Loading...
Searching...
No Matches
AdjointStrainSymmetricStressGradInnerProduct.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{
19 "This component is designed to compute the gradient of the objective function concerning "
20 "specific properties. It achieves this by computing the inner product of the property "
21 "derivative obtained a material property and the strain resulting from the forward "
22 "simulation.");
23 params.addRequiredParam<MaterialPropertyName>(
24 "stress_derivative_name", "The name of the stress derivative material property");
25 params.addRequiredParam<MaterialPropertyName>(
26 "adjoint_strain_name", "Name of the strain property in the adjoint problem");
27 return params;
28}
29
31 const InputParameters & parameters)
33 _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
34 _stress_derivative(getMaterialPropertyByName<SymmetricRankTwoTensor>(
35 getParam<MaterialPropertyName>("stress_derivative_name"))),
36 _adjoint_strain(getMaterialPropertyByName<RankTwoTensor>(
37 getParam<MaterialPropertyName>("adjoint_strain_name")))
38{
39}
40
41Real
43{
44 auto derivative = RankTwoTensor(_stress_derivative[_qp]);
45 return -_adjoint_strain[_qp].doubleContraction(derivative);
46}
registerMooseObject("OptimizationApp", AdjointStrainSymmetricStressGradInnerProduct)
This object calculates the double contraction between the stress derivative and the adjoint strain ma...
virtual Real computeQpInnerProduct() override
Used to compute the inner product at a certain quadrature point.
const MaterialProperty< RankTwoTensor > & _adjoint_strain
Holds adjoint strain at current quadrature points.
const MaterialProperty< SymmetricRankTwoTensor > & _stress_derivative
Holds stress derivative at current quadrature points.
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)