- bufferThe buffer this compute is writing to
C++ Type:std::string
Controllable:No
Description:The buffer this compute is writing to
RankTwoIdentity
Rank two identity tensor in real space.
RankTwoIdentity fills the output with the rank-2 identity tensor in real space, expanded to the full buffer shape.
Overview
For a problem dimension d, the object forms I_d and broadcasts it over the spatial grid, producing a field with shape (..., d, d). This is useful as a building block for constitutive models and tests.
Example Input File Syntax
[
TensorComputes/
[./I]
type = RankTwoIdentity
buffer = identity
[../]
]
!listing-endInput Parameters
- 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:No
Description:Set the enabled status of the MooseObject.
Advanced Parameters
Input Files
(examples/degeus_mechanics/mech.i)
[Domain]
dim = 3
nx = 32
ny = 32
nz = 32
xmax = ${fparse 2*pi}
ymax = ${fparse 2*pi}
zmax = ${fparse 2*pi}
mesh_mode = DUMMY
[]
[TensorComputes]
[Initialize]
[Finit]
type = RankTwoIdentity
buffer = F
[]
[phase]
type = PhaseMechanicsTest
buffer = phase
[]
[K]
type = ParsedCompute
buffer = K
expression = '(1-phase)*Ka + phase*Kb'
inputs = phase
constant_names = 'Ka Kb'
constant_expressions = '0.833 8.33'
[]
[mu]
type = ParsedCompute
buffer = mu
expression = '(1-phase)*mua + phase*mub'
inputs = phase
constant_names = 'mua mub'
constant_expressions = '0.386 3.86'
[]
[]
[Solve]
[hyper_elasticity]
type = HyperElasticIsotropic
buffer = stress
F = Fnew
K = K
mu = mu
[]
[root]
[applied_strain]
type = MacroscopicShearTensor
buffer = applied_strain
[]
[mech]
type = FFTMechanics
buffer = Fnew
F = F
K = K
mu = mu
l_tol = 1e-2
nl_rel_tol = 2e-2
nl_abs_tol = 2e-2
constitutive_model = hyper_elasticity
stress = stress
applied_macroscopic_strain = applied_strain
[]
[]
[]
[Postprocess]
[displacements]
type = ComputeDisplacements
buffer = disp
F = F
[]
[vonmises]
type = ComputeVonMisesStress
buffer = sV
[]
[]
[]
[TensorSolver]
# no variables are integrated by this solver (FFTMechanics performs a steady state mechanics solve)
type = ForwardEulerSolver
root_compute = root
# deformation tensor is just forwarded Fnew -> F
forward_buffer = F
forward_buffer_new = Fnew
substeps = 10
[]
[TensorOutputs]
[deformation_tensor]
type = XDMFTensorOutput
buffer = 'disp sV F'
output_mode = 'OVERSIZED_NODAL CELL CELL'
enable_hdf5 = true
[]
[]
[Executioner]
type = Transient
num_steps = 100
dt = 0.01
[]
(test/tests/mechanics/mech.i)
[Domain]
dim = 2
nx = 32
ny = 32
xmax = ${fparse 2*pi}
ymax = ${fparse 2*pi}
zmax = ${fparse 2*pi}
mesh_mode = DUMMY
parallel_mode = FFT_AUTO
[]
[TensorComputes]
[Initialize]
[phase]
type = ParsedCompute
expression = '(cos(x)/2+0.5)^1*(cos(y)/2+0.5)^1*(cos(z)/2+0.5)^1'
extra_symbols = true
buffer = phase
[]
[K]
type = ParsedCompute
buffer = K
expression = '(1-phase)*Ka + phase*Kb'
inputs = phase
constant_names = 'Ka Kb'
constant_expressions = '1 10'
[]
[mu]
type = ParsedCompute
buffer = mu
expression = '(1-phase)*mua + phase*mub'
inputs = phase
constant_names = 'mua mub'
constant_expressions = '0.5 5'
[]
[Finit]
type = RankTwoIdentity
buffer = F
[]
[]
[Solve]
[hyper_elasticity]
type = HyperElasticIsotropic
buffer = stress
F = Fnew
K = K
mu = mu
[]
[root]
[applied_strain]
type = MacroscopicShearTensor
buffer = applied_strain
[]
[mech]
type = FFTMechanics
buffer = Fnew
F = F
K = K
mu = mu
l_max_its = 40
l_tol = 1e-5
nl_rel_tol = 2e-4
nl_abs_tol = 2e-3
constitutive_model = hyper_elasticity
stress = stress
applied_macroscopic_strain = applied_strain
[]
[]
[]
[Postprocess]
[displacements]
type = ComputeDisplacements
buffer = disp
F = F
[]
[vonmises]
type = ComputeVonMisesStress
buffer = sV
[]
[]
[]
[TensorSolver]
# no variables are integrated by this solver (FFTMechanics performs a steady state mechanics solve)
type = ForwardEulerSolver
root_compute = root
# deformation tensor is just forwarded Fnew -> F
forward_buffer = F
forward_buffer_new = Fnew
substeps = 3
[]
[TensorOutputs]
active = 'parallel' # serial
[serial]
type = XDMFTensorOutput
file_base = mech_serial
buffer = 'disp sV F phase'
output_mode = 'OVERSIZED_NODAL CELL CELL NODE'
enable_hdf5 = true
execute_on = 'TIMESTEP_END'
[]
[parallel]
# NODE and OVERSIZED_NODAL are not yet available in parallel output
type = XDMFTensorOutput
file_base = mech_parallel
buffer = 'sV F phase'
output_mode = 'CELL CELL CELL'
enable_hdf5 = true
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
num_steps = 3
dt = 0.02
[]
(test/tests/mechanics/mech3d.i)
[Domain]
dim = 3
nx = 16
ny = 16
nz = 16
xmax = ${fparse 2*pi}
ymax = ${fparse 2*pi}
zmax = ${fparse 2*pi}
mesh_mode = DUMMY
parallel_mode = FFT_AUTO
[]
[TensorComputes]
[Initialize]
[phase]
type = ParsedCompute
expression = '(cos(x)/2+0.5)^1*(cos(y)/2+0.5)^1*(cos(z)/2+0.5)^1'
extra_symbols = true
buffer = phase
[]
[K]
type = ParsedCompute
buffer = K
expression = '(1-phase)*Ka + phase*Kb'
inputs = phase
constant_names = 'Ka Kb'
constant_expressions = '1 10'
[]
[mu]
type = ParsedCompute
buffer = mu
expression = '(1-phase)*mua + phase*mub'
inputs = phase
constant_names = 'mua mub'
constant_expressions = '0.5 5'
[]
[Finit]
type = RankTwoIdentity
buffer = F
[]
[]
[Solve]
[hyper_elasticity]
type = HyperElasticIsotropic
buffer = stress
F = Fnew
K = K
mu = mu
[]
[root]
[applied_strain]
type = MacroscopicShearTensor
buffer = applied_strain
[]
[mech]
type = FFTMechanics
buffer = Fnew
F = F
K = K
mu = mu
l_tol = 1e-2
nl_rel_tol = 2e-2
nl_abs_tol = 2e-2
constitutive_model = hyper_elasticity
stress = stress
applied_macroscopic_strain = applied_strain
[]
[]
[]
[Postprocess]
[displacements]
type = ComputeDisplacements
buffer = disp
F = F
[]
[vonmises]
type = ComputeVonMisesStress
buffer = sV
[]
[]
[]
[TensorSolver]
# no variables are integrated by this solver (FFTMechanics performs a steady state mechanics solve)
type = ForwardEulerSolver
root_compute = root
# deformation tensor is just forwarded Fnew -> F
forward_buffer = F
forward_buffer_new = Fnew
substeps = 10
[]
[TensorOutputs]
active = 'parallel' # serial
[serial]
type = XDMFTensorOutput
file_base = mech3d_serial
buffer = 'disp sV F phase'
output_mode = 'OVERSIZED_NODAL CELL CELL NODE'
enable_hdf5 = true
execute_on = 'TIMESTEP_END'
[]
[parallel]
# NODE and OVERSIZED_NODAL are not yet available in parallel output
type = XDMFTensorOutput
file_base = mech3d_parallel
buffer = 'sV F phase'
output_mode = 'CELL CELL CELL'
enable_hdf5 = true
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
num_steps = 3
dt = 0.01
[]