https://mooseframework.inl.gov
Loading...
Searching...
No Matches
DensityUpdate.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;
44 const Real _volume_fraction;
45
46private:
48 {
51 Real volume;
53 ElementData() = default;
54 ElementData(Real dens, Real sens, Real vol, Real filt_dens)
55 : old_density(dens), sensitivity(sens), volume(vol), new_density(filt_dens)
56 {
57 }
58 };
59
63 void gatherElementData();
64
69
70 Real computeUpdatedDensity(Real current_density, Real dc, Real lmid);
71
74
76 std::map<dof_id_type, ElementData> _elem_data_map;
77
79 const Real _lower_bound;
81 const Real _upper_bound;
82};
Element user object that performs SIMP optimization using a bisection algorithm using a volume constr...
virtual void finalize() override
virtual void execute() override
const MooseWritableVariable * _density_sensitivity
The filtered density sensitivity variable.
std::map< dof_id_type, ElementData > _elem_data_map
Data structure to hold old density, sensitivity, volume, current density.
const Real _volume_fraction
The volume fraction to be enforced.
const MooseMesh & _mesh
The system mesh.
virtual void threadJoin(const UserObject &) override
void performOptimCritLoop()
Performs the optimality criterion loop (bisection)
virtual void initialize() override
MooseWritableVariable * _design_density
The pseudo-density variable.
const VariableName _density_sensitivity_name
The elasticity compliance sensitivity name.
void gatherElementData()
Gathers element date necessary to perform the bisection algorithm for optimization.
Real computeUpdatedDensity(Real current_density, Real dc, Real lmid)
static InputParameters validParams()
virtual void timestepSetup() override
const VariableName _design_density_name
The name of the pseudo-density variable.
const Real _upper_bound
Upper bound for bisection algorithm.
Real _total_allowable_volume
Total volume allowed for volume contraint.
const Real _lower_bound
Lower bound for bisection algorithm.
const InputParameters & parameters() const
ElementData(Real dens, Real sens, Real vol, Real filt_dens)