- blockThe list of blocks (ids or names) that this object will be applied
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
- execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.
Default:TIMESTEP_END
C++ Type:ExecFlagEnum
Controllable:No
Description:The list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
VolumePostprocessor
Computes the volume of a specified block
Overview
Computes the volume of the Mesh or a subdomain of the Mesh.
Example Input File Syntax
In this example, the volume of block 1, 2 and 3 are computed by three separate VolumePostprocessor
.
[Postprocessors]
[should_be_one]
type = ElementAverageValue
block = 1
variable = constantVar
execute_on = 'initial timestep_end'
[]
[volume1]
type = VolumePostprocessor
block = 1
execute_on = 'initial timestep_end'
[]
[volume2]
type = VolumePostprocessor
block = 2
execute_on = 'initial timestep_end'
[]
[volume3]
type = VolumePostprocessor
block = 3
execute_on = 'initial timestep_end'
[]
[]
(test/tests/postprocessors/volume/sphere1D.i)Input Parameters
- allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
Default:False
C++ Type:bool
Controllable:No
Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
Default:0
C++ Type:int
Controllable:No
Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
- force_postauxFalseForces the UserObject to be executed in POSTAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in POSTAUX
- force_preauxFalseForces the UserObject to be executed in PREAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREAUX
- force_preicFalseForces the UserObject to be executed in PREIC during initial setup
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREIC during initial setup
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
- outputsVector of output names where you would like to restrict the output of variables(s) associated with this object
C++ Type:std::vector<OutputName>
Controllable:No
Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
Input Files
- (modules/solid_mechanics/test/tests/volumetric_eigenstrain/volumetric_eigenstrain.i)
- (modules/combined/test/tests/feature_volume_fraction/feature_volume_fraction.i)
- (modules/combined/examples/optimization/multi-load/square_subapp_two.i)
- (test/tests/postprocessors/geometry/3d_geometry.i)
- (modules/solid_mechanics/test/tests/volumetric_eigenstrain/ad_volumetric_eigenstrain.i)
- (modules/combined/examples/optimization/multi-load/single_subapp_two.i)
- (modules/combined/examples/optimization/thermomechanical/structural_sub.i)
- (modules/combined/examples/optimization/helmholtz_multimat_nostrip.i)
- (modules/reactor/test/tests/meshgenerators/flexible_pattern_generator/patterned_assm.i)
- (test/tests/auxkernels/user_object_dependency/aux_uo_deps.i)
- (modules/reactor/test/tests/meshgenerators/core_mesh_generator/core_periphery_ptmg_vol.i)
- (modules/reactor/test/tests/meshgenerators/peripheral_triangle_mesh_generator/abtr_tri_refine.i)
- (modules/combined/test/tests/optimization/compliance_sensitivity/three_materials_thermal.i)
- (modules/reactor/test/tests/meshgenerators/flexible_pattern_generator/double_circ_pattern.i)
- (modules/heat_transfer/test/tests/radiation_transfer_symmetry/cavity_with_pillars.i)
- (test/tests/postprocessors/volume/sphere1D.i)
- (modules/combined/examples/optimization/three_materials.i)
- (modules/reactor/test/tests/meshgenerators/flexible_pattern_generator/single_circ_pattern.i)
- (modules/reactor/test/tests/meshgenerators/flexible_pattern_generator/double_hex_pattern.i)
- (modules/heat_transfer/test/tests/radiation_transfer_symmetry/cavity_with_pillars_symmetry_bc.i)
- (modules/solid_mechanics/test/tests/volumetric_eigenstrain/volumetric_mechanical.i)
- (modules/reactor/test/tests/meshgenerators/flexible_pattern_generator/mixed_pattern.i)
- (modules/combined/test/tests/optimization/thermal_sensitivity/2d_root.i)
- (modules/combined/test/tests/optimization/compliance_sensitivity/paper_three_materials_test.i)
- (modules/combined/examples/optimization/multi-load/single_subapp_one.i)
- (test/tests/meshgenerators/mesh_repair_generator/flip_element.i)
- (modules/reactor/test/tests/meshgenerators/flexible_pattern_generator/single_hex_pattern.i)
- (modules/reactor/test/tests/meshgenerators/flexible_pattern_generator/single_hex_pattern_custom.i)
- (modules/optimization/test/tests/executioners/constrained/shape_optimization/forward.i)
- (modules/combined/examples/optimization/thermomechanical/thermal_sub.i)
- (modules/combined/examples/optimization/multi-load/square_subapp_one.i)
- (modules/combined/examples/optimization/thermomechanical/thermomechanical_main.i)
- (modules/combined/examples/optimization/multi-load/square_main.i)
- (modules/combined/test/tests/feature_volume_fraction/Avrami.i)
- (modules/combined/examples/optimization/multi-load/single_main.i)
- (modules/combined/examples/optimization/helmholtz_multimat_strip.i)
- (test/tests/postprocessors/geometry/2d_geometry.i)
- (modules/combined/test/tests/optimization/compliance_sensitivity/thermal_test.i)
- (modules/reactor/test/tests/meshgenerators/flexible_pattern_generator/single_rect_pattern.i)
- (modules/reactor/test/tests/meshgenerators/flexible_pattern_generator/custom_pattern.i)
(test/tests/postprocessors/volume/sphere1D.i)
# The volume of each block should be 3
[Mesh]
file = sphere1D.e
coord_type = RSPHERICAL
[]
[Functions]
[fred]
type = ParsedFunction
expression = '200'
[]
[]
[AuxVariables]
[constantVar]
order = FIRST
family = LAGRANGE
[]
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
initial_condition = 100
[]
[]
[AuxKernels]
[fred]
type = ConstantAux
variable = constantVar
block = 1
value = 1
[]
[]
[ICs]
[ic1]
type = ConstantIC
variable = constantVar
value = 1
block = 1
[]
[]
[Kernels]
[heat_r]
type = Diffusion
variable = u
[]
[]
[BCs]
[temps]
type = FunctionDirichletBC
variable = u
boundary = 1
function = fred
[]
[]
[Materials]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -snes_ls -ksp_gmres_restart'
petsc_options_value = 'lu basic 101'
line_search = 'none'
nl_abs_tol = 1e-11
nl_rel_tol = 1e-10
l_max_its = 20
[]
[Postprocessors]
[should_be_one]
type = ElementAverageValue
block = 1
variable = constantVar
execute_on = 'initial timestep_end'
[]
[volume1]
type = VolumePostprocessor
block = 1
execute_on = 'initial timestep_end'
[]
[volume2]
type = VolumePostprocessor
block = 2
execute_on = 'initial timestep_end'
[]
[volume3]
type = VolumePostprocessor
block = 3
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/volumetric_eigenstrain/volumetric_eigenstrain.i)
# This tests the ability of the ComputeVolumetricEigenstrain material
# to compute an eigenstrain tensor that results in a solution that exactly
# recovers the specified volumetric expansion.
# This model applies volumetric strain that ramps from 0 to 2 to a unit cube
# and computes the final volume, which should be exactly 3. Note that the default
# TaylorExpansion option for decomposition_method gives a small (~4%) error
# with this very large incremental strain, but decomposition_method=EigenSolution
# gives the exact solution.
[Mesh]
type = GeneratedMesh
dim = 3
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[]
[AuxVariables]
[volumetric_strain]
order = CONSTANT
family = MONOMIAL
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
[master]
strain = FINITE
eigenstrain_names = eigenstrain
decomposition_method = EigenSolution #Necessary for exact solution
[]
[]
[AuxKernels]
[volumetric_strain]
type = RankTwoScalarAux
scalar_type = VolumetricStrain
rank_two_tensor = total_strain
variable = volumetric_strain
[]
[]
[BCs]
[left]
type = DirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[bottom]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[back]
type = DirichletBC
variable = disp_z
boundary = back
value = 0.0
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0.3
[]
[finite_strain_stress]
type = ComputeFiniteStrainElasticStress
[]
[volumetric_eigenstrain]
type = ComputeVolumetricEigenstrain
volumetric_materials = volumetric_change
eigenstrain_name = eigenstrain
args = ''
[]
[volumetric_change]
type = GenericFunctionMaterial
prop_names = volumetric_change
prop_values = t
[]
[]
[Postprocessors]
[vol]
type = VolumePostprocessor
use_displaced_mesh = true
execute_on = 'initial timestep_end'
[]
[volumetric_strain]
type = ElementalVariableValue
variable = volumetric_strain
elementid = 0
[]
[disp_right]
type = NodalExtremeValue
variable = disp_x
boundary = right
[]
[]
[Executioner]
type = Transient
end_time = 2
[]
[Outputs]
csv = true
[]
(modules/combined/test/tests/feature_volume_fraction/feature_volume_fraction.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 40
ny = 40
nz = 0
xmax = 40
ymax = 40
zmax = 0
elem_type = QUAD4
[]
[Variables]
active = 'u'
[./u]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = 20
y1 = 20
radius = 10
int_width = 1
invalue = 1
outvalue = 0
[../]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./dot]
type = TimeDerivative
variable = u
[../]
[]
[VectorPostprocessors]
[./feature_volumes]
type = FeatureVolumeVectorPostprocessor
flood_counter = feature_counter
execute_on = 'initial timestep_end'
outputs = none
[../]
[]
[Postprocessors]
[./feature_counter]
type = FeatureFloodCount
variable = u
compute_var_to_feature_map = true
execute_on = 'initial timestep_end'
[../]
[./Volume]
type = VolumePostprocessor
execute_on = 'initial'
[../]
[./volume_fraction]
type = FeatureVolumeFraction
mesh_volume = Volume
feature_volumes = feature_volumes
execute_on = 'initial timestep_end'
[../]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 2
[]
[Outputs]
csv = true
[]
(modules/combined/examples/optimization/multi-load/square_subapp_two.i)
power = 1.0
E0 = 1.0
Emin = 1.0e-6
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[Bottom]
type = GeneratedMeshGenerator
dim = 2
nx = 100
ny = 100
xmin = 0
xmax = 150
ymin = 0
ymax = 150
[]
[left_load]
type = ExtraNodesetGenerator
input = Bottom
new_boundary = left_load
coord = '0 150 0'
[]
[right_load]
type = ExtraNodesetGenerator
input = left_load
new_boundary = right_load
coord = '150 150 0'
[]
[left_support]
type = ExtraNodesetGenerator
input = right_load
new_boundary = left_support
coord = '0 0 0'
[]
[right_support]
type = ExtraNodesetGenerator
input = left_support
new_boundary = right_support
coord = '150 0 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[Dc]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[Cc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = 0.25
[]
[sensitivity_var]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[]
[AuxKernels]
[sensitivity_kernel]
type = MaterialRealAux
check_boundary_restricted = false
property = sensitivity
variable = sensitivity_var
execute_on = 'TIMESTEP_END'
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = left_support
value = 0.0
[]
[no_x]
type = DirichletBC
variable = disp_x
boundary = left_support
value = 0.0
[]
[no_y_right]
type = DirichletBC
variable = disp_y
boundary = right_support
value = 0.0
[]
[no_x_right]
type = DirichletBC
variable = disp_x
boundary = right_support
value = 0.0
[]
[]
[NodalKernels]
[push_right]
type = NodalGravity
variable = disp_y
boundary = right_load
gravity_value = 1e-3
mass = 1
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
# We do averaging in subapps
[rad_avg]
type = RadialAverage
radius = 8
weights = linear
prop_name = sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[calc_sense]
type = SensitivityFilter
density_sensitivity = Dc
design_density = mat_den
filter_UO = rad_avg
execute_on = TIMESTEP_END
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-10
dt = 1.0
num_steps = 10
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
execute_on = 'TIMESTEP_BEGIN TIMESTEP_END NONLINEAR'
[]
[objective]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(test/tests/postprocessors/geometry/3d_geometry.i)
radius = 0.5
inner_box_length = 2.2
outer_box_length = 3
depth = 0.4
sides = 28
alpha = ${fparse 2 * pi / ${sides}}
perimeter_correction = ${fparse ${alpha} / 2 / sin(alpha / 2)}
area_correction = ${fparse alpha / sin(alpha)}
[Mesh]
file = 3d.e
construct_side_list_from_node_list = true
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./circle_side_area]
type = AreaPostprocessor
boundary = circle_side
[../]
[./inside_side_area]
type = AreaPostprocessor
boundary = inside_side
[../]
[./outside_side_area]
type = AreaPostprocessor
boundary = outside_side
[../]
[./circle_volume]
type = VolumePostprocessor
block = circle
[../]
[./inside_volume]
type = VolumePostprocessor
block = inside
[../]
[./outside_volume]
type = VolumePostprocessor
block = outside
[../]
[./total_volume]
type = VolumePostprocessor
block = 'circle inside outside'
[../]
[./circle_side_area_exact]
type = FunctionValuePostprocessor
function = 'circle_side_area_exact'
[../]
[./inside_side_area_exact]
type = FunctionValuePostprocessor
function = 'inside_side_area_exact'
[../]
[./outside_side_area_exact]
type = FunctionValuePostprocessor
function = 'outside_side_area_exact'
[../]
[./circle_volume_exact]
type = FunctionValuePostprocessor
function = 'circle_volume_exact'
[../]
[./inside_volume_exact]
type = FunctionValuePostprocessor
function = 'inside_volume_exact'
[../]
[./outside_volume_exact]
type = FunctionValuePostprocessor
function = 'outside_volume_exact'
[../]
[./total_volume_exact]
type = FunctionValuePostprocessor
function = 'total_volume_exact'
[../]
[]
[Functions]
[./circle_side_area_exact]
type = ParsedFunction
expression = '2 * pi * ${radius} / ${perimeter_correction} * ${depth}'
[../]
[./inside_side_area_exact]
type = ParsedFunction
expression = '${inner_box_length} * ${depth} * 4'
[../]
[./outside_side_area_exact]
type = ParsedFunction
expression = '${outer_box_length} * ${depth} * 4'
[../]
[./circle_volume_exact]
type = ParsedFunction
expression = 'pi * ${radius}^2 * ${depth} / ${area_correction}'
[../]
[./inside_volume_exact]
type = ParsedFunction
expression = '${inner_box_length}^2 * ${depth} - pi * ${radius}^2 * ${depth} / ${area_correction}'
[../]
[./outside_volume_exact]
type = ParsedFunction
expression = '${outer_box_length}^2 * ${depth} - ${inner_box_length}^2 * ${depth}'
[../]
[./total_volume_exact]
type = ParsedFunction
expression = '${outer_box_length}^2 * ${depth}'
[../]
[]
[Outputs]
csv = true
[]
(modules/solid_mechanics/test/tests/volumetric_eigenstrain/ad_volumetric_eigenstrain.i)
# This tests the ability of the ADComputeVolumetricEigenstrain material
# to compute an eigenstrain tensor that results in a solution that exactly
# recovers the specified volumetric expansion.
# This model applies volumetric strain that ramps from 0 to 2 to a unit cube
# and computes the final volume, which should be exactly 3. Note that the default
# TaylorExpansion option for decomposition_method gives a small (~4%) error
# with this very large incremental strain, but decomposition_method=EigenSolution
# gives the exact solution.
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[]
[AuxVariables]
[volumetric_strain]
order = CONSTANT
family = MONOMIAL
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
[master]
strain = FINITE
eigenstrain_names = eigenstrain
decomposition_method = EigenSolution #Necessary for exact solution
use_automatic_differentiation = true
[]
[]
[AuxKernels]
[volumetric_strain]
type = ADRankTwoScalarAux
scalar_type = VolumetricStrain
rank_two_tensor = total_strain
variable = volumetric_strain
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[bottom]
type = ADDirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[back]
type = ADDirichletBC
variable = disp_z
boundary = back
value = 0.0
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0.3
[]
[finite_strain_stress]
type = ADComputeFiniteStrainElasticStress
[]
[volumetric_eigenstrain]
type = ADComputeVolumetricEigenstrain
volumetric_materials = volumetric_change
eigenstrain_name = eigenstrain
[]
[volumetric_change]
type = ADGenericFunctionMaterial
prop_names = volumetric_change
prop_values = t
[]
[]
[Postprocessors]
[vol]
type = VolumePostprocessor
use_displaced_mesh = true
execute_on = 'initial timestep_end'
[]
[volumetric_strain]
type = ElementalVariableValue
variable = volumetric_strain
elementid = 0
[]
[disp_right]
type = NodalExtremeValue
variable = disp_x
boundary = right
[]
[]
[Executioner]
type = Transient
end_time = 2
[]
[Outputs]
csv = true
[]
(modules/combined/examples/optimization/multi-load/single_subapp_two.i)
power = 2
E0 = 1.0
Emin = 1.0e-6
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[Bottom]
type = GeneratedMeshGenerator
dim = 2
nx = 80
ny = 40
xmin = 0
xmax = 150
ymin = 0
ymax = 75
[]
[left_load]
type = ExtraNodesetGenerator
input = Bottom
new_boundary = left_load
coord = '37.5 75 0'
[]
[right_load]
type = ExtraNodesetGenerator
input = left_load
new_boundary = right_load
coord = '112.5 75 0'
[]
[left_support]
type = ExtraNodesetGenerator
input = right_load
new_boundary = left_support
coord = '0 0 0'
[]
[right_support]
type = ExtraNodesetGenerator
input = left_support
new_boundary = right_support
coord = '150 0 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[Dc]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[Cc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = 0.1
[]
[sensitivity_var]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[]
[AuxKernels]
[sensitivity_kernel]
type = MaterialRealAux
check_boundary_restricted = false
property = sensitivity
variable = sensitivity_var
execute_on = 'TIMESTEP_END'
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = left_support
value = 0.0
[]
[no_x]
type = DirichletBC
variable = disp_x
boundary = left_support
value = 0.0
[]
[no_y_right]
type = DirichletBC
variable = disp_y
boundary = right_support
value = 0.0
[]
[]
[NodalKernels]
[push_right]
type = NodalGravity
variable = disp_y
boundary = right_load
gravity_value = -1e-3
mass = 1
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.0
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[rad_avg]
type = RadialAverage
radius = 3
weights = linear
prop_name = sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
# No SIMP optimization in subapp
[calc_sense]
type = SensitivityFilter
density_sensitivity = Dc
design_density = mat_den
filter_UO = rad_avg
execute_on = TIMESTEP_END
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-10
dt = 1.0
num_steps = 25
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
execute_on = 'TIMESTEP_BEGIN TIMESTEP_END NONLINEAR'
[]
[objective]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(modules/combined/examples/optimization/thermomechanical/structural_sub.i)
vol_frac = 0.4
power = 2.0
E0 = 1.0e-6
E1 = 1.0
rho0 = 0.0
rho1 = 1.0
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 40
ny = 40
xmin = 0
xmax = 40
ymin = 0
ymax = 40
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = hold
nodes = 0
[]
[push_left]
type = ExtraNodesetGenerator
input = node
new_boundary = push_left
coord = '16 0 0'
[]
[push_center]
type = ExtraNodesetGenerator
input = push_left
new_boundary = push_center
coord = '24 0 0'
[]
[extra]
type = SideSetsFromBoundingBoxGenerator
input = push_center
bottom_left = '-0.01 17.999 0'
top_right = '5 22.001 0'
boundary_new = n1
boundaries_old = left
[]
[dirichlet_bc]
type = SideSetsFromNodeSetsGenerator
input = extra
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[Dc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = FIRST
initial_condition = ${vol_frac}
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = hold
value = 0.0
[]
[no_x_symm]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[]
[NodalKernels]
[push_left]
type = NodalGravity
variable = disp_y
boundary = push_left
gravity_value = -1.0e-3
mass = 1
[]
[push_center]
type = NodalGravity
variable = disp_y
boundary = push_center
gravity_value = -1.0e-3
mass = 1
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
expression = "A1:=(${E0}-${E1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${E0}-A1*${rho0}^${power}; E1:=A1*mat_den^${power}+B1; E1"
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[rad_avg]
type = RadialAverage
radius = 1.2
weights = linear
prop_name = sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[calc_sense]
type = SensitivityFilter
density_sensitivity = Dc
design_density = mat_den
filter_UO = rad_avg
execute_on = TIMESTEP_END
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-12
dt = 1.0
num_steps = 500
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'INITIAL TIMESTEP_END'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
[]
[objective]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(modules/combined/examples/optimization/helmholtz_multimat_nostrip.i)
vol_frac = 0.35
power = 1.1
Emin = 1.0e-6
Ess = 0.475 # ss
Et = 1.0 # w
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
# final_generator = 'MoveRight'
[Bottom]
type = GeneratedMeshGenerator
dim = 2
nx = 320
ny = 30
xmin = 0
xmax = 150
ymin = 0
ymax = 15
[]
[RenameBottom]
type = RenameBoundaryGenerator
input = Bottom
old_boundary = 'top bottom right left'
new_boundary = 'top_bottom bottom_bottom right_bottom left_bottom'
[]
[Top]
type = GeneratedMeshGenerator
dim = 2
nx = 320
ny = 30
xmin = 0
xmax = 150
ymin = 0
ymax = 15
[]
[MoveTop]
type = TransformGenerator
input = Top
transform = TRANSLATE
vector_value = '0 15 0'
[]
[RenameTop]
type = RenameBoundaryGenerator
input = MoveTop
old_boundary = 'top bottom right left'
new_boundary = 'top_top bottom_top right_top left_top'
[]
[bottom_gen]
type = ParsedSubdomainMeshGenerator
input = RenameBottom
combinatorial_geometry = 'y <= 15'
block_id = 1
[]
[top_gen]
type = ParsedSubdomainMeshGenerator
input = RenameTop
combinatorial_geometry = 'y > 15'
block_id = 3
[]
[stitch]
type = StitchedMeshGenerator
inputs = 'bottom_gen top_gen'
stitch_boundaries_pairs = 'top_bottom bottom_top'
[]
[left_load]
type = ExtraNodesetGenerator
input = stitch
new_boundary = left_load
coord = '37.5 30 0'
[]
[right_load]
type = ExtraNodesetGenerator
input = left_load
new_boundary = right_load
coord = '112.5 30 0'
[]
[left_support]
type = ExtraNodesetGenerator
input = right_load
new_boundary = left_support
coord = '0 0 0'
[]
[right_support]
type = ExtraNodesetGenerator
input = left_support
new_boundary = right_support
coord = '150 0 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[Dc]
initial_condition = -1.0
[]
[]
[AuxVariables]
[Cc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[sensitivity]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[AuxKernel]
type = MaterialRealAux
variable = sensitivity
property = sensitivity
execute_on = LINEAR
[]
[]
[mat_den_nodal]
family = L2_LAGRANGE
order = FIRST
initial_condition = ${vol_frac}
[AuxKernel]
type = SelfAux
execute_on = TIMESTEP_END
variable = mat_den_nodal
v = mat_den
[]
[]
[Dc_elem]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[AuxKernel]
type = SelfAux
variable = Dc_elem
v = Dc
execute_on = 'TIMESTEP_END'
[]
[]
[]
[Kernels]
[diffusion]
type = FunctionDiffusion
variable = Dc
function = 4.0
[]
[potential]
type = Reaction
variable = Dc
[]
[source]
type = CoupledForce
variable = Dc
v = sensitivity
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = left_support
value = 0.0
[]
[no_x]
type = DirichletBC
variable = disp_x
boundary = left_support
value = 0.0
[]
[no_y_right]
type = DirichletBC
variable = disp_y
boundary = right_support
value = 0.0
[]
[boundary_penalty]
type = ADRobinBC
variable = Dc
boundary = 'bottom_bottom right_bottom left_bottom top_top right_top left_top'
coefficient = 10
[]
[]
[NodalKernels]
[left_down]
type = NodalGravity
variable = disp_y
boundary = left_load
gravity_value = -1e-3
mass = 1
[]
[right_down]
type = NodalGravity
variable = disp_y
boundary = right_load
gravity_value = -1e-3
mass = 1
[]
[]
[Materials]
[elasticity_tensor_one]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys_one
poissons_ratio = poissons_ratio
args = 'mat_den'
block = '1'
[]
[elasticity_tensor_three]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys_three
poissons_ratio = poissons_ratio
args = 'mat_den'
block = '3'
[]
# One: Tungsten
[E_phys_one]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${Et}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys_one
block = '1'
outputs = 'exodus'
[]
# Three: SS316
[E_phys_three]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${Ess}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys_three
block = '3'
outputs = 'exodus'
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc_one]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys_one
block = '1'
[]
[dc_three]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys_three
block = '3'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[update_one]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
block = '1'
[]
[update_three]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
block = '3'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-10
dt = 1.0
num_steps = 90
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
block = '1 3'
[]
[objective_one]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
block = '1'
[]
[objective_three]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
block = '3'
[]
[]
(modules/reactor/test/tests/meshgenerators/flexible_pattern_generator/patterned_assm.i)
[Mesh]
[accg]
type = AdvancedConcentricCircleGenerator
num_sectors = 9
ring_radii = '1 2'
ring_intervals = '2 2'
ring_block_ids = '10 15 20'
ring_block_names = 'inner_tri inner outer'
external_boundary_id = 100
external_boundary_name = 'ext'
create_outward_interface_boundaries = false
[]
[fpg]
type = FlexiblePatternGenerator
inputs = 'accg'
boundary_type = HEXAGON
boundary_size = ${fparse 12.0*sqrt(3.0)}
boundary_sectors = 10
hex_patterns = '0 0;
0 0 0;
0 0'
hex_pitches = 6
desired_area = 1.0
[]
[phmg]
type = PatternedHexMeshGenerator
inputs = 'fpg'
pattern = '0 0;
0 0 0;
0 0'
generate_core_metadata = true
pattern_boundary = none
[]
[]
[Problem]
solve = false
[]
[Postprocessors]
[background]
type = VolumePostprocessor
block = 0
[]
[circle1]
type = VolumePostprocessor
block = '10 15'
[]
[circle2]
type = VolumePostprocessor
block = '20'
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
file_base = 'patterned_assm'
[]
[]
(test/tests/auxkernels/user_object_dependency/aux_uo_deps.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 2
ny = 2
[]
[Problem]
kernel_coverage_check = false
[]
[Variables][dummy][][]
[AuxVariables]
[u]
order = FIRST
family = LAGRANGE
[]
[]
[AuxKernels]
[u]
type = PostprocessorAux
variable = u
# this aux kernel is indirectly depending on two other postprocessors, b and c
pp = a
[]
[]
[Postprocessors]
[a]
type = ScalePostprocessor
value = b
scaling_factor = 2
[]
[b]
type = ScalePostprocessor
value = c
scaling_factor = 4
[]
[c]
type = VolumePostprocessor
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]
(modules/reactor/test/tests/meshgenerators/core_mesh_generator/core_periphery_ptmg_vol.i)
[Mesh]
[rmp]
type = ReactorMeshParams
dim = 3
geom = "Hex"
assembly_pitch = 7.10315
axial_regions = '1.0'
axial_mesh_intervals = '1'
top_boundary_id = 201
bottom_boundary_id = 202
radial_boundary_id = 200
[]
[pin1]
type = PinMeshGenerator
reactor_params = rmp
pin_type = 1
pitch = 1.42063
num_sectors = 2
ring_radii = '0.2'
duct_halfpitch = '0.68'
mesh_intervals = '1 1 1'
region_ids='1 2 5'
quad_center_elements = true
[]
[pin2]
type = PinMeshGenerator
reactor_params = rmp
pin_type = 2
pitch = 1.42063
num_sectors = 2
mesh_intervals = '2'
region_ids='2'
quad_center_elements = true
[]
[pin3]
type = PinMeshGenerator
reactor_params = rmp
pin_type = 3
pitch = 1.42063
num_sectors = 2
ring_radii = '0.3818'
mesh_intervals = '1 1'
region_ids='3 4'
quad_center_elements = true
[]
[amg1]
type = AssemblyMeshGenerator
assembly_type = 1
background_intervals = 1
inputs = 'pin2'
pattern = '0 0;
0 0 0;
0 0'
background_region_id = 10
[]
[amg2]
type = AssemblyMeshGenerator
assembly_type = 2
background_intervals = 1
inputs = 'pin1 pin3'
pattern = '0 0;
0 1 0;
1 0'
background_region_id = 20
[]
[cmg]
type = CoreMeshGenerator
inputs = 'amg1 amg2 empty'
dummy_assembly_name = empty
pattern = '1 1;
1 0 1;
1 1'
extrude = false
mesh_periphery=true
periphery_generator=triangle
periphery_region_id=30
outer_circle_radius=15
outer_circle_num_segments=100
desired_area = 0.5
periphery_block_name=PERIPHERY_PTMG
[]
[rotate90]
type = TransformGenerator
input = cmg
transform = ROTATE
vector_value = '0 0 90'
[]
[]
[AuxVariables]
[assembly_id]
family = MONOMIAL
order = CONSTANT
[]
[assembly_type_id]
family = MONOMIAL
order = CONSTANT
[]
[pin_id]
family = MONOMIAL
order = CONSTANT
[]
[pin_type_id]
family = MONOMIAL
order = CONSTANT
[]
[region_id]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[assembly_id]
type = ExtraElementIDAux
variable = assembly_id
extra_id_name = assembly_id
[]
[assembly_type_id]
type = ExtraElementIDAux
variable = assembly_type_id
extra_id_name = assembly_type_id
[]
[pin_id]
type = ExtraElementIDAux
variable = pin_id
extra_id_name = pin_id
[]
[pin_type_id]
type = ExtraElementIDAux
variable = pin_type_id
extra_id_name = pin_type_id
[]
[region_id]
type = ExtraElementIDAux
variable = region_id
extra_id_name = region_id
[]
[]
[Postprocessors]
[periphery_area]
type = VolumePostprocessor
block = PERIPHERY_PTMG_TRI
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
file_base = core_periphery_ptmg_in
[]
(modules/reactor/test/tests/meshgenerators/peripheral_triangle_mesh_generator/abtr_tri_refine.i)
[Mesh]
[hex_in]
type = FileMeshGenerator
file = gold/abtr_mesh.e
[]
[tmg]
type = PeripheralTriangleMeshGenerator
input = hex_in
peripheral_ring_radius = 150
peripheral_ring_num_segments = 50
desired_area = 50
peripheral_ring_block_name = 'periphery'
[]
[]
[Postprocessors]
[periphery_area]
type = VolumePostprocessor
block = periphery
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
file_base = abtr_tri_refine
[]
(modules/combined/test/tests/optimization/compliance_sensitivity/three_materials_thermal.i)
vol_frac = 0.4
cost_frac = 0.4
power = 4
# Stiffness (not optimized in this test)
E0 = 1.0e-6
E1 = 0.2
E2 = 0.6
E3 = 1.0
# Densities
rho0 = 1.0e-6
rho1 = 0.4
rho2 = 0.7
rho3 = 1.0
# Costs
C0 = 1.0e-6
C1 = 0.5
C2 = 0.8
C3 = 1.0
# Thermal conductivity
TC0 = 1.0e-6
TC1 = 0.2
TC2 = 0.6
TC3 = 1.0
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 40
ny = 40
xmin = 0
xmax = 40
ymin = 0
ymax = 40
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = hold
nodes = 0
[]
[push_left]
type = ExtraNodesetGenerator
input = node
new_boundary = push_left
coord = '20 0 0'
[]
[push_center]
type = ExtraNodesetGenerator
input = push_left
new_boundary = push_center
coord = '40 0 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[temp]
initial_condition = 100.0
[]
[]
[AuxVariables]
[Dc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[Cc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[Tc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[Cost]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[]
# [ICs]
# [mat_den]
# type = RandomIC
# seed = 4
# variable = mat_den
# max = '${fparse vol_frac+0.25}'
# min = '${fparse vol_frac-0.25}'
# []
# []
[AuxKernels]
[Cost]
type = MaterialRealAux
variable = Cost
property = Cost_mat
[]
[]
[Kernels]
[heat_conduction]
type = HeatConduction
variable = temp
diffusion_coefficient = thermal_cond
[]
[heat_source]
type = HeatSource
value = 1e-2 # W/m^3
variable = temp
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = hold
value = 0.0
[]
[no_x_symm]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[top]
type = DirichletBC
variable = temp
boundary = top
value = 0
[]
[bottom]
type = DirichletBC
variable = temp
boundary = bottom
value = 0
[]
[right]
type = DirichletBC
variable = temp
boundary = right
value = 0
[]
[left]
type = DirichletBC
variable = temp
boundary = left
value = 0
[]
[]
[NodalKernels]
[push_left]
type = NodalGravity
variable = disp_y
boundary = push_left
gravity_value = -1e-6 # -3
mass = 1
[]
[push_center]
type = NodalGravity
variable = disp_y
boundary = push_center
gravity_value = -1e-6 # -3
mass = 1
[]
[]
[Materials]
[thermal_cond]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${TC0}-${TC1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${TC0}-A1*${rho0}^${power}; TC1:=A1*mat_den^${power}+B1; "
"A2:=(${TC1}-${TC2})/(${rho1}^${power}-${rho2}^${power}); "
"B2:=${TC1}-A2*${rho1}^${power}; TC2:=A2*mat_den^${power}+B2; "
"A3:=(${TC2}-${TC3})/(${rho2}^${power}-${rho3}^${power}); "
"B3:=${TC2}-A3*${rho2}^${power}; TC3:=A3*mat_den^${power}+B3; "
"if(mat_den<${rho1},TC1,if(mat_den<${rho2},TC2,TC3))"
coupled_variables = 'mat_den'
property_name = thermal_cond
outputs = 'exodus'
[]
[thermal_compliance]
type = ThermalCompliance
temperature = temp
thermal_conductivity = thermal_cond
outputs = 'exodus'
[]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${E0}-${E1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${E0}-A1*${rho0}^${power}; E1:=A1*mat_den^${power}+B1; "
"A2:=(${E1}-${E2})/(${rho1}^${power}-${rho2}^${power}); "
"B2:=${E1}-A2*${rho1}^${power}; E2:=A2*mat_den^${power}+B2; "
"A3:=(${E2}-${E3})/(${rho2}^${power}-${rho3}^${power}); "
"B3:=${E2}-A3*${rho2}^${power}; E3:=A3*mat_den^${power}+B3; "
"if(mat_den<${rho1},E1,if(mat_den<${rho2},E2,E3))"
coupled_variables = 'mat_den'
property_name = E_phys
[]
[Cost_mat]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${C0}-${C1})/(${rho0}^(1/${power})-${rho1}^(1/${power})); "
"B1:=${C0}-A1*${rho0}^(1/${power}); C1:=A1*mat_den^(1/${power})+B1; "
"A2:=(${C1}-${C2})/(${rho1}^(1/${power})-${rho2}^(1/${power})); "
"B2:=${C1}-A2*${rho1}^(1/${power}); C2:=A2*mat_den^(1/${power})+B2; "
"A3:=(${C2}-${C3})/(${rho2}^(1/${power})-${rho3}^(1/${power})); "
"B3:=${C2}-A3*${rho2}^(1/${power}); C3:=A3*mat_den^(1/${power})+B3; "
"if(mat_den<${rho1},C1,if(mat_den<${rho2},C2,C3))"
coupled_variables = 'mat_den'
property_name = Cost_mat
[]
[CostDensity]
type = ParsedMaterial
property_name = CostDensity
coupled_variables = 'mat_den Cost'
expression = 'mat_den*Cost'
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
[]
[cc]
type = CostSensitivity
design_density = mat_den
cost = Cost_mat
outputs = 'exodus'
[]
[tc]
type = ThermalSensitivity
design_density = mat_den
thermal_conductivity = thermal_cond
temperature = temp
outputs = 'exodus'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[rad_avg]
type = RadialAverage
radius = 4
weights = linear
prop_name = sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[rad_avg_cost]
type = RadialAverage
radius = 4
weights = linear
prop_name = cost_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[rad_avg_thermal]
type = RadialAverage
radius = 4
weights = linear
prop_name = thermal_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[update]
type = DensityUpdateTwoConstraints
density_sensitivity = Dc
cost_density_sensitivity = Cc
cost = Cost
cost_fraction = ${cost_frac}
design_density = mat_den
volume_fraction = ${vol_frac}
bisection_lower_bound = 0
bisection_upper_bound = 1.0e12 # 100
use_thermal_compliance = true
thermal_sensitivity = Tc
# Only account for thermal optimizxation
weight_mechanical_thermal = '0 1'
relative_tolerance = 1.0e-8
bisection_move = 0.05
adaptive_move = false
execute_on = TIMESTEP_BEGIN
[]
# Provides Dc
[calc_sense]
type = SensitivityFilter
density_sensitivity = Dc
design_density = mat_den
filter_UO = rad_avg
execute_on = TIMESTEP_END
force_postaux = true
[]
# Provides Cc
[calc_sense_cost]
type = SensitivityFilter
density_sensitivity = Cc
design_density = mat_den
filter_UO = rad_avg_cost
execute_on = TIMESTEP_END
force_postaux = true
[]
# Provides Tc
[calc_sense_thermal]
type = SensitivityFilter
density_sensitivity = Tc
design_density = mat_den
filter_UO = rad_avg_thermal
execute_on = TIMESTEP_END
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-10
dt = 1.0
num_steps = 12
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[right_flux]
type = SideDiffusiveFluxAverage
variable = temp
boundary = right
diffusivity = 10
[]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
[]
[cost_sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = cost_sensitivity
[]
[cost]
type = ElementIntegralMaterialProperty
mat_prop = CostDensity
[]
[cost_frac]
type = ParsedPostprocessor
expression = 'cost / mesh_volume'
pp_names = 'cost mesh_volume'
[]
[objective]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
[]
[objective_thermal]
type = ElementIntegralMaterialProperty
mat_prop = thermal_compliance
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(modules/reactor/test/tests/meshgenerators/flexible_pattern_generator/double_circ_pattern.i)
[Mesh]
[accg]
type = AdvancedConcentricCircleGenerator
num_sectors = 9
ring_radii = '1 2'
ring_intervals = '2 2'
ring_block_ids = '10 15 20'
ring_block_names = 'inner_tri inner outer'
external_boundary_id = 100
external_boundary_name = 'ext'
create_outward_interface_boundaries = false
[]
[reduced_accg]
type = TransformGenerator
input = 'accg'
transform = SCALE
vector_value = '0.2 0.2 0.2'
[]
[fpg]
type = FlexiblePatternGenerator
inputs = 'accg reduced_accg'
boundary_type = HEXAGON
boundary_size = ${fparse 12.0*sqrt(3.0)}
boundary_sectors = 10
circular_patterns = '0 0 0 0 0 0 0 0;
1 1 1 1 1 1 1 1'
circular_radii = '7 3'
circular_rotations = '0 22.5'
desired_area = 1.0
[]
[]
[Problem]
solve = false
[]
[Postprocessors]
[background]
type = VolumePostprocessor
block = 0
[]
[circle1]
type = VolumePostprocessor
block = '10 15'
[]
[circle2]
type = VolumePostprocessor
block = '20'
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
file_base = 'double_circ_pattern'
[]
[]
(modules/heat_transfer/test/tests/radiation_transfer_symmetry/cavity_with_pillars.i)
#
# inner_left: 8
# inner_right: 9
# inner_top: 12
# inner_bottom: 11
# inner_front: 10
# back_2: 7
# obstruction: 6
#
[Mesh]
[cartesian]
type = CartesianMeshGenerator
dim = 3
dx = '0.4 0.5 0.5 0.5 0.5 0.5 0.5 0.4'
dy = '0.5 0.75 0.5'
dz = '1.5 0.5'
subdomain_id = '
3 1 1 1 1 1 1 4
3 1 2 1 1 2 1 4
3 1 1 1 1 1 1 4
3 1 1 1 1 1 1 4
3 1 1 1 1 1 1 4
3 1 1 1 1 1 1 4
'
[]
[add_obstruction]
type = SideSetsBetweenSubdomainsGenerator
primary_block = 2
paired_block = 1
new_boundary = obstruction
input = cartesian
[]
[add_new_back]
type = ParsedGenerateSideset
combinatorial_geometry = 'abs(z) < 1e-10'
included_subdomains = '1'
normal = '0 0 -1'
new_sideset_name = back_2
input = add_obstruction
[]
[add_inner_left]
type = SideSetsBetweenSubdomainsGenerator
primary_block = 3
paired_block = 1
new_boundary = inner_left
input = add_new_back
[]
[add_inner_right]
type = SideSetsBetweenSubdomainsGenerator
primary_block = 4
paired_block = 1
new_boundary = inner_right
input = add_inner_left
[]
[add_inner_front]
type = ParsedGenerateSideset
combinatorial_geometry = 'abs(z - 2) < 1e-10'
included_subdomains = '1'
normal = '0 0 1'
new_sideset_name = inner_front
input = add_inner_right
[]
[add_inner_bottom]
type = ParsedGenerateSideset
combinatorial_geometry = 'abs(y) < 1e-10'
included_subdomains = '1'
normal = '0 -1 0'
new_sideset_name = inner_bottom
input = add_inner_front
[]
[add_inner_top]
type = ParsedGenerateSideset
combinatorial_geometry = 'abs(y - 1.75) < 1e-10'
included_subdomains = '1'
normal = '0 1 0'
new_sideset_name = inner_top
input = add_inner_bottom
[]
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[temperature]
block = '2 3 4'
initial_condition = 300
[]
[]
[Kernels]
[conduction]
type = HeatConduction
variable = temperature
block = '2 3 4'
diffusion_coefficient = 1
[]
[source]
type = BodyForce
variable = temperature
value = 1000
block = '2'
[]
[]
[BCs]
[convective]
type = CoupledConvectiveHeatFluxBC
variable = temperature
T_infinity = 300
htc = 50
boundary = 'left right'
[]
[]
[GrayDiffuseRadiation]
[cavity]
boundary = '6 7 8 9 10 11 12'
emissivity = '1 1 1 1 1 1 1'
n_patches = '1 1 1 1 1 1 1'
adiabatic_boundary = '7 10 11 12'
partitioners = 'metis metis metis metis metis metis metis'
temperature = temperature
ray_tracing_face_order = SECOND
normalize_view_factor = false
[]
[]
[Postprocessors]
[Tpv]
type = PointValue
variable = temperature
point = '0.3 0.5 0.5'
[]
[volume]
type = VolumePostprocessor
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(test/tests/postprocessors/volume/sphere1D.i)
# The volume of each block should be 3
[Mesh]
file = sphere1D.e
coord_type = RSPHERICAL
[]
[Functions]
[fred]
type = ParsedFunction
expression = '200'
[]
[]
[AuxVariables]
[constantVar]
order = FIRST
family = LAGRANGE
[]
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
initial_condition = 100
[]
[]
[AuxKernels]
[fred]
type = ConstantAux
variable = constantVar
block = 1
value = 1
[]
[]
[ICs]
[ic1]
type = ConstantIC
variable = constantVar
value = 1
block = 1
[]
[]
[Kernels]
[heat_r]
type = Diffusion
variable = u
[]
[]
[BCs]
[temps]
type = FunctionDirichletBC
variable = u
boundary = 1
function = fred
[]
[]
[Materials]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -snes_ls -ksp_gmres_restart'
petsc_options_value = 'lu basic 101'
line_search = 'none'
nl_abs_tol = 1e-11
nl_rel_tol = 1e-10
l_max_its = 20
[]
[Postprocessors]
[should_be_one]
type = ElementAverageValue
block = 1
variable = constantVar
execute_on = 'initial timestep_end'
[]
[volume1]
type = VolumePostprocessor
block = 1
execute_on = 'initial timestep_end'
[]
[volume2]
type = VolumePostprocessor
block = 2
execute_on = 'initial timestep_end'
[]
[volume3]
type = VolumePostprocessor
block = 3
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
exodus = true
[]
(modules/combined/examples/optimization/three_materials.i)
vol_frac = 0.4
cost_frac = 0.3
power = 4
E0 = 1.0e-6
E1 = 0.2
E2 = 0.6
E3 = 1.0
rho0 = 1.0e-6
rho1 = 0.4
rho2 = 0.7
rho3 = 1.0
C0 = 1.0e-6
C1 = 0.5
C2 = 0.8
C3 = 1.0
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 50
ny = 50
xmin = 0
xmax = 50
ymin = 0
ymax = 50
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = hold
nodes = 0
[]
[push_left]
type = ExtraNodesetGenerator
input = node
new_boundary = push_left
coord = '25 0 0'
[]
[push_center]
type = ExtraNodesetGenerator
input = push_left
new_boundary = push_center
coord = '50 0 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[Dc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[Cc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[Cost]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[]
[AuxKernels]
[Cost]
type = MaterialRealAux
variable = Cost
property = Cost_mat
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = hold
value = 0.0
[]
[no_x_symm]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[]
[NodalKernels]
[push_left]
type = NodalGravity
variable = disp_y
boundary = push_left
gravity_value = -1e-3
mass = 1
[]
[push_center]
type = NodalGravity
variable = disp_y
boundary = push_center
gravity_value = -1e-3
mass = 1
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${E0}-${E1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${E0}-A1*${rho0}^${power}; E1:=A1*mat_den^${power}+B1; "
"A2:=(${E1}-${E2})/(${rho1}^${power}-${rho2}^${power}); "
"B2:=${E1}-A2*${rho1}^${power}; E2:=A2*mat_den^${power}+B2; "
"A3:=(${E2}-${E3})/(${rho2}^${power}-${rho3}^${power}); "
"B3:=${E2}-A3*${rho2}^${power}; E3:=A3*mat_den^${power}+B3; "
"if(mat_den<${rho1},E1,if(mat_den<${rho2},E2,E3))"
coupled_variables = 'mat_den'
property_name = E_phys
[]
[Cost_mat]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${C0}-${C1})/(${rho0}^(1/${power})-${rho1}^(1/${power})); "
"B1:=${C0}-A1*${rho0}^(1/${power}); C1:=A1*mat_den^(1/${power})+B1; "
"A2:=(${C1}-${C2})/(${rho1}^(1/${power})-${rho2}^(1/${power})); "
"B2:=${C1}-A2*${rho1}^(1/${power}); C2:=A2*mat_den^(1/${power})+B2; "
"A3:=(${C2}-${C3})/(${rho2}^(1/${power})-${rho3}^(1/${power})); "
"B3:=${C2}-A3*${rho2}^(1/${power}); C3:=A3*mat_den^(1/${power})+B3; "
"if(mat_den<${rho1},C1,if(mat_den<${rho2},C2,C3))"
coupled_variables = 'mat_den'
property_name = Cost_mat
[]
[CostDensity]
type = ParsedMaterial
property_name = CostDensity
coupled_variables = 'mat_den Cost'
expression = 'mat_den*Cost'
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
[]
[cc]
type = CostSensitivity
design_density = mat_den
cost = Cost_mat
outputs = 'exodus'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[rad_avg]
type = RadialAverage
radius = 3
weights = linear
prop_name = sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[rad_avg_cost]
type = RadialAverage
radius = 3
weights = linear
prop_name = cost_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[update]
type = DensityUpdateTwoConstraints
# This is
density_sensitivity = Dc
cost_density_sensitivity = Cc
cost = Cost
cost_fraction = ${cost_frac}
design_density = mat_den
volume_fraction = ${vol_frac}
bisection_lower_bound = 0
bisection_upper_bound = 1.0e16 # 100
bisection_move = 0.05
adaptive_move = true
relative_tolerance = 1.0e-3
execute_on = TIMESTEP_BEGIN
[]
# Provides Dc
[calc_sense]
type = SensitivityFilter
density_sensitivity = Dc
design_density = mat_den
filter_UO = rad_avg
execute_on = TIMESTEP_END
force_postaux = true
[]
# Provides Cc
[calc_sense_cost]
type = SensitivityFilter
density_sensitivity = Cc
design_density = mat_den
filter_UO = rad_avg_cost
execute_on = TIMESTEP_END
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-10
dt = 1.0
num_steps = 40
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
[]
[cost_sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = cost_sensitivity
[]
[cost]
type = ElementIntegralMaterialProperty
mat_prop = CostDensity
[]
[cost_frac]
type = ParsedPostprocessor
expression = 'cost / mesh_volume'
pp_names = 'cost mesh_volume'
[]
[]
(modules/reactor/test/tests/meshgenerators/flexible_pattern_generator/single_circ_pattern.i)
[Mesh]
[accg]
type = AdvancedConcentricCircleGenerator
num_sectors = 9
ring_radii = '1 2'
ring_intervals = '2 2'
ring_block_ids = '10 15 20'
ring_block_names = 'inner_tri inner outer'
external_boundary_id = 100
external_boundary_name = 'ext'
create_outward_interface_boundaries = false
[]
[fpg]
type = FlexiblePatternGenerator
inputs = 'accg'
boundary_type = HEXAGON
boundary_size = ${fparse 12.0*sqrt(3.0)}
boundary_sectors = 10
circular_patterns = '0 0 0 0 0 0 0 0'
circular_radii = '7'
desired_area = 1.0
[]
[]
[Problem]
solve = false
[]
[Postprocessors]
[background]
type = VolumePostprocessor
block = 0
[]
[circle1]
type = VolumePostprocessor
block = '10 15'
[]
[circle2]
type = VolumePostprocessor
block = '20'
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
file_base = 'single_circ_pattern'
[]
[]
(modules/reactor/test/tests/meshgenerators/flexible_pattern_generator/double_hex_pattern.i)
[Mesh]
[accg]
type = AdvancedConcentricCircleGenerator
num_sectors = 9
ring_radii = '1 2'
ring_intervals = '2 2'
ring_block_ids = '10 15 20'
ring_block_names = 'inner_tri inner outer'
external_boundary_id = 100
external_boundary_name = 'ext'
create_outward_interface_boundaries = false
[]
[reduced_accg]
type = TransformGenerator
input = 'accg'
transform = SCALE
vector_value = '0.2 0.2 0.2'
[]
[fpg]
type = FlexiblePatternGenerator
inputs = 'accg reduced_accg'
boundary_type = HEXAGON
boundary_sectors = 10
boundary_size = ${fparse 12.0*sqrt(3.0)}
hex_patterns = '0 0;
0 0 0;
0 0|
1 1;
1 1 1;
1 1'
hex_pitches = '6 6'
hex_origins = '0.0 0.0 0.0
2.0 2.0 0.0'
desired_area = 1.0
[]
[]
[Problem]
solve = false
[]
[Postprocessors]
[background]
type = VolumePostprocessor
block = 0
[]
[circle1]
type = VolumePostprocessor
block = '10 15'
[]
[circle2]
type = VolumePostprocessor
block = '20'
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
file_base = 'double_hex_pattern'
[]
[]
(modules/heat_transfer/test/tests/radiation_transfer_symmetry/cavity_with_pillars_symmetry_bc.i)
#
# inner_left: 8
# inner_top: 11
# inner_bottom: 10
# inner_front: 9
# back_2: 7
# obstruction: 6
#
[Mesh]
[cartesian]
type = CartesianMeshGenerator
dim = 3
dx = '0.4 0.5 0.5 0.5'
dy = '0.5 0.75 0.5'
dz = '1.5 0.5'
subdomain_id = '
3 1 1 1
3 1 2 1
3 1 1 1
3 1 1 1
3 1 1 1
3 1 1 1
'
[]
[add_obstruction]
type = SideSetsBetweenSubdomainsGenerator
primary_block = 2
paired_block = 1
new_boundary = obstruction
input = cartesian
[]
[add_new_back]
type = ParsedGenerateSideset
combinatorial_geometry = 'abs(z) < 1e-10'
included_subdomains = '1'
normal = '0 0 -1'
new_sideset_name = back_2
input = add_obstruction
[]
[add_inner_left]
type = SideSetsBetweenSubdomainsGenerator
primary_block = 3
paired_block = 1
new_boundary = inner_left
input = add_new_back
[]
[add_inner_front]
type = ParsedGenerateSideset
combinatorial_geometry = 'abs(z - 2) < 1e-10'
included_subdomains = '1'
normal = '0 0 1'
new_sideset_name = inner_front
input = add_inner_left
[]
[add_inner_bottom]
type = ParsedGenerateSideset
combinatorial_geometry = 'abs(y) < 1e-10'
included_subdomains = '1'
normal = '0 -1 0'
new_sideset_name = inner_bottom
input = add_inner_front
[]
[add_inner_top]
type = ParsedGenerateSideset
combinatorial_geometry = 'abs(y - 1.75) < 1e-10'
included_subdomains = '1'
normal = '0 1 0'
new_sideset_name = inner_top
input = add_inner_bottom
[]
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[temperature]
block = '2 3'
initial_condition = 300
[]
[]
[Kernels]
[conduction]
type = HeatConduction
variable = temperature
block = '2 3'
diffusion_coefficient = 1
[]
[source]
type = BodyForce
variable = temperature
value = 1000
block = '2'
[]
[]
[BCs]
[convective]
type = CoupledConvectiveHeatFluxBC
variable = temperature
T_infinity = 300
htc = 50
boundary = 'left'
[]
[]
[GrayDiffuseRadiation]
[./cavity]
boundary = '6 7 8 9 10 11'
emissivity = '1 1 1 1 1 1'
n_patches = '1 1 1 1 1 1'
adiabatic_boundary = '7 9 10 11'
symmetry_boundary = '2'
partitioners = 'metis metis metis metis metis metis'
temperature = temperature
ray_tracing_face_order = SECOND
normalize_view_factor = false
[../]
[]
[Postprocessors]
[Tpv]
type = PointValue
variable = temperature
point = '0.3 0.5 0.5'
[]
[volume]
type = VolumePostprocessor
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/volumetric_eigenstrain/volumetric_mechanical.i)
# This test ensures that the reported volumetric strain for a cube with
# mechanically imposed displacements (through Dirichlet BCs) exactly
# matches that from a version of this test that experiences the same
# defomation, but due to imposed eigenstrains.
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[]
[AuxVariables]
[./volumetric_strain]
order = CONSTANT
family = MONOMIAL
[../]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
[./master]
strain = FINITE
decomposition_method = EigenSolution #Necessary for exact solution
[../]
[]
[AuxKernels]
[./volumetric_strain]
type = RankTwoScalarAux
scalar_type = VolumetricStrain
rank_two_tensor = total_strain
variable = volumetric_strain
[../]
[]
[Functions]
[pres_disp]
type = PiecewiseLinear
# These values are taken from the displacements in the eigenstrain
# version of this test. The volume of the cube (which starts out as
# a 1x1x1 cube) is (1 + disp)^3. At time 2, this is
# (1.44224957030741)^3, which is 3.0.
xy_data = '0 0
1 0.25992104989487
2 0.44224957030741'
[]
[]
[BCs]
[./left]
type = DirichletBC
variable = disp_x
boundary = left
value = 0.0
[../]
[./bottom]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[../]
[./back]
type = DirichletBC
variable = disp_z
boundary = back
value = 0.0
[../]
[./right]
type = FunctionDirichletBC
variable = disp_x
boundary = right
function = pres_disp
[../]
[./top]
type = FunctionDirichletBC
variable = disp_y
boundary = top
function = pres_disp
[../]
[./front]
type = FunctionDirichletBC
variable = disp_z
boundary = front
function = pres_disp
[../]
[]
[Materials]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0.3
[../]
[./finite_strain_stress]
type = ComputeFiniteStrainElasticStress
[../]
[./volumetric_change]
type = GenericFunctionMaterial
prop_names = volumetric_change
prop_values = t
[../]
[]
[Postprocessors]
[./vol]
type = VolumePostprocessor
use_displaced_mesh = true
execute_on = 'initial timestep_end'
[../]
[./volumetric_strain]
type = ElementalVariableValue
variable = volumetric_strain
elementid = 0
[../]
[./disp_right]
type = NodalExtremeValue
variable = disp_x
boundary = right
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
l_max_its = 100
l_tol = 1e-4
nl_abs_tol = 1e-8
nl_rel_tol = 1e-12
start_time = 0.0
end_time = 2.0
dt = 1.0
[]
[Outputs]
csv = true
[]
(modules/reactor/test/tests/meshgenerators/flexible_pattern_generator/mixed_pattern.i)
[Mesh]
[accg]
type = AdvancedConcentricCircleGenerator
num_sectors = 9
ring_radii = '1 2'
ring_intervals = '2 2'
ring_block_ids = '10 15 20'
ring_block_names = 'inner_tri inner outer'
external_boundary_id = 100
external_boundary_name = 'ext'
create_outward_interface_boundaries = false
[]
[reduced_accg]
type = TransformGenerator
input = 'accg'
transform = SCALE
vector_value = '0.4 0.4 0.4'
[]
[fpg]
type = FlexiblePatternGenerator
inputs = 'accg reduced_accg'
boundary_type = HEXAGON
boundary_size = ${fparse 12.0*sqrt(3.0)}
boundary_sectors = 10
hex_patterns = '0 0;
0 2 0;
0 0'
hex_pitches = 7
rect_pitches_x = 3
rect_pitches_y = 5
rect_patterns = '1 1;
1 1'
extra_positions = '0.0 10.0 0.0
0.0 -10.0 0.0'
extra_positions_mg_indices = '1 1'
desired_area = 1.0
[]
[]
[Problem]
solve = false
[]
[Postprocessors]
[background]
type = VolumePostprocessor
block = 0
[]
[circle1]
type = VolumePostprocessor
block = '10 15'
[]
[circle2]
type = VolumePostprocessor
block = '20'
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
file_base = 'mixed_pattern'
[]
[]
(modules/combined/test/tests/optimization/thermal_sensitivity/2d_root.i)
vol_frac = 0.5
E0 = 1
Emin = 1e-4
power = 1
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 20
ny = 20
xmin = 0
xmax = 40
ymin = 0
ymax = 40
[]
[]
[Variables]
[T]
initial_condition = 100
[]
[]
[AuxVariables]
[Dc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[]
[Kernels]
[heat]
type = HeatConduction
diffusion_coefficient = k
variable = T
[]
[heat_source]
type = HeatSource
function = 1e-2
variable = T
[]
[]
[DiracKernels]
[src]
type = ConstantPointSource
variable = T
point = '0 5 0'
value = 10
[]
[]
[BCs]
[no_x]
type = DirichletBC
variable = T
boundary = 'right top bottom'
value = 0.0
[]
[]
[Materials]
[k]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
coupled_variables = 'mat_den'
property_name = k
[]
[dc]
type = ThermalSensitivity
temperature = T
design_density = mat_den
thermal_conductivity = k
[]
#only needed for objective function output in postprocessor
[thermal_compliance]
type = ThermalCompliance
temperature = T
thermal_conductivity = k
[]
[]
[UserObjects]
[rad_avg]
type = RadialAverage
radius = 3
weights = linear
prop_name = thermal_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[update]
type = DensityUpdate
density_sensitivity = Dc
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
[]
[calc_sense]
type = SensitivityFilter
density_sensitivity = Dc
design_density = mat_den
filter_UO = rad_avg
execute_on = TIMESTEP_END
force_postaux = true
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-8
dt = 1.0
dtmin = 1.0
num_steps = 20
[]
[Outputs]
[out]
type = CSV
execute_on = 'FINAL'
[]
print_linear_residuals = false
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = thermal_sensitivity
[]
[objective_thermal]
type = ElementIntegralMaterialProperty
mat_prop = thermal_compliance
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(modules/combined/test/tests/optimization/compliance_sensitivity/paper_three_materials_test.i)
vol_frac = 0.4
cost_frac = 0.2 #0.283 # Change back to 0.4
power = 4
E0 = 1.0e-6
E1 = 0.2
E2 = 0.6
E3 = 1.0
rho0 = 1.0e-6
rho1 = 0.4
rho2 = 0.7
rho3 = 1.0
C0 = 1.0e-6
C1 = 0.5
C2 = 0.8
C3 = 1.0
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 50
ny = 50
xmin = 0
xmax = 50
ymin = 0
ymax = 50
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = hold
nodes = 0
[]
[push_left]
type = ExtraNodesetGenerator
input = node
new_boundary = push_left
coord = '25 0 0'
[]
[push_center]
type = ExtraNodesetGenerator
input = push_left
new_boundary = push_center
coord = '50 0 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[Dc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[Cc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[Cost]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[]
[AuxKernels]
[Cost]
type = MaterialRealAux
variable = Cost
property = Cost_mat
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = hold
value = 0.0
[]
[no_x_symm]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[]
[NodalKernels]
[push_left]
type = NodalGravity
variable = disp_y
boundary = push_left
gravity_value = -1e-3
mass = 1
[]
[push_center]
type = NodalGravity
variable = disp_y
boundary = push_center
gravity_value = -1e-3
mass = 1
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${E0}-${E1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${E0}-A1*${rho0}^${power}; E1:=A1*mat_den^${power}+B1; "
"A2:=(${E1}-${E2})/(${rho1}^${power}-${rho2}^${power}); "
"B2:=${E1}-A2*${rho1}^${power}; E2:=A2*mat_den^${power}+B2; "
"A3:=(${E2}-${E3})/(${rho2}^${power}-${rho3}^${power}); "
"B3:=${E2}-A3*${rho2}^${power}; E3:=A3*mat_den^${power}+B3; "
"if(mat_den<${rho1},E1,if(mat_den<${rho2},E2,E3))"
coupled_variables = 'mat_den'
property_name = E_phys
[]
[Cost_mat]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${C0}-${C1})/(${rho0}^(1/${power})-${rho1}^(1/${power})); "
"B1:=${C0}-A1*${rho0}^(1/${power}); C1:=A1*mat_den^(1/${power})+B1; "
"A2:=(${C1}-${C2})/(${rho1}^(1/${power})-${rho2}^(1/${power})); "
"B2:=${C1}-A2*${rho1}^(1/${power}); C2:=A2*mat_den^(1/${power})+B2; "
"A3:=(${C2}-${C3})/(${rho2}^(1/${power})-${rho3}^(1/${power})); "
"B3:=${C2}-A3*${rho2}^(1/${power}); C3:=A3*mat_den^(1/${power})+B3; "
"if(mat_den<${rho1},C1,if(mat_den<${rho2},C2,C3))"
coupled_variables = 'mat_den'
property_name = Cost_mat
[]
[CostDensity]
type = ParsedMaterial
property_name = CostDensity
coupled_variables = 'mat_den Cost'
expression = 'mat_den*Cost'
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
[]
[cc]
type = CostSensitivity
design_density = mat_den
cost = Cost_mat
outputs = 'exodus'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[rad_avg]
type = RadialAverage
radius = 2
weights = linear
prop_name = sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[rad_avg_cost]
type = RadialAverage
radius = 2
weights = linear
prop_name = cost_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[update]
type = DensityUpdateTwoConstraints
# This is
density_sensitivity = Dc
cost_density_sensitivity = Cc
cost = Cost
cost_fraction = ${cost_frac}
design_density = mat_den
volume_fraction = ${vol_frac}
bisection_lower_bound = 0
bisection_upper_bound = 1.0e16 # 100
relative_tolerance = 1.0e-3
bisection_move = 0.02
execute_on = TIMESTEP_BEGIN
[]
# Provides Dc
[calc_sense]
type = SensitivityFilter
density_sensitivity = Dc
design_density = mat_den
filter_UO = rad_avg
execute_on = TIMESTEP_END
force_postaux = true
[]
# Provides Cc
[calc_sense_cost]
type = SensitivityFilter
density_sensitivity = Cc
design_density = mat_den
filter_UO = rad_avg_cost
execute_on = TIMESTEP_END
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-10
dt = 1.0
num_steps = 25
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
[]
[cost_sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = cost_sensitivity
[]
[cost]
type = ElementIntegralMaterialProperty
mat_prop = CostDensity
[]
[cost_frac]
type = ParsedPostprocessor
expression = 'cost / mesh_volume'
pp_names = 'cost mesh_volume'
[]
[objective]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(modules/combined/examples/optimization/multi-load/single_subapp_one.i)
power = 2
E0 = 1.0
Emin = 1.0e-6
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
# final_generator = 'MoveRight'
[Bottom]
type = GeneratedMeshGenerator
dim = 2
nx = 80
ny = 40
xmin = 0
xmax = 150
ymin = 0
ymax = 75
[]
[left_load]
type = ExtraNodesetGenerator
input = Bottom
new_boundary = left_load
coord = '37.5 75 0'
[]
[right_load]
type = ExtraNodesetGenerator
input = left_load
new_boundary = right_load
coord = '112.5 75 0'
[]
[left_support]
type = ExtraNodesetGenerator
input = right_load
new_boundary = left_support
coord = '0 0 0'
[]
[right_support]
type = ExtraNodesetGenerator
input = left_support
new_boundary = right_support
coord = '150 0 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[Dc]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[Cc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = 0.1
[]
[sensitivity_var]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[]
[AuxKernels]
[sensitivity_kernel]
type = MaterialRealAux
property = sensitivity
variable = sensitivity_var
check_boundary_restricted = false
execute_on = 'TIMESTEP_END'
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = left_support
value = 0.0
[]
[no_x]
type = DirichletBC
variable = disp_x
boundary = left_support
value = 0.0
[]
[no_y_right]
type = DirichletBC
variable = disp_y
boundary = right_support
value = 0.0
[]
[]
[NodalKernels]
[push_left]
type = NodalGravity
variable = disp_y
boundary = left_load
gravity_value = -1e-3
mass = 1
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.0
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[rad_avg]
type = RadialAverage
radius = 3
weights = linear
prop_name = sensitivity
force_preaux = true
execute_on = 'TIMESTEP_END'
[]
# No SIMP optimization in subapp
[calc_sense]
type = SensitivityFilter
density_sensitivity = Dc
design_density = mat_den
filter_UO = rad_avg
force_postaux = true
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-10
dt = 1.0
num_steps = 25
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
execute_on = 'TIMESTEP_BEGIN TIMESTEP_END NONLINEAR'
[]
[objective]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(test/tests/meshgenerators/mesh_repair_generator/flip_element.i)
[Mesh]
[dir1]
type = ElementGenerator
nodal_positions = '0 0 0
1 0 0
0 1 0'
element_connectivity = '0 1 2'
elem_type = 'TRI3'
[]
[rename]
type = RenameBlockGenerator
input = dir1
old_block = 0
new_block = 1
[]
[dir2]
type = ElementGenerator
nodal_positions = '0 0 0
1 0 0
0 1 0'
element_connectivity = '0 2 1'
elem_type = 'TRI3'
[]
[combine]
type = CombinerGenerator
inputs = 'dir2 rename'
[]
[extrude]
type = MeshExtruderGenerator
input = combine
extrusion_vector = '0 0 1'
[]
[flip]
type = MeshRepairGenerator
input = extrude
fix_elements_orientation = true
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[vol0]
type = VolumePostprocessor
block = 0
[]
[vol1]
type = VolumePostprocessor
block = 1
[]
[]
[Outputs]
csv = true
[]
(modules/reactor/test/tests/meshgenerators/flexible_pattern_generator/single_hex_pattern.i)
[Mesh]
[accg]
type = AdvancedConcentricCircleGenerator
num_sectors = 9
ring_radii = '1 2'
ring_intervals = '2 2'
ring_block_ids = '10 15 20'
ring_block_names = 'inner_tri inner outer'
external_boundary_id = 100
external_boundary_name = 'ext'
create_outward_interface_boundaries = false
[]
[fpg]
type = FlexiblePatternGenerator
inputs = 'accg'
boundary_type = HEXAGON
boundary_size = ${fparse 12.0*sqrt(3.0)}
boundary_sectors = 10
hex_patterns = '0 0;
0 0 0;
0 0'
hex_pitches = 6
desired_area = 1.0
background_subdomain_id = 200
background_subdomain_name = 'background'
[]
[]
[Problem]
solve = false
[]
[Postprocessors]
[background]
type = VolumePostprocessor
block = 200
[]
[circle1]
type = VolumePostprocessor
block = '10 15'
[]
[circle2]
type = VolumePostprocessor
block = '20'
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
file_base = 'single_hex_pattern_hex'
[]
[]
(modules/reactor/test/tests/meshgenerators/flexible_pattern_generator/single_hex_pattern_custom.i)
[Mesh]
[accg]
type = AdvancedConcentricCircleGenerator
num_sectors = 9
ring_radii = '1 2'
ring_intervals = '2 2'
ring_block_ids = '10 15 20'
ring_block_names = 'inner_tri inner outer'
external_boundary_id = 100
external_boundary_name = 'ext'
create_outward_interface_boundaries = false
[]
[pcg]
type = ParsedCurveGenerator
x_formula = '10*cos(t)'
y_formula = 'y1:=10*sin(t);
y2:=15*sin(t);
if(t<pi,y1,y2)'
section_bounding_t_values = '0.0 ${fparse pi} ${fparse 2.0*pi}'
nums_segments = '10 10'
constant_names = 'pi'
constant_expressions = '${fparse pi}'
is_closed_loop = true
[]
[fpg]
type = FlexiblePatternGenerator
inputs = 'accg'
boundary_type = CUSTOM
boundary_mesh = pcg
hex_patterns = '0 0;
0 0 0;
0 0'
hex_pitches = 6
desired_area = 1.0
[]
[]
[Problem]
solve = false
[]
[Postprocessors]
[background]
type = VolumePostprocessor
block = 0
[]
[circle1]
type = VolumePostprocessor
block = '10 15'
[]
[circle2]
type = VolumePostprocessor
block = '20'
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
file_base = 'single_hex_pattern_custom'
[]
[]
(modules/optimization/test/tests/executioners/constrained/shape_optimization/forward.i)
# This test is documented as an example for ConstrainedShapeOptimization. This
# test should not be changed without updating the documentation.
inner_radius = 6
outer_radius = 10
volume_constraint = 200
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[mesh]
type = ConcentricCircleMeshGenerator
has_outer_square = no
num_sectors = 16
radii = '${inner_radius} ${outer_radius}'
rings = '16 16'
preserve_volumes = false
[]
[inner_radius]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
new_boundary = inner
primary_block = 2
paired_block = 1
[]
[delete]
type = BlockDeletionGenerator
input = inner_radius
block = 1
[]
[gather_all]
type = BoundingBoxNodeSetGenerator
input = delete
bottom_left = '-100 -100 -100'
top_right = '100 100 100'
new_boundary = total
[]
[combine]
type = SideSetsFromBoundingBoxGenerator
input = gather_all
bottom_left = '-100 -100 -100'
top_right = '100 100 100'
boundaries_old = 'inner outer'
boundary_new = moving
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[T]
[]
[]
[AuxVariables]
[dist_between]
[AuxKernel]
type = NearestNodeDistanceAux
variable = dist_between
paired_boundary = moving
boundary = total
block = 2
use_displaced_mesh = false
execute_on = "INITIAL"
[]
[]
[]
[Kernels]
[disp_x]
type = MatDiffusion
variable = disp_x
use_displaced_mesh = false
diffusivity = diff_coef
[]
[disp_y]
type = MatDiffusion
variable = disp_y
use_displaced_mesh = false
diffusivity = diff_coef
[]
# run physics of interest on deformed mesh
[Diffusion]
type = FunctionDiffusion
variable = T
use_displaced_mesh = true
[]
[Source]
type = BodyForce
variable = T
value = 1
use_displaced_mesh = true
[]
[]
[Materials]
# perserve elements near the boundary
[diff_coef]
type = ParsedMaterial
coupled_variables = 'dist_between'
expression = '1/(dist_between+0.5)'
property_name = 'diff_coef'
[]
[h]
type = ADGenericFunctionMaterial
prop_names = h
prop_values = h
[]
# convection type boundary condition
[convection_bc]
type = ADParsedMaterial
coupled_variables = "T"
expression = "h*(100-T)"
material_property_names = "h"
property_name = convection
[]
[]
[Functions]
[r1_x]
type = ParsedOptimizationFunction
expression = 'r1 * cos((atan(y/x)))'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[r1_y]
type = ParsedOptimizationFunction
expression = 'r1 * sin((atan(y/x)))'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[r0_x]
type = ParsedOptimizationFunction
expression = 'r0 * cos((atan(y/x)))'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[r0_y]
type = ParsedOptimizationFunction
expression = 'r0 * sin((atan(y/x)))'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[h]
type = ParsedOptimizationFunction
# r0+${inner_radius} is the true current inner radius
expression = '10 /(pi * (r0+${inner_radius})^3)'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[eq_grad_r0]
type = ParsedOptimizationFunction
expression = '-2 * pi * (r0 + ${inner_radius})'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[eq_grad_r1]
type = ParsedOptimizationFunction
# r1+${outer_radius} is the true current outer radius
expression = '2 * pi * (r1+${outer_radius})'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[]
[BCs]
[diffuse_r1_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 'outer'
function = r1_x
preset = false
[]
[diffuse_r1_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 'outer'
function = r1_y
preset = false
[]
[diffuse_r0_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 'inner'
function = r0_x
preset = false
[]
[diffuse_r0_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 'inner'
function = r0_y
preset = false
[]
# run physics on deformed mesh
[convection]
type = ADMatNeumannBC
variable = T
boundary = inner
boundary_material = convection
use_displaced_mesh = true
value = 1
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Reporters]
[params]
type = ConstantReporter
real_vector_names = 'radii'
real_vector_values = '0 0'
dof_id_type_vector_names = 'num_params'
dof_id_type_vector_values = '2'
[]
[]
[Postprocessors]
[current_volume]
type = VolumePostprocessor
use_displaced_mesh = true
[]
# objective function
[objective]
type = NodalExtremeValue
variable = T
[]
[eq_constraint]
type = ParsedPostprocessor
pp_names = current_volume
expression = 'current_volume - ${volume_constraint}'
[]
[func_r0]
type = FunctionValuePostprocessor
function = eq_grad_r0
[]
[func_r1]
type = FunctionValuePostprocessor
function = eq_grad_r1
[]
[]
[VectorPostprocessors]
# convert "Real" postprocessors to vectors
[vol_constraint]
type = VectorOfPostprocessors
postprocessors = 'eq_constraint'
force_postaux = true
[]
[eq_grad]
type = VectorOfPostprocessors
postprocessors = 'func_r0 func_r1'
force_postaux = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = none
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
[]
[Outputs]
console = false
[]
(modules/combined/examples/optimization/thermomechanical/thermal_sub.i)
vol_frac = 0.4
power = 2.0
E0 = 1.0e-6
E1 = 1.0
rho0 = 0.0
rho1 = 1.0
C0 = 1.0e-6
C1 = 1.0
TC0 = 1.0e-16
TC1 = 1.0
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 40
ny = 40
xmin = 0
xmax = 40
ymin = 0
ymax = 40
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = hold
nodes = 0
[]
[push_left]
type = ExtraNodesetGenerator
input = node
new_boundary = push_left
coord = '16 0 0'
[]
[push_center]
type = ExtraNodesetGenerator
input = push_left
new_boundary = push_center
coord = '24 0 0'
[]
[extra]
type = SideSetsFromBoundingBoxGenerator
input = push_center
bottom_left = '-0.01 17.999 0'
top_right = '5 22.001 0'
boundary_new = n1
boundaries_old = left
[]
[dirichlet_bc]
type = SideSetsFromNodeSetsGenerator
input = extra
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[temp]
initial_condition = 100.0
[]
[]
[AuxVariables]
[Dc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[Cc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[Tc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[Cost]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = FIRST
initial_condition = ${vol_frac}
[]
[]
[AuxKernels]
[Cost]
type = MaterialRealAux
variable = Cost
property = Cost_mat
[]
[]
[Kernels]
[heat_conduction]
type = HeatConduction
variable = temp
diffusion_coefficient = thermal_cond
[]
[heat_source]
type = HeatSource
value = 1e-2 # W/m^3
variable = temp
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = hold
value = 0.0
[]
[no_x_symm]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[left_n1]
type = DirichletBC
variable = temp
boundary = n1
value = 0.0
[]
[top]
type = NeumannBC
variable = temp
boundary = top
value = 0
[]
[bottom]
type = NeumannBC
variable = temp
boundary = bottom
value = 0
[]
[right]
type = NeumannBC
variable = temp
boundary = right
value = 0
[]
[left]
type = NeumannBC
variable = temp
boundary = left
value = 0
[]
[]
[NodalKernels]
[push_left]
type = NodalGravity
variable = disp_y
boundary = push_left
gravity_value = 0.0 # -1e-8
mass = 1
[]
[push_center]
type = NodalGravity
variable = disp_y
boundary = push_center
gravity_value = 0.0 # -1e-8
mass = 1
[]
[]
[Materials]
[thermal_cond]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${TC0}-${TC1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${TC0}-A1*${rho0}^${power}; TC1:=A1*mat_den^${power}+B1; TC1"
coupled_variables = 'mat_den'
property_name = thermal_cond
outputs = 'exodus'
[]
[thermal_compliance]
type = ThermalCompliance
temperature = temp
thermal_conductivity = thermal_cond
outputs = 'exodus'
[]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${E0}-${E1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${E0}-A1*${rho0}^${power}; E1:=A1*mat_den^${power}+B1; E1"
coupled_variables = 'mat_den'
property_name = E_phys
[]
[Cost_mat]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${C0}-${C1})/(${rho0}^(1/${power})-${rho1}^(1/${power})); "
"B1:=${C0}-A1*${rho0}^(1/${power}); C1:=A1*mat_den^(1/${power})+B1; C1"
coupled_variables = 'mat_den'
property_name = Cost_mat
[]
[CostDensity]
type = ParsedMaterial
property_name = CostDensity
coupled_variables = 'mat_den Cost'
expression = 'mat_den*Cost'
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
[]
[cc]
type = CostSensitivity
design_density = mat_den
cost = Cost_mat
outputs = 'exodus'
[]
[tc]
type = ThermalSensitivity
design_density = mat_den
thermal_conductivity = thermal_cond
temperature = temp
outputs = 'exodus'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[rad_avg]
type = RadialAverage
radius = 0.1
weights = linear
prop_name = sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[rad_avg_cost]
type = RadialAverage
radius = 0.1
weights = linear
prop_name = cost_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[rad_avg_thermal]
type = RadialAverage
radius = 0.1
weights = linear
prop_name = thermal_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
# Provides Dc
[calc_sense]
type = SensitivityFilter
density_sensitivity = Dc
design_density = mat_den
filter_UO = rad_avg
execute_on = TIMESTEP_END
force_postaux = true
[]
# Provides Cc
[calc_sense_cost]
type = SensitivityFilter
density_sensitivity = Cc
design_density = mat_den
filter_UO = rad_avg_cost
execute_on = TIMESTEP_END
force_postaux = true
[]
# Provides Tc
[calc_sense_thermal]
type = SensitivityFilter
density_sensitivity = Tc
design_density = mat_den
filter_UO = rad_avg_thermal
execute_on = TIMESTEP_END
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-12
dt = 1.0
num_steps = 500
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[right_flux]
type = SideDiffusiveFluxAverage
variable = temp
boundary = right
diffusivity = 10
[]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
[]
[cost_sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = cost_sensitivity
[]
[cost]
type = ElementIntegralMaterialProperty
mat_prop = CostDensity
[]
[cost_frac]
type = ParsedPostprocessor
expression = 'cost / mesh_volume'
pp_names = 'cost mesh_volume'
[]
[objective]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
[]
[objective_thermal]
type = ElementIntegralMaterialProperty
mat_prop = thermal_compliance
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(modules/combined/examples/optimization/multi-load/square_subapp_one.i)
power = 1.0
E0 = 1.0
Emin = 1.0e-6
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[Bottom]
type = GeneratedMeshGenerator
dim = 2
nx = 100
ny = 100
xmin = 0
xmax = 150
ymin = 0
ymax = 150
[]
[left_load]
type = ExtraNodesetGenerator
input = Bottom
new_boundary = left_load
coord = '0 150 0'
[]
[right_load]
type = ExtraNodesetGenerator
input = left_load
new_boundary = right_load
coord = '150 150 0'
[]
[left_support]
type = ExtraNodesetGenerator
input = right_load
new_boundary = left_support
coord = '0 0 0'
[]
[right_support]
type = ExtraNodesetGenerator
input = left_support
new_boundary = right_support
coord = '150 0 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[Dc]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[Cc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = 0.25
[]
[sensitivity_var]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[]
[AuxKernels]
[sensitivity_kernel]
type = MaterialRealAux
property = sensitivity
variable = sensitivity_var
check_boundary_restricted = false
execute_on = 'TIMESTEP_END'
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = left_support
value = 0.0
[]
[no_x]
type = DirichletBC
variable = disp_x
boundary = left_support
value = 0.0
[]
[no_y_right]
type = DirichletBC
variable = disp_y
boundary = right_support
value = 0.0
[]
[no_x_right]
type = DirichletBC
variable = disp_x
boundary = right_support
value = 0.0
[]
[]
[NodalKernels]
[push_left]
type = NodalGravity
variable = disp_y
boundary = left_load
gravity_value = -1e-3
mass = 1
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
# We do averaging in subapps
[rad_avg]
type = RadialAverage
radius = 8
weights = linear
prop_name = sensitivity
force_preaux = true
execute_on = 'TIMESTEP_END'
[]
# Provides Dc
[calc_sense]
type = SensitivityFilter
density_sensitivity = Dc
design_density = mat_den
filter_UO = rad_avg
force_postaux = true
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-10
dt = 1.0
num_steps = 10
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
execute_on = 'TIMESTEP_BEGIN TIMESTEP_END NONLINEAR'
[]
[objective]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(modules/combined/examples/optimization/thermomechanical/thermomechanical_main.i)
vol_frac = 0.4
power = 2.0
E0 = 1.0e-6
E1 = 1.0
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 40
ny = 40
xmin = 0
xmax = 40
ymin = 0
ymax = 40
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = hold
nodes = 0
[]
[push_left]
type = ExtraNodesetGenerator
input = node
new_boundary = push_left
coord = '16 0 0'
[]
[push_center]
type = ExtraNodesetGenerator
input = push_left
new_boundary = push_center
coord = '24 0 0'
[]
[extra]
type = SideSetsFromBoundingBoxGenerator
input = push_center
bottom_left = '-0.01 17.999 0'
top_right = '5 22.001 0'
boundary_new = n1
boundaries_old = left
[]
[dirichlet_bc]
type = SideSetsFromNodeSetsGenerator
input = extra
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[mat_den]
family = MONOMIAL
order = FIRST
initial_condition = 0.02
[]
[sensitivity_one]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[sensitivity_two]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[total_sensitivity]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[]
[AuxKernels]
[total_sensitivity]
type = ParsedAux
variable = total_sensitivity
expression = '(1-1.0e-7)*sensitivity_one + 1.0e-7*sensitivity_two'
coupled_variables = 'sensitivity_one sensitivity_two'
execute_on = 'LINEAR TIMESTEP_END'
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = hold
value = 0.0
[]
[no_x_symm]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${E1} + (mat_den ^ ${power}) * (${E1}-${E0})'
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
# We do filtering in the subapps
[update]
type = DensityUpdate
density_sensitivity = total_sensitivity
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = MULTIAPP_FIXED_POINT_BEGIN
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-8
dt = 1.0
num_steps = 2
[]
[Outputs]
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
exodus = true
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralVariablePostprocessor
variable = total_sensitivity
[]
[]
[MultiApps]
[sub_app_one]
type = TransientMultiApp
input_files = structural_sub.i
[]
[sub_app_two]
type = TransientMultiApp
input_files = thermal_sub.i
[]
[]
[Transfers]
# First SUB-APP: STRUCTURAL
# To subapp densities
[subapp_one_density]
type = MultiAppCopyTransfer
to_multi_app = sub_app_one
source_variable = mat_den # Here
variable = mat_den
[]
# From subapp sensitivity
[subapp_one_sensitivity]
type = MultiAppCopyTransfer
from_multi_app = sub_app_one
source_variable = Dc # sensitivity_var
variable = sensitivity_one # Here
[]
# Second SUB-APP: HEAT CONDUCTIVITY
# To subapp densities
[subapp_two_density]
type = MultiAppCopyTransfer
to_multi_app = sub_app_two
source_variable = mat_den # Here
variable = mat_den
[]
# From subapp sensitivity
[subapp_two_sensitivity]
type = MultiAppCopyTransfer
from_multi_app = sub_app_two
source_variable = Tc # sensitivity_var
variable = sensitivity_two # Here
[]
[]
(modules/combined/examples/optimization/multi-load/square_main.i)
# This example is intended to reproduce a 2D example with opposing horizontal
# loads (see [1]). This test has an undefined solution if reguar SIMP is applied.
# Using multi-loads SIMP, on the other hand, generates a structure that optimizes
# the response to both loads individually,
# [1]. Lat. Am. j. solids struct. 12 (5), May 2015
# Topological derivative-based topology optimization of structures subject to multiple load-cases
vol_frac = 0.5
power = 1.0
E0 = 1.0
Emin = 1.0e-6
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[Bottom]
type = GeneratedMeshGenerator
dim = 2
nx = 100
ny = 100
xmin = 0
xmax = 150
ymin = 0
ymax = 150
[]
[left_load]
type = ExtraNodesetGenerator
input = Bottom
new_boundary = left_load
coord = '0 150 0'
[]
[right_load]
type = ExtraNodesetGenerator
input = left_load
new_boundary = right_load
coord = '150 150 0'
[]
[left_support]
type = ExtraNodesetGenerator
input = right_load
new_boundary = left_support
coord = '0 0 0'
[]
[right_support]
type = ExtraNodesetGenerator
input = left_support
new_boundary = right_support
coord = '150 0 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[mat_den]
family = MONOMIAL
order = CONSTANT
[]
[sensitivity_one]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[sensitivity_two]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[total_sensitivity]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[]
[ICs]
[mat_den]
type = RandomIC
seed = 7
variable = mat_den
max = '${fparse vol_frac+0.35}'
min = '${fparse vol_frac-0.35}'
[]
[]
[AuxKernels]
[total_sensitivity]
type = ParsedAux
variable = total_sensitivity
expression = '0.5*sensitivity_one + 0.5*sensitivity_two'
coupled_variables = 'sensitivity_one sensitivity_two'
execute_on = 'LINEAR TIMESTEP_END'
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = left_support
value = 0.0
[]
[no_x]
type = DirichletBC
variable = disp_x
boundary = left_support
value = 0.0
[]
[no_y_right]
type = DirichletBC
variable = disp_y
boundary = right_support
value = 0.0
[]
[no_x_right]
type = DirichletBC
variable = disp_x
boundary = right_support
value = 0.0
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[update]
type = DensityUpdate
density_sensitivity = total_sensitivity
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = MULTIAPP_FIXED_POINT_BEGIN
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-10
dt = 1.0
num_steps = 10
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralVariablePostprocessor
variable = total_sensitivity
[]
[]
[MultiApps]
[sub_app_one]
type = TransientMultiApp
input_files = square_subapp_one.i
[]
[sub_app_two]
type = TransientMultiApp
input_files = square_subapp_two.i
[]
[]
[Transfers]
# First SUB-APP
# To subapp densities
[subapp_one_density]
type = MultiAppCopyTransfer
to_multi_app = sub_app_one
source_variable = mat_den # Here
variable = mat_den
[]
# From subapp sensitivity
[subapp_one_sensitivity]
type = MultiAppCopyTransfer
from_multi_app = sub_app_one
source_variable = Dc # sensitivity_var
variable = sensitivity_one # Here
[]
# Second SUB-APP
# To subapp densities
[subapp_two_density]
type = MultiAppCopyTransfer
to_multi_app = sub_app_two
source_variable = mat_den # Here
variable = mat_den
[]
# From subapp sensitivity
[subapp_two_sensitivity]
type = MultiAppCopyTransfer
from_multi_app = sub_app_two
source_variable = Dc # sensitivity_var
variable = sensitivity_two # Here
[]
[]
(modules/combined/test/tests/feature_volume_fraction/Avrami.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 40
ny = 40
nz = 0
xmax = 40
ymax = 40
zmax = 0
elem_type = QUAD4
[]
[Variables]
active = 'u'
[./u]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = 20
y1 = 20
radius = 10
int_width = 1
invalue = 1
outvalue = 0
[../]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./dot]
type = TimeDerivative
variable = u
[../]
[]
[VectorPostprocessors]
[./feature_volumes]
type = FeatureVolumeVectorPostprocessor
flood_counter = feature_counter
execute_on = 'initial timestep_end'
outputs = none
[../]
[]
[Postprocessors]
[./feature_counter]
type = FeatureFloodCount
variable = u
compute_var_to_feature_map = true
execute_on = 'initial timestep_end'
[../]
[./Volume]
type = VolumePostprocessor
execute_on = 'initial'
[../]
[./Avrami]
type = FeatureVolumeFraction
execute_on = 'initial timestep_end'
mesh_volume = Volume
feature_volumes = feature_volumes
equil_fraction = 0.5
value_type = AVRAMI
[../]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 2
[]
[Outputs]
csv = true
[]
(modules/combined/examples/optimization/multi-load/single_main.i)
vol_frac = 0.3
power = 1.1
E0 = 1.0
Emin = 1.0e-6
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
# final_generator = 'MoveRight'
[Bottom]
type = GeneratedMeshGenerator
dim = 2
nx = 80
ny = 40
xmin = 0
xmax = 150
ymin = 0
ymax = 75
[]
[left_load]
type = ExtraNodesetGenerator
input = Bottom
new_boundary = left_load
coord = '37.5 75 0'
[]
[right_load]
type = ExtraNodesetGenerator
input = left_load
new_boundary = right_load
coord = '112.5 75 0'
[]
[left_support]
type = ExtraNodesetGenerator
input = right_load
new_boundary = left_support
coord = '0 0 0'
[]
[right_support]
type = ExtraNodesetGenerator
input = left_support
new_boundary = right_support
coord = '150 0 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = 0.02
[]
[sensitivity_one]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[sensitivity_two]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[total_sensitivity]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[]
[AuxKernels]
[total_sensitivity]
type = ParsedAux
variable = total_sensitivity
expression = '0.5*sensitivity_one + 0.5*sensitivity_two'
coupled_variables = 'sensitivity_one sensitivity_two'
execute_on = 'LINEAR TIMESTEP_END'
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = left_support
value = 0.0
[]
[no_x]
type = DirichletBC
variable = disp_x
boundary = left_support
value = 0.0
[]
[no_y_right]
type = DirichletBC
variable = disp_y
boundary = right_support
value = 0.0
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.0
[]
[stress]
type = ComputeLinearElasticStress
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
# We do filtering in the subapps
[update]
type = DensityUpdate
density_sensitivity = total_sensitivity
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = MULTIAPP_FIXED_POINT_BEGIN
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-10
dt = 1.0
num_steps = 25
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralVariablePostprocessor
variable = total_sensitivity
[]
[]
[MultiApps]
[sub_app_one]
type = TransientMultiApp
input_files = single_subapp_one.i
[]
[sub_app_two]
type = TransientMultiApp
input_files = single_subapp_two.i
[]
[]
[Transfers]
# First SUB-APP
# To subapp densities
[subapp_one_density]
type = MultiAppCopyTransfer
to_multi_app = sub_app_one
source_variable = mat_den # Here
variable = mat_den
[]
# From subapp sensitivity
[subapp_one_sensitivity]
type = MultiAppCopyTransfer
from_multi_app = sub_app_one
source_variable = Dc # sensitivity_var
variable = sensitivity_one # Here
[]
# Second SUB-APP
# To subapp densities
[subapp_two_density]
type = MultiAppCopyTransfer
to_multi_app = sub_app_two
source_variable = mat_den # Here
variable = mat_den
[]
# From subapp sensitivity
[subapp_two_sensitivity]
type = MultiAppCopyTransfer
from_multi_app = sub_app_two
source_variable = Dc # sensitivity_var
variable = sensitivity_two # Here
[]
[]
(modules/combined/examples/optimization/helmholtz_multimat_strip.i)
vol_frac = 0.35
power = 1.1
Emin = 1.0e-6
Ess = 0.475 # ss
Et = 1.0 # w
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
# final_generator = 'MoveRight'
[Bottom]
type = GeneratedMeshGenerator
dim = 2
nx = 320
ny = 30
xmin = 0
xmax = 150
ymin = 0
ymax = 15
[]
[RenameBottom]
type = RenameBoundaryGenerator
input = Bottom
old_boundary = 'top bottom right left'
new_boundary = 'top_bottom bottom_bottom right_bottom left_bottom'
[]
[Middle]
type = GeneratedMeshGenerator
dim = 2
nx = 320
ny = 6
xmin = 0
xmax = 150
ymin = 0
ymax = 3
[]
[MoveMiddle]
type = TransformGenerator
input = Middle
transform = TRANSLATE
vector_value = '0 15 0'
[]
[RenameMiddle]
type = RenameBoundaryGenerator
input = MoveMiddle
old_boundary = 'top bottom right left'
new_boundary = 'top_middle bottom_middle right_middle left_middle'
[]
[Top]
type = GeneratedMeshGenerator
dim = 2
nx = 320
ny = 30
xmin = 0
xmax = 150
ymin = 0
ymax = 15
[]
[MoveTop]
type = TransformGenerator
input = Top
transform = TRANSLATE
vector_value = '0 18 0'
[]
[RenameTop]
type = RenameBoundaryGenerator
input = MoveTop
old_boundary = 'top bottom right left'
new_boundary = 'top_top bottom_top right_top left_top'
[]
[bottom_gen]
type = ParsedSubdomainMeshGenerator
input = RenameBottom
combinatorial_geometry = 'y <= 15'
block_id = 1
[]
[middle_gen]
type = ParsedSubdomainMeshGenerator
input = RenameMiddle
combinatorial_geometry = 'y <= 18 & y > 15'
block_id = 2
[]
[top_gen]
type = ParsedSubdomainMeshGenerator
input = RenameTop
combinatorial_geometry = 'y > 18'
block_id = 3
[]
[stitch]
type = StitchedMeshGenerator
inputs = 'bottom_gen middle_gen top_gen'
stitch_boundaries_pairs = 'top_bottom bottom_middle; top_middle bottom_top'
[]
[left_load]
type = ExtraNodesetGenerator
input = stitch
new_boundary = left_load
coord = '37.5 33 0'
[]
[right_load]
type = ExtraNodesetGenerator
input = left_load
new_boundary = right_load
coord = '112.5 33 0'
[]
[left_support]
type = ExtraNodesetGenerator
input = right_load
new_boundary = left_support
coord = '0 0 0'
[]
[right_support]
type = ExtraNodesetGenerator
input = left_support
new_boundary = right_support
coord = '150 0 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[Dc]
initial_condition = -1.0
[]
[]
[AuxVariables]
[Cc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[sensitivity]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[AuxKernel]
type = MaterialRealAux
variable = sensitivity
property = sensitivity
execute_on = LINEAR
[]
block = '1 2 3'
[]
[mat_den_nodal]
family = L2_LAGRANGE
order = FIRST
initial_condition = ${vol_frac}
[AuxKernel]
type = SelfAux
execute_on = TIMESTEP_END
variable = mat_den_nodal
v = mat_den
[]
[]
[Dc_elem]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[AuxKernel]
type = SelfAux
variable = Dc_elem
v = Dc
execute_on = 'TIMESTEP_END'
[]
[]
[]
[Kernels]
[diffusion]
type = FunctionDiffusion
variable = Dc
function = 4.0
[]
[potential]
type = Reaction
variable = Dc
[]
[source]
type = CoupledForce
variable = Dc
v = sensitivity
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = left_support
value = 0.0
[]
[no_x]
type = DirichletBC
variable = disp_x
boundary = left_support
value = 0.0
[]
[no_y_right]
type = DirichletBC
variable = disp_y
boundary = right_support
value = 0.0
[]
[boundary_penalty]
type = ADRobinBC
variable = Dc
boundary = 'bottom_bottom right_bottom left_bottom top_top right_top left_top left_middle '
'right_middle'
coefficient = 10
[]
[]
[NodalKernels]
[left_down]
type = NodalGravity
variable = disp_y
boundary = left_load
gravity_value = -1e-3
mass = 1
[]
[right_down]
type = NodalGravity
variable = disp_y
boundary = right_load
gravity_value = -1e-3
mass = 1
[]
[]
[Materials]
[sensitivity]
type = ParsedMaterial
property_name = 'sensitivity'
block = '2'
expression = '0'
[]
[elasticity_tensor_one]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys_one
poissons_ratio = poissons_ratio
args = 'mat_den'
block = '1'
[]
[elasticity_tensor_three]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys_three
poissons_ratio = poissons_ratio
args = 'mat_den'
block = '3'
[]
[elasticity_tensor_two]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1.0
poissons_ratio = 0.3
block = '2'
[]
# One: Tungsten
[E_phys_one]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${Et}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys_one
block = '1'
outputs = 'exodus'
[]
# Three: SS316
[E_phys_three]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${Ess}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys_three
block = '3'
outputs = 'exodus'
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc_one]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys_one
block = '1'
[]
[dc_three]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys_three
block = '3'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[update_one]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
block = '1'
[]
[update_three]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
block = '3'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-10
dt = 1.0
num_steps = 90
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
block = '1 3'
[]
[objective_one]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
block = '1'
[]
[objective_three]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
block = '3'
[]
[]
(test/tests/postprocessors/geometry/2d_geometry.i)
radius = 0.5
inner_box_length = 2.2
outer_box_length = 3
sides = 16
alpha = ${fparse 2 * pi / ${sides}}
perimeter_correction = ${fparse alpha / 2 / sin(alpha / 2)}
area_correction = ${fparse alpha / sin(alpha)}
[Mesh]
file = 2d.e
construct_side_list_from_node_list = true
[]
[Variables]
[./u]
initial_condition = 1
block = circle
[../]
[./v]
initial_condition = 2
block = 'inside outside'
[../]
[]
[Kernels]
[./diff_u]
type = Diffusion
variable = u
[../]
[./diff_v]
type = Diffusion
variable = v
[../]
[]
[BCs]
[./circle]
type = DirichletBC
variable = u
boundary = circle_side_wrt_inside
value = 2
[../]
[./inner]
type = DirichletBC
variable = v
boundary = circle_side_wrt_circle
value = 4
[../]
[./outer]
type = DirichletBC
variable = v
boundary = outside_side
value = 6
[../]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./u_avg]
type = ElementAverageValue
variable = u
block = circle
[../]
[./v_avg]
type = ElementAverageValue
variable = v
block = 'inside outside'
[../]
[./circle_perimeter_wrt_circle]
type = AreaPostprocessor
boundary = circle_side_wrt_circle
[../]
[./circle_perimeter_wrt_inside]
type = AreaPostprocessor
boundary = circle_side_wrt_inside
[../]
[./inside_perimeter_wrt_inside]
type = AreaPostprocessor
boundary = inside_side_wrt_inside
[../]
[./inside_perimeter_wrt_outside]
type = AreaPostprocessor
boundary = inside_side_wrt_outside
[../]
[./outside_perimeter]
type = AreaPostprocessor
boundary = outside_side
[../]
[./circle_area]
type = VolumePostprocessor
block = circle
[../]
[./inside_area]
type = VolumePostprocessor
block = inside
[../]
[./outside_area]
type = VolumePostprocessor
block = outside
[../]
[./total_area]
type = VolumePostprocessor
block = 'circle inside outside'
[../]
[./circle_perimeter_exact]
type = FunctionValuePostprocessor
function = 'circle_perimeter_exact'
[../]
[./inside_perimeter_exact]
type = FunctionValuePostprocessor
function = 'inside_perimeter_exact'
[../]
[./outside_perimeter_exact]
type = FunctionValuePostprocessor
function = 'outside_perimeter_exact'
[../]
[./circle_area_exact]
type = FunctionValuePostprocessor
function = 'circle_area_exact'
[../]
[./inside_area_exact]
type = FunctionValuePostprocessor
function = 'inside_area_exact'
[../]
[./outside_area_exact]
type = FunctionValuePostprocessor
function = 'outside_area_exact'
[../]
[./total_area_exact]
type = FunctionValuePostprocessor
function = 'total_area_exact'
[../]
[]
[Functions]
[./circle_perimeter_exact]
type = ParsedFunction
expression = '2 * pi * ${radius} / ${perimeter_correction}'
[../]
[./inside_perimeter_exact]
type = ParsedFunction
expression = '${inner_box_length} * 4'
[../]
[./outside_perimeter_exact]
type = ParsedFunction
expression = '${outer_box_length} * 4'
[../]
[./circle_area_exact]
type = ParsedFunction
expression = 'pi * ${radius}^2 / ${area_correction}'
[../]
[./inside_area_exact]
type = ParsedFunction
expression = '${inner_box_length}^2 - pi * ${radius}^2 / ${area_correction}'
[../]
[./outside_area_exact]
type = ParsedFunction
expression = '${outer_box_length}^2 - ${inner_box_length}^2'
[../]
[./total_area_exact]
type = ParsedFunction
expression = '${outer_box_length}^2'
[../]
[]
[Outputs]
csv = true
[]
(modules/combined/test/tests/optimization/compliance_sensitivity/thermal_test.i)
vol_frac = 0.4
cost_frac = 10.0
power = 2.0
E0 = 1.0e-6
E1 = 1.0
rho0 = 0.0
rho1 = 1.0
C0 = 1.0e-6
C1 = 1.0
TC0 = 1.0e-16
TC1 = 1.0
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = 0
xmax = 40
ymin = 0
ymax = 40
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = hold
nodes = 0
[]
[push_left]
type = ExtraNodesetGenerator
input = node
new_boundary = push_left
coord = '16 0 0'
[]
[push_center]
type = ExtraNodesetGenerator
input = push_left
new_boundary = push_center
coord = '24 0 0'
[]
[extra]
type = SideSetsFromBoundingBoxGenerator
input = push_center
bottom_left = '-0.01 17.999 0'
top_right = '5 22.001 0'
boundary_new = n1
included_boundaries = left
[]
[dirichlet_bc]
type = SideSetsFromNodeSetsGenerator
input = extra
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[temp]
initial_condition = 100.0
[]
[]
[AuxVariables]
[Dc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[Cc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[Tc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[Cost]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = FIRST
initial_condition = ${vol_frac}
[]
[]
[AuxKernels]
[Cost]
type = MaterialRealAux
variable = Cost
property = Cost_mat
[]
[]
[Kernels]
[heat_conduction]
type = HeatConduction
variable = temp
diffusion_coefficient = thermal_cond
[]
[heat_source]
type = HeatSource
value = 1e-2 # W/m^3
variable = temp
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = hold
value = 0.0
[]
[no_x_symm]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[left_n1]
type = DirichletBC
variable = temp
boundary = n1
value = 0.0
[]
[top]
type = NeumannBC
variable = temp
boundary = top
value = 0
[]
[bottom]
type = NeumannBC
variable = temp
boundary = bottom
value = 0
[]
[right]
type = NeumannBC
variable = temp
boundary = right
value = 0
[]
[left]
type = NeumannBC
variable = temp
boundary = left
value = 0
[]
[]
[NodalKernels]
[push_left]
type = NodalGravity
variable = disp_y
boundary = push_left
gravity_value = 0.0 # -1e-8
mass = 1
[]
[push_center]
type = NodalGravity
variable = disp_y
boundary = push_center
gravity_value = 0.0 # -1e-8
mass = 1
[]
[]
[Materials]
[thermal_cond]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${TC0}-${TC1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${TC0}-A1*${rho0}^${power}; TC1:=A1*mat_den^${power}+B1; TC1"
coupled_variables = 'mat_den'
property_name = thermal_cond
outputs = 'exodus'
[]
[thermal_compliance]
type = ThermalCompliance
temperature = temp
thermal_conductivity = thermal_cond
outputs = 'exodus'
[]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${E0}-${E1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${E0}-A1*${rho0}^${power}; E1:=A1*mat_den^${power}+B1; E1"
coupled_variables = 'mat_den'
property_name = E_phys
[]
[Cost_mat]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${C0}-${C1})/(${rho0}^(1/${power})-${rho1}^(1/${power})); "
"B1:=${C0}-A1*${rho0}^(1/${power}); C1:=A1*mat_den^(1/${power})+B1; C1"
coupled_variables = 'mat_den'
property_name = Cost_mat
[]
[CostDensity]
type = ParsedMaterial
property_name = CostDensity
coupled_variables = 'mat_den Cost'
expression = 'mat_den*Cost'
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
[]
[cc]
type = CostSensitivity
design_density = mat_den
cost = Cost_mat
outputs = 'exodus'
[]
[tc]
type = ThermalSensitivity
design_density = mat_den
thermal_conductivity = thermal_cond
temperature = temp
outputs = 'exodus'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[rad_avg]
type = RadialAverage
radius = 0.1
weights = linear
prop_name = sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[rad_avg_cost]
type = RadialAverage
radius = 0.1
weights = linear
prop_name = cost_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[rad_avg_thermal]
type = RadialAverage
radius = 0.1
weights = linear
prop_name = thermal_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[update]
type = DensityUpdateTwoConstraints
density_sensitivity = Dc
cost_density_sensitivity = Cc
cost = Cost
cost_fraction = ${cost_frac}
design_density = mat_den
volume_fraction = ${vol_frac}
bisection_lower_bound = 0
bisection_upper_bound = 1.0e12 # 100
use_thermal_compliance = true
thermal_sensitivity = Tc
weight_mechanical_thermal = '0 1'
relative_tolerance = 1.0e-12
bisection_move = 0.015
adaptive_move = false
execute_on = TIMESTEP_BEGIN
[]
# Provides Dc
[calc_sense]
type = SensitivityFilter
density_sensitivity = Dc
design_density = mat_den
filter_UO = rad_avg
execute_on = TIMESTEP_END
force_postaux = true
[]
# Provides Cc
[calc_sense_cost]
type = SensitivityFilter
density_sensitivity = Cc
design_density = mat_den
filter_UO = rad_avg_cost
execute_on = TIMESTEP_END
force_postaux = true
[]
# Provides Tc
[calc_sense_thermal]
type = SensitivityFilter
density_sensitivity = Tc
design_density = mat_den
filter_UO = rad_avg_thermal
execute_on = TIMESTEP_END
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-12
dt = 1.0
num_steps = 5
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[right_flux]
type = SideDiffusiveFluxAverage
variable = temp
boundary = right
diffusivity = 10
[]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
[]
[cost_sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = cost_sensitivity
[]
[cost]
type = ElementIntegralMaterialProperty
mat_prop = CostDensity
[]
[cost_frac]
type = ParsedPostprocessor
expression = 'cost / mesh_volume'
pp_names = 'cost mesh_volume'
[]
[objective]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
[]
[objective_thermal]
type = ElementIntegralMaterialProperty
mat_prop = thermal_compliance
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(modules/reactor/test/tests/meshgenerators/flexible_pattern_generator/single_rect_pattern.i)
[Mesh]
[accg]
type = AdvancedConcentricCircleGenerator
num_sectors = 9
ring_radii = '1 2'
ring_intervals = '2 2'
ring_block_ids = '10 15 20'
ring_block_names = 'inner_tri inner outer'
external_boundary_id = 100
external_boundary_name = 'ext'
create_outward_interface_boundaries = false
[]
[fpg]
type = FlexiblePatternGenerator
inputs = 'accg'
boundary_type = HEXAGON
boundary_size = ${fparse 16.0*sqrt(3.0)}
boundary_sectors = 10
rect_pitches_x = 6
rect_pitches_y = 8
rect_patterns = '0 0 0;
0 0 0;
0 0 0'
desired_area = 1.0
[]
[]
[Problem]
solve = false
[]
[Postprocessors]
[background]
type = VolumePostprocessor
block = 0
[]
[circle1]
type = VolumePostprocessor
block = '10 15'
[]
[circle2]
type = VolumePostprocessor
block = '20'
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
file_base = 'single_rect_pattern'
[]
[]
(modules/reactor/test/tests/meshgenerators/flexible_pattern_generator/custom_pattern.i)
[Mesh]
[accg]
type = AdvancedConcentricCircleGenerator
num_sectors = 9
ring_radii = '1 2'
ring_intervals = '2 2'
ring_block_ids = '10 15 20'
ring_block_names = 'inner_tri inner outer'
external_boundary_id = 100
external_boundary_name = 'ext'
create_outward_interface_boundaries = false
[]
[fpg]
type = FlexiblePatternGenerator
inputs = 'accg'
boundary_type = HEXAGON
boundary_size = ${fparse 16.0*sqrt(3.0)}
boundary_sectors = 10
extra_positions = '0.0 6.0 0.0
-3.0 0.0 0.0
3.0 0.0 0.0
-6.0 -6.0 0.0
0.0 -6.0 0.0
6.0 -6.0 0.0'
extra_positions_mg_indices = '0 0 0 0 0 0'
desired_area = 1.0
[]
[]
[Problem]
solve = false
[]
[Postprocessors]
[background]
type = VolumePostprocessor
block = 0
[]
[circle1]
type = VolumePostprocessor
block = '10 15'
[]
[circle2]
type = VolumePostprocessor
block = '20'
[]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
file_base = 'custom_pattern'
[]
[]