- bufferThe buffer this solver is writing to
C++ Type:std::vector<std::string>
Controllable:No
Description:The buffer this solver is writing to
- linear_reciprocalBuffer with the reciprocal of the linear prefactor (e.g. kappa*k^2). Either one buffer per nonlinear_reciprocal, or no buffer names, or `0` to skip linear reciprocal buffers for a given variable.
C++ Type:std::vector<std::string>
Controllable:No
Description:Buffer with the reciprocal of the linear prefactor (e.g. kappa*k^2). Either one buffer per nonlinear_reciprocal, or no buffer names, or `0` to skip linear reciprocal buffers for a given variable.
- nonlinear_reciprocalBuffer with the reciprocal of the non-linear contribution
C++ Type:std::vector<std::string>
Controllable:No
Description:Buffer with the reciprocal of the non-linear contribution
- reciprocal_bufferBuffer with the reciprocal of the integrated buffer
C++ Type:std::vector<std::string>
Controllable:No
Description:Buffer with the reciprocal of the integrated buffer
AdamsBashforthMoulton
Adams-Bashforth-Moulton semi-implicit/explicit time integration solver with optional implicit corrector.
Semi-implicit time integrator using Adams-Bashforth prediction and Adams-Moulton correction. The predictor and corrector orders, as well as the number of corrector iterations, are configurable via "predictor_order", "corrector_order", and "corrector_steps". Subcycling is controlled by "substeps".
Example Input File Syntax
[TensorSolver<<<{"href": "../../syntax/TensorSolver/index.html"}>>>]
type = AdamsBashforthMoulton
buffer = c
reciprocal_buffer = cbar
linear_reciprocal = kappabarbar
nonlinear_reciprocal = Mbarmubar
[](test/tests/tensor_compute/group.i)Input Parameters
- corrector_order2Order of the Adams-Moulton corrector.
Default:2
C++ Type:unsigned long
Range:corrector_order > 0 & corrector_order <= 5
Controllable:No
Description:Order of the Adams-Moulton corrector.
- corrector_steps0Number the Adams-Moulton corrector steps to take (one is usually sufficient).
Default:0
C++ Type:unsigned long
Controllable:No
Description:Number the Adams-Moulton corrector steps to take (one is usually sufficient).
- forward_bufferThese buffers are updated with the corresponding buffers from forward_buffer_old. No integration is performed. Buffer forwarding is used only to resolve cyclic dependencies.
C++ Type:std::vector<std::string>
Controllable:No
Description:These buffers are updated with the corresponding buffers from forward_buffer_old. No integration is performed. Buffer forwarding is used only to resolve cyclic dependencies.
- forward_buffer_newNew values to update `forward_buffer` with.
C++ Type:std::vector<std::string>
Controllable:No
Description:New values to update `forward_buffer` with.
- predictor_order2Order of the Adams-Bashforth predictor.
Default:2
C++ Type:unsigned long
Range:predictor_order > 0 & predictor_order <= 5
Controllable:No
Description:Order of the Adams-Bashforth predictor.
- root_computePrimary compute object that updates the buffers. This is usually a ComputeGroup object. A ComputeGroup encompassing all computes will be generated automatically if the user does not provide this parameter.
C++ Type:std::string
Controllable:No
Description:Primary compute object that updates the buffers. This is usually a ComputeGroup object. A ComputeGroup encompassing all computes will be generated automatically if the user does not provide this parameter.
- substeps1semi-implicit substeps per time step.
Default:1
C++ Type:unsigned int
Controllable:No
Description:semi-implicit substeps per time step.
Optional 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
- (benchmarks/01_spinodal_decomposition/1a_solver.i)
- (test/tests/tensor_compute/parallel_roundtrip_3d.i)
- (test/tests/cahnhilliard/cahnhilliard.i)
- (examples/cahn_hilliard/cahnhilliard.i)
- (examples/swift_hohenberg/rotating_grain.i)
- (test/tests/tensor_compute/parallel_roundtrip.i)
- (examples/cahn_hilliard/cahnhilliard2.i)
- (test/tests/tensor_compute/group.i)
- (test/tests/tensor_compute/backandforth.i)
- (test/tests/kks/KKS_no_flux_bc.i)
- (test/tests/kks/KKS_libtorch.i)
- (test/tests/solvers/diagonal.i)
- (test/tests/solvers/nl_coupled.i)
- (examples/phase_field_crystal/pfc_fcc_atomic_structure_3d.i)
- (examples/phase_field_crystal/pfc_fcc_atomic_structure.i)
- (benchmarks/02_oswald_ripening/2a.i)
- (test/tests/tensor_compute/pfc_fcc.i)
- (examples/libtorch_kks/KKS_libtorch.i)
predictor_order
Default:2
C++ Type:unsigned long
Range:predictor_order > 0 & predictor_order <= 5
Controllable:No
Description:Order of the Adams-Bashforth predictor.
corrector_order
Default:2
C++ Type:unsigned long
Range:corrector_order > 0 & corrector_order <= 5
Controllable:No
Description:Order of the Adams-Moulton corrector.
corrector_steps
Default:0
C++ Type:unsigned long
Controllable:No
Description:Number the Adams-Moulton corrector steps to take (one is usually sufficient).
substeps
Default:1
C++ Type:unsigned int
Controllable:No
Description:semi-implicit substeps per time step.
(test/tests/tensor_compute/group.i)
[Domain]
dim = 3
nx = 128
ny = 128
nz = 128
xmax = ${fparse pi*4}
ymax = ${fparse pi*4}
zmax = ${fparse pi*4}
mesh_mode = DUMMY
[]
[TensorBuffers]
# phase field
[c]
[]
[cbar]
[]
[mu]
[]
[mubar]
[]
[Mbarmubar]
[]
# mechanics
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[mumechbar]
[]
[mumech]
[]
# constant tensors
[Mbar]
[]
[kappabarbar]
[]
[]
[TensorOutputs]
[xdmf]
type = XDMFTensorOutput
buffer = 'c disp_x disp_y disp_z mu mumech'
output_mode = 'Node Node Node Node Cell Cell'
enable_hdf5 = true
[]
[]
[TensorComputes]
[Initialize]
[c]
type = RandomTensor
buffer = c
min = 0.44
max = 0.56
[]
[disp_x]
type = RandomTensor
buffer = disp_x
min = 0
max = 0
[]
[disp_y]
type = RandomTensor
buffer = disp_y
min = 0
max = 0
[]
[disp_z]
type = RandomTensor
buffer = disp_z
min = 0
max = 0
[]
[Mbar]
type = ReciprocalLaplacianFactor
factor = 0.2 # Mobility
buffer = Mbar
[]
[kappabarbar]
type = ReciprocalLaplacianSquareFactor
factor = -0.001 # kappa
buffer = kappabarbar
[]
[]
[Solve]
[mu]
# chemical potential (real space)
type = ParsedCompute
buffer = mu
expression = '0.1*c^2*(c-1)^2' # + c*sin(x/2)*0.005'
extra_symbols = true
derivatives = c
inputs = c
[]
[mubar]
# chemical potential (reciprocal space)
type = ForwardFFT
buffer = mubar
input = mu
[]
[mumechbar]
# mechanical chemical potential (reciprocal space)
type = FFTElasticChemicalPotential
buffer = mumechbar
cbar = cbar
displacements = 'disp_x disp_y disp_z'
lambda = 100
mu = 50
e0 = 0.02
[]
[mumech]
# chemical potential (reciprocal space)
type = InverseFFT
buffer = mumech
input = mumechbar
[]
[Mbarmubar]
type = ParsedCompute
buffer = Mbarmubar
expression = 'Mbar*(mubar+mumechbar)'
inputs = 'Mbar mubar mumechbar'
[]
[cbar]
type = ForwardFFT
buffer = cbar
input = c
[]
[qsmech]
type = FFTQuasistaticElasticity
displacements = 'disp_x disp_y disp_z'
cbar = cbar
lambda = 100
mu = 50
e0 = 0.02
[]
[group]
type = ComputeGroup
computes = 'cbar mumech mu mubar'
[]
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
buffer = c
reciprocal_buffer = cbar
linear_reciprocal = kappabarbar
nonlinear_reciprocal = Mbarmubar
[]
[Postprocessors]
[min_c]
type = TensorExtremeValuePostprocessor
buffer = c
value_type = MIN
execute_on = 'TIMESTEP_END'
[]
[max_c]
type = TensorExtremeValuePostprocessor
buffer = c
value_type = MAX
execute_on = 'TIMESTEP_END'
[]
[min_disp_x]
type = TensorExtremeValuePostprocessor
buffer = disp_x
value_type = MIN
execute_on = 'TIMESTEP_END'
[]
[max_disp_x]
type = TensorExtremeValuePostprocessor
buffer = disp_x
value_type = MAX
execute_on = 'TIMESTEP_END'
[]
[min_disp_y]
type = TensorExtremeValuePostprocessor
buffer = disp_y
value_type = MIN
execute_on = 'TIMESTEP_END'
[]
[max_disp_y]
type = TensorExtremeValuePostprocessor
buffer = disp_y
value_type = MAX
execute_on = 'TIMESTEP_END'
[]
[min_disp_z]
type = TensorExtremeValuePostprocessor
buffer = disp_z
value_type = MIN
execute_on = 'TIMESTEP_END'
[]
[max_disp_z]
type = TensorExtremeValuePostprocessor
buffer = disp_z
value_type = MAX
execute_on = 'TIMESTEP_END'
[]
[C]
type = TensorIntegralPostprocessor
buffer = c
execute_on = 'TIMESTEP_END'
[]
[cavg]
type = TensorAveragePostprocessor
buffer = c
execute_on = 'TIMESTEP_END'
[]
[]
[Problem]
type = TensorProblem
spectral_solve_substeps = 1000
print_debug_output = true
[]
[Executioner]
type = Transient
num_steps = 100
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.8
dt = 0.1
[]
dtmax = 1000
[]
[Outputs]
csv = true
perf_graph = true
execute_on = 'TIMESTEP_END'
[]
(benchmarks/01_spinodal_decomposition/1a_solver.i)
[Domain]
dim = 2
nx = 200
ny = 200
xmax = 200
ymax = 200
device_names = 'cuda'
mesh_mode = DOMAIN
[]
[TensorBuffers]
[c]
map_to_aux_variable = c
[]
[cbar]
[]
[mu]
# map_to_aux_variable = mu
[]
[mubar]
[]
[Mbarmubar]
[]
# constant tensors
[Mbar]
[]
[kappabarbar]
[]
# postprocessing
[F]
[]
[Fgrad]
[]
[]
[TensorComputes]
[Initialize]
[c]
type = ParsedCompute
buffer = c
extra_symbols = true
expression = 'c0+epsilon*(cos(0.105*x)*cos(0.11*y)+(cos(0.13*x)*cos(0.087*y))^2+cos(0.025*x-0.15*y)*cos(0.07*x-0.02*y))'
constant_names = 'c0 epsilon'
constant_expressions = '0.5 0.01'
[]
[Mbar]
type = ReciprocalLaplacianFactor
factor = 5 # Mobility
buffer = Mbar
[]
[kappabarbar]
type = ReciprocalLaplacianSquareFactor
factor = -10 # -kappa*M
buffer = kappabarbar
[]
[]
[Solve]
[mu]
type = ParsedCompute
buffer = mu
expression = 'rho_s*(c-c_alpha)^2*(c_beta-c)^2'
constant_names = 'rho_s c_alpha c_beta'
constant_expressions = '5 0.3 0.7'
derivatives = c
inputs = c
[]
[mubar]
type = ForwardFFT
buffer = mubar
input = mu
[]
[Mbarmubar]
type = ParsedCompute
buffer = Mbarmubar
expression = 'Mbar*mubar'
inputs = 'Mbar mubar'
[]
[cbar]
type = ForwardFFT
buffer = cbar
input = c
[]
[]
[Postprocess]
[Fgrad]
type = FFTGradientSquare
buffer = Fgrad
input = c
factor = 1 # kappa/2
[]
[F]
type = ParsedCompute
buffer = F
expression = 'rho_s * (c-c_alpha)^2 * (c_beta-c)^2 + Fgrad'
constant_names = 'rho_s c_alpha c_beta'
constant_expressions = '5 0.3 0.7'
inputs = 'c Fgrad'
[]
[]
[]
[UserObjects]
[terminator]
type = Terminator
expression = change<1e-4
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
buffer = c
substeps = 1000
history_size = 1
reciprocal_buffer = cbar
linear_reciprocal = kappabarbar
nonlinear_reciprocal = Mbarmubar
[]
[AuxVariables]
# [mu]
# family = MONOMIAL
# order = CONSTANT
# []
[c]
# family = MONOMIAL
# order = CONSTANT
[]
[]
[Postprocessors]
[min_c]
type = TensorExtremeValuePostprocessor
buffer = c
value_type = MIN
execute_on = 'TIMESTEP_END'
[]
[max_c]
type = TensorExtremeValuePostprocessor
buffer = c
value_type = MAX
execute_on = 'TIMESTEP_END'
[]
[F]
type = TensorIntegralPostprocessor
buffer = F
[]
[change]
type = TensorIntegralChangePostprocessor
buffer = c
[]
[]
[Problem]
type = TensorProblem
spectral_solve_substeps = 1000
[]
[Executioner]
type = Transient
num_steps = 1000
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.1
dt = 1
[]
dtmax = 300
[]
[Outputs]
exodus = true
csv = true
perf_graph = true
execute_on = 'TIMESTEP_END'
[]
(test/tests/tensor_compute/parallel_roundtrip_3d.i)
[Domain]
# Test parallel FFT round-trip with slab decomposition in 3D
device_names = "cpu cpu cpu"
device_weights = "1 1 1"
dim = 3
nx = 64
ny = 64
nz = 64
xmax = ${fparse pi*4}
ymax = ${fparse pi*4}
zmax = ${fparse pi*4}
[]
[TensorBuffers]
[eta_gold]
[]
[eta]
[]
[eta_bar]
[]
[eta_roundtrip]
[]
[diff]
[]
[zero]
[]
[]
[TensorComputes]
[Initialize]
[eta_gold]
type = ParsedCompute
buffer = eta_gold
expression = 'sin(x)+sin(y)+sin(z)+cos(2*x)*sin(3*y)*cos(z)'
extra_symbols = true
[]
[eta]
type = ParsedCompute
buffer = eta
expression = eta_gold
inputs = eta_gold
[]
[zero]
type = ConstantReciprocalTensor
buffer = zero
real = 0
imaginary = 0
[]
[]
[Solve]
# Test: eta -> FFT -> iFFT -> eta_roundtrip
# eta_roundtrip should equal eta (within numerical precision)
[eta_bar]
type = ForwardFFT
buffer = eta_bar
input = eta
[]
[eta_roundtrip]
type = InverseFFT
buffer = eta_roundtrip
input = eta_bar
[]
[]
[Postprocess]
[diff]
type = ParsedCompute
buffer = diff
expression = 'abs(eta - eta_roundtrip) + abs(eta - eta_gold)'
inputs = 'eta eta_roundtrip eta_gold'
[]
[]
[]
[Postprocessors]
[max_error]
type = TensorExtremeValuePostprocessor
buffer = diff
value_type = MAX
[]
[l2_error]
type = TensorIntegralPostprocessor
buffer = diff
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
buffer = eta
reciprocal_buffer = eta_bar
linear_reciprocal = zero
nonlinear_reciprocal = zero
[]
[TensorOutputs]
[eta]
type = XDMFTensorOutput
buffer = 'eta'
output_mode = 'CELL'
enable_hdf5 = true
[]
[]
[Problem]
type = TensorProblem
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
csv = true
execute_on = 'INITIAL TIMESTEP_END'
[]
(test/tests/cahnhilliard/cahnhilliard.i)
#
# Simple Cahn-Hilliard solve on a 2D grid. We create a matching (conforming)
# MOOSE mesh (with one element per FFT grid cell) and project the solution onto
# the MOOSE mesh to utilize the exodus output object.
#
[Domain]
dim = 2
nx = 20
ny = 20
xmax = 3
ymax = 3
mesh_mode = DOMAIN
[]
# In this input we fully trely on implicit TensorBuffer declaration
[TensorComputes]
[Initialize]
[c]
# Random initial condition around a concentration of 1/2
type = RandomTensor
buffer = c
min = 0.44
max = 0.56
seed = 0
[]
[mu_init]
type = ConstantTensor
buffer = mu
[]
# precompute fixed factors for the solve
[Mbar]
type = ReciprocalLaplacianFactor
factor = 0.2 # Mobility
buffer = Mbar
[]
[kappabarbar]
type = ReciprocalLaplacianSquareFactor
factor = -0.001 # kappa
buffer = kappabarbar
[]
[]
[Solve]
[cahn_hilliard]
[mu]
type = ParsedCompute
buffer = mu
expression = '0.1*c^2*(c-1)^2'
derivatives = c
inputs = c
[]
[mubar]
type = ForwardFFT
buffer = mubar
input = mu
[]
[Mbarmubar]
type = ParsedCompute
buffer = Mbarmubar
expression = 'Mbar*mubar'
inputs = 'Mbar mubar'
[]
[cbar]
type = ForwardFFT
buffer = cbar
input = c
[]
[]
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
root_compute = cahn_hilliard
buffer = c
reciprocal_buffer = cbar
linear_reciprocal = kappabarbar
nonlinear_reciprocal = Mbarmubar
substeps = 10
[]
[AuxVariables]
[mu]
# the mu tensor is projected onto this elemental variable
family = MONOMIAL
order = CONSTANT
[]
[c]
# the c tensor is projected onto this nodal variable
[]
[]
[AuxKernels]
active = ''
[c]
type = ProjectTensorAux
buffer = c
variable = c
execute_on = 'INITIAL TIMESTEP_END'
[]
[mu]
type = ProjectTensorAux
buffer = mu
variable = mu
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Postprocessors]
[min_c]
type = SemiImplicitCriticalTimeStep
buffer = kappabarbar
execute_on = 'INITIAL TIMESTEP_END'
[]
[delta_int_c]
type = TensorIntegralChangePostprocessor
buffer = c
[]
[]
[Problem]
type = TensorProblem
[]
[Executioner]
type = Transient
num_steps = 10
dt = 1e-3
[]
[TensorOutputs]
active = ''
[xdmf]
type = XDMFTensorOutput
buffer = 'c mu'
output_mode = 'Node Cell'
enable_hdf5 = true
# Do not transpose output to avoid regolding the test. In practice the default
# of transpose = true should always be used
transpose = false
[]
[xdmf2]
# second output to trigger the hdf5 thread safety error
type = XDMFTensorOutput
buffer = 'c'
output_mode = 'Cell'
enable_hdf5 = true
# Do not transpose output to avoid regolding the test. In practice the default
# of transpose = true should always be used
transpose = false
[]
[]
[Outputs]
exodus = true
csv = true
[]
(examples/cahn_hilliard/cahnhilliard.i)
#
# Simple Cahn-Hilliard solve on a 2D grid. We create a matching (conforming)
# MOOSE mesh (with one element per FFT grid cell) and project the solution onto
# the MOOSE mesh to utilize the exodus output object.
#
[Domain]
dim = 2
nx = 200
ny = 200
xmax = ${fparse pi*8}
ymax = ${fparse pi*8}
# automatically create a matching mesh
mesh_mode = DOMAIN
[]
[TensorBuffers]
[c]
# perform fast mapping to the matching mesh by directly writing to
# the solution vector of the specified Auxvariable
map_to_aux_variable = c
[]
[cbar]
[]
[mu]
map_to_aux_variable = mu
[]
[mubar]
[]
[Mbarmubar]
[]
# constant tensors
[Mbar]
[]
[kappabarbar]
[]
[]
[TensorComputes]
[Initialize]
[c]
# Random initial condition around a concentration of 1/2
type = RandomTensor
buffer = c
min = 0.44
max = 0.56
[]
# precompute fixed factors for the solve
[Mbar]
type = ReciprocalLaplacianFactor
factor = 0.2 # Mobility
buffer = Mbar
[]
[kappabarbar]
type = ReciprocalLaplacianSquareFactor
factor = -0.001 # kappa
buffer = kappabarbar
[]
[mu_init]
type = ConstantTensor
buffer = mu
real = 0
[]
[]
[Solve]
[cahn_hilliard]
[mu]
type = ParsedCompute
buffer = mu
expression = '0.1*c^2*(c-1)^2'
derivatives = c
inputs = c
[]
[mubar]
type = ForwardFFT
buffer = mubar
input = mu
[]
[Mbarmubar]
type = ParsedCompute
buffer = Mbarmubar
expression = 'Mbar*mubar'
inputs = 'Mbar mubar'
[]
[cbar]
type = ForwardFFT
buffer = cbar
input = c
[]
[]
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
root_compute = cahn_hilliard
buffer = c
reciprocal_buffer = cbar
linear_reciprocal = kappabarbar
nonlinear_reciprocal = Mbarmubar
substeps = 1000
[]
[AuxVariables]
[mu]
# the mu tensor is projected onto this elemental variable
family = MONOMIAL
order = CONSTANT
[]
[c]
# the c tensor is projected onto this nodal variable
[]
[]
# a slower but more flexible alternative to `map_to_aux_variable` is running
# these `ProjectTensorAux` AuxKernels to perform the projection. This aprpoach
# also supports non-conforming meshes.
[AuxKernels]
# [c]
# type = ProjectTensorAux
# buffer = c
# variable = c
# execute_on = final
# []
# [f]
# type = ProjectTensorAux
# buffer = f
# variable = f
# execute_on = TIMESTEP_END
# []
[]
[Postprocessors]
[min_c]
type = ElementExtremeValue
variable = c
value_type = MIN
execute_on = 'TIMESTEP_END'
[]
[max_c]
type = ElementExtremeValue
variable = c
value_type = MAX
execute_on = 'TIMESTEP_END'
[]
# [F]
# type = ElementIntegralVariablePostprocessor
# variable = f
# execute_on = 'TIMESTEP_END'
# []
[C]
type = ElementIntegralVariablePostprocessor
variable = c
execute_on = 'TIMESTEP_END'
[]
[]
[Problem]
type = TensorProblem
[]
[Executioner]
type = Transient
num_steps = 100
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.8
dt = 0.1
[]
dtmax = 1000
[]
[Outputs]
exodus = true
csv = true
perf_graph = true
execute_on = 'TIMESTEP_END'
[]
(examples/swift_hohenberg/rotating_grain.i)
#
# Solve a simple Swift-Hohenberg crystal phase field problem. The initial condition is
# a circular grain that is rotated against the surropunding matrix.
# This example demonstrates the use of the [TensorComputes/Postprocess] system to perform
# compute steps just prior to running the output objects. Here we perform a low-pass filtering
# by forward transfroming the psi amplitude field into frequency space, attenuating frequencies
# by the exponent of their wave number, and transforming back into real space. This filtering
# makes the dislocation structure in the crystal more pronounced in the visualization.
#
w=60
[Domain]
dim = 2
nx = 400
ny = 400
xmax = ${fparse pi*2*w}
ymax = ${fparse pi*2*w}
device_names = 'cuda'
mesh_mode = DOMAIN
[]
[TensorBuffers]
[psi]
map_to_aux_variable = psi
[]
[psibar]
[]
[psi3]
[]
[psi3bar]
[]
# constant tensors
[linear]
[]
# output
[filter]
map_to_aux_variable = filter
[]
[filterbar]
[]
[]
[AuxVariables]
[psi]
[]
[filter]
[]
[]
crystal = '-sin(sin(a)*y/2+cos(a)*x/2)^2*sin(sin(a+1/3*pi)*y/2+cos(a+1/3*pi)*x/2)^2*sin(sin(a-1/3*pi)*y/2+cos(a-1/3*pi)*x/2)^2'
[Functions]
[grain1]
type = ParsedFunction
expression = 'a := 0; ${crystal}'
[]
[grain2]
type = ParsedFunction
expression = 'a := 0.95; ${crystal}'
[]
[domain]
type = ParsedFunction
expression = 'r := (x-${w}*pi)^2+(y-${w}*pi)^2; if(r<(${w}*2/3*pi)^2, grain2, grain1)'
symbol_names = 'grain1 grain2'
symbol_values = 'grain1 grain2'
[]
[]
[TensorComputes]
[Initialize]
[psi]
type = MooseFunctionTensor
buffer = psi
function = domain
[]
[linear]
type = SwiftHohenbergLinear
buffer = linear
alpha = 1
r = 0.025
[]
[]
[Solve]
[psi3]
type = ParsedCompute
buffer = psi3
expression = "0.20*psi^2-psi^3"
inputs = psi
[]
[psibar]
type = ForwardFFT
buffer = psibar
input = psi
[]
[psi3bar]
type = ForwardFFT
buffer = psi3bar
input = psi3
[]
[]
[Postprocess]
[low_pass]
type = ParsedCompute
buffer = filterbar
extra_symbols = true
expression = 'psibar * exp(-k2*10)'
inputs = psibar
[]
[filter]
type = InverseFFT
buffer = filter
input = filterbar
[]
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
buffer = psi
reciprocal_buffer = psibar
linear_reciprocal = linear
nonlinear_reciprocal = psi3bar
substeps = 100
[]
[Problem]
type = TensorProblem
[]
[Executioner]
type = Transient
num_steps = 120
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.1
dt = 5
[]
dtmax = 500
[]
[Postprocessors]
[min_psi]
type = TensorExtremeValuePostprocessor
buffer = psi
value_type = MIN
execute_on = 'TIMESTEP_END'
[]
[max_psi]
type = TensorExtremeValuePostprocessor
buffer = psi
value_type = MAX
execute_on = 'TIMESTEP_END'
[]
[Psi]
type = TensorIntegralPostprocessor
buffer = psi
[]
[]
[Outputs]
exodus = true
perf_graph = true
execute_on = 'TIMESTEP_END'
[]
(test/tests/tensor_compute/parallel_roundtrip.i)
[Domain]
# Test parallel FFT round-trip with slab decomposition
device_names = "cpu cpu cpu"
device_weights = "1 1 1"
parallel_mode = FFT_SLAB
dim = 2
nx = 128
ny = 128
xmax = ${fparse pi*4}
ymax = ${fparse pi*4}
[]
[TensorBuffers]
[eta_gold]
[]
[eta]
[]
[eta_bar]
[]
[eta_roundtrip]
[]
[diff]
[]
[zero]
[]
[]
[TensorComputes]
[Initialize]
[eta_gold]
type = ParsedCompute
buffer = eta_gold
expression = 'sin(x)+sin(y)+cos(2*x)*sin(3*y)'
extra_symbols = true
[]
[eta]
type = ParsedCompute
buffer = eta
expression = eta_gold
inputs = eta_gold
[]
[zero]
type = ConstantReciprocalTensor
buffer = zero
real = 0
imaginary = 0
[]
[]
[Solve]
# Test: eta -> FFT -> iFFT -> eta_roundtrip
# eta_roundtrip should equal eta (within numerical precision)
[eta_bar]
type = ForwardFFT
buffer = eta_bar
input = eta
[]
[eta_roundtrip]
type = InverseFFT
buffer = eta_roundtrip
input = eta_bar
[]
[]
[Postprocess]
[diff]
type = ParsedCompute
buffer = diff
expression = 'abs(eta - eta_roundtrip) + abs(eta - eta_gold)'
inputs = 'eta eta_roundtrip eta_gold'
[]
[]
[]
[Postprocessors]
[max_error]
type = TensorExtremeValuePostprocessor
buffer = diff
value_type = MAX
[]
[l2_error]
type = TensorIntegralPostprocessor
buffer = diff
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
buffer = eta
reciprocal_buffer = eta_bar
linear_reciprocal = zero
nonlinear_reciprocal = zero
[]
[Problem]
type = TensorProblem
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
csv = true
execute_on = 'INITIAL TIMESTEP_END'
[]
(examples/cahn_hilliard/cahnhilliard2.i)
#
# The same simple Cahn-Hilliard solve as cahnhilliard.i, but on a 3D grid
# and using the faster TensorOutputs system.
#
[Domain]
dim = 3
nx = 200
ny = 200
nz = 200
xmax = ${fparse pi*8}
ymax = ${fparse pi*8}
zmax = ${fparse pi*8}
# run on a CUDA device (adjust this to `cpu` if not available)
device_names = 'cuda'
# create a single element dummy mesh. Output will use the custom XDMF output
# in the `TensorOutputs` system.
mesh_mode = DUMMY
[]
[TensorBuffers]
[c]
[]
[cbar]
[]
[mu]
[]
[mubar]
[]
[Mbarmubar]
[]
# constant tensors
[Mbar]
[]
[kappabarbar]
[]
[]
[TensorOutputs]
# the TensorOutouts system supports asynchronous threaded output.
# for GOU calculations a copy of the solution fields is moved to the CPU,
# and while the output files are written the next time step is already
# starting to compute.
[xdmf]
type = XDMFTensorOutput
buffer = 'c mu'
enable_hdf5 = true
[]
[]
[TensorComputes]
[Initialize]
[c]
type = RandomTensor
buffer = c
min = 0.44
max = 0.56
[]
[Mbar]
type = ReciprocalLaplacianFactor
factor = 0.2 # Mobility
buffer = Mbar
[]
[kappabarbar]
type = ReciprocalLaplacianSquareFactor
factor = -0.001 # kappa
buffer = kappabarbar
[]
[]
[Solve]
[mu]
type = ParsedCompute
buffer = mu
expression = '0.1*c^2*(c-1)^2'
derivatives = c
inputs = c
[]
[mubar]
type = ForwardFFT
buffer = mubar
input = mu
[]
[Mbarmubar]
type = ParsedCompute
buffer = Mbarmubar
expression = 'Mbar*mubar'
inputs = 'Mbar mubar'
[]
[cbar]
type = ForwardFFT
buffer = cbar
input = c
[]
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
buffer = c
reciprocal_buffer = cbar
linear_reciprocal = kappabarbar
nonlinear_reciprocal = Mbarmubar
substeps = 1000
[]
[Postprocessors]
[min_c]
type = TensorExtremeValuePostprocessor
buffer = c
value_type = MIN
execute_on = 'TIMESTEP_END'
[]
[max_c]
type = TensorExtremeValuePostprocessor
buffer = c
value_type = MAX
execute_on = 'TIMESTEP_END'
[]
[C]
type = TensorIntegralPostprocessor
buffer = c
execute_on = 'TIMESTEP_END'
[]
[cavg]
type = TensorAveragePostprocessor
buffer = c
execute_on = 'TIMESTEP_END'
[]
[]
[Problem]
type = TensorProblem
[]
[Executioner]
type = Transient
num_steps = 100
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.8
dt = 0.1
[]
dtmax = 1000
[]
[Outputs]
csv = true
perf_graph = true
execute_on = 'TIMESTEP_END'
[]
(test/tests/tensor_compute/group.i)
[Domain]
dim = 3
nx = 128
ny = 128
nz = 128
xmax = ${fparse pi*4}
ymax = ${fparse pi*4}
zmax = ${fparse pi*4}
mesh_mode = DUMMY
[]
[TensorBuffers]
# phase field
[c]
[]
[cbar]
[]
[mu]
[]
[mubar]
[]
[Mbarmubar]
[]
# mechanics
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[mumechbar]
[]
[mumech]
[]
# constant tensors
[Mbar]
[]
[kappabarbar]
[]
[]
[TensorOutputs]
[xdmf]
type = XDMFTensorOutput
buffer = 'c disp_x disp_y disp_z mu mumech'
output_mode = 'Node Node Node Node Cell Cell'
enable_hdf5 = true
[]
[]
[TensorComputes]
[Initialize]
[c]
type = RandomTensor
buffer = c
min = 0.44
max = 0.56
[]
[disp_x]
type = RandomTensor
buffer = disp_x
min = 0
max = 0
[]
[disp_y]
type = RandomTensor
buffer = disp_y
min = 0
max = 0
[]
[disp_z]
type = RandomTensor
buffer = disp_z
min = 0
max = 0
[]
[Mbar]
type = ReciprocalLaplacianFactor
factor = 0.2 # Mobility
buffer = Mbar
[]
[kappabarbar]
type = ReciprocalLaplacianSquareFactor
factor = -0.001 # kappa
buffer = kappabarbar
[]
[]
[Solve]
[mu]
# chemical potential (real space)
type = ParsedCompute
buffer = mu
expression = '0.1*c^2*(c-1)^2' # + c*sin(x/2)*0.005'
extra_symbols = true
derivatives = c
inputs = c
[]
[mubar]
# chemical potential (reciprocal space)
type = ForwardFFT
buffer = mubar
input = mu
[]
[mumechbar]
# mechanical chemical potential (reciprocal space)
type = FFTElasticChemicalPotential
buffer = mumechbar
cbar = cbar
displacements = 'disp_x disp_y disp_z'
lambda = 100
mu = 50
e0 = 0.02
[]
[mumech]
# chemical potential (reciprocal space)
type = InverseFFT
buffer = mumech
input = mumechbar
[]
[Mbarmubar]
type = ParsedCompute
buffer = Mbarmubar
expression = 'Mbar*(mubar+mumechbar)'
inputs = 'Mbar mubar mumechbar'
[]
[cbar]
type = ForwardFFT
buffer = cbar
input = c
[]
[qsmech]
type = FFTQuasistaticElasticity
displacements = 'disp_x disp_y disp_z'
cbar = cbar
lambda = 100
mu = 50
e0 = 0.02
[]
[group]
type = ComputeGroup
computes = 'cbar mumech mu mubar'
[]
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
buffer = c
reciprocal_buffer = cbar
linear_reciprocal = kappabarbar
nonlinear_reciprocal = Mbarmubar
[]
[Postprocessors]
[min_c]
type = TensorExtremeValuePostprocessor
buffer = c
value_type = MIN
execute_on = 'TIMESTEP_END'
[]
[max_c]
type = TensorExtremeValuePostprocessor
buffer = c
value_type = MAX
execute_on = 'TIMESTEP_END'
[]
[min_disp_x]
type = TensorExtremeValuePostprocessor
buffer = disp_x
value_type = MIN
execute_on = 'TIMESTEP_END'
[]
[max_disp_x]
type = TensorExtremeValuePostprocessor
buffer = disp_x
value_type = MAX
execute_on = 'TIMESTEP_END'
[]
[min_disp_y]
type = TensorExtremeValuePostprocessor
buffer = disp_y
value_type = MIN
execute_on = 'TIMESTEP_END'
[]
[max_disp_y]
type = TensorExtremeValuePostprocessor
buffer = disp_y
value_type = MAX
execute_on = 'TIMESTEP_END'
[]
[min_disp_z]
type = TensorExtremeValuePostprocessor
buffer = disp_z
value_type = MIN
execute_on = 'TIMESTEP_END'
[]
[max_disp_z]
type = TensorExtremeValuePostprocessor
buffer = disp_z
value_type = MAX
execute_on = 'TIMESTEP_END'
[]
[C]
type = TensorIntegralPostprocessor
buffer = c
execute_on = 'TIMESTEP_END'
[]
[cavg]
type = TensorAveragePostprocessor
buffer = c
execute_on = 'TIMESTEP_END'
[]
[]
[Problem]
type = TensorProblem
spectral_solve_substeps = 1000
print_debug_output = true
[]
[Executioner]
type = Transient
num_steps = 100
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.8
dt = 0.1
[]
dtmax = 1000
[]
[Outputs]
csv = true
perf_graph = true
execute_on = 'TIMESTEP_END'
[]
(test/tests/tensor_compute/backandforth.i)
[Domain]
xmax = ${fparse pi*4}
ymax = ${fparse pi*4}
mesh_mode = DUMMY
[]
[TensorBuffers]
[eta_gold]
[]
[eta]
[]
[eta_bar]
[]
[eta2]
[]
[zero]
[]
[diff]
[]
[]
[TensorComputes]
[Initialize]
[eta_gold]
type = ParsedCompute
buffer = eta_gold
expression = 'sin(x)+sin(y)+sin(z)'
extra_symbols = true
[]
[eta]
type = ParsedCompute
buffer = eta
expression = eta_gold
inputs = eta_gold
[]
[eta2]
type = ConstantTensor
buffer = eta2
real = 1
[]
[zero]
type = ConstantReciprocalTensor
buffer = zero
real = 0
imaginary = 0
[]
[]
[Solve]
[eta_bar]
type = ForwardFFT
buffer = eta_bar
input = eta
[]
[eta_2]
type = InverseFFT
buffer = eta2
input = eta_bar
[]
[]
[Postprocess]
[diff]
type = ParsedCompute
buffer = diff
expression = 'abs(eta - eta2) + abs(eta - eta_gold)'
inputs = 'eta eta2 eta_gold'
[]
[]
[]
[Postprocessors]
[norm]
type = TensorIntegralPostprocessor
buffer = diff
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
buffer = eta
reciprocal_buffer = eta_bar
linear_reciprocal = zero
nonlinear_reciprocal = zero
[]
[Problem]
type = TensorProblem
[]
[Executioner]
type = Transient
num_steps = 4
[]
[Outputs]
csv = true
[]
(test/tests/kks/KKS_no_flux_bc.i)
#
# Kim-Kim-Suzuki with no-flux BC imposed using the smooth boundary method (SBM), solved on a 2D grid.
# Mask tensor 'psi' supplies the mask for the solve region to the system.
# Note: c is not directly conserved here - the masked value (psi > 0.0)*c will however be conserved.
#
# Constants for Initial Conditions
r = 30
l = 4.2
# Initial condition function for order parameter
eta_IC = '0.5*(1-tanh(2*(sqrt(x^2+y^2)-${r})/${l}))'
# Phase-field model parameters
kappa_eta = 5
rho_sq = 2
w = 1
M = 5
L = 5
c0_a = 0.3
c0_b = 0.7
# Expressions for switching function and bulk Gibbs energy
h_eta = 'eta^3*(6*eta^2-15*eta+10)'
F = '${h_eta}*(${rho_sq}*((c - (1-${h_eta})*(${c0_b} - ${c0_a}))-${c0_a})^2) + (1-${h_eta})*(${rho_sq}*((c + (${h_eta})*(${c0_b} - ${c0_a}))-${c0_b})^2 ) + ${w}*(eta^2)*(1-eta)^2'
[Domain]
dim = 2
nx = 20
ny = 20
xmin = -50
xmax = 50
ymin = -50
ymax = 50
# run on a CUDA device (adjust this to `cpu` if not available)
device_names = 'cpu'
# automatically create a matching mesh
mesh_mode = DUMMY
[]
[Functions]
[psi_func]
type = ParsedFunction
expression = 'if(x<x_min-${l},0,if(x>x_min+${l},1,0.5-0.5*cos(pi*(x-(x_min-${l}))/2/${l}) )) * if(x<x_max-${l},1,if(x>x_max+${l},0,0.5+0.5*cos(pi*(x-(x_max-${l}))/2/${l}) ))'
symbol_names = 'x_min x_max y_min y_max'
symbol_values = '30 70 0 100'
[]
[]
[TensorComputes]
[Initialize]
[c_IC]
type = ParsedCompute
buffer = c
expression = '0.6 + (${c0_a}-0.6)*${eta_IC}'
extra_symbols = 'true'
[]
[eta_IC]
type = ParsedCompute
buffer = eta
expression = '${eta_IC}'
extra_symbols = 'true'
[]
[psi_init]
type = MooseFunctionTensor
function = psi_func
buffer = psi
[]
[zero]
type = ConstantReciprocalTensor
buffer = zero
[]
[M]
type = ConstantTensor
buffer = M
real = ${M}
[]
[L]
type = ConstantTensor
buffer = L
real = ${L}
[]
[L_kappa]
type = ConstantTensor
buffer = L_kappa
real = ${fparse ${L} * ${kappa_eta} }
[]
[]
[Solve]
[cbar]
type = ForwardFFT
buffer = cbar
input = c
[]
[etabar]
type = ForwardFFT
buffer = etabar
input = eta
[]
[mu]
type = ParsedCompute
buffer = 'mu'
expression = '${F}'
inputs = 'c eta'
derivatives = 'c'
[]
[div_J]
type = ReciprocalMatDiffusion
buffer = 'div_J'
chemical_potential = mu
mobility = M
psi = psi
[]
[domega_chem_deta]
type = ParsedCompute
buffer = 'domega_chem_deta'
expression = '${F} - mu*c'
inputs = 'mu c eta'
derivatives = 'eta'
[]
[AC_bulk]
type = ReciprocalAllenCahn
buffer = AC_bulk
dF_chem_deta = domega_chem_deta
L = L
psi = psi
[]
[kappa_grad_eta]
type = ReciprocalMatDiffusion
buffer = 'kappa_grad_eta'
chemical_potential = 'eta'
mobility = 'L_kappa'
psi = psi
[]
[AC_bar]
type = ParsedCompute
buffer = AC_bar
expression = 'kappa_grad_eta + AC_bulk'
inputs = 'AC_bulk kappa_grad_eta'
[]
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
buffer = 'c eta'
reciprocal_buffer = 'cbar etabar'
linear_reciprocal = 'zero zero'
nonlinear_reciprocal = 'div_J AC_bar'
substeps = 1e3
predictor_order = 3
[]
[Postprocessors]
[total_C]
type = TensorIntegralPostprocessor
buffer = c
execute_on = 'INITIAL TIMESTEP_END'
[]
[total_eta]
type = TensorIntegralPostprocessor
buffer = eta
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[TensorOutputs]
[xdmf]
type = XDMFTensorOutput
buffer = 'eta c mu psi'
enable_hdf5 = true
transpose = false
[]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 10
[]
[Outputs]
csv = true
perf_graph = true
execute_on = 'INITIAL TIMESTEP_END'
[]
(test/tests/kks/KKS_libtorch.i)
#
# Kim-Kim-Suzuki with Gibbs energy supplied by a torch model, solved on a 2D grid.
#
# Constants for Initial Conditions
r = 30
l = 4.2
# Initial condition function for order parameter
eta_IC = '0.5*(1-tanh(2*(sqrt(x^2+y^2)-${r})/${l}))'
# Phase-field model parameters
kappa_eta = 5
w = 1
M = 5
L = 5
# Expressions for switching function and bulk Gibbs energy
h_eta = 'eta^3*(6*eta^2-15*eta+10)'
[Domain]
dim = 2
nx = 50
ny = 50
xmin = -50
xmax = 50
ymin = -50
ymax = 50
# automatically create a matching mesh
mesh_mode = DUMMY
[]
[TensorComputes]
[Initialize]
[c_IC]
type = ParsedCompute
buffer = c
expression = '0.7 + (0.3-0.6)*${eta_IC}'
extra_symbols = 'true'
[]
[eta_IC]
type = ParsedCompute
buffer = eta
expression = '${eta_IC}'
extra_symbols = 'true'
[]
[psi_init]
type = ConstantTensor
buffer = psi
real = 1
[]
[M]
type = ConstantTensor
buffer = M
real = ${M}
[]
[L]
type = ConstantTensor
buffer = L
real = ${L}
[]
[L_kappa]
type = ReciprocalLaplacianFactor
buffer = L_kappa
factor = ${fparse ${L} * ${kappa_eta} }
[]
[h_eta_IC]
type = ParsedCompute
buffer = h_eta
expression = '${h_eta}'
inputs = eta
[]
[G_func_IC]
type = LibtorchGibbsEnergy
buffer = 'G'
phase_fractions = 'h_eta'
concentrations = 'c'
domega_detas = 'dG_dh'
chem_pots = 'mu'
libtorch_model_file = 'marlin:libtorch_gibbs_energy/torch_NN_gibbs_model.pt'
[]
[]
[Solve]
[h_eta]
type = ParsedCompute
buffer = h_eta
expression = '${h_eta}'
inputs = eta
[]
[G_func]
type = LibtorchGibbsEnergy
buffer = 'G'
phase_fractions = 'h_eta'
concentrations = 'c'
domega_detas = 'dG_dh'
chem_pots = 'mu'
libtorch_model_file = 'marlin:libtorch_gibbs_energy/torch_NN_gibbs_model.pt'
[]
[dG_deta]
type = ParsedCompute
buffer = 'dG_deta'
inputs = 'eta dG_dh'
expression = 'dG_dh * ${h_eta} + ${w} * eta^2 * (1-eta^2)^2'
derivatives = 'eta'
[]
[etabar]
type = ForwardFFT
buffer = etabar
input = eta
[]
[AC_bulk]
type = ReciprocalAllenCahn
L = L
buffer = AC_bulk
dF_chem_deta = dG_deta
psi = psi
[]
[NL_eta]
type = ParsedCompute
buffer = NL_eta
expression = 'AC_bulk '
inputs = 'AC_bulk'
[]
[cbar]
type = ForwardFFT
buffer = cbar
input = c
[]
[div_J]
type = ReciprocalMatDiffusion
buffer = 'div_J'
chemical_potential = mu
mobility = M
psi = psi
[]
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
buffer = 'c eta'
reciprocal_buffer = 'cbar etabar'
linear_reciprocal = '0 L_kappa'
nonlinear_reciprocal = 'div_J NL_eta'
substeps = 1e3
predictor_order = 3
[]
[TensorOutputs]
[xdmf]
type = XDMFTensorOutput
buffer = 'eta c mu psi dG_deta dG_dh G'
enable_hdf5 = true
transpose = false
[]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 10
[]
[Outputs]
csv = true
perf_graph = true
execute_on = 'INITIAL TIMESTEP_END'
[]
(test/tests/solvers/diagonal.i)
#
# Simple Cahn-Hilliard solve on a 2D grid.
#
[Domain]
dim = 2
nx = 150
ny = 150
xmax = '${fparse pi*2}'
ymax = '${fparse pi*2}'
mesh_mode = DUMMY
[]
[GlobalParams]
constant_names = 'A B'
constant_expressions = '1 3.5'
[]
[TensorComputes]
[Initialize]
[u]
type = ParsedCompute
buffer = u
extra_symbols = true
expression = 'sin(x)*sin(y)'
expand = REAL
[]
[v]
type = ConstantTensor
buffer = v
real = 0
[]
# precompute fixed factors for the solve
[Du]
type = ReciprocalLaplacianFactor
factor = 1e-2
buffer = Du
[]
[Dv]
type = ReciprocalLaplacianFactor
factor = 1e-3
buffer = Dv
[]
[]
[Solve]
[u_bar]
type = ForwardFFT
buffer = u_bar
input = u
[]
[v_bar]
type = ForwardFFT
buffer = v_bar
input = v
[]
[source_u]
type = ParsedCompute
buffer = source_u
expression = 'A - (B+1)*u +u^2*v'
inputs = 'u v'
[]
[source_u_bar]
type = ForwardFFT
buffer = source_u_bar
input = source_u
[]
[source_v]
type = ParsedCompute
buffer = source_v
expression = 'B*u - u^2*v'
inputs = 'u v'
[]
[source_v_bar]
type = ForwardFFT
buffer = source_v_bar
input = source_v
[]
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
buffer = 'u v'
reciprocal_buffer = 'u_bar v_bar'
linear_reciprocal = 'Du Dv'
nonlinear_reciprocal = 'source_u_bar source_v_bar'
substeps = ${ss}
corrector_steps = ${cs}
predictor_order = ${order}
corrector_order = ${order}
[]
[Problem]
type = TensorProblem
[]
[Postprocessors]
[u_min]
type = TensorExtremeValuePostprocessor
buffer = u
value_type = MIN
[]
[u_max]
type = TensorExtremeValuePostprocessor
buffer = u
value_type = MAX
[]
[v_min]
type = TensorExtremeValuePostprocessor
buffer = v
value_type = MIN
[]
[v_max]
type = TensorExtremeValuePostprocessor
buffer = v
value_type = MAX
[]
[U]
type = TensorIntegralPostprocessor
buffer = u
[]
[V]
type = TensorIntegralPostprocessor
buffer = v
[]
[]
[Executioner]
type = Transient
num_steps = 25
dt = 0.5
[]
[Outputs]
file_base = diagonal_${ss}_${cs}_${order}
csv = true
[]
(test/tests/solvers/nl_coupled.i)
#
# Simple Cahn-Hilliard solve on a 2D grid.
#
[Domain]
dim = 2
nx = 150
ny = 150
xmax = '${fparse pi*2}'
ymax = '${fparse pi*2}'
mesh_mode = DUMMY
[]
[GlobalParams]
constant_names = 'A B'
constant_expressions = '1 3.5'
[]
[TensorComputes]
[Initialize]
[u]
type = ParsedCompute
buffer = u
extra_symbols = true
expression = 'sin(x)*sin(y)'
expand = REAL
[]
[v]
type = ParsedCompute
buffer = v
extra_symbols = true
expression = 'cos(x)*cos(y)'
expand = REAL
[]
[zero]
type = ConstantReciprocalTensor
buffer = zero
[]
# precompute fixed factors for the solve
[D1]
type = ReciprocalLaplacianFactor
factor = 1e-2
buffer = D1
[]
[D2]
type = ReciprocalLaplacianFactor
factor = 1e-3
buffer = D2
[]
[]
[Solve]
[u_bar]
type = ForwardFFT
buffer = u_bar
input = u
[]
[v_bar]
type = ForwardFFT
buffer = v_bar
input = v
[]
[Du]
type = ParsedCompute
buffer = Du
expression = 'D2*v_bar'
inputs = 'D2 v_bar'
[]
[Dv]
type = ParsedCompute
buffer = Dv
expression = 'D2*u_bar'
inputs = 'D2 u_bar'
[]
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
buffer = 'u v'
reciprocal_buffer = 'u_bar v_bar'
linear_reciprocal = 'D1 D1'
nonlinear_reciprocal = 'Du Dv'
substeps = ${ss}
corrector_steps = ${cs}
predictor_order = ${order}
corrector_order = ${order}
[]
[Problem]
type = TensorProblem
[]
[Postprocessors]
[u_min]
type = TensorExtremeValuePostprocessor
buffer = u
value_type = MIN
[]
[u_max]
type = TensorExtremeValuePostprocessor
buffer = u
value_type = MAX
[]
[v_min]
type = TensorExtremeValuePostprocessor
buffer = v
value_type = MIN
[]
[v_max]
type = TensorExtremeValuePostprocessor
buffer = v
value_type = MAX
[]
[U]
type = TensorIntegralPostprocessor
buffer = u
[]
[V]
type = TensorIntegralPostprocessor
buffer = v
[]
[]
[Executioner]
type = Transient
num_steps = 25
dt = 10
[]
[Outputs]
file_base = nl_coupled_${ss}_${cs}_${order}
csv = true
[]
(examples/phase_field_crystal/pfc_fcc_atomic_structure_3d.i)
# 3D FCC PFC test showing atomic-scale density fluctuations
# Based on PhysRevE.81.061601 two-mode FCC PFC model
# Grid parameters - 3D resolution
N = 64 # Grid points per dimension (64^3 = 262k points)
# PFC model parameters - LARGER epsilon for clearer atomic structure
psi_mean = -0.2 # Mean density
epsilon = 0.15 # Larger undercooling for stronger modulations
R1_param = 0.0 # Two-mode coupling (0 for max FCC stability)
Q1_param = ${fparse sqrt(4.0/3.0)} # FCC wave number ratio
# Domain size: want several unit cells
# The (111) wavelength is 2*pi/q0 = 2*pi*sqrt(3/4) ≈ 5.44 (dimensionless)
# Fit 8 wavelengths in each direction
Lx = ${fparse 8 * 2 * ${pi} / ${Q1_param}}
Ly = ${Lx}
Lz = ${Lx}
[Domain]
dim = 3
nx = ${N}
ny = ${N}
nz = ${N}
xmax = ${Lx}
ymax = ${Ly}
zmax = ${Lz}
[]
[TensorComputes]
[Initialize]
# Random perturbations to seed crystal growth
[psi]
type = RandomTensor
buffer = psi
max = ${fparse ${psi_mean} + 0.01}
min = ${fparse ${psi_mean} - 0.01}
seed = 12345
[]
# Linear operator for FCC
[linear]
type = FCCPFCLinear
buffer = 'linear'
eps = ${epsilon}
R1 = ${R1_param}
Q1 = ${Q1_param}
mobility = 1.0
[]
# Dealiasing for cubic nonlinearity
[smooth_operator]
type = DeAliasingTensor
buffer = smooth_operator
method = HOULI
[]
[]
[Solve]
# Nonlinear term
[nl_div_psi_cubed]
type = FCCPFCNonlinear
buffer = NL
psi = psi
dealiasing = smooth_operator
mobility = 1.0
[]
# FFT for spectral solver
[psi_hat]
type = ForwardFFT
buffer = psi_hat
input = psi
[]
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
buffer = 'psi'
linear_reciprocal = 'linear'
nonlinear_reciprocal = 'NL'
reciprocal_buffer = 'psi_hat'
corrector_order = 1
corrector_steps = 3
predictor_order = 1
substeps = 10000
[]
[Postprocessors]
[max_psi]
type = TensorExtremeValuePostprocessor
buffer = psi
value_type = MAX
execute_on = 'initial timestep_end'
[]
[min_psi]
type = TensorExtremeValuePostprocessor
buffer = psi
value_type = MIN
execute_on = 'initial timestep_end'
[]
[mean_psi]
type = TensorAveragePostprocessor
buffer = psi
execute_on = 'initial timestep_end'
[]
[]
[TensorOutputs]
[xdmf]
type = XDMFTensorOutput
buffer = 'psi'
enable_hdf5 = true
[]
[]
[Executioner]
type = Transient
num_steps = 200 # Reduced for 3D (much more expensive)
dt = 5
[]
[Outputs]
perf_graph = true
csv = true
[]
(examples/phase_field_crystal/pfc_fcc_atomic_structure.i)
# FCC PFC test designed to clearly show atomic-scale density fluctuations
# Using larger epsilon for stronger density modulations
# Based on PhysRevE.81.061601 two-mode FCC PFC model
# Grid parameters - fine resolution to resolve atomic peaks
N = 4 # Grid points per dimension
# PFC model parameters - LARGER epsilon for clearer atomic structure
psi_mean = -0.2 # Mean density
epsilon = 0.15 # Larger undercooling for stronger modulations
R1_param = 0.0 # Two-mode coupling (0 for max FCC stability)
Q1_param = ${fparse sqrt(4.0/3.0)} # FCC wave number ratio
# Domain size: want several unit cells but fine enough resolution
# The (111) wavelength is 2*pi/q0 = 2*pi*sqrt(3/4) ≈ 5.44 (dimensionless)
# Let's fit about 'N' wavelengths in each direction
Lx = ${fparse N * 2 * pi / ${Q1_param}}
Ly = ${Lx}
[Domain]
dim = 2
nx = ${fparse ${N} * 8 }
ny = ${fparse ${N} * 8 }
xmax = ${Lx}
ymax = ${Ly}
[]
[TensorComputes]
[Initialize]
# Random perturbations to seed crystal growth
[psi]
type = RandomTensor
buffer = psi
max = ${fparse ${psi_mean} + 0.01}
min = ${fparse ${psi_mean} - 0.01}
seed = 12345
[]
# Linear operator for FCC
[linear]
type = FCCPFCLinear
buffer = 'linear'
eps = ${epsilon}
R1 = ${R1_param}
Q1 = ${Q1_param}
mobility = 1.0
[]
# Dealiasing for cubic nonlinearity
[smooth_operator]
type = DeAliasingTensor
buffer = smooth_operator
method = HOULI
[]
[]
[Solve]
# Nonlinear term
[nl_div_psi_cubed]
type = FCCPFCNonlinear
buffer = NL
psi = psi
dealiasing = smooth_operator
mobility = 1.0
[]
# FFT for spectral solver
[psi_hat]
type = ForwardFFT
buffer = psi_hat
input = psi
[]
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
buffer = 'psi'
linear_reciprocal = 'linear'
nonlinear_reciprocal = 'NL'
reciprocal_buffer = 'psi_hat'
corrector_order = 1
corrector_steps = 3
predictor_order = 1
substeps = 10000
[]
[Postprocessors]
[max_psi]
type = TensorExtremeValuePostprocessor
buffer = psi
value_type = MAX
execute_on = 'initial timestep_end'
[]
[min_psi]
type = TensorExtremeValuePostprocessor
buffer = psi
value_type = MIN
execute_on = 'initial timestep_end'
[]
[mean_psi]
type = TensorAveragePostprocessor
buffer = psi
execute_on = 'initial timestep_end'
[]
[]
[TensorOutputs]
[xdmf]
type = XDMFTensorOutput
buffer = 'psi'
enable_hdf5 = true
[]
[]
[Executioner]
type = Transient
num_steps = 1000
dt = 20 # Larger timestep for faster evolution
[]
[Outputs]
perf_graph = true
csv = true
[]
(benchmarks/02_oswald_ripening/2a.i)
[Domain]
dim = 2
nx = 200
ny = 200
xmax = 200
ymax = 200
mesh_mode = DOMAIN
[]
fchem = 'fa:=rho^2*(c-ca)^2;
fb:=rho^2*(cb-c)^2;
h:=n1^3*(6*n1^2-15*n1+10) +
n2^3*(6*n2^2-15*n2+10) +
n3^3*(6*n3^2-15*n3+10) +
n4^3*(6*n4^2-15*n4+10);
g:=n1^2*(1-n1)^2 +
n2^2*(1-n2)^2 +
n3^2*(1-n3)^2 +
n4^2*(1-n4)^2 +
alpha*(
n1^2*n2^2 + n1^2*n3^2 + n1^2*n4^2 +
n2^2*n1^2 + n2^2*n3^2 + n2^2*n4^2 +
n3^2*n1^2 + n3^2*n2^2 + n3^2*n4^2 +
n4^2*n1^2 + n4^2*n2^2 + n4^2*n3^2);
(fa*(1-h) + fb*h + w*g)'
nic = 'epsilon*(cos((0.01*idx)*x-4)*cos((0.007+0.01*idx)*y)
+cos((0.11+0.01*idx)*x)*cos((0.11+0.01*idx)*y)
+psi*(cos((0.046+0.001*idx)*x+(0.0405+0.001*idx)*y)
*cos((0.031+0.001*idx)*x-(0.004+0.001*idx)*y))^2)^2'
cnames = 'rho ca cb alpha w L M'
cvalues = 'sqrt(2) 0.3 0.7 5 1 5 5'
[TensorBuffers]
# variables
[c]
# map_to_aux_variable = c
[]
[n1]
[]
[n2]
[]
[n3]
[]
[n4]
[]
[c_bar]
[]
[n1_bar]
[]
[n2_bar]
[]
[n3_bar]
[]
[n4_bar]
[]
[mu_c]
# map_to_aux_variable = mu
[]
[mu_n1]
[]
[mu_n2]
[]
[mu_n3]
[]
[mu_n4]
[]
[mu_c_bar]
[]
[mu_n1_bar]
[]
[mu_n2_bar]
[]
[mu_n3_bar]
[]
[mu_n4_bar]
[]
[Mbar_mu_c_bar]
[]
# constant tensors
[Lbar] # FFT(M*laplacian)
[]
[MkappaL2bar] # FFT(-M*kappa*laplacian^2)
[]
[kappaLbar] # FFT(L*kappa*laplacian)
[]
# postprocessing
[F]
[]
[Fgrad_c]
[]
[Fgrad_n1]
[]
[Fgrad_n2]
[]
[Fgrad_n3]
[]
[Fgrad_n4]
[]
[bnds]
#map_to_aux_variable = bnds
[]
[]
[TensorComputes]
[Initialize]
[c]
type = ParsedCompute
buffer = c
extra_symbols = true
expression = 'c0+epsilon*(cos(0.105*x)*cos(0.11*y)+(cos(0.13*x)*cos(0.087*y))^2+cos(0.025*x-0.15*y)*cos(0.07*x-0.02*y))'
constant_names = 'c0 epsilon'
constant_expressions = '0.5 0.01'
[]
[Lbar]
type = ReciprocalLaplacianFactor
# Mobility is pulled into the chemical potential below
buffer = Lbar
[]
[MkappaL2bar]
type = ReciprocalLaplacianSquareFactor
factor = -15 # -kappa_c*M
buffer = MkappaL2bar
[]
[kappaLbar]
type = ReciprocalLaplacianFactor
buffer = kappaLbar
factor = 15 # kappa_ni*L
[]
[n1]
type = ParsedCompute
buffer = n1
expression = ${nic}
extra_symbols = true
constant_names = 'idx epsilon psi'
constant_expressions = ' 1 0.1 1.5'
[]
[n2]
type = ParsedCompute
buffer = n2
expression = ${nic}
extra_symbols = true
constant_names = 'idx epsilon psi'
constant_expressions = ' 2 0.1 1.5'
[]
[n3]
type = ParsedCompute
buffer = n3
expression = ${nic}
extra_symbols = true
constant_names = 'idx epsilon psi'
constant_expressions = ' 3 0.1 1.5'
[]
[n4]
type = ParsedCompute
buffer = n4
expression = ${nic}
extra_symbols = true
constant_names = 'idx epsilon psi'
constant_expressions = ' 4 0.1 1.5'
[]
[]
[Solve]
[mu_c]
type = ParsedCompute
buffer = mu_c
expression = '${fchem}*M'
constant_names = ${cnames}
constant_expressions = ${cvalues}
derivatives = c
inputs = 'c n1 n2 n3 n4'
[]
[mu_n1]
type = ParsedCompute
buffer = mu_n1
expression = '${fchem}*(-L)'
constant_names = ${cnames}
constant_expressions = ${cvalues}
derivatives = n1
inputs = 'c n1 n2 n3 n4'
[]
[mu_n2]
type = ParsedCompute
buffer = mu_n2
expression = '${fchem}*(-L)'
constant_names = ${cnames}
constant_expressions = ${cvalues}
derivatives = n2
inputs = 'c n1 n2 n3 n4'
[]
[mu_n3]
type = ParsedCompute
buffer = mu_n3
expression = '${fchem}*(-L)'
constant_names = ${cnames}
constant_expressions = ${cvalues}
derivatives = n3
inputs = 'c n1 n2 n3 n4'
[]
[mu_n4]
type = ParsedCompute
buffer = mu_n4
expression = '${fchem}*(-L)'
constant_names = ${cnames}
constant_expressions = ${cvalues}
derivatives = n4
inputs = 'c n1 n2 n3 n4'
[]
[mu_c_bar]
type = ForwardFFT
buffer = mu_c_bar
input = mu_c
[]
[mu_n1_bar]
type = ForwardFFT
buffer = mu_n1_bar
input = mu_n1
[]
[mu_n2_bar]
type = ForwardFFT
buffer = mu_n2_bar
input = mu_n2
[]
[mu_n3_bar]
type = ForwardFFT
buffer = mu_n3_bar
input = mu_n3
[]
[mu_n4_bar]
type = ForwardFFT
buffer = mu_n4_bar
input = mu_n4
[]
[Mbar_mu_c_bar]
type = ParsedCompute
buffer = Mbar_mu_c_bar
expression = 'Lbar*mu_c_bar'
inputs = 'Lbar mu_c_bar'
[]
[c_bar]
type = ForwardFFT
buffer = c_bar
input = c
[]
[n1_bar]
type = ForwardFFT
buffer = n1_bar
input = n1
[]
[n2_bar]
type = ForwardFFT
buffer = n2_bar
input = n2
[]
[n3_bar]
type = ForwardFFT
buffer = n3_bar
input = n3
[]
[n4_bar]
type = ForwardFFT
buffer = n4_bar
input = n4
[]
[]
[Postprocess]
[Fgrad_c]
type = FFTGradientSquare
buffer = Fgrad_c
input = c
factor = 1.5 # kappa/2
[]
[Fgrad_n1]
type = FFTGradientSquare
buffer = Fgrad_n1
input = n1
factor = 1.5 # kappa/2
[]
[Fgrad_n2]
type = FFTGradientSquare
buffer = Fgrad_n2
input = n2
factor = 1.5 # kappa/2
[]
[Fgrad_n3]
type = FFTGradientSquare
buffer = Fgrad_n3
input = n3
factor = 1.5 # kappa/2
[]
[Fgrad_n4]
type = FFTGradientSquare
buffer = Fgrad_n4
input = n4
factor = 1.5 # kappa/2
[]
[F]
type = ParsedCompute
buffer = F
expression = '${fchem} + Fgrad_c + Fgrad_n1 + Fgrad_n2 + Fgrad_n3 + Fgrad_n4'
constant_names = ${cnames}
constant_expressions = ${cvalues}
inputs = 'c n1 n2 n3 n4 Fgrad_c Fgrad_n1 Fgrad_n2 Fgrad_n3 Fgrad_n4'
[]
[bnds]
type = ParsedCompute
buffer = bnds
expression = 'n1^2 + n2^2 + n3^2 + n4^2'
inputs = 'n1 n2 n3 n4'
[]
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
buffer = 'c n1 n2 n3 n4'
reciprocal_buffer = 'c_bar n1_bar n2_bar n3_bar n4_bar'
linear_reciprocal = 'MkappaL2bar kappaLbar kappaLbar kappaLbar kappaLbar'
nonlinear_reciprocal = 'Mbar_mu_c_bar mu_n1_bar mu_n2_bar mu_n3_bar mu_n4_bar'
substeps = 2000
predictor_order = 2
corrector_order = 2
corrector_steps = 0
[]
[AuxVariables]
[c]
[]
[bnds]
[]
[]
[Postprocessors]
[min_c]
type = TensorExtremeValuePostprocessor
buffer = c
value_type = MIN
execute_on = 'TIMESTEP_END'
[]
[max_c]
type = TensorExtremeValuePostprocessor
buffer = c
value_type = MAX
execute_on = 'TIMESTEP_END'
[]
[F]
type = TensorIntegralPostprocessor
buffer = F
[]
# [stable_dt]
# type = SemiImplicitCriticalTimeStep
# buffer = MkappaL2bar
# []
[]
[Problem]
type = TensorProblem
[]
[Executioner]
type = Transient
num_steps = 1030
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.1
dt = 0.001
[]
dtmax = 10
[]
[Outputs]
csv = true
perf_graph = true
execute_on = 'TIMESTEP_END'
[]
[TensorOutputs]
[xdmf]
type = XDMFTensorOutput
buffer = 'c bnds'
output_mode = 'CELL CELL'
[]
[]
(test/tests/tensor_compute/pfc_fcc.i)
# FCC PFC test designed to clearly show atomic-scale density fluctuations
# Using larger epsilon for stronger density modulations
# Based on PhysRevE.81.061601 two-mode FCC PFC model
# Grid parameters - fine resolution to resolve atomic peaks
N = 1 # Grid points per dimension
# PFC model parameters - LARGER epsilon for clearer atomic structure
psi_mean = -0.2 # Mean density
epsilon = 0.15 # Larger undercooling for stronger modulations
R1_param = 0.0 # Two-mode coupling (0 for max FCC stability)
Q1_param = ${fparse sqrt(4.0/3.0)} # FCC wave number ratio
# Domain size: want several unit cells but fine enough resolution
# The (111) wavelength is 2*pi/q0 = 2*pi*sqrt(3/4) ≈ 5.44 (dimensionless)
# Let's fit about 'N' wavelengths in each direction
Lx = ${fparse N * 2 * pi / ${Q1_param}}
Ly = ${Lx}
[Domain]
dim = 2
nx = ${fparse ${N} * 8 }
ny = ${fparse ${N} * 8 }
xmax = ${Lx}
ymax = ${Ly}
[]
[TensorComputes]
[Initialize]
# Random perturbations to seed crystal growth
[psi]
type = RandomTensor
buffer = psi
max = ${fparse ${psi_mean} + 0.01}
min = ${fparse ${psi_mean} - 0.01}
seed = 12345
[]
# Linear operator for FCC
[linear]
type = FCCPFCLinear
buffer = 'linear'
eps = ${epsilon}
R1 = ${R1_param}
Q1 = ${Q1_param}
mobility = 1.0
[]
# Dealiasing for cubic nonlinearity
[smooth_operator]
type = DeAliasingTensor
buffer = smooth_operator
method = HOULI
[]
[]
[Solve]
# Nonlinear term
[nl_div_psi_cubed]
type = FCCPFCNonlinear
buffer = NL
psi = psi
dealiasing = smooth_operator
mobility = 1.0
[]
# FFT for spectral solver
[psi_hat]
type = ForwardFFT
buffer = psi_hat
input = psi
[]
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
buffer = 'psi'
linear_reciprocal = 'linear'
nonlinear_reciprocal = 'NL'
reciprocal_buffer = 'psi_hat'
corrector_order = 1
corrector_steps = 3
predictor_order = 1
substeps = 1000
[]
[Postprocessors]
[max_psi]
type = TensorExtremeValuePostprocessor
buffer = psi
value_type = MAX
execute_on = 'initial timestep_end'
[]
[min_psi]
type = TensorExtremeValuePostprocessor
buffer = psi
value_type = MIN
execute_on = 'initial timestep_end'
[]
[mean_psi]
type = TensorAveragePostprocessor
buffer = psi
execute_on = 'initial timestep_end'
[]
[]
[TensorOutputs]
[xdmf]
type = XDMFTensorOutput
buffer = 'psi'
enable_hdf5 = true
[]
[]
[Executioner]
type = Transient
num_steps = 100
dt = 0.2 # Larger timestep for faster evolution
[]
[Outputs]
perf_graph = true
csv = true
[]
(examples/libtorch_kks/KKS_libtorch.i)
#
# Kim-Kim-Suzuki with Gibbs energy supplied by a torch model, solved on a 2D grid.
#
# Constants for Initial Conditions
r = 30
l = 4.2
# Initial condition function for order parameter
eta_IC = '0.5*(1-tanh(2*(sqrt(x^2+y^2)-${r})/${l}))'
# Phase-field model parameters
kappa_eta = 5
w = 1
M = 5
L = 5
# Expressions for switching function and bulk Gibbs energy
h_eta = 'eta^3*(6*eta^2-15*eta+10)'
[Domain]
dim = 2
nx = 100
ny = 100
xmin = -50
xmax = 50
ymin = -50
ymax = 50
# automatically create a matching mesh
mesh_mode = DUMMY
[]
[TensorComputes]
[Initialize]
[c_IC]
type = ParsedCompute
buffer = c
expression = '0.6 + (0.3-0.6)*${eta_IC}'
extra_symbols = 'true'
[]
[eta_IC]
type = ParsedCompute
buffer = eta
expression = '${eta_IC}'
extra_symbols = 'true'
[]
[psi_init]
type = ConstantTensor
buffer = psi
real = 1
[]
[M]
type = ConstantTensor
buffer = M
real = ${M}
[]
[L]
type = ConstantTensor
buffer = L
real = ${L}
[]
[L_kappa]
type = ReciprocalLaplacianFactor
buffer = L_kappa
factor = ${fparse ${L} * ${kappa_eta} }
[]
[h_eta_IC]
type = ParsedCompute
buffer = h_eta
expression = '${h_eta}'
inputs = eta
[]
[G_func_IC]
type = LibtorchGibbsEnergy
buffer = 'G'
phase_fractions = 'h_eta'
concentrations = 'c'
domega_detas = 'dG_dh'
chem_pots = 'mu'
libtorch_model_file = 'torch_NN_gibbs_model.pt'
[]
[smooth]
type = DeAliasingTensor
method = HOULI
buffer = smooth
[]
[]
[Solve]
[h_eta]
type = ParsedCompute
buffer = h_eta
expression = '${h_eta}'
inputs = eta
[]
[G_func]
type = LibtorchGibbsEnergy
buffer = 'G'
phase_fractions = 'h_eta'
concentrations = 'c'
domega_detas = 'dG_dh'
chem_pots = 'mu'
libtorch_model_file = 'torch_NN_gibbs_model.pt'
[]
[dG_deta]
type = ParsedCompute
buffer = 'dG_deta'
inputs = 'eta dG_dh'
expression = 'dG_dh * ${h_eta} + ${w} * eta^2 * (1-eta^2)^2'
derivatives = 'eta'
[]
[etabar]
type = ForwardFFT
buffer = etabar
input = eta
[]
[AC_bulk]
type = ReciprocalAllenCahn
L = L
buffer = AC_bulk
dF_chem_deta = dG_deta
psi = psi
[]
[NL_eta]
type = ParsedCompute
buffer = NL_eta
expression = 'AC_bulk '
inputs = 'AC_bulk'
[]
[cbar]
type = ForwardFFT
buffer = cbar
input = c
[]
[div_J]
type = ReciprocalMatDiffusion
buffer = 'div_J'
chemical_potential = mu
mobility = M
psi = psi
[]
[NL_c]
type = ParsedCompute
buffer = 'NL_c'
inputs = 'div_J smooth'
expression = 'smooth * div_J'
[]
[]
[]
[TensorSolver]
type = AdamsBashforthMoulton
buffer = 'c eta'
reciprocal_buffer = 'cbar etabar'
linear_reciprocal = '0 L_kappa'
nonlinear_reciprocal = 'NL_c NL_eta'
substeps = 1e3
predictor_order = 3
corrector_order = 1
corrector_steps = 1
[]
[Postprocessors]
[total_c]
type = TensorIntegralPostprocessor
buffer = c
[]
[]
[TensorOutputs]
[xdmf]
type = XDMFTensorOutput
buffer = 'eta c mu psi dG_deta dG_dh G'
enable_hdf5 = true
transpose = false
[]
[]
[Executioner]
type = Transient
num_steps = 100
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.25
dt = 0.1
[]
dtmax = 10
[]
[Outputs]
csv = true
perf_graph = true
execute_on = 'INITIAL TIMESTEP_END'
[]