https://mooseframework.inl.gov
Loading...
Searching...
No Matches
DensityUpdateTwoConstraints.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 "ElementUserObject.h"
13#include "MooseTypes.h"
14
20{
21public:
23
25
26 virtual void initialize() override {};
27 virtual void timestepSetup() override;
28 virtual void execute() override;
29 virtual void finalize() override {};
30 virtual void threadJoin(const UserObject &) override {};
31
32protected:
36 const VariableName _design_density_name;
38 const VariableName _density_sensitivity_name;
40 const VariableName _cost_name;
42
51 const Real _volume_fraction;
53 const Real _cost_fraction;
54 // Relative tolerance used to stop the two-variable bisection method.
56 // Weights to solve a dual physics problem, e.g. a thermomechanical one.
57 std::vector<Real> _weight_values;
58
59private:
61 {
66 Real cost;
67 Real volume;
69
70 ElementData() = default;
72 Real dens, Real sens, Real cost_sens, Real thermal_sens, Real cst, Real vol, Real filt_dens)
73 : old_density(dens),
74 sensitivity(sens),
75 cost_sensitivity(cost_sens),
76 thermal_sensitivity(thermal_sens),
77 cost(cst),
78 volume(vol),
79 new_density(filt_dens)
80 {
81 }
82 };
83
87 void gatherElementData();
92
93 Real computeUpdatedDensity(Real current_density,
94 Real dc,
95 Real cost_sensitivity,
96 Real thermal_sensitivity,
97 Real cost,
98 Real lmid,
99 Real cmid);
100
103
106
108 std::map<dof_id_type, ElementData> _elem_data_map;
109
111 const Real _lower_bound;
113 const Real _upper_bound;
115 const Real _bisection_move;
117 const bool _adaptive_move;
122};
Element user object that performs SIMP optimization using a bisection algorithm applying a volume con...
const MooseWritableVariable * _density_sensitivity
The filtered density sensitivity variable (elasticity)
Real _total_allowable_cost
Total volume allowed for cost contraint.
const Real _lower_bound
Lower bound for bisection algorithm.
void gatherElementData()
Gathers element date necessary to perform the bisection algorithm for optimization.
const VariableName _design_density_name
The name of the pseudo-density variable.
const Real _bisection_move
Bisection algorithm move.
const bool _adaptive_move
Whether bisection moves are adaptive.
Real _total_allowable_volume
Total volume allowed for volume contraint.
const Real _volume_fraction
The volume fraction to be enforced.
const MooseVariable & _cost
The cost variable.
virtual void threadJoin(const UserObject &) override
void performOptimCritLoop()
Performs the optimality criterion loop (bisection)
const Real _upper_bound
Upper bound for bisection algorithm.
MooseVariable * _thermal_sensitivity
Thermal compliance variable.
const MooseMesh & _mesh
The system mesh.
const MooseWritableVariable * _cost_density_sensitivity
The filtered density sensitivity variable (cost)
const VariableName _density_sensitivity_name
The elasticity compliance sensitivity name.
MooseWritableVariable * _design_density
The pseudo-density variable.
Real computeUpdatedDensity(Real current_density, Real dc, Real cost_sensitivity, Real thermal_sensitivity, Real cost, Real lmid, Real cmid)
VariableName _thermal_sensitivity_name
Thermal compliance sensitivity name.
std::map< dof_id_type, ElementData > _elem_data_map
Data structure to hold old density, sensitivity, volume, current density.
const Real _cost_fraction
The cost fraction to be enforced.
const InputParameters & parameters() const
ElementData(Real dens, Real sens, Real cost_sens, Real thermal_sens, Real cst, Real vol, Real filt_dens)