- 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
MagHStrongCart
Calculates a residual contribution for bound magnetic charge (div M)
Overview
The magnetostatic Poisson equation reads,
where is the magnetostatic potential due to a bound magnetization charge . Multiplying both sides by a test function and integrating over the computational volume, we have
Integrating by parts,
The surface terms vanish due to properties of and we are left with the residual contribution for .
Note that the first term is just the Laplacian which we name Electrostatics Kernel with . The on-diagonal jacobian entries computed by,
are zero since this term does not explicitly depend on . However, we still need to compute the off-diagonal jacobian entries due to variations with respect to
where is a shape function of the finite element method and the Kronecker product.
Example Input File Syntax
Input Parameters
- 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
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/ringdown.i)
- (test/tests/spin_waves/transient_common.i)
- (test/tests/magnets/sp4_f2.i)
- (test/tests/magnets/sp3.i)
- (test/tests/magnets/slab_PML_small.i)
- (test/tests/magnets/Sstate_gen-Py_OOMF.i)
- (test/tests/magnets/mag_brick.i)
- (test/tests/spin_waves/sw_eigen_film.i)
- (test/tests/magnets/sp4_f1.i)
- (tutorial/ringdown.i)
- (test/tests/magnets/magnetostatic_brick.i)
- (test/tests/magnets/sp2_second.i)
- (test/tests/magnets/llb_demag_film.i)
- (test/tests/magnets/sp2_first.i)
- (test/tests/magnets/sp5.i)
- (test/tests/magnets/sp1.i)
(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/spin_waves/transient_common.i)
[Variables]
[mag_x]
block = film
[InitialCondition]
type = FunctionIC
function = ic_mag_x
[]
[]
[mag_z]
block = film
[InitialCondition]
type = FunctionIC
function = ic_mag_z
[]
[]
[potential_H_int]
block = 'film vacuum'
[InitialCondition]
type = FunctionIC
function = ic_potential
[]
[]
[]
[Kernels]
[mag_x_time]
type = TimeDerivative
variable = mag_x
block = film
[]
[mag_z_time]
type = TimeDerivative
variable = mag_z
block = film
[]
[magnetostatic_source]
type = MagHStrongCart
variable = potential_H_int
mag_y = 0.0
block = film
[]
[]
[Postprocessors]
[gx]
type = PointValue
variable = mag_x
point = '0.0 0.0 0.0'
execute_on = 'initial timestep_end'
[]
[gz]
type = PointValue
variable = mag_z
point = '0.0 0.0 0.0'
execute_on = 'initial timestep_end'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
[TimeIntegrator]
type = CrankNicolson
[]
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu mumps'
nl_rel_tol = 1e-12
nl_abs_tol = 1e-30
dt = ${dt}
num_steps = ${num_steps}
[]
(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/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/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/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/sw_eigen_film.i)
!include film_common.i
[Variables]
[mag_x]
block = film
[]
[mag_z]
block = film
[]
[potential_H_int]
block = 'film vacuum'
[]
[]
[Kernels]
[mag_x_time]
type = CoefReaction
variable = mag_x
coefficient = -1.0
extra_vector_tags = 'eigen'
block = film
[]
[mag_z_time]
type = CoefReaction
variable = mag_z
coefficient = -1.0
extra_vector_tags = 'eigen'
block = film
[]
[magnetostatic_source]
type = MagHStrongCart
variable = potential_H_int
block = film
[]
[]
[Problem]
active_eigen_index = 2
[]
[VectorPostprocessors]
[eigenvalues]
type = Eigenvalues
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[eig_0]
type = VectorPostprocessorComponent
vectorpostprocessor = eigenvalues
vector_name = eigen_values_imag
index = 0
execute_on = 'timestep_end'
outputs = none
[]
[omega_n0]
type = ParsedPostprocessor
expression = 'abs(eig_0)'
pp_names = 'eig_0'
execute_on = 'timestep_end'
[]
[eig_2]
type = VectorPostprocessorComponent
vectorpostprocessor = eigenvalues
vector_name = eigen_values_imag
index = 2
execute_on = 'timestep_end'
outputs = none
[]
[omega_n1]
type = ParsedPostprocessor
expression = 'abs(eig_2)'
pp_names = 'eig_2'
execute_on = 'timestep_end'
[]
[eig_4]
type = VectorPostprocessorComponent
vectorpostprocessor = eigenvalues
vector_name = eigen_values_imag
index = 4
execute_on = 'timestep_end'
outputs = none
[]
[omega_n2]
type = ParsedPostprocessor
expression = 'abs(eig_4)'
pp_names = 'eig_4'
execute_on = 'timestep_end'
[]
[eig_6]
type = VectorPostprocessorComponent
vectorpostprocessor = eigenvalues
vector_name = eigen_values_imag
index = 6
execute_on = 'timestep_end'
outputs = none
[]
[omega_n3]
type = ParsedPostprocessor
expression = 'abs(eig_6)'
pp_names = 'eig_6'
execute_on = 'timestep_end'
[]
[rel_kittel]
type = ParsedPostprocessor
expression = 'omega_n0 / (140.206695 * 0.238434) - 1'
pp_names = 'omega_n0'
execute_on = 'timestep_end'
[]
[]
[UserObjects]
[kittel]
type = Terminator
expression = '!(abs(rel_kittel) < 1e-10)'
fail_mode = HARD
error_level = ERROR
message = 'k = 0 eigenvalue is not the Kittel frequency g0 (H0 - Ms)'
execute_on = 'timestep_end'
[]
[]
[Executioner]
type = Eigenvalue
solve_type = KRYLOVSCHUR
eigen_problem_type = GEN_NON_HERMITIAN
which_eigen_pairs = TARGET_MAGNITUDE
n_eigen_pairs = 8
n_basis_vectors = 24
eigen_tol = 1e-12
initial_eigenvalue = 1e12
petsc_options_iname = '-st_type -eps_target -st_pc_type -st_pc_factor_mat_solver_type'
petsc_options_value = 'sinvert 0 lu mumps'
[]
[Outputs]
file_base = out_sw_eigen_film
exodus = true
csv = true
execute_on = 'timestep_end'
[]
(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
[]
(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/magnetostatic_brick.i)
[Mesh]
[./fmg]
type = FileMeshGenerator
file = exodus_pysq_dx1_AnoI.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 long_susc t'
prop_values = '0.01 0.013 1.2 221010.0 1256.64 1 0 0 1.0 0'
[../]
[./a_long]
type = GenericFunctionMaterial
prop_names = 'alpha_long'
prop_values = 'bc_func_1'
[../]
[./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 = '100.0'
[../]
[]
[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
block = '1'
[./InitialCondition]
type = RandomIC
min = 0.001
max = 0.002
seed = 2
[../]
[../]
[./polar_theta]
order = FIRST
family = LAGRANGE
block = '1'
[./InitialCondition]
type = RandomIC
min = 1.5707
max = 1.5708
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'
[../]
[]
[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 = ExchangeCartLL
variable = mag_x
component = 0
[../]
[./dllg_y_exch]
type = ExchangeCartLL
variable = mag_y
component = 1
[../]
[./dllg_z_exch]
type = ExchangeCartLL
variable = mag_z
component = 2
[../]
[./d_HM_x]
type = InteractionCartLL
variable = mag_x
component = 0
[../]
[./d_HM_y]
type = InteractionCartLL
variable = mag_y
component = 1
[../]
[./d_HM_z]
type = InteractionCartLL
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'
mag_x = mag_x
mag_y = mag_y
mag_z = mag_z
[../]
[./llb_x]
type = LongitudinalLLB
variable = mag_x
component = 0
[../]
[./llb_y]
type = LongitudinalLLB
variable = mag_y
component = 1
[../]
[./llb_z]
type = LongitudinalLLB
variable = mag_z
component = 2
[../]
[]
[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 = 'timestep_end final'
[../]
[./<mx>]
type = ElementAverageValue
variable = mag_x
block = '1'
execute_on = 'timestep_end final'
[../]
[./<my>]
type = ElementAverageValue
variable = mag_y
block = '1'
execute_on = 'timestep_end final'
[../]
[./<mz>]
type = ElementAverageValue
variable = mag_z
block = '1'
execute_on = 'timestep_end final'
[../]
[./Fexch]
type = MagneticExchangeEnergy
execute_on = 'timestep_end final'
block = '1'
[../]
[./Fdemag]
type = MagnetostaticEnergyCart
execute_on = 'timestep_end final'
block = '1'
[../]
[./Fllb]
type = MagneticExcessLLBEnergy
execute_on = 'timestep_end final'
block = '1'
[../]
[./Ftot]
type = LinearCombinationPostprocessor
pp_names = 'Fexch Fdemag Fllb'
pp_coefs = ' 1.0 1.0 1.0'
execute_on = 'timestep_end final'
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
petsc_options = '-snes_ksp_ew -snes_converged_reason'
petsc_options_iname = ' -ksp_gmres_restart -snes_atol -snes_rtol -ksp_rtol -pc_type'
petsc_options_value = ' 121 1e-10 1e-8 1e-6 bjacobi'
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
[./TimeIntegrator]
type = ImplicitEuler
[../]
dtmin = 1e-9
dtmax = 1.0e-5
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 18
growth_factor = 1.3
cutback_factor = 0.8
dt = 1.0e-8
[../]
verbose = true
num_steps = 2
[]
[Outputs]
print_linear_residuals = false
[./out]
type = Exodus
file_base = out_magnetostatic_brick
elemental_as_nodal = true
time_step_interval = 1
[../]
[./outCSV]
type = CSV
file_base = out_magnetostatic_brick
[../]
[]
(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/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/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/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
[]