https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CostSensitivity.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 "CostSensitivity.h"
11
13
16{
18 params.addClassDescription("Computes cost sensitivity needed for multimaterial SIMP method.");
19 params.addRequiredCoupledVar("design_density", "Design density variable name.");
20 params.addRequiredParam<MaterialPropertyName>("cost",
21 "DerivativeParsedMaterial for cost of materials.");
22 return params;
23}
24
27 _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
28 _sensitivity(declareProperty<Real>(_base_name + "cost_sensitivity")),
29 _design_density(coupledValue("design_density")),
30 _design_density_name(coupledName("design_density", 0)),
31 _dcostdrho(getMaterialPropertyDerivativeByName<Real>(getParam<MaterialPropertyName>("cost"),
32 _design_density_name)),
33 _cost(getMaterialPropertyByName<Real>(getParam<MaterialPropertyName>("cost")))
34{
35}
36
37void
39{
40 _sensitivity[_qp] = _current_elem->volume() * _cost[_qp] +
41 _current_elem->volume() * _design_density[_qp] * _dcostdrho[_qp];
42}
registerMooseObject("OptimizationApp", CostSensitivity)
Computes the cost sensitivity for SIMP optimization algorithms that consider a cost constraint,...
MaterialProperty< Real > & _sensitivity
The cost sensitivity material generated by this object.
CostSensitivity(const InputParameters &parameters)
const MaterialProperty< Real > & _cost
Cost material property.
virtual void computeQpProperties() override
static InputParameters validParams()
const MaterialProperty< Real > & _dcostdrho
Derivative of the cost with respect to the pseudo-density variable.
const VariableValue & _design_density
Pseudo-density variable.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()