- componentAn integer corresponding to the direction in order parameter space this kernel acts in (e.g. for unrotated functionals 0 for q_x, 1 for q_y, 2 for q_z).
C++ Type:unsigned int
Controllable:No
Description:An integer corresponding to the direction in order parameter space this kernel acts in (e.g. for unrotated functionals 0 for q_x, 1 for q_y, 2 for q_z).
- mag_xThe x component of the constrained magnetic vector
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:The x component of the constrained magnetic vector
- mag_yThe y component of the constrained magnetic vector
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:The y component of the constrained magnetic vector
- mag_zThe z component of the constrained magnetic vector
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:The z component of the constrained magnetic vector
- variableThe name of the variable that this residual object operates on
C++ Type:NonlinearVariableName
Unit:(no unit assumed)
Controllable:No
Description:The name of the variable that this residual object operates on
MasterExchangeCartLLG
Calculates a residual contribution due to the magnetic exchange energy.
Overview
We consider the effective field generated by the variational derivative of the exchange stiffness energy density ,
where is the magnetization and the saturation magnetization. Since,
we can write the above expression as
with the normalized magnetization. The effective field is
The LLG equation for the normalized magnetization is,
(1)
with the gyromagnetic ratio. Multiplying by a test function , moving over the RHS, neglecting the time derivative, and integrating over the volume, we have,
This equation in index notation is,
with the Levi-Civita symbol. Inserting the expression for the effective field due to the exchange stiffness, we have
Now integrating by parts we obtain,
The surface terms vanish due to the properties of and we are left with the residual contribution to due to the exchange,
The on-diagonal and off-diagonal jacobian contributions are calculated with,
using and where is the shape function of the finite element method. Note that can be treated as a spatially dependent materials property. This means that the volume integrals will be taken over and this parameter should be moved inside in the above expressions.
Landau-Lifshitz-Bloch route
With llb = true the kernel solves the LLB equation, in which is free (Finite-temperature micromagnetics). The residual is with the test vector . It needs the material properties alpha_perp and alpha_par, and Ae is . alpha keeps its role as in the prefactor .
Integration by parts puts the gradient on . When the damping varies in space, for example , supply the optional RealVectorValue material properties grad_alpha_perp and grad_alpha_par (both or neither); they add the terms of the weak form. Without them the damping is treated as uniform, which drives walls and skyrmions by a spurious torque proportional to .
[Kernels<<<{"href": "../../syntax/Kernels/index.html"}>>>]
[MasterExchangeCartLLG_x]
type = MasterExchangeCartLLG<<<{"description": "Calculates a residual contribution due to the magnetic exchange energy.", "href": "MasterExchangeCartLLG.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = mag_x
component<<<{"description": "An integer corresponding to the direction in order parameter space this kernel acts in (e.g. for unrotated functionals 0 for q_x, 1 for q_y, 2 for q_z)."}>>> = 0
[]
[](test/tests/magnets/llb_alpha_ramp_wall.i)Example Input File Syntax
Input Parameters
- Hscale1scaling factor for effective fields
Default:1
C++ Type:Real
Unit:(no unit assumed)
Controllable:No
Description:scaling factor for effective fields
- 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
- displacementsThe displacements
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:The displacements
- g01electron gyromagnetic factor
Default:1
C++ Type:Real
Unit:(no unit assumed)
Controllable:No
Description:electron gyromagnetic factor
- llbFalseLandau-Lifshitz-Bloch route (m = M/Ms0, |m| free): transverse damping alpha_perp/|m|^2 and longitudinal damping alpha_par (material properties alpha_perp, alpha_par); alpha stays the coupling lambda in the g0/(1 + alpha^2) prefactor. Spatially varying alpha_perp/alpha_par need the optional RealVectorValue material properties grad_alpha_perp and grad_alpha_par (both or neither, e.g. CoupledGradientMaterial with scalar_property_factor = dalpha_perp/dT): they add the product-rule terms of the weak form; without them the damping is treated as uniform
Default:False
C++ Type:bool
Controllable:No
Description:Landau-Lifshitz-Bloch route (m = M/Ms0, |m| free): transverse damping alpha_perp/|m|^2 and longitudinal damping alpha_par (material properties alpha_perp, alpha_par); alpha stays the coupling lambda in the g0/(1 + alpha^2) prefactor. Spatially varying alpha_perp/alpha_par need the optional RealVectorValue material properties grad_alpha_perp and grad_alpha_par (both or neither, e.g. CoupledGradientMaterial with scalar_property_factor = dalpha_perp/dT): they add the product-rule terms of the weak form; without them the damping is treated as uniform
- llb_m2_eps1e-06Regularisation of 1/|m|^2 -> 1/(|m|^2 + llb_m2_eps) in the LLB damping terms; matters only where |m| ~ sqrt(llb_m2_eps), e.g. at the centre of a linear wall
Default:1e-06
C++ Type:Real
Unit:(no unit assumed)
Controllable:No
Description:Regularisation of 1/|m|^2 -> 1/(|m|^2 + llb_m2_eps) in the LLB damping terms; matters only where |m| ~ sqrt(llb_m2_eps), e.g. at the centre of a linear wall
- mu01permeability of the vacuum
Default:1
C++ Type:Real
Unit:(no unit assumed)
Controllable:No
Description:permeability of the vacuum
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contribution
C++ Type:std::vector<TagName>
Controllable:No
Description:The tags for the vectors this residual object should fill with the absolute value of the residual contribution
- extra_matrix_tagsThe extra tags for the matrices this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the matrices this Kernel should fill
- extra_vector_tagsThe extra tags for the vectors this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the vectors this Kernel should fill
- matrix_onlyFalseWhether this object is only doing assembly to matrices (no vectors)
Default:False
C++ Type:bool
Controllable:No
Description:Whether this object is only doing assembly to matrices (no vectors)
- matrix_tagssystemThe tag for the matrices this Kernel should fill
Default:system
C++ Type:MultiMooseEnum
Options:nontime, system
Controllable:No
Description:The tag for the matrices this Kernel should fill
- vector_tagsnontimeThe tag for the vectors this Kernel should fill
Default:nontime
C++ Type:MultiMooseEnum
Options:nontime, time
Controllable:No
Description:The tag for the vectors this Kernel should fill
Contribution To Tagged Field Data 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.
- diag_save_inThe name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Unit:(no unit assumed)
Controllable:No
Description:The name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- 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
- save_inThe name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Unit:(no unit assumed)
Controllable:No
Description:The name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- search_methodnearest_node_connected_sidesChoice of search algorithm. All options begin by finding the nearest node in the primary boundary to a query point in the secondary boundary. In the default nearest_node_connected_sides algorithm, primary boundary elements are searched iff that nearest node is one of their nodes. This is fast to determine via a pregenerated node-to-elem map and is robust on conforming meshes. In the optional all_proximate_sides algorithm, primary boundary elements are searched iff they touch that nearest node, even if they are not topologically connected to it. This is more CPU-intensive but is necessary for robustness on any boundary surfaces which has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes in adaptively h-refined meshes).
Default:nearest_node_connected_sides
C++ Type:MooseEnum
Options:nearest_node_connected_sides, all_proximate_sides
Controllable:No
Description:Choice of search algorithm. All options begin by finding the nearest node in the primary boundary to a query point in the secondary boundary. In the default nearest_node_connected_sides algorithm, primary boundary elements are searched iff that nearest node is one of their nodes. This is fast to determine via a pregenerated node-to-elem map and is robust on conforming meshes. In the optional all_proximate_sides algorithm, primary boundary elements are searched iff they touch that nearest node, even if they are not topologically connected to it. This is more CPU-intensive but is necessary for robustness on any boundary surfaces which has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes in adaptively h-refined meshes).
- 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
- 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
Unit:(no unit assumed)
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.
Material Property Retrieval Parameters
Input Files
- (test/tests/magnets/sp4_f1.i)
- (test/tests/magnets/aniso_k2_cone.i)
- (test/tests/magnets/llb_demag_film.i)
- (test/tests/magnets/sp2_first.i)
- (test/tests/magnets/slab_PML_small.i)
- (test/tests/magnets/sp6_2d.i)
- (test/tests/magnets/llb_helix.i)
- (test/tests/magnets/sp6_3d.i)
- (test/tests/magnets/sp1.i)
- (test/tests/magnets/sp6_1d.i)
- (test/tests/magnets/mag_brick.i)
- (test/tests/spin_waves/afm_skyr_modes.i)
- (tutorial/ringdown.i)
- (test/tests/magnets/sp2_second.i)
- (test/tests/magnets/walker_llg.i)
- (test/tests/magnets/ringdown.i)
- (test/tests/magnets/sp4_f2.i)
- (test/tests/magnets/sp3.i)
- (test/tests/magnets/Sstate_gen-Py_OOMF.i)
- (test/tests/magnets/llb_alpha_ramp_dmi.i)
- (test/tests/spin_waves/film_common.i)
- (test/tests/magnets/sp5.i)
- (test/tests/magnets/walker_llg_above.i)
- (test/tests/magnets/llb_alpha_ramp_wall.i)
(test/tests/magnets/llb_alpha_ramp_wall.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 600
xmin = -30
xmax = 30
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
g0 = 1
mu0 = 1
Hscale = 1
llb = true
[]
[Functions]
[ap]
type = ParsedFunction
expression = '0.25 + -0.002*x'
[]
[al]
type = ParsedFunction
expression = '0.15 + 0.002*x'
[]
[]
[Materials]
[constants]
type = GenericConstantMaterial
prop_names = 'alpha Ms Ae K1 nx ny nz me chi_par'
prop_values = '0.1 1 1 1 0 0 1 0.8 0.05'
[]
[alphas]
type = GenericFunctionMaterial
prop_names = 'alpha_perp alpha_par'
prop_values = 'ap al'
[]
[grad_alphas]
type = GenericConstantVectorMaterial
prop_names = 'grad_alpha_perp grad_alpha_par'
prop_values = '-0.002 0 0 0.002 0 0'
[]
[]
[Variables]
[mag_x]
[InitialCondition]
type = FunctionIC
function = '0'
[]
[]
[mag_y]
[InitialCondition]
type = FunctionIC
function = '0.8/cosh(x)'
[]
[]
[mag_z]
[InitialCondition]
type = FunctionIC
function = '0.8*tanh(x)'
[]
[]
[]
[AuxVariables]
[uz]
[]
[]
[AuxKernels]
[uz]
type = ParsedAux
variable = uz
coupled_variables = 'mag_x mag_y mag_z'
expression = 'mag_z/sqrt(mag_x^2 + mag_y^2 + mag_z^2)'
[]
[]
[Kernels]
[time_x]
type = TimeDerivative
variable = mag_x
[]
[time_y]
type = TimeDerivative
variable = mag_y
[]
[time_z]
type = TimeDerivative
variable = mag_z
[]
[MasterExchangeCartLLG_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
[]
[MasterExchangeCartLLG_y]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
[]
[MasterExchangeCartLLG_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
[]
[MasterAnisotropyCartLLG_x]
type = MasterAnisotropyCartLLG
variable = mag_x
component = 0
[]
[MasterAnisotropyCartLLG_y]
type = MasterAnisotropyCartLLG
variable = mag_y
component = 1
[]
[MasterAnisotropyCartLLG_z]
type = MasterAnisotropyCartLLG
variable = mag_z
component = 2
[]
[MasterLongitudinalLLB_x]
type = MasterLongitudinalLLB
variable = mag_x
component = 0
form = llb
temperature = 0.5
Tc = 1
[]
[MasterLongitudinalLLB_y]
type = MasterLongitudinalLLB
variable = mag_y
component = 1
form = llb
temperature = 0.5
Tc = 1
[]
[MasterLongitudinalLLB_z]
type = MasterLongitudinalLLB
variable = mag_z
component = 2
form = llb
temperature = 0.5
Tc = 1
[]
[]
[UserObjects]
[assert]
type = Terminator
expression = 'sim_time > 10 & abs(q_rel) > 0.05'
fail_mode = HARD
error_level = ERROR
message = 'LLB wall in an alpha ramp moves: the grad(alpha) terms are missing or wrong'
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[Iuz]
type = ElementIntegralVariablePostprocessor
variable = uz
[]
[q]
type = ParsedPostprocessor
expression = '-0.5*Iuz'
pp_names = 'Iuz'
[]
[sim_time]
type = TimePostprocessor
[]
[q_rel]
type = ParsedPostprocessor
expression = 'q/(0.00396039604*sim_time)'
pp_names = 'q sim_time'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
scheme = bdf2
dt = 0.05
end_time = 20
nl_abs_tol = 1e-10
nl_rel_tol = 1e-8
nl_rel_step_tol = 1e-12
line_search = none
nl_forced_its = 1
[]
[Outputs]
file_base = out_llb_alpha_ramp_wall
csv = true
[]
(test/tests/magnets/sp4_f1.i)
[Mesh]
# muMAG SP4 field 1, mesh scaled down for the test. Real mesh used: 2.5 nm film cells (200 x 50 in-plane,
# 2 through the 3 nm thickness), refined to 1.25 nm (4 through the thickness) in a 5 nm band along the film
# edges, and a graded hanging-node vacuum out to a 185 x 152 x 180 l_ex box.
[box]
type = CartesianMeshGenerator
dim = 3
dx = '100.0 20.0 87.938337 20.0 100.0'
dy = '100.0 20.0 21.984584 20.0 100.0'
dz = '40.0 4.0 0.527630 4.0 40.0'
ix = '2 1 16 1 2'
iy = '2 1 4 1 2'
iz = '2 1 1 1 2'
[]
[center]
type = TransformGenerator
input = box
transform = TRANSLATE
vector_value = '-163.969169 -130.992292 -44.263815'
[]
[film_block]
type = ParsedSubdomainMeshGenerator
input = center
block_id = 1
combinatorial_geometry = 'x >= -43.969169 & x <= 43.969169 & y >= -10.992292 & y <= 10.992292 & z >= -0.263815 & z <= 0.263815'
[]
[block_names]
type = RenameBlockGenerator
input = film_block
old_block = '0 1'
new_block = 'vacuum film'
[]
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
potential_H_int = potential_H_int
Hext_x = Hext_x
Hext_y = Hext_y
Hext_z = Hext_z
mu0 = 1.256637
g0 = 140.206695
Hscale = 1.0
[]
[Variables]
[mag_x]
block = film
[InitialCondition]
type = ConstantIC
value = 0.991756
[]
[]
[mag_y]
block = film
[InitialCondition]
type = ConstantIC
value = 0.128140
[]
[]
[mag_z]
block = film
[InitialCondition]
type = ConstantIC
value = 0.0
[]
[]
[potential_H_int]
block = 'film vacuum'
[]
[]
[AuxVariables]
[mag_s]
block = film
[]
[Hext_x]
block = film
[InitialCondition]
type = ConstantIC
value = -0.0308706115
[]
[]
[Hext_y]
block = film
[InitialCondition]
type = ConstantIC
value = 0.0053960825
[]
[]
[Hext_z]
block = film
[]
[]
[AuxKernels]
[mag_norm]
type = VectorMagnitudeAux
variable = mag_s
x = mag_x
y = mag_y
z = mag_z
block = film
execute_on = 'initial timestep_end'
[]
[]
[Materials]
[film_properties]
type = GenericConstantMaterial
prop_names = 'alpha Ae Ms permittivity'
prop_values = '0.02 1.0 1.261566 1.0'
block = film
[]
[vacuum_properties]
type = GenericConstantMaterial
prop_names = 'Ms permittivity'
prop_values = '0.0 1.0'
block = vacuum
[]
[]
[Kernels]
[mag_x_time]
type = TimeDerivative
variable = mag_x
block = film
[]
[mag_y_time]
type = TimeDerivative
variable = mag_y
block = film
[]
[mag_z_time]
type = TimeDerivative
variable = mag_z
block = film
[]
[exchange_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
block = film
[]
[exchange_y]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
block = film
[]
[exchange_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
block = film
[]
[field_x]
type = MasterInteractionCartLLGHConst
variable = mag_x
component = 0
block = film
[]
[field_y]
type = MasterInteractionCartLLGHConst
variable = mag_y
component = 1
block = film
[]
[field_z]
type = MasterInteractionCartLLGHConst
variable = mag_z
component = 2
block = film
[]
[magnetostatic_laplace]
type = Electrostatics
variable = potential_H_int
block = 'film vacuum'
[]
[magnetostatic_source]
type = MagHStrongCart
variable = potential_H_int
block = film
[]
[]
[BCs]
[outer_vacuum]
type = DirichletBC
variable = potential_H_int
boundary = '0 1 2 3 4 5'
value = 0.0
[]
[]
[Postprocessors]
[mx]
type = ElementAverageValue
variable = mag_x
block = film
[]
[my]
type = ElementAverageValue
variable = mag_y
block = film
[]
[mz]
type = ElementAverageValue
variable = mag_z
block = film
[]
[mag_norm_min]
type = NodalExtremeValue
variable = mag_s
value_type = min
block = film
[]
[mag_norm_max]
type = NodalExtremeValue
variable = mag_s
value_type = max
block = film
[]
[Fexch]
type = MasterMagneticExchangeEnergy
energy_scale = 1.0
block = film
[]
[Fdemag]
type = MagnetostaticEnergyCart
energy_scale = 1.0
block = film
[]
[Fzeeman]
type = MasterMagneticZeemanEnergyCart
energy_scale = 1.0
block = film
[]
[]
[UserObjects]
[renormalize]
type = PointwiseRenormalizeVector
v = 'mag_x mag_y mag_z'
execute_on = timestep_end
force_preaux = true
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
[TimeIntegrator]
type = NewmarkBeta
[]
petsc_options_iname = '-pc_type -snes_atol -snes_rtol'
petsc_options_value = 'lu 1e-8 1e-8'
dt = 0.001
num_steps = 5
[]
[Outputs]
file_base = out_sp4_f1
exodus = true
csv = true
[]
(test/tests/magnets/aniso_k2_cone.i)
# Easy cone from K2: K1 = 1, K2 = -1 relaxes m to cos^2(theta) = K1/(2|K2|) = 0.5 (mz = 0.70711); mesh scaled down from 40 x 20 x 10.
[Mesh]
type = GeneratedMesh
dim = 3
nx = 4
ny = 2
nz = 1
xmax = 4
ymax = 2
zmax = 1
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
g0 = 1.0
mu0 = 1.0
[]
[Materials]
[constants]
type = GenericConstantMaterial
prop_names = 'alpha Ae Ms K1 K2 nx ny nz'
prop_values = '1.0 0.1 1.0 1.0 -1.0 0 0 1'
[]
[]
[Variables]
[mag_x]
[InitialCondition]
type = FunctionIC
function = 'sin(0.1 + 0.1*x)'
[]
[]
[mag_y]
[]
[mag_z]
[InitialCondition]
type = FunctionIC
function = 'cos(0.1 + 0.1*x)'
[]
[]
[]
[Kernels]
[time_x]
type = TimeDerivative
variable = mag_x
[]
[time_y]
type = TimeDerivative
variable = mag_y
[]
[time_z]
type = TimeDerivative
variable = mag_z
[]
[exchange_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
[]
[exchange_y]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
[]
[exchange_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
[]
[anisotropy_x]
type = MasterAnisotropyCartLLG
variable = mag_x
component = 0
[]
[anisotropy_y]
type = MasterAnisotropyCartLLG
variable = mag_y
component = 1
[]
[anisotropy_z]
type = MasterAnisotropyCartLLG
variable = mag_z
component = 2
[]
[]
[Correctors]
[unit_magnetization]
type = PointwiseRenormalizeVector
v = 'mag_x mag_y mag_z'
norm = 1
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[mz]
type = ElementAverageValue
variable = mag_z
execute_on = 'initial timestep_end'
[]
[Fexch]
type = MasterMagneticExchangeEnergy
execute_on = 'initial timestep_end'
[]
[Faniso]
type = MasterMagneticAnisotropyEnergy
execute_on = 'initial timestep_end'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-10
nl_abs_tol = 1e-12
dt = 1.0
end_time = 30
[]
[Outputs]
file_base = out_aniso_k2_cone
csv = true
[]
(test/tests/magnets/llb_demag_film.i)
[Mesh]
[line]
type = CartesianMeshGenerator
dim = 1
dx = '5 2 5'
ix = '5 8 5'
subdomain_id = '0 1 0'
[]
[names]
type = RenameBlockGenerator
input = line
old_block = '0 1'
new_block = 'vacuum film'
[]
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
g0 = 2.211e-4
mu0 = 1.2566370614e-6
potential_H_int = phi
Hext_x = zero
Hext_y = zero
Hext_z = Hz
[]
[Materials]
[film]
type = GenericConstantMaterial
prop_names = 'alpha alpha_perp alpha_par Ms Ae me chi_par permittivity'
prop_values = '0.02 0.01428571429 0.01142857143 860000 13000000 0.4680904102 1.87707808e-09 1.0'
block = film
[]
[vacuum]
type = GenericConstantMaterial
prop_names = 'Ms permittivity'
prop_values = '0 1.0'
block = vacuum
[]
[]
[Variables]
[mag_x]
block = film
initial_condition = 0.01633611973
[]
[mag_y]
block = film
initial_condition = 0
[]
[mag_z]
block = film
initial_condition = 0.4678052622
[]
[phi]
[]
[]
[AuxVariables]
[zero]
block = film
[]
[Hz]
block = film
initial_condition = 159154.9431
[]
[hd_res]
order = CONSTANT
family = MONOMIAL
block = film
[]
[dphidx]
order = CONSTANT
family = MONOMIAL
block = film
[]
[]
[AuxKernels]
[dphidx]
type = VariableGradientComponent
variable = dphidx
gradient_variable = phi
component = x
block = film
[]
[hd_res]
type = ParsedAux
variable = hd_res
coupled_variables = 'dphidx mag_x'
expression = 'abs(dphidx - 860000*mag_x)/860000'
block = film
[]
[]
[Kernels]
[time_x]
type = TimeDerivative
variable = mag_x
block = film
[]
[time_y]
type = TimeDerivative
variable = mag_y
block = film
[]
[time_z]
type = TimeDerivative
variable = mag_z
block = film
[]
[MasterExchangeCartLLG_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
block = film
llb = true
[]
[MasterExchangeCartLLG_y]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
block = film
llb = true
[]
[MasterExchangeCartLLG_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
block = film
llb = true
[]
[MasterInteractionCartLLGHConst_x]
type = MasterInteractionCartLLGHConst
variable = mag_x
component = 0
block = film
llb = true
[]
[MasterInteractionCartLLGHConst_y]
type = MasterInteractionCartLLGHConst
variable = mag_y
component = 1
block = film
llb = true
[]
[MasterInteractionCartLLGHConst_z]
type = MasterInteractionCartLLGHConst
variable = mag_z
component = 2
block = film
llb = true
[]
[MasterLongitudinalLLB_x]
type = MasterLongitudinalLLB
variable = mag_x
component = 0
block = film
form = llb
temperature = 600
Tc = 700
[]
[MasterLongitudinalLLB_y]
type = MasterLongitudinalLLB
variable = mag_y
component = 1
block = film
form = llb
temperature = 600
Tc = 700
[]
[MasterLongitudinalLLB_z]
type = MasterLongitudinalLLB
variable = mag_z
component = 2
block = film
form = llb
temperature = 600
Tc = 700
[]
[phi_laplace]
type = Electrostatics
variable = phi
[]
[phi_source]
type = MagHStrongCart
variable = phi
block = film
[]
[]
[BCs]
[pin]
type = DirichletBC
variable = phi
boundary = left
value = 0
[]
[]
[Postprocessors]
[mx]
type = ElementAverageValue
variable = mag_x
block = film
[]
[my]
type = ElementAverageValue
variable = mag_y
block = film
[]
[mz]
type = ElementAverageValue
variable = mag_z
block = film
[]
[sim_time]
type = TimePostprocessor
[]
[hd_err]
type = ElementExtremeValue
variable = hd_res
block = film
[]
[mrel]
type = ParsedPostprocessor
expression = 'sqrt(mx*mx + my*my + mz*mz)/0.4683891565'
pp_names = 'mx my mz'
[]
[]
[UserObjects]
[assert]
type = Terminator
expression = 'hd_err > 1e-6 | (sim_time > 0.25 & abs(mrel - 1) > 2e-6)'
fail_mode = HARD
error_level = ERROR
message = 'LLB film: demag field is not -Ms0 m_x, or |m| misses the para-process value'
execute_on = 'timestep_end'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
scheme = bdf2
dt = 0.0009506011268
end_time = 0.3
nl_abs_tol = 1e-10
nl_rel_tol = 1e-8
nl_rel_step_tol = 1e-12
line_search = none
nl_forced_its = 1
[]
[Outputs]
file_base = out_llb_demag_film
csv = true
[]
(test/tests/magnets/sp2_first.i)
[Mesh]
# muMAG standard problem 2 (5d x d x 0.1d film, no anisotropy, field along [111]), FIRST-order demag
# potential. Reduced units: l_ex = 1, Km = mu0 Ms^2 / 2 = 1; lengths below are for d = 1 l_ex.
# Scaled-down mesh for a fast regression test. For the actual SP2 benchmark multiply every length by
# d/l_ex and use 100 x 20 x 3 film cells with a graded vacuum, e.g.
# dx = '2 1 0.5 0.25 0.25 5 0.25 0.25 0.5 1 2', ix = '1 1 1 1 5 100 5 1 1 1 1',
# dy = '2 1 0.5 0.25 0.25 1 0.25 0.25 0.5 1 2', iy = '1 1 1 1 5 20 5 1 1 1 1',
# dz = '1.2 0.6 0.3 0.133333 0.066667 0.033333 0.1 0.033333 0.066667 0.133333 0.3 0.6 1.2',
# iz = '1 1 1 1 1 1 3 1 1 1 1 1 1' (box half-sizes 6.5d x 4.5d x 2.383333d), then sweep the field.
[box]
type = CartesianMeshGenerator
dim = 3
dx = '4.0 1.0 5.0 1.0 4.0'
dy = '4.0 1.0 1.0 1.0 4.0'
dz = '2.0 0.2 0.1 0.2 2.0'
ix = '1 1 10 1 1'
iy = '1 1 2 1 1'
iz = '1 1 1 1 1'
[]
[center]
type = TransformGenerator
input = box
transform = TRANSLATE
vector_value = '-7.5 -5.5 -2.25'
[]
[film_block]
type = ParsedSubdomainMeshGenerator
input = center
block_id = 1
combinatorial_geometry = 'abs(x) <= 2.500001 & abs(y) <= 0.500001 & abs(z) <= 0.050001'
[]
[block_names]
type = RenameBlockGenerator
input = film_block
old_block = '0 1'
new_block = 'vacuum film'
[]
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
potential_H_int = potential_H_int
Hext_x = Hext
Hext_y = Hext
Hext_z = Hext
mu0 = 1.256637
g0 = 221.1
Hscale = 1.0
[]
[Variables]
# start uniform along [111]
[mag_x]
block = film
[InitialCondition]
type = ConstantIC
value = 0.5773502691896258
[]
[]
[mag_y]
block = film
[InitialCondition]
type = ConstantIC
value = 0.5773502691896258
[]
[]
[mag_z]
block = film
[InitialCondition]
type = ConstantIC
value = 0.5773502691896258
[]
[]
[potential_H_int]
block = 'film vacuum'
[]
[]
[AuxVariables]
[mag_s]
block = film
[]
# applied field H/Ms = 0.08 along [111]: each component = 0.08 * Ms / sqrt(3)
[Hext]
block = film
[InitialCondition]
type = ConstantIC
value = 0.05827295
[]
[]
[]
[AuxKernels]
[mag_norm]
type = VectorMagnitudeAux
variable = mag_s
x = mag_x
y = mag_y
z = mag_z
block = film
execute_on = 'initial timestep_end'
[]
[]
[Materials]
[film_properties]
type = GenericConstantMaterial
prop_names = 'alpha Ae Ms permittivity'
prop_values = '1.0 1.0 1.261566 1.0'
block = film
[]
[vacuum_properties]
type = GenericConstantMaterial
prop_names = 'Ms permittivity'
prop_values = '0.0 1.0'
block = vacuum
[]
[]
[Kernels]
[mag_x_time]
type = TimeDerivative
variable = mag_x
block = film
[]
[mag_y_time]
type = TimeDerivative
variable = mag_y
block = film
[]
[mag_z_time]
type = TimeDerivative
variable = mag_z
block = film
[]
[exchange_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
block = film
[]
[exchange_y]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
block = film
[]
[exchange_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
block = film
[]
[field_x]
type = MasterInteractionCartLLGHConst
variable = mag_x
component = 0
block = film
[]
[field_y]
type = MasterInteractionCartLLGHConst
variable = mag_y
component = 1
block = film
[]
[field_z]
type = MasterInteractionCartLLGHConst
variable = mag_z
component = 2
block = film
[]
[magnetostatic_laplace]
type = Electrostatics
variable = potential_H_int
block = 'film vacuum'
[]
[magnetostatic_source]
type = MagHStrongCart
variable = potential_H_int
block = film
[]
[]
[BCs]
[outer_vacuum]
type = DirichletBC
variable = potential_H_int
boundary = '0 1 2 3 4 5'
value = 0.0
[]
[]
[Postprocessors]
[mx]
type = ElementAverageValue
variable = mag_x
block = film
[]
[my]
type = ElementAverageValue
variable = mag_y
block = film
[]
[mz]
type = ElementAverageValue
variable = mag_z
block = film
[]
[mag_norm_min]
type = NodalExtremeValue
variable = mag_s
value_type = min
block = film
[]
[Fexch]
type = MasterMagneticExchangeEnergy
energy_scale = 1.0
block = film
[]
[Fdemag]
type = MagnetostaticEnergyCart
energy_scale = 1.0
block = film
[]
[Fzeeman]
type = MasterMagneticZeemanEnergyCart
energy_scale = 1.0
block = film
[]
[]
[UserObjects]
[renormalize]
type = PointwiseRenormalizeVector
v = 'mag_x mag_y mag_z'
execute_on = timestep_end
force_preaux = true
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
scheme = implicit-euler
petsc_options_iname = '-pc_type -snes_atol -snes_rtol'
petsc_options_value = 'lu 1e-8 1e-8'
dt = 0.01
num_steps = 2
[]
[Outputs]
file_base = out_sp2_first
exodus = true
csv = true
[]
(test/tests/magnets/slab_PML_small.i)
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
potential_H_int = potential_H_int
g0 = 1.0
Hscale = 0.004519239
mu0 = 1.256637e-06
y0pmlminus = -25
deltasyminus = 1.0e04
deltawyminus = 5
deltapyminus = 0.1
[]
alphadef = 0.02
[Mesh]
[./mesh]
type = GeneratedMeshGenerator
dim = 3
nx = 25
ny = 43
nz = 5
xmin = -50
xmax = 50
ymin = -35
ymax = 50
zmin = -10
zmax = 10
[../]
[./infinite_domain]
type = SubdomainBoundingBoxGenerator
input = mesh
bottom_left = '-50 -35 -10'
top_right = '50 50 10'
block_id = 3
block_name = infinite_domain
[../]
[./vacuum_box]
type = SubdomainBoundingBoxGenerator
input = infinite_domain
bottom_left = '-50 -25 -10'
top_right = '50 50 10'
block_id = 2
block_name = vacuum
[../]
[./boundary1]
type = SideSetsBetweenSubdomainsGenerator
input = vacuum_box
new_boundary = id_boundary
paired_block = vacuum
primary_block = 3
[../]
[./brick]
type = SubdomainBoundingBoxGenerator
input = boundary1
bottom_left = '-10 -10 -1.5'
top_right = '10 10 1.5'
block_id = 1
block_name = brick
[../]
[../]
[Materials]
[./constants]
type = GenericConstantMaterial
prop_names = ' alpha permittivity Ae Ms'
prop_values = '${alphadef} 1.0 1.3e-05 1.2'
block = '1'
[../]
[./a_long]
type = GenericFunctionMaterial
prop_names = 'alpha_long'
prop_values = 'bc_func_1'
block = '1'
[../]
[./constantsv]
type = GenericConstantMaterial
prop_names = ' permittivity'
prop_values = '1.0'
block = '3 2'
[../]
[]
[Functions]
[./bc_func_1]
type = ParsedFunction
expression = 'st'
symbol_names = 'st'
symbol_values = '1.e1'
[../]
[]
[Variables]
[./mag_x]
order = FIRST
family = LAGRANGE
block = '1'
[./InitialCondition]
type = RandomConstrainedVectorFieldIC
phi = azimuth_phi
theta = polar_theta
M0s = 1.0
component = 0
[../]
[../]
[./mag_y]
order = FIRST
family = LAGRANGE
block = '1'
[./InitialCondition]
type = RandomConstrainedVectorFieldIC
phi = azimuth_phi
theta = polar_theta
M0s = 1.0
component = 1
[../]
[../]
[./mag_z]
order = FIRST
family = LAGRANGE
block= '1'
[./InitialCondition]
type = RandomConstrainedVectorFieldIC
phi = azimuth_phi
theta = polar_theta
M0s = 1.0
component = 2
[../]
[../]
[./potential_H_int]
order = FIRST
family = LAGRANGE
block = '1 2'
[../]
[./phi2]
order = FIRST
family = LAGRANGE
block = 3
[../]
[]
[AuxVariables]
[./azimuth_phi]
order = FIRST
family = LAGRANGE
block = '1'
[./InitialCondition]
type = RandomIC
min = 1.5708
max = 1.5709
seed = 2
[../]
[../]
[./polar_theta]
order = FIRST
family = LAGRANGE
block = '1'
[./InitialCondition]
type = RandomIC
min = 1.5708
max = 1.5709
seed = 37
[../]
[../]
[./mag_s]
order = FIRST
family = LAGRANGE
block = '1'
[../]
[./H_y]
order = FIRST
family = MONOMIAL
block = '1 2'
[../]
[./H_y_v]
order = FIRST
family = MONOMIAL
block = '3'
[../]
[]
[AuxKernels]
[./mag_mag]
type = VectorMagnitudeAux
variable = mag_s
x = mag_x
y = mag_y
z = mag_z
execute_on = 'initial timestep_end final'
block = '1'
[../]
[./Hy_brick]
type = DemagFieldAux
variable = H_y
component = 1
block = '1 2'
[../]
[./Hy_id]
type = DemagFieldAuxPML
phi1 = phi2
variable = H_y_v
component = 1
block = '3'
[../]
[]
[Kernels]
[./mag_x_time]
type = TimeDerivative
variable = mag_x
block = '1'
[../]
[./mag_y_time]
type = TimeDerivative
variable = mag_y
block = '1'
[../]
[./mag_z_time]
type = TimeDerivative
variable = mag_z
block = '1'
[../]
[./dllg_x_exch]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
block = '1'
[../]
[./dllg_y_exch]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
block = '1'
[../]
[./dllg_z_exch]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
block = '1'
[../]
[./d_HM_x]
type = MasterInteractionCartLLG
variable = mag_x
component = 0
block = '1'
[../]
[./d_HM_y]
type = MasterInteractionCartLLG
variable = mag_y
component = 1
block = '1'
[../]
[./d_HM_z]
type = MasterInteractionCartLLG
variable = mag_z
component = 2
block = '1'
[../]
[./llb1_x]
type = MasterLongitudinalLLB
variable = mag_x
component = 0
block = '1'
[../]
[./llb1_y]
type = MasterLongitudinalLLB
variable = mag_y
component = 1
block = '1'
[../]
[./llb1_z]
type = MasterLongitudinalLLB
variable = mag_z
component = 2
block = '1'
[../]
[./int_pot_lap]
type = Electrostatics
variable = potential_H_int
block = '1 2'
[../]
[./int_bc_pot_lap]
type = MagHStrongCart
variable = potential_H_int
block = '1'
[../]
[./infinite_domain]
type = MagneticPMLCart
variable = phi2
component = 1
block = '3'
[../]
[]
[BCs]
[./vacuum_box]
type = DirichletBC
variable = phi2
value = 0.
boundary = 'bottom'
[../]
[./other_boundaries]
type = DirichletBC
variable = potential_H_int
value = 0.
boundary = 'left right front back top '
[../]
[./boundarydirichlet]
type = CoupledDirichletBC
variable = phi2
coupled_var = potential_H_int
boundary = id_boundary
[]
[]
[Postprocessors]
[./dt]
type = TimestepSize
[../]
[./M1]
type = ElementAverageValue
variable = mag_s
execute_on = 'initial timestep_end final'
block = '1'
[../]
[./<mx>]
type = ElementAverageValue
variable = mag_x
execute_on = 'initial timestep_end final'
block = '1'
[../]
[./<my>]
type = ElementAverageValue
variable = mag_y
execute_on = 'initial timestep_end final'
block = '1'
[../]
[./<mz>]
type = ElementAverageValue
variable = mag_z
execute_on = 'initial timestep_end final'
block = '1'
[../]
[./Fexch]
type = MasterMagneticExchangeEnergy
energy_scale = 0.001
execute_on = 'initial timestep_end final'
block = '1'
[../]
[./Fdemag]
type = MagnetostaticEnergyCart
energy_scale = 0.001
execute_on = 'initial timestep_begin timestep_end final'
block = '1'
[../]
[./Fllb1]
type = MagneticExcessLLBEnergy
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
execute_on = 'initial timestep_end final'
block = '1'
[../]
[./Ftot]
type = LinearCombinationPostprocessor
pp_names = 'Fexch Fdemag'
pp_coefs = ' 1.0 1.0'
execute_on = 'initial timestep_end final'
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
petsc_options_iname = ' -ksp_gmres_restart -ksp_rtol -pc_type -sub_pc_type '
petsc_options_value = ' 100 1e-8 bjacobi ilu'
[../]
[]
[Executioner]
type = Transient
nl_abs_tol = 1e-12
nl_rel_tol = 1e-9
solve_type = 'NEWTON'
automatic_scaling = true
[./TimeIntegrator]
type = NewmarkBeta
[../]
dtmin = 1.e-5
dtmax = 1.e-3
end_time = 2
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 25
linear_iteration_ratio = 100
dt = 1e-4
growth_factor = 1.1
cutback_factor = 0.75
[../]
num_steps = 2
[../]
[Outputs]
print_linear_residuals = false
[pgraph]
type = PerfGraphOutput
execute_on = final
level = 2
[]
[./out]
type = Exodus
file_base = slab_PML_small_25_002
elemental_as_nodal = true
time_step_interval = 1
execute_on = 'initial timestep_end'
[../]
[./outCSV]
type = CSV
file_base = slab_PML_small_25_002
time_step_interval = 1
[../]
[]
(test/tests/magnets/sp6_2d.i)
[Mesh]
# SP6 2D benchmark: num_sectors = 80, rings = 50 (1 nm rings), relaxed (IterationAdaptiveDT, dtmax 0.01) until rms dm/dt < 1e-6 /ns.
[disk]
type = ConcentricCircleMeshGenerator
num_sectors = 6
radii = '50'
rings = '10'
has_outer_square = false
preserve_volumes = false
[]
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
g0 = 0.0002211
mu0 = 1.256637061e-06
Hscale = 1
dmi_type = interfacial
[]
[Materials]
[constants]
type = GenericConstantMaterial
prop_names = 'alpha Ms Ae D K1 nx ny nz'
prop_values = '1 860000 13000000 -3000000 400000 0 0 1'
[]
[]
[Variables]
[mag_x]
[InitialCondition]
type = FunctionIC
function = '(x/sqrt(x*x+y*y+1e-24)*(1-abs(2*exp(-(x*x+y*y)/625)-1)))/sqrt((1-abs(2*exp(-(x*x+y*y)/625)-1))^2*(x*x+y*y)/(x*x+y*y+1e-24)+(2*exp(-(x*x+y*y)/625)-1)^2)'
[]
[]
[mag_y]
[InitialCondition]
type = FunctionIC
function = '(y/sqrt(x*x+y*y+1e-24)*(1-abs(2*exp(-(x*x+y*y)/625)-1)))/sqrt((1-abs(2*exp(-(x*x+y*y)/625)-1))^2*(x*x+y*y)/(x*x+y*y+1e-24)+(2*exp(-(x*x+y*y)/625)-1)^2)'
[]
[]
[mag_z]
[InitialCondition]
type = FunctionIC
function = '(2*exp(-(x*x+y*y)/625)-1)/sqrt((1-abs(2*exp(-(x*x+y*y)/625)-1))^2*(x*x+y*y)/(x*x+y*y+1e-24)+(2*exp(-(x*x+y*y)/625)-1)^2)'
[]
[]
[]
[Correctors]
[unit_magnetization]
type = PointwiseRenormalizeVector
v = 'mag_x mag_y mag_z'
norm = 1
execute_on = 'timestep_end'
[]
[]
[Kernels]
[time_x]
type = TimeDerivative
variable = mag_x
[]
[time_y]
type = TimeDerivative
variable = mag_y
[]
[time_z]
type = TimeDerivative
variable = mag_z
[]
[exchange_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
[]
[exchange_y]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
[]
[exchange_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
[]
[dmi_x]
type = MasterDMICartLLG
variable = mag_x
component = 0
[]
[dmi_y]
type = MasterDMICartLLG
variable = mag_y
component = 1
[]
[dmi_z]
type = MasterDMICartLLG
variable = mag_z
component = 2
[]
[anisotropy_x]
type = MasterAnisotropyCartLLG
variable = mag_x
component = 0
[]
[anisotropy_y]
type = MasterAnisotropyCartLLG
variable = mag_y
component = 1
[]
[anisotropy_z]
type = MasterAnisotropyCartLLG
variable = mag_z
component = 2
[]
[]
[Postprocessors]
[mx]
type = ElementAverageValue
variable = mag_x
[]
[mz]
type = ElementAverageValue
variable = mag_z
[]
[E_exchange]
type = MasterMagneticExchangeEnergy
energy_scale = 2e-27
[]
[E_dmi]
type = MasterMagneticDMIEnergy
energy_scale = 2e-27
[]
[E_anisotropy]
type = MasterMagneticAnisotropyEnergy
energy_scale = 2e-27
[]
[E_total]
type = LinearCombinationPostprocessor
pp_names = 'E_exchange E_dmi E_anisotropy'
pp_coefs = '1 1 1'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-10
nl_abs_tol = 1e-12
dt = 0.005
num_steps = 10
[]
[Outputs]
file_base = out_sp6_2d
exodus = true
csv = true
[]
(test/tests/magnets/llb_helix.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 800
xmax = 54.45427266
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
g0 = 2.211e-4
mu0 = 1.2566370614e-6
dmi_type = bulk
[]
[Materials]
[constants]
type = GenericConstantMaterial
prop_names = 'alpha alpha_perp alpha_par Ms Ae D me chi_par'
prop_values = '1.0 0.7142857143 0.5714285714 860000 13000000 3000000 0.4680904102 1.87707808e-09'
[]
[]
[Variables]
[mag_x]
initial_condition = 0.01
[]
[mag_y]
[InitialCondition]
type = FunctionIC
function = '0.4680904102*cos(0.1153846154*x)'
[]
[]
[mag_z]
[InitialCondition]
type = FunctionIC
function = '0.4680904102*sin(0.1153846154*x)'
[]
[]
[]
[BCs]
[Periodic]
[all]
variable = 'mag_x mag_y mag_z'
auto_direction = x
[]
[]
[]
[AuxVariables]
[mm]
[]
[]
[AuxKernels]
[mm]
type = ParsedAux
variable = mm
coupled_variables = 'mag_x mag_y mag_z'
expression = 'sqrt(mag_x^2 + mag_y^2 + mag_z^2)'
[]
[]
[Kernels]
[time_x]
type = TimeDerivative
variable = mag_x
[]
[time_y]
type = TimeDerivative
variable = mag_y
[]
[time_z]
type = TimeDerivative
variable = mag_z
[]
[MasterExchangeCartLLG_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
llb = true
[]
[MasterExchangeCartLLG_y]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
llb = true
[]
[MasterExchangeCartLLG_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
llb = true
[]
[MasterDMICartLLG_x]
type = MasterDMICartLLG
variable = mag_x
component = 0
llb = true
[]
[MasterDMICartLLG_y]
type = MasterDMICartLLG
variable = mag_y
component = 1
llb = true
[]
[MasterDMICartLLG_z]
type = MasterDMICartLLG
variable = mag_z
component = 2
llb = true
[]
[MasterLongitudinalLLB_x]
type = MasterLongitudinalLLB
variable = mag_x
component = 0
form = llb
temperature = 600
Tc = 700
[]
[MasterLongitudinalLLB_y]
type = MasterLongitudinalLLB
variable = mag_y
component = 1
form = llb
temperature = 600
Tc = 700
[]
[MasterLongitudinalLLB_z]
type = MasterLongitudinalLLB
variable = mag_z
component = 2
form = llb
temperature = 600
Tc = 700
[]
[]
[Postprocessors]
[sim_time]
type = TimePostprocessor
[]
[m_avg]
type = ElementAverageValue
variable = mm
[]
[E_ex]
type = MasterMagneticExchangeEnergy
[]
[E_dmi]
type = MasterMagneticDMIEnergy
[]
[shift_rel]
type = ParsedPostprocessor
expression = '(m_avg/0.4680904102 - 1)/0.0006010528864'
pp_names = 'm_avg'
[]
[dens_rel]
type = ParsedPostprocessor
expression = '(E_ex + E_dmi)/54.45427266/(-173076.9231*m_avg*m_avg)'
pp_names = 'E_ex E_dmi m_avg'
[]
[]
[UserObjects]
[assert]
type = Terminator
expression = 'sim_time > 1.0 & (abs(shift_rel - 1) > 0.02 | abs(dens_rel - 1) > 1e-4)'
fail_mode = HARD
error_level = ERROR
message = 'LLB bulk-DMI helix: |m| shift or energy density differs from the analytic LLB result'
execute_on = 'timestep_end'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
scheme = bdf2
end_time = 1.2
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-5
growth_factor = 1.3
optimal_iterations = 8
[]
dtmax = 0.05
nl_abs_tol = 1e-10
nl_rel_tol = 1e-8
nl_rel_step_tol = 1e-12
line_search = none
nl_forced_its = 1
[]
[Outputs]
file_base = out_llb_helix
csv = true
[]
(test/tests/magnets/sp6_3d.i)
[Mesh]
# SP6 3D benchmark: num_sectors = 72, rings = 46, num_layers = 21 (~1-2 nm), relaxed (IterationAdaptiveDT, dtmax 0.003) until rms dm/dt < 1e-6 /ns.
[disk]
type = ConcentricCircleMeshGenerator
num_sectors = 4
radii = '91.5'
rings = '8'
has_outer_square = false
preserve_volumes = false
[]
[cylinder]
type = AdvancedExtruderGenerator
input = disk
heights = '21'
num_layers = '3'
direction = '0 0 1'
[]
[center]
type = TransformGenerator
input = cylinder
transform = TRANSLATE
vector_value = '0 0 -10.5'
[]
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
g0 = 0.0002211
mu0 = 1.256637061e-06
Hscale = 1
dmi_type = bulk
potential_H_int = potential_H_int
Hext_x = Hext_x
Hext_y = Hext_y
Hext_z = Hext_z
[]
[Materials]
[constants]
type = GenericConstantMaterial
prop_names = 'alpha Ms Ae D'
prop_values = '1 384000 8780000 1580000'
[]
[]
[Variables]
[mag_x]
[InitialCondition]
type = FunctionIC
function = '(-y/sqrt(x*x+y*y+1e-24)*(1-abs((1-2*exp(-(x*x+y*y)/1296)))))/sqrt((1-abs((1-2*exp(-(x*x+y*y)/1296))))^2*(x*x+y*y)/(x*x+y*y+1e-24)+(1-2*exp(-(x*x+y*y)/1296))^2)'
[]
[]
[mag_y]
[InitialCondition]
type = FunctionIC
function = '(x/sqrt(x*x+y*y+1e-24)*(1-abs((1-2*exp(-(x*x+y*y)/1296)))))/sqrt((1-abs((1-2*exp(-(x*x+y*y)/1296))))^2*(x*x+y*y)/(x*x+y*y+1e-24)+(1-2*exp(-(x*x+y*y)/1296))^2)'
[]
[]
[mag_z]
[InitialCondition]
type = FunctionIC
function = '(1-2*exp(-(x*x+y*y)/1296))/sqrt((1-abs((1-2*exp(-(x*x+y*y)/1296))))^2*(x*x+y*y)/(x*x+y*y+1e-24)+(1-2*exp(-(x*x+y*y)/1296))^2)'
[]
[]
[]
[AuxVariables]
[potential_H_int]
[]
[Hext_x]
[]
[Hext_y]
[]
[Hext_z]
initial_condition = 318309.8862
[]
[]
[Correctors]
[unit_magnetization]
type = PointwiseRenormalizeVector
v = 'mag_x mag_y mag_z'
norm = 1
execute_on = 'timestep_end'
[]
[]
[Kernels]
[time_x]
type = TimeDerivative
variable = mag_x
[]
[time_y]
type = TimeDerivative
variable = mag_y
[]
[time_z]
type = TimeDerivative
variable = mag_z
[]
[exchange_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
[]
[exchange_y]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
[]
[exchange_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
[]
[dmi_x]
type = MasterDMICartLLG
variable = mag_x
component = 0
[]
[dmi_y]
type = MasterDMICartLLG
variable = mag_y
component = 1
[]
[dmi_z]
type = MasterDMICartLLG
variable = mag_z
component = 2
[]
[zeeman_x]
type = MasterInteractionCartLLGHConst
variable = mag_x
component = 0
[]
[zeeman_y]
type = MasterInteractionCartLLGHConst
variable = mag_y
component = 1
[]
[zeeman_z]
type = MasterInteractionCartLLGHConst
variable = mag_z
component = 2
[]
[]
[Postprocessors]
[mx]
type = ElementAverageValue
variable = mag_x
[]
[mz]
type = ElementAverageValue
variable = mag_z
[]
[E_exchange]
type = MasterMagneticExchangeEnergy
energy_scale = 1e-27
[]
[E_dmi]
type = MasterMagneticDMIEnergy
energy_scale = 1e-27
[]
[E_zeeman]
type = MasterMagneticZeemanEnergyCart
energy_scale = 1e-27
[]
[E_total]
type = LinearCombinationPostprocessor
pp_names = 'E_exchange E_dmi E_zeeman'
pp_coefs = '1 1 1'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-10
nl_abs_tol = 1e-12
dt = 0.005
num_steps = 5
[]
[Outputs]
file_base = out_sp6_3d
exodus = true
csv = true
[]
(test/tests/magnets/sp1.i)
[Mesh]
# Scaled-down mesh for a fast regression test. For the actual muMAG SP1 benchmark use 20 nm
# in-plane film cells and a graded vacuum, e.g. ix = '8 6 50 6 8', iy = '8 6 100 6 8',
# iz = '8 6 2 6 8' with dz = '300.0 7.0 3.517533 7.0 300.0'.
[box]
type = CartesianMeshGenerator
dim = 3
dx = '500.0 35.2 175.876674 35.2 500.0'
dy = '500.0 35.2 351.753349 35.2 500.0'
dz = '300.0 7.0 3.517533 7.0 300.0'
ix = '2 1 5 1 2'
iy = '2 1 10 1 2'
iz = '2 1 1 1 2'
[]
[center]
type = TransformGenerator
input = box
transform = TRANSLATE
vector_value = '-623.138337 -711.076675 -308.758767'
[]
[film_block]
type = ParsedSubdomainMeshGenerator
input = center
block_id = 1
combinatorial_geometry = 'x >= -87.938337 & x <= 87.938337 & y >= -175.876675 & y <= 175.876675 & z >= -1.758767 & z <= 1.758767'
[]
[block_names]
type = RenameBlockGenerator
input = film_block
old_block = '0 1'
new_block = 'vacuum film'
[]
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
potential_H_int = potential_H_int
Hext_x = Hext_x
Hext_y = Hext_y
Hext_z = Hext_z
mu0 = 1.256637
g0 = 140.206695
Hscale = 1.0
[]
[Variables]
[mag_x]
block = film
[InitialCondition]
type = ConstantIC
value = 0.0
[]
[]
[mag_y]
block = film
[InitialCondition]
type = ConstantIC
value = 1.0
[]
[]
[mag_z]
block = film
[InitialCondition]
type = ConstantIC
value = 0.0
[]
[]
[potential_H_int]
block = 'film vacuum'
[]
[]
[AuxVariables]
[mag_s]
block = film
[]
[Hext_x]
block = film
[InitialCondition]
type = ConstantIC
value = 0.06273559
[]
[]
[Hext_y]
block = film
[InitialCondition]
type = ConstantIC
value = 0.00109505
[]
[]
[Hext_z]
block = film
[]
[]
[AuxKernels]
[mag_norm]
type = VectorMagnitudeAux
variable = mag_s
x = mag_x
y = mag_y
z = mag_z
block = film
execute_on = 'initial timestep_end'
[]
[]
[Materials]
[film_properties]
type = GenericConstantMaterial
prop_names = 'alpha Ae Ms permittivity K1 nx ny nz'
prop_values = '1.0 1.0 1.261566 1.0 0.001243 0 1 0'
block = film
[]
[vacuum_properties]
type = GenericConstantMaterial
prop_names = 'Ms permittivity'
prop_values = '0.0 1.0'
block = vacuum
[]
[]
[Kernels]
[mag_x_time]
type = TimeDerivative
variable = mag_x
block = film
[]
[mag_y_time]
type = TimeDerivative
variable = mag_y
block = film
[]
[mag_z_time]
type = TimeDerivative
variable = mag_z
block = film
[]
[exchange_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
block = film
[]
[exchange_y]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
block = film
[]
[exchange_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
block = film
[]
[anisotropy_x]
type = MasterAnisotropyCartLLG
variable = mag_x
component = 0
block = film
[]
[anisotropy_y]
type = MasterAnisotropyCartLLG
variable = mag_y
component = 1
block = film
[]
[anisotropy_z]
type = MasterAnisotropyCartLLG
variable = mag_z
component = 2
block = film
[]
[field_x]
type = MasterInteractionCartLLGHConst
variable = mag_x
component = 0
block = film
[]
[field_y]
type = MasterInteractionCartLLGHConst
variable = mag_y
component = 1
block = film
[]
[field_z]
type = MasterInteractionCartLLGHConst
variable = mag_z
component = 2
block = film
[]
[magnetostatic_laplace]
type = Electrostatics
variable = potential_H_int
block = 'film vacuum'
[]
[magnetostatic_source]
type = MagHStrongCart
variable = potential_H_int
block = film
[]
[]
[BCs]
[outer_vacuum]
type = DirichletBC
variable = potential_H_int
boundary = '0 1 2 3 4 5'
value = 0.0
[]
[]
[Postprocessors]
[mx]
type = ElementAverageValue
variable = mag_x
block = film
[]
[my]
type = ElementAverageValue
variable = mag_y
block = film
[]
[mz]
type = ElementAverageValue
variable = mag_z
block = film
[]
[mag_norm_min]
type = NodalExtremeValue
variable = mag_s
value_type = min
block = film
[]
[Fexch]
type = MasterMagneticExchangeEnergy
energy_scale = 1.0
block = film
[]
[Faniso]
type = MasterMagneticAnisotropyEnergy
energy_scale = 1.0
block = film
[]
[Fdemag]
type = MagnetostaticEnergyCart
energy_scale = 1.0
block = film
[]
[Fzeeman]
type = MasterMagneticZeemanEnergyCart
energy_scale = 1.0
block = film
[]
[]
[UserObjects]
[renormalize]
type = PointwiseRenormalizeVector
v = 'mag_x mag_y mag_z'
execute_on = timestep_end
force_preaux = true
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
scheme = implicit-euler
petsc_options_iname = '-pc_type -snes_atol -snes_rtol'
petsc_options_value = 'lu 1e-8 1e-8'
dt = 0.05
num_steps = 5
[]
[Outputs]
file_base = out_sp1
exodus = true
csv = true
[]
(test/tests/magnets/sp6_1d.i)
[Mesh]
# SP6 1D benchmark: nx = 100 (h = 1 nm), relaxed (IterationAdaptiveDT, dtmax 0.01) until rms dm/dt < 1e-6 /ns.
[wire]
type = GeneratedMeshGenerator
dim = 1
nx = 25
xmin = -50
xmax = 50
[]
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
g0 = 0.0002211
mu0 = 1.256637061e-06
Hscale = 1
dmi_type = interfacial
[]
[Materials]
[constants]
type = GenericConstantMaterial
prop_names = 'alpha Ms Ae D K1 nx ny nz'
prop_values = '1 860000 13000000 -3000000 400000 0 0 1'
[]
[]
[Variables]
[mag_x]
initial_condition = 0
[]
[mag_y]
initial_condition = 0
[]
[mag_z]
initial_condition = 1
[]
[]
[Correctors]
[unit_magnetization]
type = PointwiseRenormalizeVector
v = 'mag_x mag_y mag_z'
norm = 1
execute_on = 'timestep_end'
[]
[]
[Kernels]
[time_x]
type = TimeDerivative
variable = mag_x
[]
[time_y]
type = TimeDerivative
variable = mag_y
[]
[time_z]
type = TimeDerivative
variable = mag_z
[]
[exchange_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
[]
[exchange_y]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
[]
[exchange_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
[]
[dmi_x]
type = MasterDMICartLLG
variable = mag_x
component = 0
[]
[dmi_y]
type = MasterDMICartLLG
variable = mag_y
component = 1
[]
[dmi_z]
type = MasterDMICartLLG
variable = mag_z
component = 2
[]
[anisotropy_x]
type = MasterAnisotropyCartLLG
variable = mag_x
component = 0
[]
[anisotropy_y]
type = MasterAnisotropyCartLLG
variable = mag_y
component = 1
[]
[anisotropy_z]
type = MasterAnisotropyCartLLG
variable = mag_z
component = 2
[]
[]
[Postprocessors]
[mx]
type = ElementAverageValue
variable = mag_x
[]
[mz]
type = ElementAverageValue
variable = mag_z
[]
[E_exchange]
type = MasterMagneticExchangeEnergy
energy_scale = 1e-27
[]
[E_dmi]
type = MasterMagneticDMIEnergy
energy_scale = 1e-27
[]
[E_anisotropy]
type = MasterMagneticAnisotropyEnergy
energy_scale = 1e-27
[]
[E_total]
type = LinearCombinationPostprocessor
pp_names = 'E_exchange E_dmi E_anisotropy'
pp_coefs = '1 1 1'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-10
nl_abs_tol = 1e-12
dt = 0.01
num_steps = 10
[]
[Outputs]
file_base = out_sp6_1d
exodus = true
csv = true
[]
(test/tests/magnets/mag_brick.i)
[Mesh]
[./fmg]
type = FileMeshGenerator
file = exodus_dx2_x10_y10_z30_b100.e
[]
[central_interface]
type = SideSetsBetweenSubdomainsGenerator
input = fmg
master_block = '1'
paired_block = '2'
primary_block = '1'
new_boundary = '70'
[]
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
potential_H_int = potential_H_int
[]
[Materials]
[./constants]
type = GenericConstantMaterial
prop_names = ' alpha Ae Ms g0 mu0 nx ny nz '
prop_values = '0.01 0.013 1.2 221010.0 1256.64 0 1 1 '
[../]
[./a_long]
type = GenericFunctionMaterial
prop_names = 'alpha_long'
prop_values = 'bc_func_1'
[../]
[./aniso]
type = GenericConstantMaterial
prop_names = 'K1 K2'
prop_values = '-20.0 0'
[../]
[./permitivitty_1]
type = GenericConstantMaterial
prop_names = 'permittivity'
prop_values = '1.0'
block = '1 2'
[../]
[]
[Functions]
[./bc_func_1]
type = ParsedFunction
expression = 'st'
symbol_names = 'st'
symbol_values = '1e3'
[../]
[]
[Variables]
[./mag_x]
order = FIRST
family = LAGRANGE
block = '1'
[./InitialCondition]
type = RandomConstrainedVectorFieldIC
phi = azimuth_phi
theta = polar_theta
M0s = 1.0
component = 0
[../]
[../]
[./mag_y]
order = FIRST
family = LAGRANGE
block = '1'
[./InitialCondition]
type = RandomConstrainedVectorFieldIC
phi = azimuth_phi
theta = polar_theta
M0s = 1.0
component = 1
[../]
[../]
[./mag_z]
order = FIRST
family = LAGRANGE
block = '1'
[./InitialCondition]
type = RandomConstrainedVectorFieldIC
phi = azimuth_phi
theta = polar_theta
M0s = 1.0
component = 2
[../]
[../]
[./potential_H_int]
order = FIRST
family = LAGRANGE
block = '1 2'
[../]
[]
[AuxVariables]
[./azimuth_phi]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = RandomIC
min = 0.3
max = 0.31
seed = 2
[../]
[../]
[./polar_theta]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = RandomIC
min = 1.4
max = 1.41
seed = 37
[../]
[../]
[./mag_s]
order = FIRST
family = LAGRANGE
block = '1'
[../]
[./H_x]
order = CONSTANT
family = MONOMIAL
block = '1 2'
[../]
[./H_y]
order = CONSTANT
family = MONOMIAL
block = '1 2'
[../]
[./H_z]
order = CONSTANT
family = MONOMIAL
block = '1 2'
[../]
[./azimuth_phi_mag_min1]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = RandomIC
min = 0.0
max = 0.00001
seed = 2
[../]
[../]
[./polar_theta_mag_min1]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = RandomIC
min = 0.0
max = 0.00001
seed = 37
[../]
[../]
[]
[AuxKernels]
[./mag_mag]
type = VectorMagnitudeAux
variable = mag_s
x = mag_x
y = mag_y
z = mag_z
block = '1'
execute_on = 'timestep_end final'
[../]
[./hxo]
type = DemagFieldAux
component = 0
variable = H_x
block = '1 2'
execute_on = 'timestep_end final'
[../]
[./hyo]
type = DemagFieldAux
component = 1
variable = H_y
block = '1 2'
execute_on = 'timestep_end final'
[../]
[./hzo]
type = DemagFieldAux
component = 2
variable = H_z
block = '1 2'
execute_on = 'timestep_end final'
[../]
[]
[Kernels]
[./mag_x_time]
type = TimeDerivative
variable = mag_x
block = '1'
[../]
[./mag_y_time]
type = TimeDerivative
variable = mag_y
block = '1'
[../]
[./mag_z_time]
type = TimeDerivative
variable = mag_z
block = '1'
[../]
[./dllg_x_exch]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
[../]
[./dllg_y_exch]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
[../]
[./dllg_z_exch]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
[../]
[./d_aM_x]
type = MasterAnisotropyCartLLG
variable = mag_x
component = 0
[../]
[./d_aM_y]
type = MasterAnisotropyCartLLG
variable = mag_y
component = 1
[../]
[./d_aM_z]
type = MasterAnisotropyCartLLG
variable = mag_z
component = 2
[../]
[./d_HM_x]
type = MasterInteractionCartLLG
variable = mag_x
component = 0
[../]
[./d_HM_y]
type = MasterInteractionCartLLG
variable = mag_y
component = 1
[../]
[./d_HM_z]
type = MasterInteractionCartLLG
variable = mag_z
component = 2
[../]
[./int_pot_lap]
type = Electrostatics
variable = potential_H_int
block = '1 2'
[../]
[./int_bc_pot_lap]
type = MagHStrongCart
variable = potential_H_int
block = '1'
[../]
[./llb_x]
type = MasterLongitudinalLLB
variable = mag_x
component = 0
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
[../]
[./llb_y]
type = MasterLongitudinalLLB
variable = mag_y
component = 1
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
[../]
[./llb_z]
type = MasterLongitudinalLLB
variable = mag_z
component = 2
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
[../]
[]
[BCs]
[./bc_int_pot_boundary]
type = DirichletBC
variable = potential_H_int
value = 0.0
boundary = '1 2 3 4 5 6'
[../]
[./bc_surface_mag_x]
type = NeumannBC
variable = mag_x
value = 0.0
boundary = '70'
[../]
[./bc_surface_mag_y]
type = NeumannBC
variable = mag_y
value = 0.0
boundary = '70'
[../]
[./bc_surface_mag_z]
type = NeumannBC
variable = mag_z
value = 0.0
boundary = '70'
[../]
[]
[Postprocessors]
[./dt]
type = TimestepSize
[../]
[./<M>]
type = ElementAverageValue
variable = mag_s
block = '1'
execute_on = 'initial timestep_end final'
[../]
[./<mx>]
type = ElementAverageValue
variable = mag_x
block = '1'
execute_on = 'initial timestep_end final'
[../]
[./<my>]
type = ElementAverageValue
variable = mag_y
block = '1'
execute_on = 'initial timestep_end final'
[../]
[./<mz>]
type = ElementAverageValue
variable = mag_z
block = '1'
execute_on = 'initial timestep_end final'
[../]
[./Fa]
type = MasterMagneticAnisotropyEnergy
execute_on = 'initial timestep_end final'
block = '1'
energy_scale = 6241.51
[../]
[./Fexch]
type = MasterMagneticExchangeEnergy
execute_on = 'timestep_end final'
block = '1'
energy_scale = 6241.51
[../]
[./Fdemag]
type = MagnetostaticEnergyCart
execute_on = 'timestep_end final'
block = '1'
energy_scale = 6241.51
[../]
[./Fllb]
type = MagneticExcessLLBEnergy
execute_on = 'timestep_end final'
block = '1'
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
[../]
[./Ftot]
type = LinearCombinationPostprocessor
pp_names = 'Fexch Fdemag Fa'
pp_coefs = ' 1.0 1.0 1.0'
execute_on = 'timestep_end final'
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
petsc_options_iname = ' -ksp_gmres_restart -snes_atol -snes_rtol -ksp_rtol -pc_type'
petsc_options_value = ' 121 1e-8 1e-8 1e-5 bjacobi'
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
[./TimeIntegrator]
type = ImplicitEuler
[../]
dtmin = 1e-12
dtmax = 1.0e-2
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 10
linear_iteration_ratio = 100
dt = 1.0e-8
[../]
verbose = true
num_steps = 2
[]
[Outputs]
print_linear_residuals = false
[./out]
type = Exodus
file_base = out_mag_brick
elemental_as_nodal = true
time_step_interval = 1
[../]
[./outCSV]
type = CSV
file_base = out_mag_brick
[../]
[]
(test/tests/spin_waves/afm_skyr_modes.i)
# AFM skyrmion eigenmodes (SP8; Kravchuk et al., PRB 99, 184429 (2019)): two sublattices, interfacial DMI, field along z,
# undamped NewmarkBeta ring-down of a deformed Neel skyrmion (mu = 0 + mu = 2 kick), reduced units ell = Hsf = gamma = 1,
# xi = 0.05, delta = 0.9, h = 0.1 (Ae = xi/2, D = 2 delta xi/pi, Ha = xi, He = 1/(2 xi), H0 = h).
# To scale to the benchmark: radii = '9 25', rings = '180 80', num_sectors = 40; start from the state relaxed by the same
# kernels (alpha = 0.02, implicit Euler, PointwiseRenormalizeVector) and kick it; run dt = 0.25 to t = 300 and fit the
# frequencies of int n_z cos(mu phi) dA (LFB mu = 0: 0.1508, mu = +-2: 0.4411 / 0.4301 at h = 0.1).
[Mesh]
[disk]
type = ConcentricCircleMeshGenerator
num_sectors = 4
radii = '4 8'
rings = '8 4'
has_outer_square = false
preserve_volumes = false
[]
[]
[GlobalParams]
mag1_x = mag1_x
mag1_y = mag1_y
mag1_z = mag1_z
mag2_x = mag2_x
mag2_y = mag2_y
mag2_z = mag2_z
dmi_type = interfacial
[]
[Materials]
[constants]
type = GenericConstantMaterial
prop_names = 'alpha Ms g0 Ae D He Ha H0'
prop_values = '0.0 1.0 1.0 0.025 0.0286478897565 10 0.05 0.1'
[]
[]
[Functions]
[nx]
type = ParsedFunction
expression = 'r := sqrt(x*x + y*y + 1e-24); R := 2.5*(1.01 + 0.02*(x*x - y*y)/(r*r)); x/r/cosh(r - R)'
[]
[ny]
type = ParsedFunction
expression = 'r := sqrt(x*x + y*y + 1e-24); R := 2.5*(1.01 + 0.02*(x*x - y*y)/(r*r)); y/r/cosh(r - R)'
[]
[nz]
type = ParsedFunction
expression = 'r := sqrt(x*x + y*y + 1e-24); R := 2.5*(1.01 + 0.02*(x*x - y*y)/(r*r)); tanh(r - R)'
[]
[mnx]
type = ParsedFunction
symbol_names = 'f'
symbol_values = 'nx'
expression = '-f'
[]
[mny]
type = ParsedFunction
symbol_names = 'f'
symbol_values = 'ny'
expression = '-f'
[]
[mnz]
type = ParsedFunction
symbol_names = 'f'
symbol_values = 'nz'
expression = '-f'
[]
[]
[Variables]
[mag1_x]
[InitialCondition]
type = FunctionIC
function = nx
[]
[]
[mag1_y]
[InitialCondition]
type = FunctionIC
function = ny
[]
[]
[mag1_z]
[InitialCondition]
type = FunctionIC
function = nz
[]
[]
[mag2_x]
[InitialCondition]
type = FunctionIC
function = mnx
[]
[]
[mag2_y]
[InitialCondition]
type = FunctionIC
function = mny
[]
[]
[mag2_z]
[InitialCondition]
type = FunctionIC
function = mnz
[]
[]
[]
[Kernels]
[t1x]
type = TimeDerivative
variable = mag1_x
[]
[ex1x]
type = MasterExchangeCartLLG
variable = mag1_x
component = 0
mag_x = mag1_x
mag_y = mag1_y
mag_z = mag1_z
[]
[dmi1x]
type = MasterDMICartLLG
variable = mag1_x
component = 0
mag_x = mag1_x
mag_y = mag1_y
mag_z = mag1_z
[]
[afm1x]
type = UniaxialAFMSublattice
variable = mag1_x
mag_sub = 0
component = 0
[]
[t1y]
type = TimeDerivative
variable = mag1_y
[]
[ex1y]
type = MasterExchangeCartLLG
variable = mag1_y
component = 1
mag_x = mag1_x
mag_y = mag1_y
mag_z = mag1_z
[]
[dmi1y]
type = MasterDMICartLLG
variable = mag1_y
component = 1
mag_x = mag1_x
mag_y = mag1_y
mag_z = mag1_z
[]
[afm1y]
type = UniaxialAFMSublattice
variable = mag1_y
mag_sub = 0
component = 1
[]
[t1z]
type = TimeDerivative
variable = mag1_z
[]
[ex1z]
type = MasterExchangeCartLLG
variable = mag1_z
component = 2
mag_x = mag1_x
mag_y = mag1_y
mag_z = mag1_z
[]
[dmi1z]
type = MasterDMICartLLG
variable = mag1_z
component = 2
mag_x = mag1_x
mag_y = mag1_y
mag_z = mag1_z
[]
[afm1z]
type = UniaxialAFMSublattice
variable = mag1_z
mag_sub = 0
component = 2
[]
[t2x]
type = TimeDerivative
variable = mag2_x
[]
[ex2x]
type = MasterExchangeCartLLG
variable = mag2_x
component = 0
mag_x = mag2_x
mag_y = mag2_y
mag_z = mag2_z
[]
[dmi2x]
type = MasterDMICartLLG
variable = mag2_x
component = 0
mag_x = mag2_x
mag_y = mag2_y
mag_z = mag2_z
[]
[afm2x]
type = UniaxialAFMSublattice
variable = mag2_x
mag_sub = 1
component = 0
[]
[t2y]
type = TimeDerivative
variable = mag2_y
[]
[ex2y]
type = MasterExchangeCartLLG
variable = mag2_y
component = 1
mag_x = mag2_x
mag_y = mag2_y
mag_z = mag2_z
[]
[dmi2y]
type = MasterDMICartLLG
variable = mag2_y
component = 1
mag_x = mag2_x
mag_y = mag2_y
mag_z = mag2_z
[]
[afm2y]
type = UniaxialAFMSublattice
variable = mag2_y
mag_sub = 1
component = 1
[]
[t2z]
type = TimeDerivative
variable = mag2_z
[]
[ex2z]
type = MasterExchangeCartLLG
variable = mag2_z
component = 2
mag_x = mag2_x
mag_y = mag2_y
mag_z = mag2_z
[]
[dmi2z]
type = MasterDMICartLLG
variable = mag2_z
component = 2
mag_x = mag2_x
mag_y = mag2_y
mag_z = mag2_z
[]
[afm2z]
type = UniaxialAFMSublattice
variable = mag2_z
mag_sub = 1
component = 2
[]
[]
[Correctors]
[unit_m1]
type = PointwiseRenormalizeVector
v = 'mag1_x mag1_y mag1_z'
norm = 1
execute_on = 'initial timestep_end'
force_preaux = true
[]
[unit_m2]
type = PointwiseRenormalizeVector
v = 'mag2_x mag2_y mag2_z'
norm = 1
execute_on = 'initial timestep_end'
force_preaux = true
[]
[]
[AuxVariables]
[n_z]
[]
[nzc2]
[]
[m_z]
[]
[]
[AuxKernels]
[n_z]
type = ParsedAux
enable_jit = false
variable = n_z
coupled_variables = 'mag1_z mag2_z'
expression = '(mag1_z - mag2_z)/2'
execute_on = 'initial timestep_end'
[]
[nzc2]
type = ParsedAux
enable_jit = false
variable = nzc2
coupled_variables = 'mag1_z mag2_z'
use_xyzt = true
expression = '(mag1_z - mag2_z)/2*(x*x - y*y)/(x*x + y*y + 1e-24)'
execute_on = 'initial timestep_end'
[]
[m_z]
type = ParsedAux
enable_jit = false
variable = m_z
coupled_variables = 'mag1_z mag2_z'
expression = '(mag1_z + mag2_z)/2'
execute_on = 'initial timestep_end'
[]
[]
[Postprocessors]
[nz_int]
type = ElementIntegralVariablePostprocessor
variable = n_z
execute_on = 'initial timestep_end'
[]
[nzc2_int]
type = ElementIntegralVariablePostprocessor
variable = nzc2
execute_on = 'initial timestep_end'
[]
[mz_int]
type = ElementIntegralVariablePostprocessor
variable = m_z
execute_on = 'initial timestep_end'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-10
nl_abs_tol = 1e-12
[TimeIntegrator]
type = NewmarkBeta
[]
dt = 0.25
num_steps = 5
[]
[Outputs]
file_base = out_afm_skyr_modes
csv = true
[]
(tutorial/ringdown.i)
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
potential_H_int = potential_H_int
g0 = 1.0
Hscale = 0.004519239
mu0 = 1.256637e-06
[]
alphadef = 0.02
[Mesh]
[./mesh]
type = GeneratedMeshGenerator
dim = 3
nx = 50
ny = 50
nz = 10
xmin = -50
xmax = 50
ymin = -50
ymax = 50
zmin = -10
zmax = 10
[../]
[./vacuum_box]
type = SubdomainBoundingBoxGenerator
input = mesh
bottom_left = '-50 -50 -10'
top_right = '50 50 10'
block_id = 2
block_name = vacuum
[../]
[./brick]
type = SubdomainBoundingBoxGenerator
input = vacuum_box
bottom_left = '-10 -10 -1.5'
top_right = '10 10 1.5'
block_id = 1
block_name = brick
[../]
[../]
[Materials]
############################################################################
##
## material constants used.
##
############################################################################
[./constants]
type = GenericConstantMaterial
prop_names = ' alpha permittivity Ae Ms'
prop_values = '${alphadef} 1.0 1.3e-05 1.2'
block = '1'
[../]
[./a_long]
type = GenericFunctionMaterial
prop_names = 'alpha_long'
prop_values = 'bc_func_1'
block = '1'
[../]
[./constantsv]
type = GenericConstantMaterial
prop_names = ' alpha permittivity Ae Ms'
prop_values = '1 1.0 1.3e-05 .0'
block = '2'
[../]
[./a_longv]
type = GenericFunctionMaterial
prop_names = 'alpha_long'
prop_values = 'bc_func_1'
block = '2'
[../]
[]
[Functions]
[./bc_func_1]
type = ParsedFunction
expression = 'st'
symbol_names = 'st'
symbol_values = '1.e1' #3?
[../]
[]
[Variables]
[./mag_x]
order = FIRST
family = LAGRANGE
block = '1'
[./InitialCondition]
type = RandomConstrainedVectorFieldIC
phi = azimuth_phi
theta = polar_theta
M0s = 1.0 #amplitude of the RandomConstrainedVectorFieldIC
component = 0
[../]
[../]
[./mag_y]
order = FIRST
family = LAGRANGE
block = '1'
[./InitialCondition]
type = RandomConstrainedVectorFieldIC
phi = azimuth_phi
theta = polar_theta
M0s = 1.0
component = 1
[../]
[../]
[./mag_z]
order = FIRST
family = LAGRANGE
block= '1'
[./InitialCondition]
type = RandomConstrainedVectorFieldIC
phi = azimuth_phi
theta = polar_theta
M0s = 1.0
component = 2
[../]
[../]
[./potential_H_int]
order = FIRST
family = LAGRANGE
block = '1 2'
[../]
[]
[AuxVariables]
#--------------------------------------------#
# #
# field to seed IC that obeys constraint #
# #
#--------------------------------------------#
[./azimuth_phi]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = RandomIC
min = 0.
max = 0.01
seed = 2
[../]
[../]
[./polar_theta]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = RandomIC
min = 1.5708
max = 1.5709
seed = 37
[../]
[../]
[./mag_s]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
#---------------------------------------#
# #
# Time dependence #
# #
#---------------------------------------#
[./mag_x_time]
type = TimeDerivative
variable = mag_x
block = '1'
[../]
[./mag_y_time]
type = TimeDerivative
variable = mag_y
block = '1'
[../]
[./mag_z_time]
type = TimeDerivative
variable = mag_z
block = '1'
[../]
#---------------------------------------#
# #
# Local magnetic exchange #
# #
#---------------------------------------#
[./dllg_x_exch]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
block = '1'
[../]
[./dllg_y_exch]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
block = '1'
[../]
[./dllg_z_exch]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
block = '1'
[../]
#---------------------------------------#
# #
# demagnetization field #
# #
#---------------------------------------#
[./d_HM_x]
type = MasterInteractionCartLLG
variable = mag_x
component = 0
block = '1'
[../]
[./d_HM_y]
type = MasterInteractionCartLLG
variable = mag_y
component = 1
block = '1'
[../]
[./d_HM_z]
type = MasterInteractionCartLLG
variable = mag_z
component = 2
block = '1'
[../]
#---------------------------------------#
# #
# LLB constraint terms #
# #
#---------------------------------------#
[./llb1_x]
type = MasterLongitudinalLLB
variable = mag_x
component = 0
block = '1'
[../]
[./llb1_y]
type = MasterLongitudinalLLB
variable = mag_y
component = 1
block = '1'
[../]
[./llb1_z]
type = MasterLongitudinalLLB
variable = mag_z
component = 2
block = '1'
[../]
#---------------------------------------#
# #
# Magnetostatic Poisson equation #
# #
#---------------------------------------#
[./int_pot_lap]
type = Electrostatics
variable = potential_H_int
block = '1 2'
[../]
[./int_bc_pot_lap]
type = MagHStrongCart
variable = potential_H_int
block = '1'
[../]
[]
[BCs]
[./vacuum_box]
type = DirichletBC
value = 0.
variable = potential_H_int
boundary = '0 1 2 3 4 5'
[../]
[]
[Postprocessors]
[./dt]
type = TimestepSize
[../]
#---------------------------------------#
# #
# Average M = |m| #
# #
#---------------------------------------#
[./M1]
type = ElementAverageValue
variable = mag_s
execute_on = 'initial timestep_end final'
block = '1'
[../]
[./<mx>]
type = ElementAverageValue
variable = mag_x
execute_on = 'initial timestep_end final'
block = '1'
[../]
[./<my>]
type = ElementAverageValue
variable = mag_y
execute_on = 'initial timestep_end final'
block = '1'
[../]
[./<mz>]
type = ElementAverageValue
variable = mag_z
execute_on = 'initial timestep_end final'
block = '1'
[../]
#---------------------------------------#
# #
# Calculate exchange energy of #
# the magnetic body #
# #
#---------------------------------------#
[./Fexch]
type = MasterMagneticExchangeEnergy
energy_scale = 0.001 #converts results to eV
execute_on = 'initial timestep_end final'
block = '1'
[../]
#---------------------------------------#
# #
# Calculate demagnetization energy #
# of the magnetic body #
# #
#---------------------------------------#
[./Fdemag]
type = MagnetostaticEnergyCart
energy_scale = 0.001 #converts results to eV
execute_on = 'initial timestep_end final'
block = '1'
[../]
#---------------------------------------#
# #
# Calculate excess energy from missed #
# LLB targets #
# #
#---------------------------------------#
[./Fllb1]
type = MagneticExcessLLBEnergy
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
execute_on = 'initial timestep_end final'
block = '1'
[../]
#---------------------------------------#
# #
# add all the energy contributions #
# and calculate their percent change #
# #
#---------------------------------------#
[./Ftot]
type = LinearCombinationPostprocessor
pp_names = 'Fexch Fdemag'
pp_coefs = ' 1.0 1.0'
execute_on = 'initial timestep_end final'
[../]
[./perc_change]
type = EnergyRatePostprocessor
postprocessor = Ftot
dt = dt
execute_on = 'timestep_end final'
[../]
[./elapsed]
type = PerfGraphData
section_name = "Root" # for profiling the problem
data_type = total
[../]
[]
[AuxKernels]
[./mag_mag]
type = VectorMagnitudeAux
variable = mag_s
x = mag_x
y = mag_y
z = mag_z
execute_on = 'initial timestep_end final'
block = '1'
[../]
[]
[UserObjects]
[./kill]
type = Terminator
expression = 'perc_change <= 1.0e-6'
[../]
[]
[Preconditioning]
#---------------------------------------#
# #
# Solver options #
# #
#---------------------------------------#
[./smp]
type = SMP
full = true
petsc_options_iname = ' -ksp_gmres_restart -snes_atol -snes_rtol -ksp_rtol -pc_type '
petsc_options_value = ' 100 1e-12 1e-9 1e-8 bjacobi'
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
[./TimeIntegrator]
type = NewmarkBeta
[../]
dtmin = 1.e-4
dtmax = 5.e-3
end_time = 10.0
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 25 #usually 10
linear_iteration_ratio = 100
dt = 1e-6
growth_factor = 1.1
cutback_factor = 0.75
[../]
num_steps = 12000
[../]
[Outputs]
print_linear_residuals = false
[./out]
type = Exodus
file_base = out_ringdown
elemental_as_nodal = true
time_step_interval = 10
[../]
[./outCSV]
type = CSV
file_base = out_ringdown
[../]
[]
(test/tests/magnets/sp2_second.i)
[Mesh]
second_order = true
# muMAG standard problem 2 (5d x d x 0.1d film, no anisotropy, field along [111]), SECOND-order demag
# potential (HEX27 elements, magnetization first order): much better demag factors than sp2_first.i
# (Hc ~0.4% from the Stoner-Wohlfarth limit at d = 1 vs ~4% low), at several times the cost. Reduced units: l_ex = 1, Km = mu0 Ms^2 / 2 = 1; lengths below are for d = 1 l_ex.
# Scaled-down mesh for a fast regression test. For the actual SP2 benchmark multiply every length by
# d/l_ex and use 100 x 20 x 3 film cells with a graded vacuum, e.g.
# dx = '2 1 0.5 0.25 0.25 5 0.25 0.25 0.5 1 2', ix = '1 1 1 1 5 100 5 1 1 1 1',
# dy = '2 1 0.5 0.25 0.25 1 0.25 0.25 0.5 1 2', iy = '1 1 1 1 5 20 5 1 1 1 1',
# dz = '1.2 0.6 0.3 0.133333 0.066667 0.033333 0.1 0.033333 0.066667 0.133333 0.3 0.6 1.2',
# iz = '1 1 1 1 1 1 3 1 1 1 1 1 1' (box half-sizes 6.5d x 4.5d x 2.383333d), then sweep the field.
[box]
type = CartesianMeshGenerator
dim = 3
dx = '4.0 1.0 5.0 1.0 4.0'
dy = '4.0 1.0 1.0 1.0 4.0'
dz = '2.0 0.2 0.1 0.2 2.0'
ix = '1 1 10 1 1'
iy = '1 1 2 1 1'
iz = '1 1 1 1 1'
[]
[center]
type = TransformGenerator
input = box
transform = TRANSLATE
vector_value = '-7.5 -5.5 -2.25'
[]
[film_block]
type = ParsedSubdomainMeshGenerator
input = center
block_id = 1
combinatorial_geometry = 'abs(x) <= 2.500001 & abs(y) <= 0.500001 & abs(z) <= 0.050001'
[]
[block_names]
type = RenameBlockGenerator
input = film_block
old_block = '0 1'
new_block = 'vacuum film'
[]
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
potential_H_int = potential_H_int
Hext_x = Hext
Hext_y = Hext
Hext_z = Hext
mu0 = 1.256637
g0 = 221.1
Hscale = 1.0
[]
[Variables]
# start uniform along [111]
[mag_x]
block = film
[InitialCondition]
type = ConstantIC
value = 0.5773502691896258
[]
[]
[mag_y]
block = film
[InitialCondition]
type = ConstantIC
value = 0.5773502691896258
[]
[]
[mag_z]
block = film
[InitialCondition]
type = ConstantIC
value = 0.5773502691896258
[]
[]
[potential_H_int]
order = SECOND
block = 'film vacuum'
[]
[]
[AuxVariables]
[mag_s]
block = film
[]
# applied field H/Ms = 0.08 along [111]: each component = 0.08 * Ms / sqrt(3)
[Hext]
block = film
[InitialCondition]
type = ConstantIC
value = 0.05827295
[]
[]
[]
[AuxKernels]
[mag_norm]
type = VectorMagnitudeAux
variable = mag_s
x = mag_x
y = mag_y
z = mag_z
block = film
execute_on = 'initial timestep_end'
[]
[]
[Materials]
[film_properties]
type = GenericConstantMaterial
prop_names = 'alpha Ae Ms permittivity'
prop_values = '1.0 1.0 1.261566 1.0'
block = film
[]
[vacuum_properties]
type = GenericConstantMaterial
prop_names = 'Ms permittivity'
prop_values = '0.0 1.0'
block = vacuum
[]
[]
[Kernels]
[mag_x_time]
type = TimeDerivative
variable = mag_x
block = film
[]
[mag_y_time]
type = TimeDerivative
variable = mag_y
block = film
[]
[mag_z_time]
type = TimeDerivative
variable = mag_z
block = film
[]
[exchange_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
block = film
[]
[exchange_y]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
block = film
[]
[exchange_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
block = film
[]
[field_x]
type = MasterInteractionCartLLGHConst
variable = mag_x
component = 0
block = film
[]
[field_y]
type = MasterInteractionCartLLGHConst
variable = mag_y
component = 1
block = film
[]
[field_z]
type = MasterInteractionCartLLGHConst
variable = mag_z
component = 2
block = film
[]
[magnetostatic_laplace]
type = Electrostatics
variable = potential_H_int
block = 'film vacuum'
[]
[magnetostatic_source]
type = MagHStrongCart
variable = potential_H_int
block = film
[]
[]
[BCs]
[outer_vacuum]
type = DirichletBC
variable = potential_H_int
boundary = '0 1 2 3 4 5'
value = 0.0
[]
[]
[Postprocessors]
[mx]
type = ElementAverageValue
variable = mag_x
block = film
[]
[my]
type = ElementAverageValue
variable = mag_y
block = film
[]
[mz]
type = ElementAverageValue
variable = mag_z
block = film
[]
[mag_norm_min]
type = NodalExtremeValue
variable = mag_s
value_type = min
block = film
[]
[Fexch]
type = MasterMagneticExchangeEnergy
energy_scale = 1.0
block = film
[]
[Fdemag]
type = MagnetostaticEnergyCart
energy_scale = 1.0
block = film
[]
[Fzeeman]
type = MasterMagneticZeemanEnergyCart
energy_scale = 1.0
block = film
[]
[]
[UserObjects]
[renormalize]
type = PointwiseRenormalizeVector
v = 'mag_x mag_y mag_z'
execute_on = timestep_end
force_preaux = true
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
scheme = implicit-euler
petsc_options_iname = '-pc_type -snes_atol -snes_rtol'
petsc_options_value = 'lu 1e-8 1e-8'
dt = 0.01
num_steps = 2
[]
[Outputs]
file_base = out_sp2_second
exodus = true
csv = true
[]
(test/tests/magnets/walker_llg.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 600
xmin = -30
xmax = 30
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
potential_H_int = zero
Hext_x = hx
Hext_y = zero
Hext_z = zero
g0 = 1
mu0 = 1
Hscale = 1
[]
[Materials]
[constants]
type = GenericConstantMaterial
prop_names = 'alpha Ms Ae K1 nx ny nz Kh nhx nhy nhz'
prop_values = '0.1 1 1 1 1 0 0 0.5 0 0 1'
[]
[]
[Variables]
[mag_x]
[InitialCondition]
type = FunctionIC
function = '-tanh(x/0.9759000729)'
[]
[]
[mag_y]
[InitialCondition]
type = FunctionIC
function = '0.9486832981/cosh(x/0.9759000729)'
[]
[]
[mag_z]
[InitialCondition]
type = FunctionIC
function = '0.316227766/cosh(x/0.9759000729)'
[]
[]
[]
[AuxVariables]
[zero]
[]
[hx]
initial_condition = 0.03
[]
[]
[Kernels]
[time_x]
type = TimeDerivative
variable = mag_x
[]
[time_y]
type = TimeDerivative
variable = mag_y
[]
[time_z]
type = TimeDerivative
variable = mag_z
[]
[MasterExchangeCartLLG_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
[]
[MasterExchangeCartLLG_y]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
[]
[MasterExchangeCartLLG_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
[]
[MasterAnisotropyCartLLG_x]
type = MasterAnisotropyCartLLG
variable = mag_x
component = 0
[]
[MasterAnisotropyCartLLG_y]
type = MasterAnisotropyCartLLG
variable = mag_y
component = 1
[]
[MasterAnisotropyCartLLG_z]
type = MasterAnisotropyCartLLG
variable = mag_z
component = 2
[]
[MasterInteractionCartLLGHConst_x]
type = MasterInteractionCartLLGHConst
variable = mag_x
component = 0
[]
[MasterInteractionCartLLGHConst_y]
type = MasterInteractionCartLLGHConst
variable = mag_y
component = 1
[]
[MasterInteractionCartLLGHConst_z]
type = MasterInteractionCartLLGHConst
variable = mag_z
component = 2
[]
[]
[UserObjects]
[renormalize]
type = PointwiseRenormalizeVector
v = 'mag_x mag_y mag_z'
execute_on = timestep_end
force_preaux = true
[]
[assert]
type = Terminator
expression = 'sim_time > 5 & (abs(v/0.2927700219 - 1) > 2e-3 | abs(phi - 18.43494882) > 0.2)'
fail_mode = HARD
error_level = ERROR
message = 'Walker wall: velocity or tilt angle off the exact Walker solution'
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[Ix]
type = ElementIntegralVariablePostprocessor
variable = mag_x
[]
[dIx]
type = ChangeOverTimePostprocessor
postprocessor = Ix
[]
[Iy]
type = ElementIntegralVariablePostprocessor
variable = mag_y
[]
[dIy]
type = ChangeOverTimePostprocessor
postprocessor = Iy
[]
[Iz]
type = ElementIntegralVariablePostprocessor
variable = mag_z
[]
[dIz]
type = ChangeOverTimePostprocessor
postprocessor = Iz
[]
[dt]
type = TimestepSize
[]
[sim_time]
type = TimePostprocessor
[]
[v]
type = ParsedPostprocessor
expression = 'dIx/(2*dt)'
pp_names = 'dIx dt'
[]
[phi]
type = ParsedPostprocessor
expression = 'atan2(Iz, Iy)*180/3.141592653589793'
pp_names = 'Iy Iz'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
scheme = bdf2
dt = 0.05
end_time = 20
nl_abs_tol = 1e-10
nl_rel_tol = 1e-8
nl_rel_step_tol = 1e-12
line_search = none
nl_forced_its = 1
[]
[Outputs]
file_base = out_walker_llg
csv = true
[]
(test/tests/magnets/ringdown.i)
alphadef = 0.02
[Mesh]
[./mesh]
type = GeneratedMeshGenerator
dim = 3
nx = 50
ny = 50
nz = 10
xmin = -50
xmax = 50
ymin = -50
ymax = 50
zmin = -10
zmax = 10
[../]
[./vacuum_box]
type = SubdomainBoundingBoxGenerator
input = mesh
bottom_left = '-50 -50 -10'
top_right = '50 50 10'
block_id = 2
block_name = vacuum
[../]
[./brick]
type = SubdomainBoundingBoxGenerator
input = vacuum_box
bottom_left = '-10 -10 -1.5'
top_right = '10 10 1.5'
block_id = 1
block_name = brick
[../]
[../]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
potential_H_int = potential_H_int
Hscale = 0.004519239
g0 = 1.0
mu0 = 1.256637e-06
[]
[Materials]
[./constants]
type = GenericConstantMaterial
prop_names = ' alpha Ae Ms permittivity'
prop_values = '${alphadef} 1.3e-05 1.2 1.'
block = '1'
[../]
[./a_long]
type = GenericFunctionMaterial
prop_names = 'alpha_long'
prop_values = 'bc_func_1'
block = '1'
[../]
[./constantsv]
type = GenericConstantMaterial
prop_names = ' alpha Ae Ms permittivity'
prop_values = '1 1.e-05 0. 1. '
block = '2'
[../]
[./a_longv]
type = GenericFunctionMaterial
prop_names = 'alpha_long'
prop_values = 'bc_func_1'
block = '2'
[../]
[]
[Functions]
[./bc_func_1]
type = ParsedFunction
expression = 'st'
symbol_names = 'st'
symbol_values = '1.e3'
[../]
[]
[Variables]
[./mag_x]
order = FIRST
family = LAGRANGE
block = '1'
[./InitialCondition]
type = RandomConstrainedVectorFieldIC
phi = azimuth_phi
theta = polar_theta
M0s = 1.0
component = 0
[../]
[../]
[./mag_y]
order = FIRST
family = LAGRANGE
block = '1'
[./InitialCondition]
type = RandomConstrainedVectorFieldIC
phi = azimuth_phi
theta = polar_theta
M0s = 1.0
component = 1
[../]
[../]
[./mag_z]
order = FIRST
family = LAGRANGE
block= '1'
[./InitialCondition]
type = RandomConstrainedVectorFieldIC
phi = azimuth_phi
theta = polar_theta
M0s = 1.0
component = 2
[../]
[../]
[./potential_H_int]
order = FIRST
family = LAGRANGE
block = '1 2'
[../]
[]
[AuxVariables]
[./azimuth_phi]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = RandomIC
min = 0.
max = 0.01
seed = 2
[../]
[../]
[./polar_theta]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = RandomIC
min = 1.5708
max = 1.5709
seed = 37
[../]
[../]
[./mag_s]
order = FIRST
family = LAGRANGE
[../]
[./H_x]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = ConstantIC
value = 1.0
[../]
[../]
[./H_y]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = ConstantIC
value = 1.0
[../]
[../]
[./H_z]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = ConstantIC
value = 1.0
[../]
[../]
[]
[AuxKernels]
[./mag_mag]
type = VectorMagnitudeAux
variable = mag_s
x = mag_x
y = mag_y
z = mag_z
execute_on = 'initial timestep_end final'
block = '1'
[../]
[]
[Kernels]
[./mag_x_time]
type = TimeDerivative
variable = mag_x
block = '1'
[../]
[./mag_y_time]
type = TimeDerivative
variable = mag_y
block = '1'
[../]
[./mag_z_time]
type = TimeDerivative
variable = mag_z
block = '1'
[../]
[./dllg_x_exch]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
block = '1'
[../]
[./dllg_y_exch]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
block = '1'
[../]
[./dllg_z_exch]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
block = '1'
[../]
[./d_HM_x]
type = MasterInteractionCartLLG
variable = mag_x
component = 0
block = '1'
[../]
[./d_HM_y]
type = MasterInteractionCartLLG
variable = mag_y
component = 1
block = '1'
[../]
[./d_HM_z]
type = MasterInteractionCartLLG
variable = mag_z
component = 2
block = '1'
[../]
[./int_pot_lap]
type = Electrostatics
variable = potential_H_int
block = '1 2'
[../]
[./int_bc_pot_lap]
type = MagHStrongCart
variable = potential_H_int
block = '1'
[../]
[]
[BCs]
[./vacuum_box]
type = DirichletBC
value = 0.
variable = potential_H_int
boundary = '0 1 2 3 4 5'
[../]
[]
[Postprocessors]
[./dt]
type = TimestepSize
[../]
[./M1]
type = ElementAverageValue
variable = mag_s
execute_on = 'initial timestep_end final'
block = '1'
[../]
[./<mx>]
type = ElementAverageValue
variable = mag_x
execute_on = 'initial timestep_end final'
block = '1'
[../]
[./<my>]
type = ElementAverageValue
variable = mag_y
execute_on = 'initial timestep_end final'
block = '1'
[../]
[./<mz>]
type = ElementAverageValue
variable = mag_z
execute_on = 'initial timestep_end final'
block = '1'
[../]
[./Fexch]
type = MasterMagneticExchangeEnergy
energy_scale = 1.
execute_on = 'initial timestep_end final'
block = '1'
[../]
[./Fdemag]
type = MagnetostaticEnergyCart
energy_scale = 1.
execute_on = 'initial timestep_end final'
block = '1'
[../]
[./Fllb1]
type = MagneticExcessLLBEnergy
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
execute_on = 'initial timestep_end final'
block = '1'
[../]
[./Ftot]
type = LinearCombinationPostprocessor
pp_names = 'Fexch Fdemag'
pp_coefs = ' 1.0 1.0'
execute_on = 'initial timestep_end final'
[../]
[]
[UserObjects]
[mag]
type = RenormalizeVector
v = 'mag_x mag_y mag_z'
norm = 1
execute_on = 'TIMESTEP_END'
[]
[]
[Preconditioning]
active = smp
[./muPBP]
type = PBP
solve_order = 'mag_x mag_y mag_z potential_H_int'
preconditioner = 'AMG ILU'
off_diag_row = 'mag_x mag_y mag_z'
off_diag_column = 'mag_x mag_y mag_z'
[../]
[./muFSP]
type = FSP
topsplit = 'magpot'
[./magpot]
splitting = 'mag pot'
splitting_type = additive
[../]
[./mag]
vars = 'mag_x mag_y mag_z'
petsc_options_iname = ' -ksp_gmres_restart -snes_atol -snes_rtol -ksp_rtol -pc_type -pc_sub_type '
petsc_options_value = ' 40 1e-20 1e-6 1e-6 bjacobi ilu'
[../]
[./pot]
vars = potential_H_int
petsc_options_iname = ' -ksp_gmres_restart -snes_atol -snes_rtol -ksp_rtol -pc_type -pc_sub_type '
petsc_options_value = ' 40 1e-12 1e-6 1e-6 bjacobi ilu'
[../]
[../]
[./smp]
type = SMP
full = true
petsc_options_iname = ' -ksp_gmres_restart -snes_atol -snes_rtol -ksp_rtol -pc_type'
petsc_options_value = ' 40 1e-8 1e-8 1e-4 bjacobi'
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
[./TimeIntegrator]
type = NewmarkBeta
[../]
dtmin = 1.e-5
dtmax = 2.e-3
end_time = 5.
automatic_scaling = true
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 15
iteration_window = 2
linear_iteration_ratio = 1000
dt = 1.e-4
growth_factor = 1.1
cutback_factor = 0.75
[../]
num_steps = 20
[../]
[Outputs]
print_linear_residuals = false
[./out]
type = Exodus
file_base = ringdown
elemental_as_nodal = true
time_step_interval = 10
[../]
[./outCSV]
type = CSV
file_base = ringdown
[../]
[]
(test/tests/magnets/sp4_f2.i)
[Mesh]
# muMAG SP4 field 2, mesh scaled down for the test. Real mesh used: 2.5 nm film cells (200 x 50 in-plane,
# 2 through the 3 nm thickness), refined to 1.25 nm (4 through the thickness) in a 5 nm band along the film
# edges, and a graded hanging-node vacuum out to a 185 x 152 x 180 l_ex box
[box]
type = CartesianMeshGenerator
dim = 3
dx = '100.0 20.0 87.938337 20.0 100.0'
dy = '100.0 20.0 21.984584 20.0 100.0'
dz = '40.0 4.0 0.527630 4.0 40.0'
ix = '2 1 16 1 2'
iy = '2 1 4 1 2'
iz = '2 1 1 1 2'
[]
[center]
type = TransformGenerator
input = box
transform = TRANSLATE
vector_value = '-163.969169 -130.992292 -44.263815'
[]
[film_block]
type = ParsedSubdomainMeshGenerator
input = center
block_id = 1
combinatorial_geometry = 'x >= -43.969169 & x <= 43.969169 & y >= -10.992292 & y <= 10.992292 & z >= -0.263815 & z <= 0.263815'
[]
[block_names]
type = RenameBlockGenerator
input = film_block
old_block = '0 1'
new_block = 'vacuum film'
[]
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
potential_H_int = potential_H_int
Hext_x = Hext_x
Hext_y = Hext_y
Hext_z = Hext_z
mu0 = 1.256637
g0 = 140.206695
Hscale = 1.0
[]
[Variables]
[mag_x]
block = film
[InitialCondition]
type = ConstantIC
value = 0.991756
[]
[]
[mag_y]
block = film
[InitialCondition]
type = ConstantIC
value = 0.128140
[]
[]
[mag_z]
block = film
[InitialCondition]
type = ConstantIC
value = 0.0
[]
[]
[potential_H_int]
block = 'film vacuum'
[]
[]
[AuxVariables]
[mag_s]
block = film
[]
[Hext_x]
block = film
[InitialCondition]
type = ConstantIC
value = -0.0445490532
[]
[]
[Hext_y]
block = film
[InitialCondition]
type = ConstantIC
value = -0.0079058883
[]
[]
[Hext_z]
block = film
[]
[]
[AuxKernels]
[mag_norm]
type = VectorMagnitudeAux
variable = mag_s
x = mag_x
y = mag_y
z = mag_z
block = film
execute_on = 'initial timestep_end'
[]
[]
[Materials]
[film_properties]
type = GenericConstantMaterial
prop_names = 'alpha Ae Ms permittivity'
prop_values = '0.02 1.0 1.261566 1.0'
block = film
[]
[vacuum_properties]
type = GenericConstantMaterial
prop_names = 'Ms permittivity'
prop_values = '0.0 1.0'
block = vacuum
[]
[]
[Kernels]
[mag_x_time]
type = TimeDerivative
variable = mag_x
block = film
[]
[mag_y_time]
type = TimeDerivative
variable = mag_y
block = film
[]
[mag_z_time]
type = TimeDerivative
variable = mag_z
block = film
[]
[exchange_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
block = film
[]
[exchange_y]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
block = film
[]
[exchange_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
block = film
[]
[field_x]
type = MasterInteractionCartLLGHConst
variable = mag_x
component = 0
block = film
[]
[field_y]
type = MasterInteractionCartLLGHConst
variable = mag_y
component = 1
block = film
[]
[field_z]
type = MasterInteractionCartLLGHConst
variable = mag_z
component = 2
block = film
[]
[magnetostatic_laplace]
type = Electrostatics
variable = potential_H_int
block = 'film vacuum'
[]
[magnetostatic_source]
type = MagHStrongCart
variable = potential_H_int
block = film
[]
[]
[BCs]
[outer_vacuum]
type = DirichletBC
variable = potential_H_int
boundary = '0 1 2 3 4 5'
value = 0.0
[]
[]
[Postprocessors]
[mx]
type = ElementAverageValue
variable = mag_x
block = film
[]
[my]
type = ElementAverageValue
variable = mag_y
block = film
[]
[mz]
type = ElementAverageValue
variable = mag_z
block = film
[]
[mag_norm_min]
type = NodalExtremeValue
variable = mag_s
value_type = min
block = film
[]
[mag_norm_max]
type = NodalExtremeValue
variable = mag_s
value_type = max
block = film
[]
[Fexch]
type = MasterMagneticExchangeEnergy
energy_scale = 1.0
block = film
[]
[Fdemag]
type = MagnetostaticEnergyCart
energy_scale = 1.0
block = film
[]
[Fzeeman]
type = MasterMagneticZeemanEnergyCart
energy_scale = 1.0
block = film
[]
[]
[UserObjects]
[renormalize]
type = PointwiseRenormalizeVector
v = 'mag_x mag_y mag_z'
execute_on = timestep_end
force_preaux = true
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
[TimeIntegrator]
type = NewmarkBeta
[]
petsc_options_iname = '-pc_type -snes_atol -snes_rtol'
petsc_options_value = 'lu 1e-8 1e-8'
dt = 0.001
num_steps = 5
[]
[Outputs]
file_base = out_sp4_f2
exodus = true
csv = true
[]
(test/tests/magnets/sp3.i)
[Mesh]
# Scaled-down mesh for a fast regression test. For the actual muMAG SP3 benchmark use at least
# N = 10 cells per cube edge (h <= 0.1 L, extrapolate in N), a refined vacuum shell >= 0.3 L
# thick, and a graded vacuum out to a box >= 10 L.
[box]
type = CartesianMeshGenerator
dim = 3
dx = '16.8 2.1 8.4 2.1 16.8'
dy = '16.8 2.1 8.4 2.1 16.8'
dz = '16.8 2.1 8.4 2.1 16.8'
ix = '2 1 4 1 2'
iy = '2 1 4 1 2'
iz = '2 1 4 1 2'
[]
[center]
type = TransformGenerator
input = box
transform = TRANSLATE
vector_value = '-23.1 -23.1 -23.1'
[]
[cube_block]
type = SubdomainBoundingBoxGenerator
input = center
block_id = 1
bottom_left = '-4.2 -4.2 -4.2'
top_right = '4.2 4.2 4.2'
[]
[block_names]
type = RenameBlockGenerator
input = cube_block
old_block = '0 1'
new_block = 'vacuum cube'
[]
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
potential_H_int = potential_H_int
mu0 = 1.256637
g0 = 221.1
Hscale = 1.0
[]
[Functions]
[flower_mx]
type = ParsedFunction
expression = '1/sqrt(1 + (0.45*x*y/17.64)^2 + (0.45*x*z/17.64)^2)'
[]
[flower_my]
type = ParsedFunction
expression = '(0.45*x*y/17.64)/sqrt(1 + (0.45*x*y/17.64)^2 + (0.45*x*z/17.64)^2)'
[]
[flower_mz]
type = ParsedFunction
expression = '(0.45*x*z/17.64)/sqrt(1 + (0.45*x*y/17.64)^2 + (0.45*x*z/17.64)^2)'
[]
[]
[Variables]
[mag_x]
block = cube
[InitialCondition]
type = FunctionIC
function = flower_mx
[]
[]
[mag_y]
block = cube
[InitialCondition]
type = FunctionIC
function = flower_my
[]
[]
[mag_z]
block = cube
[InitialCondition]
type = FunctionIC
function = flower_mz
[]
[]
[potential_H_int]
block = 'cube vacuum'
[]
[]
[AuxVariables]
[mag_s]
block = cube
[]
[]
[AuxKernels]
[mag_norm]
type = VectorMagnitudeAux
variable = mag_s
x = mag_x
y = mag_y
z = mag_z
block = cube
execute_on = 'initial timestep_end'
[]
[]
[Materials]
[cube_properties]
type = GenericConstantMaterial
prop_names = 'alpha Ae Ms permittivity K1 nx ny nz'
prop_values = '100.0 1.0 1.261566 1.0 0.1 1 0 0'
block = cube
[]
[vacuum_properties]
type = GenericConstantMaterial
prop_names = 'Ms permittivity'
prop_values = '0.0 1.0'
block = vacuum
[]
[]
[Kernels]
[mag_x_time]
type = TimeDerivative
variable = mag_x
block = cube
[]
[mag_y_time]
type = TimeDerivative
variable = mag_y
block = cube
[]
[mag_z_time]
type = TimeDerivative
variable = mag_z
block = cube
[]
[exchange_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
block = cube
[]
[exchange_y]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
block = cube
[]
[exchange_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
block = cube
[]
[anisotropy_x]
type = MasterAnisotropyCartLLG
variable = mag_x
component = 0
block = cube
[]
[anisotropy_y]
type = MasterAnisotropyCartLLG
variable = mag_y
component = 1
block = cube
[]
[anisotropy_z]
type = MasterAnisotropyCartLLG
variable = mag_z
component = 2
block = cube
[]
[demag_x]
type = MasterInteractionCartLLG
variable = mag_x
component = 0
block = cube
[]
[demag_y]
type = MasterInteractionCartLLG
variable = mag_y
component = 1
block = cube
[]
[demag_z]
type = MasterInteractionCartLLG
variable = mag_z
component = 2
block = cube
[]
[magnetostatic_laplace]
type = Electrostatics
variable = potential_H_int
block = 'cube vacuum'
[]
[magnetostatic_source]
type = MagHStrongCart
variable = potential_H_int
block = cube
[]
[]
[BCs]
[outer_vacuum]
type = DirichletBC
variable = potential_H_int
boundary = '0 1 2 3 4 5'
value = 0.0
[]
[]
[Postprocessors]
[mx]
type = ElementAverageValue
variable = mag_x
block = cube
[]
[my]
type = ElementAverageValue
variable = mag_y
block = cube
[]
[mz]
type = ElementAverageValue
variable = mag_z
block = cube
[]
[mag_norm_min]
type = NodalExtremeValue
variable = mag_s
value_type = min
block = cube
[]
[Fexch]
type = MasterMagneticExchangeEnergy
energy_scale = 1.0
block = cube
[]
[Faniso]
type = MasterMagneticAnisotropyEnergy
energy_scale = 1.0
block = cube
[]
[Fdemag]
type = MagnetostaticEnergyCart
energy_scale = 1.0
block = cube
[]
[]
[UserObjects]
[renormalize]
type = PointwiseRenormalizeVector
v = 'mag_x mag_y mag_z'
execute_on = timestep_end
force_preaux = true
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
scheme = implicit-euler
petsc_options_iname = '-pc_type -snes_atol -snes_rtol'
petsc_options_value = 'lu 1e-8 1e-8'
dt = 0.25
num_steps = 5
[]
[Outputs]
file_base = out_sp3
exodus = true
csv = true
[]
(test/tests/magnets/Sstate_gen-Py_OOMF.i)
Nx = 100
Ny = 25
Nz = 3
xMin = 0.0
yMin = 0.0
zMin = 1.5
xMax = 500.0
yMax = 125.0
zMax = 3.0
alphadef = 1.0
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
nx = ${Nx}
ny = ${Ny}
nz = ${Nz}
xmin = ${xMin}
xmax = ${xMax}
ymin = ${yMin}
ymax = ${yMax}
zmin = ${zMin}
zmax = ${zMax}
elem_type = HEX8
[]
[]
[UserObjects]
[./reader_nearest]
type = PropertyReadFile
prop_file_name = 'fulldata_state.csv'
read_type = 'voronoi'
nprop = 6
nblock = 1
nvoronoi = 7500
[../]
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
potential_H_int = potential_H_int
mu0 = 1.0
Hscale = 1.0
g0 = 17680.8
[]
[Materials]
[./constants]
type = GenericConstantMaterial
prop_names = ' alpha g0mu0Ms permittivity Ae Ms '
prop_values = '${alphadef} 34989.1 1.0 13.0 1.0 '
[../]
[./a_long]
type = GenericFunctionMaterial
prop_names = 'alpha_long'
prop_values = 'bc_func_1'
[../]
[]
[Functions]
[./bc_func_1]
type = ParsedFunction
expression = 'st'
symbol_names = 'st'
symbol_values = '1e1'
[../]
[./node_mx]
type = PiecewiseConstantFromCSV
read_prop_user_object = 'reader_nearest'
read_type = 'voronoi'
column_number = '3'
[../]
[./node_my]
type = PiecewiseConstantFromCSV
read_prop_user_object = 'reader_nearest'
read_type = 'voronoi'
column_number = '4'
[../]
[./node_mz]
type = PiecewiseConstantFromCSV
read_prop_user_object = 'reader_nearest'
read_type = 'voronoi'
column_number = '5'
[../]
[]
[Variables]
[./mag_x]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = FunctionIC
function = node_mx
[../]
[../]
[./mag_y]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = FunctionIC
function = node_my
[../]
[../]
[./mag_z]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = FunctionIC
function = node_mz
[../]
[../]
[./potential_H_int]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./azimuth_phi]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = RandomIC
min = 0.234979
max = 0.244979
seed = 2
[../]
[../]
[./polar_theta]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = RandomIC
min = 1.46742
max = 1.47742
seed = 37
[../]
[../]
[./mag_s]
order = FIRST
family = LAGRANGE
[../]
[./H_x]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = ConstantIC
value = 1.0
[../]
[../]
[./H_y]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = ConstantIC
value = 1.0
[../]
[../]
[./H_z]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = ConstantIC
value = 1.0
[../]
[../]
[]
[AuxKernels]
[./mag_mag]
type = VectorMagnitudeAux
variable = mag_s
x = mag_x
y = mag_y
z = mag_z
execute_on = 'initial timestep_end final'
[../]
[]
[Kernels]
[./mag_x_time]
type = TimeDerivative
variable = mag_x
[../]
[./mag_y_time]
type = TimeDerivative
variable = mag_y
[../]
[./mag_z_time]
type = TimeDerivative
variable = mag_z
[../]
[./dllg_x_exch]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
[../]
[./dllg_y_exch]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
[../]
[./dllg_z_exch]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
[../]
[./d_HM_x]
type = MasterInteractionCartLLG
variable = mag_x
component = 0
[../]
[./d_HM_y]
type = MasterInteractionCartLLG
variable = mag_y
component = 1
[../]
[./d_HM_z]
type = MasterInteractionCartLLG
variable = mag_z
component = 2
[../]
[./llb1_x]
type = LongitudinalLLB
variable = mag_x
component = 0
[../]
[./llb1_y]
type = LongitudinalLLB
variable = mag_y
component = 1
[../]
[./llb1_z]
type = LongitudinalLLB
variable = mag_z
component = 2
[../]
[./int_pot_lap]
type = Electrostatics
variable = potential_H_int
[../]
[./int_bc_pot_lap]
type = MagHStrongCart
variable = potential_H_int
[../]
[]
[BCs]
[]
[Postprocessors]
[./dt]
type = TimestepSize
[../]
[./M1]
type = ElementAverageValue
variable = mag_s
execute_on = 'initial timestep_end final'
[../]
[./<mx>]
type = ElementAverageValue
variable = mag_x
execute_on = 'initial timestep_end final'
[../]
[./<my>]
type = ElementAverageValue
variable = mag_y
execute_on = 'initial timestep_end final'
[../]
[./<mz>]
type = ElementAverageValue
variable = mag_z
execute_on = 'initial timestep_end final'
[../]
[./Fexch]
type = MasterMagneticExchangeEnergy
energy_scale = 0.001
execute_on = 'initial timestep_end final'
[../]
[./Fdemag]
type = MagnetostaticEnergyCart
energy_scale = 0.001
execute_on = 'initial timestep_end final'
[../]
[./Fllb1]
type = MagneticExcessLLBEnergy
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
execute_on = 'initial timestep_end final'
[../]
[./Ftot]
type = LinearCombinationPostprocessor
pp_names = 'Fexch Fdemag'
pp_coefs = ' 1.0 1.0'
execute_on = 'initial timestep_end final'
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
petsc_options_iname = ' -ksp_gmres_restart -ksp_rtol -pc_type '
petsc_options_value = ' 526 1e-6 bjacobi'
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
nl_abs_tol = 1e-5
nl_rel_tol = 1e-3
[./TimeIntegrator]
type = NewmarkBeta
[../]
dtmin = 1e-18
dtmax = 1.0
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 38
linear_iteration_ratio = 1000
dt = 1e-8
growth_factor = 1.1
[../]
num_steps = 2
[]
[Outputs]
print_linear_residuals = false
[./out]
type = Exodus
file_base = out_Sstate_gen-Py_111_OOMF
elemental_as_nodal = true
time_step_interval = 1
[../]
[./outCSV]
type = CSV
file_base = out_Sstate_gen-Py_111_OOMF
[../]
[]
(test/tests/magnets/llb_alpha_ramp_dmi.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 600
xmin = -30
xmax = 30
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
g0 = 1
mu0 = 1
Hscale = 1
llb = true
[]
[Functions]
[ap]
type = ParsedFunction
expression = '0.25 + -0.002*x'
[]
[al]
type = ParsedFunction
expression = '0.15 + 0.002*x'
[]
[]
[Materials]
[constants]
type = GenericConstantMaterial
prop_names = 'alpha Ms Ae K1 nx ny nz me chi_par D'
prop_values = '0.1 1 1 1 0 0 1 0.8 0.05 0.3'
[]
[alphas]
type = GenericFunctionMaterial
prop_names = 'alpha_perp alpha_par'
prop_values = 'ap al'
[]
[grad_alphas]
type = GenericConstantVectorMaterial
prop_names = 'grad_alpha_perp grad_alpha_par'
prop_values = '-0.002 0 0 0.002 0 0'
[]
[]
[Variables]
[mag_x]
[InitialCondition]
type = FunctionIC
function = '0.8/cosh(x)'
[]
[]
[mag_y]
[InitialCondition]
type = FunctionIC
function = '0'
[]
[]
[mag_z]
[InitialCondition]
type = FunctionIC
function = '0.8*tanh(x)'
[]
[]
[]
[AuxVariables]
[uz]
[]
[]
[AuxKernels]
[uz]
type = ParsedAux
variable = uz
coupled_variables = 'mag_x mag_y mag_z'
expression = 'mag_z/sqrt(mag_x^2 + mag_y^2 + mag_z^2)'
[]
[]
[Kernels]
[time_x]
type = TimeDerivative
variable = mag_x
[]
[time_y]
type = TimeDerivative
variable = mag_y
[]
[time_z]
type = TimeDerivative
variable = mag_z
[]
[MasterExchangeCartLLG_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
[]
[MasterExchangeCartLLG_y]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
[]
[MasterExchangeCartLLG_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
[]
[MasterAnisotropyCartLLG_x]
type = MasterAnisotropyCartLLG
variable = mag_x
component = 0
[]
[MasterAnisotropyCartLLG_y]
type = MasterAnisotropyCartLLG
variable = mag_y
component = 1
[]
[MasterAnisotropyCartLLG_z]
type = MasterAnisotropyCartLLG
variable = mag_z
component = 2
[]
[MasterDMICartLLG_x]
type = MasterDMICartLLG
variable = mag_x
component = 0
dmi_type = interfacial
[]
[MasterDMICartLLG_y]
type = MasterDMICartLLG
variable = mag_y
component = 1
dmi_type = interfacial
[]
[MasterDMICartLLG_z]
type = MasterDMICartLLG
variable = mag_z
component = 2
dmi_type = interfacial
[]
[MasterLongitudinalLLB_x]
type = MasterLongitudinalLLB
variable = mag_x
component = 0
form = llb
temperature = 0.5
Tc = 1
[]
[MasterLongitudinalLLB_y]
type = MasterLongitudinalLLB
variable = mag_y
component = 1
form = llb
temperature = 0.5
Tc = 1
[]
[MasterLongitudinalLLB_z]
type = MasterLongitudinalLLB
variable = mag_z
component = 2
form = llb
temperature = 0.5
Tc = 1
[]
[]
[UserObjects]
[assert]
type = Terminator
expression = 'sim_time > 10 & abs(q_rel) > 0.05'
fail_mode = HARD
error_level = ERROR
message = 'LLB wall in an alpha ramp moves: the grad(alpha) terms are missing or wrong'
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[Iuz]
type = ElementIntegralVariablePostprocessor
variable = uz
[]
[q]
type = ParsedPostprocessor
expression = '-0.5*Iuz'
pp_names = 'Iuz'
[]
[sim_time]
type = TimePostprocessor
[]
[q_rel]
type = ParsedPostprocessor
expression = 'q/(0.00396039604*sim_time)'
pp_names = 'q sim_time'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
scheme = bdf2
dt = 0.05
end_time = 20
nl_abs_tol = 1e-10
nl_rel_tol = 1e-8
nl_rel_step_tol = 1e-12
line_search = none
nl_forced_its = 1
[]
[Outputs]
file_base = out_llb_alpha_ramp_dmi
csv = true
[]
(test/tests/spin_waves/film_common.i)
[Mesh]
[box]
type = CartesianMeshGenerator
dim = 2
dx = '40.0'
dy = '80.0 40.0 20.0 10.0 5.0 2.5 1.25 0.5 1.0 0.5 1.25 2.5 5.0 10.0 20.0 40.0 80.0'
ix = '20'
iy = '1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1'
subdomain_id = '0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0'
[]
[center]
type = TransformGenerator
input = box
transform = TRANSLATE
vector_value = '0.0 -159.75 0.0'
[]
[block_names]
type = RenameBlockGenerator
input = center
old_block = '0 1'
new_block = 'vacuum film'
[]
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
potential_H_int = potential_H_int
Hext_x = Hext_x
Hext_y = Hext_y
Hext_z = Hext_z
mu0 = 1.256637
g0 = 140.206695
Hscale = 1.0
[]
[AuxVariables]
[mag_y]
block = film
[InitialCondition]
type = ConstantIC
value = 1.0
[]
[]
[Hext_x]
block = film
[]
[Hext_y]
block = film
[InitialCondition]
type = ConstantIC
value = 0.238434
[]
[]
[Hext_z]
block = film
[]
[]
[Materials]
[film_properties]
type = GenericConstantMaterial
prop_names = 'alpha Ae Ms permittivity'
prop_values = '0.0 1.0 1.261566 1.0'
block = film
[]
[vacuum_properties]
type = GenericConstantMaterial
prop_names = 'Ms permittivity'
prop_values = '0.0 1.0'
block = vacuum
[]
[]
[Kernels]
[exchange_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
block = film
[]
[exchange_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
block = film
[]
[field_x]
type = MasterInteractionCartLLGHConst
variable = mag_x
component = 0
block = film
[]
[field_z]
type = MasterInteractionCartLLGHConst
variable = mag_z
component = 2
block = film
[]
[magnetostatic_laplace]
type = Electrostatics
variable = potential_H_int
block = 'film vacuum'
[]
[]
[BCs]
[outer_vacuum]
type = DirichletBC
variable = potential_H_int
boundary = 'left right bottom top'
value = 0.0
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
(test/tests/magnets/sp5.i)
[Mesh]
# muMAG SP5 benchmark mesh: 2.5 nm film cells (40 x 40 in-plane, 4 through the 10 nm), 4 film-size vacuum shells then x1.7
# grading out to an 800 x 800 x 350 nm box (graded tensor mesh g4a); relax the vortex first (alpha 0.5, u = 0), then
# restart with the current for 14 ns (NewmarkBeta, IterationAdaptiveDT, dtmax 0.005).
[box]
type = CartesianMeshGenerator
dim = 3
dx = '5.862556 2.931278 17.587667 2.931278 5.862556'
dy = '5.862556 2.931278 17.587667 2.931278 5.862556'
dz = '1.758767 0.879383 1.758767 0.879383 1.758767'
ix = '1 1 6 1 1'
iy = '1 1 6 1 1'
iz = '1 1 2 1 1'
[]
[center]
type = TransformGenerator
input = box
transform = TRANSLATE
vector_value = '-17.5876675 -17.5876675 -3.517534'
[]
[film_block]
type = SubdomainBoundingBoxGenerator
input = center
block_id = 1
bottom_left = '-8.795 -8.795 -0.8795'
top_right = '8.795 8.795 0.8795'
[]
[block_names]
type = RenameBlockGenerator
input = film_block
old_block = '0 1'
new_block = 'vacuum film'
[]
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
potential_H_int = potential_H_int
Hext_x = Hext_x
Hext_y = Hext_y
Hext_z = Hext_z
mu0 = 1.256637
g0 = 140.206695
Hscale = 1.0
[]
[Materials]
[film_properties]
type = GenericConstantMaterial
prop_names = 'alpha Ae Ms permittivity'
prop_values = '0.1 1.0 1.261566 1.0'
block = film
[]
[vacuum_properties]
type = GenericConstantMaterial
prop_names = 'permittivity'
prop_values = '1.0'
block = vacuum
[]
[]
[Variables]
[mag_x]
block = film
[InitialCondition]
type = FunctionIC
function = '-y/sqrt(x*x + y*y + 1.7587667438*1.7587667438)'
[]
[]
[mag_y]
block = film
[InitialCondition]
type = FunctionIC
function = 'x/sqrt(x*x + y*y + 1.7587667438*1.7587667438)'
[]
[]
[mag_z]
block = film
[InitialCondition]
type = FunctionIC
function = '1.7587667438/sqrt(x*x + y*y + 1.7587667438*1.7587667438)'
[]
[]
[potential_H_int]
block = 'film vacuum'
[]
[]
[AuxVariables]
[mag_s]
block = film
[]
[Hext_x]
block = film
[]
[Hext_y]
block = film
[]
[Hext_z]
block = film
[]
[]
[AuxKernels]
[mag_norm]
type = VectorMagnitudeAux
variable = mag_s
x = mag_x
y = mag_y
z = mag_z
execute_on = 'initial timestep_end'
block = film
[]
[]
[Correctors]
[unit_magnetization]
type = PointwiseRenormalizeVector
v = 'mag_x mag_y mag_z'
norm = 1
execute_on = 'initial timestep_end final'
force_preaux = true
[]
[]
[Kernels]
[time_x]
type = TimeDerivative
variable = mag_x
block = film
[]
[exchange_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
block = film
[]
[demag_x]
type = MasterInteractionCartLLGHConst
variable = mag_x
component = 0
block = film
[]
[stt_x]
type = MasterZLSpinTransferTorqueCartLLG
variable = mag_x
component = 0
current_direction = 0
u = -12.6930
xi = 0.05
block = film
[]
[time_y]
type = TimeDerivative
variable = mag_y
block = film
[]
[exchange_y]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
block = film
[]
[demag_y]
type = MasterInteractionCartLLGHConst
variable = mag_y
component = 1
block = film
[]
[stt_y]
type = MasterZLSpinTransferTorqueCartLLG
variable = mag_y
component = 1
current_direction = 0
u = -12.6930
xi = 0.05
block = film
[]
[time_z]
type = TimeDerivative
variable = mag_z
block = film
[]
[exchange_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
block = film
[]
[demag_z]
type = MasterInteractionCartLLGHConst
variable = mag_z
component = 2
block = film
[]
[stt_z]
type = MasterZLSpinTransferTorqueCartLLG
variable = mag_z
component = 2
current_direction = 0
u = -12.6930
xi = 0.05
block = film
[]
[magnetostatic_laplace]
type = Electrostatics
variable = potential_H_int
block = 'film vacuum'
[]
[magnetostatic_source]
type = MagHStrongCart
variable = potential_H_int
block = film
[]
[]
[BCs]
[outer_vacuum]
type = DirichletBC
variable = potential_H_int
boundary = '0 1 2 3 4 5'
value = 0.0
[]
[]
[Postprocessors]
[mx]
type = ElementAverageValue
variable = mag_x
block = film
execute_on = 'initial timestep_end'
[]
[my]
type = ElementAverageValue
variable = mag_y
block = film
execute_on = 'initial timestep_end'
[]
[mz]
type = ElementAverageValue
variable = mag_z
block = film
execute_on = 'initial timestep_end'
[]
[mag_norm_min]
type = NodalExtremeValue
variable = mag_s
value_type = min
block = film
execute_on = 'initial timestep_end'
[]
[mag_norm_max]
type = NodalExtremeValue
variable = mag_s
value_type = max
block = film
execute_on = 'initial timestep_end'
[]
[Fexch]
type = MasterMagneticExchangeEnergy
energy_scale = 1.0
block = film
execute_on = 'initial timestep_end'
[]
[Fdemag]
type = MagnetostaticEnergyCart
energy_scale = 1.0
block = film
execute_on = 'initial timestep_end'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
[TimeIntegrator]
type = NewmarkBeta
[]
petsc_options_iname = '-pc_type -snes_atol -snes_rtol'
petsc_options_value = 'lu 1e-8 1e-8'
dtmin = 1e-6
dtmax = 5e-3
num_steps = 10
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 15
iteration_window = 2
linear_iteration_ratio = 1000
dt = 1e-4
growth_factor = 1.1
cutback_factor = 0.7
[]
[]
[Outputs]
file_base = out_sp5
exodus = true
csv = true
[]
(test/tests/magnets/walker_llg_above.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 300
xmin = -30
xmax = 30
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
potential_H_int = zero
Hext_x = hx
Hext_y = zero
Hext_z = zero
g0 = 1
mu0 = 1
Hscale = 1
[]
[Materials]
[constants]
type = GenericConstantMaterial
prop_names = 'alpha Ms Ae K1 nx ny nz Kh nhx nhy nhz'
prop_values = '0.1 1 1 1 1 0 0 0.5 0 0 1'
[]
[]
[Variables]
[mag_x]
[InitialCondition]
type = FunctionIC
function = '-tanh(x)'
[]
[]
[mag_y]
[InitialCondition]
type = FunctionIC
function = '1/cosh(x)'
[]
[]
[mag_z]
[InitialCondition]
type = FunctionIC
function = '0'
[]
[]
[]
[AuxVariables]
[zero]
[]
[hx]
initial_condition = 0.1
[]
[]
[Kernels]
[time_x]
type = TimeDerivative
variable = mag_x
[]
[time_y]
type = TimeDerivative
variable = mag_y
[]
[time_z]
type = TimeDerivative
variable = mag_z
[]
[MasterExchangeCartLLG_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
[]
[MasterExchangeCartLLG_y]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
[]
[MasterExchangeCartLLG_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
[]
[MasterAnisotropyCartLLG_x]
type = MasterAnisotropyCartLLG
variable = mag_x
component = 0
[]
[MasterAnisotropyCartLLG_y]
type = MasterAnisotropyCartLLG
variable = mag_y
component = 1
[]
[MasterAnisotropyCartLLG_z]
type = MasterAnisotropyCartLLG
variable = mag_z
component = 2
[]
[MasterInteractionCartLLGHConst_x]
type = MasterInteractionCartLLGHConst
variable = mag_x
component = 0
[]
[MasterInteractionCartLLGHConst_y]
type = MasterInteractionCartLLGHConst
variable = mag_y
component = 1
[]
[MasterInteractionCartLLGHConst_z]
type = MasterInteractionCartLLGHConst
variable = mag_z
component = 2
[]
[]
[UserObjects]
[renormalize]
type = PointwiseRenormalizeVector
v = 'mag_x mag_y mag_z'
execute_on = timestep_end
force_preaux = true
[]
[assert]
type = Terminator
expression = 'sim_time > 20 & abs(w/w_walker - 1) > 0.01'
fail_mode = HARD
error_level = ERROR
message = 'Walker breakdown: the wall precession rate is off (H - H_W sin 2phi)/(1 + alpha^2)'
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[Ix]
type = ElementIntegralVariablePostprocessor
variable = mag_x
[]
[dIx]
type = ChangeOverTimePostprocessor
postprocessor = Ix
[]
[Iy]
type = ElementIntegralVariablePostprocessor
variable = mag_y
[]
[dIy]
type = ChangeOverTimePostprocessor
postprocessor = Iy
[]
[Iz]
type = ElementIntegralVariablePostprocessor
variable = mag_z
[]
[dIz]
type = ChangeOverTimePostprocessor
postprocessor = Iz
[]
[dt]
type = TimestepSize
[]
[sim_time]
type = TimePostprocessor
[]
[w]
type = ParsedPostprocessor
expression = '(Iy*dIz - Iz*dIy)/((Iy*Iy + Iz*Iz)*dt)'
pp_names = 'Iy Iz dIy dIz dt'
[]
[w_walker]
type = ParsedPostprocessor
expression = '(0.1 - 0.05*sin(2*atan2(Iz, Iy)))/1.01'
pp_names = 'Iy Iz'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
scheme = bdf2
dt = 0.05
end_time = 40
nl_abs_tol = 1e-10
nl_rel_tol = 1e-8
nl_rel_step_tol = 1e-12
line_search = none
nl_forced_its = 1
[]
[Outputs]
file_base = out_walker_llg_above
csv = true
[]
(test/tests/magnets/llb_alpha_ramp_wall.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 600
xmin = -30
xmax = 30
[]
[GlobalParams]
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
g0 = 1
mu0 = 1
Hscale = 1
llb = true
[]
[Functions]
[ap]
type = ParsedFunction
expression = '0.25 + -0.002*x'
[]
[al]
type = ParsedFunction
expression = '0.15 + 0.002*x'
[]
[]
[Materials]
[constants]
type = GenericConstantMaterial
prop_names = 'alpha Ms Ae K1 nx ny nz me chi_par'
prop_values = '0.1 1 1 1 0 0 1 0.8 0.05'
[]
[alphas]
type = GenericFunctionMaterial
prop_names = 'alpha_perp alpha_par'
prop_values = 'ap al'
[]
[grad_alphas]
type = GenericConstantVectorMaterial
prop_names = 'grad_alpha_perp grad_alpha_par'
prop_values = '-0.002 0 0 0.002 0 0'
[]
[]
[Variables]
[mag_x]
[InitialCondition]
type = FunctionIC
function = '0'
[]
[]
[mag_y]
[InitialCondition]
type = FunctionIC
function = '0.8/cosh(x)'
[]
[]
[mag_z]
[InitialCondition]
type = FunctionIC
function = '0.8*tanh(x)'
[]
[]
[]
[AuxVariables]
[uz]
[]
[]
[AuxKernels]
[uz]
type = ParsedAux
variable = uz
coupled_variables = 'mag_x mag_y mag_z'
expression = 'mag_z/sqrt(mag_x^2 + mag_y^2 + mag_z^2)'
[]
[]
[Kernels]
[time_x]
type = TimeDerivative
variable = mag_x
[]
[time_y]
type = TimeDerivative
variable = mag_y
[]
[time_z]
type = TimeDerivative
variable = mag_z
[]
[MasterExchangeCartLLG_x]
type = MasterExchangeCartLLG
variable = mag_x
component = 0
[]
[MasterExchangeCartLLG_y]
type = MasterExchangeCartLLG
variable = mag_y
component = 1
[]
[MasterExchangeCartLLG_z]
type = MasterExchangeCartLLG
variable = mag_z
component = 2
[]
[MasterAnisotropyCartLLG_x]
type = MasterAnisotropyCartLLG
variable = mag_x
component = 0
[]
[MasterAnisotropyCartLLG_y]
type = MasterAnisotropyCartLLG
variable = mag_y
component = 1
[]
[MasterAnisotropyCartLLG_z]
type = MasterAnisotropyCartLLG
variable = mag_z
component = 2
[]
[MasterLongitudinalLLB_x]
type = MasterLongitudinalLLB
variable = mag_x
component = 0
form = llb
temperature = 0.5
Tc = 1
[]
[MasterLongitudinalLLB_y]
type = MasterLongitudinalLLB
variable = mag_y
component = 1
form = llb
temperature = 0.5
Tc = 1
[]
[MasterLongitudinalLLB_z]
type = MasterLongitudinalLLB
variable = mag_z
component = 2
form = llb
temperature = 0.5
Tc = 1
[]
[]
[UserObjects]
[assert]
type = Terminator
expression = 'sim_time > 10 & abs(q_rel) > 0.05'
fail_mode = HARD
error_level = ERROR
message = 'LLB wall in an alpha ramp moves: the grad(alpha) terms are missing or wrong'
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[Iuz]
type = ElementIntegralVariablePostprocessor
variable = uz
[]
[q]
type = ParsedPostprocessor
expression = '-0.5*Iuz'
pp_names = 'Iuz'
[]
[sim_time]
type = TimePostprocessor
[]
[q_rel]
type = ParsedPostprocessor
expression = 'q/(0.00396039604*sim_time)'
pp_names = 'q sim_time'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
scheme = bdf2
dt = 0.05
end_time = 20
nl_abs_tol = 1e-10
nl_rel_tol = 1e-8
nl_rel_step_tol = 1e-12
line_search = none
nl_forced_its = 1
[]
[Outputs]
file_base = out_llb_alpha_ramp_wall
csv = true
[]