Phase Behaviors of Block Copolymers - Part 2: Microphase Separation
import Pkg
Pkg.activate(".")
using Polymer
using Scattering
using Polyorder
using PhaseDiagram
using PolymerArchitectureMakie
using CairoMakie
using LaTeXStrings
using Random: Xoshiro Activating project at `~/SynologyDrive/Develop/Polyorder.jl/docs/tutorial`# Suppressing displaying source code file location for @info
using Logging
global_logger(ConsoleLogger());include("common.jl");Phase diagram maps equilibrium phases to the parameter space. To construct a phase diagram for microphase separation, it is sufficient to determine the phase boundary between each pair of phases. The phase boundary is determined by comparing the free energies of two phases and find the point where the free energies are equal.
Manual construction
Use batch evaluations to obtain free energies for both phases as in the User Guide Part1 for LAM and HEX. Then find the cross point of the two free energy curves, which corresponds to the phase boundary.
Batch evaluations of LAM
We can compute the free energies of LAM for a list of $f_A$ values.
scft_AB_lam = let
ds = 0.01
uc = UnitCell(3.0)
lat = BravaisLattice(uc)
system = AB_system(χN=15.0, fA=0.36)
NoncyclicChainSCFT(system, lat, ds; rng=Xoshiro(3083))
end;Polyorder.solve!(scft_AB_lam) # Pre-solve to obtain a stable LAM phase.[ Info: ******* SCFT Simulation Start *******
[ Info: Algorithm: PicardMann iteration with α=0.2.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.0]
└ * Angles: [0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: number: 100
[ Info: F: 2.3596143503
[ Info: resediual norm: 0.00376
[ Info: number: 200
[ Info: F: 2.3619067229
[ Info: resediual norm: 0.000168
[ Info: number: 300
[ Info: F: 2.3619040246
[ Info: resediual norm: 3.21e-5
[ Info: number: 400
[ Info: F: 2.3619039943
[ Info: resediual norm: 6.18e-6
[ Info: number: 500
[ Info: F: 2.3619039973
[ Info: resediual norm: 1.19e-6
[ Info: final loss: 9.94139049540598e-7
[ Info: Stop triggered by EarlyStopping.Threshold(1.0e-6) stopping criterion.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3619039975
[ Info: final loss: 9.94e-7
[ Info: final stress norm: 0.0939920283496345
┌ Info: final unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.0]
└ * Angles: [0]
[ Info: iterations: 511
[ Info: time per iteration: 4 milliseconds, 4 microseconds, 776 nanoseconds
[ Info: Run time: 00:00:02.046440542
[ Info: =======================================
Polyorder.Successful()begin
# volume fractions for AB component
fAs_lam = [0.36, 0.38, 0.4, 0.42]
fA_ctrl = fControlParameter(:A, :AB, scft_AB_lam.system)
Fs_lam = similar(fAs_lam)
μs_lam = similar(fAs_lam)
info_lam = []
end;using Polyorder: BB, SISlet
scft = Polyorder.clone(scft_AB_lam)
for i in eachindex(fAs_lam)
system = Polymer.update!(scft.system, fAs_lam[i], fA_ctrl)
lat = Polyorder.lattice(scft) # use the lattice from the previous optimized model
scft = Polyorder.reset(scft, lat, system)
updater = VariableCell(BB(1.0), SIS(1.0))
conv, _ = cell_solve!(scft, updater)
Fs_lam[i], μs_lam[i] = Polyorder.F(scft), Polyorder.μ̃(scft, 1)
# Store extra information
info = (convgence=conv,
fA=fAs_lam[i],
F=Polyorder.F(scft),
Lx=first(Polyorder.unitcell(scft).edges),
Nx=first(size(first(scft.ϕfields))))
push!(info_lam, info)
end
end[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.0]
└ * Angles: [0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: final loss: 9.595717099636902e-7
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3352553246
[ Info: final loss: 9.6e-7
[ Info: final stress norm: 3.9e-7
┌ Info: final unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.568902930418528]
└ * Angles: [0]
[ Info: iterations: 150
[ Info: time per iteration: 10 milliseconds, 476 microseconds, 999 nanoseconds
[ Info: Run time: 00:00:01.571549916
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.568902930418528]
└ * Angles: [0]
[ Info: Final F: 2.3352553246344625
[ Info: Final loss: 9.595717099636902e-7
[ Info: Final stress: 3.898838449629261e-7
[ Info: Total solve! calls: 15
[ Info: Total SCFT iterations: 150
[ Info: Total time: 00:00:02
[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.568902930418528]
└ * Angles: [0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: final loss: 8.134908382583924e-7
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3658445739
[ Info: final loss: 8.13e-7
[ Info: final stress norm: 1.05e-7
┌ Info: final unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.6166852581030238]
└ * Angles: [0]
[ Info: iterations: 140
[ Info: time per iteration: 51 microseconds, 859 nanoseconds
[ Info: Run time: 00:00:00.007260334
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.6166852581030238]
└ * Angles: [0]
[ Info: Final F: 2.365844573901427
[ Info: Final loss: 8.134908382583924e-7
[ Info: Final stress: 1.0546155199128313e-7
[ Info: Total solve! calls: 14
[ Info: Total SCFT iterations: 140
[ Info: Total time: 00:00:01
[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.6166852581030238]
└ * Angles: [0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: final loss: 6.943105629522423e-7
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3882218072
[ Info: final loss: 6.94e-7
[ Info: final stress norm: 2.22e-8
┌ Info: final unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.6509168879961176]
└ * Angles: [0]
[ Info: iterations: 140
[ Info: time per iteration: 50 microseconds, 549 nanoseconds
[ Info: Run time: 00:00:00.007076875
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.6509168879961176]
└ * Angles: [0]
[ Info: Final F: 2.388221807209647
[ Info: Final loss: 6.943105629522423e-7
[ Info: Final stress: 2.2178459449717124e-8
[ Info: Total solve! calls: 14
[ Info: Total SCFT iterations: 140
[ Info: Total time: 00:00:01
[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.6509168879961176]
└ * Angles: [0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: final loss: 5.007952005834704e-7
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.4044851945
[ Info: final loss: 5.01e-7
[ Info: final stress norm: 1.33e-6
┌ Info: final unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.675603789484451]
└ * Angles: [0]
[ Info: iterations: 150
[ Info: time per iteration: 52 microseconds
[ Info: Run time: 00:00:00.007800125
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.675603789484451]
└ * Angles: [0]
[ Info: Final F: 2.4044851945184007
[ Info: Final loss: 5.007952005834704e-7
[ Info: Final stress: 1.3302820195466843e-6
[ Info: Total solve! calls: 15
[ Info: Total SCFT iterations: 150
[ Info: Total time: 00:00:01Free energy as a function of $f_A$ for LAM:
let
f = Figure()
ax = Axis(f[1, 1],
xlabel = L"f",
ylabel = L"F",
)
lines!(ax, fAs_lam, Fs_lam, label=nothing)
scatter!(ax, fAs_lam, Fs_lam, label="F")
f
end┌ Warning: Found `resolution` in the theme when creating a `Scene`. The `resolution` keyword for `Scene`s and `Figure`s has been deprecated. Use `Figure(; size = ...` or `Scene(; size = ...)` instead, which better reflects that this is a unitless size and not a pixel resolution. The key could also come from `set_theme!` calls or related theming functions.
└ @ Makie ~/.julia/packages/Makie/PpRC2/src/scenes.jl:264Exercises
- Compute the free energies of the LAM phase for the same system with
χN=20.0andfA=[0.36, 0.38, 0.40, 0.42].
Batch evaluations of HEX
We can compute the free energies of HEX for a list of $f_A$ values.
scft_AB_hex = let
ds = 0.01
uc = UnitCell(Hexagonal2D(), 3.6) # A simple cell with side length 3.6 Rg
lat = BravaisLattice(uc, 17) # space group No.17
system = AB_system(χN=15.0, fA=0.36)
NoncyclicChainSCFT(system, lat, ds; rng=Xoshiro(3083))
end;let
# scftconfig = SCFTConfig(symmetrize=false, max_iter=500, tolmode=:F, tol=1e-8)
# config = Polyorder.Config(scft=scftconfig)
Polyorder.solve!(scft_AB_hex)
end[ Info: ******* SCFT Simulation Start *******
[ Info: Algorithm: PicardMann iteration with α=0.2.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [3.6, 3.6]
└ * Angles: [2π/3, 0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: number: 100
[ Info: F: 2.3284747293
[ Info: resediual norm: 0.00352
[ Info: number: 200
[ Info: F: 2.3276921116
[ Info: resediual norm: 0.000201
[ Info: number: 300
[ Info: F: 2.327690384
[ Info: resediual norm: 1.44e-5
[ Info: number: 400
[ Info: F: 2.3276903624
[ Info: resediual norm: 2.51e-6
[ Info: final loss: 9.992651720955644e-7
[ Info: Stop triggered by EarlyStopping.Threshold(1.0e-6) stopping criterion.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.327690362
[ Info: final loss: 9.99e-7
[ Info: final stress norm: 0.029823303918913472
┌ Info: final unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [3.6, 3.6]
└ * Angles: [2π/3, 0]
[ Info: iterations: 459
[ Info: time per iteration: 5 milliseconds, 933 microseconds, 185 nanoseconds
[ Info: Run time: 00:00:02.723332125
[ Info: =======================================
Polyorder.Successful()begin
# volume fractions for AB component
fAs_hex = [0.36, 0.38, 0.4, 0.42]
Fs_hex = similar(fAs_hex)
μs_hex = similar(fAs_hex)
info_hex = []
end;using Polyorder: SDlet
scft = Polyorder.clone(scft_AB_hex)
# scftconfig = SCFTConfig(symmetrize=false, max_iter=500, tolmode=:F, tol=1e-8)
# config = Polyorder.Config(scft=scftconfig)
for i in eachindex(fAs_hex)
system = Polymer.update!(scft.system, fAs_hex[i], fA_ctrl)
lat = Polyorder.lattice(scft)
scft = Polyorder.reset(scft, lat, system)
updater = VariableCell(BB(1.0), SD(0.2))
conv, _ = cell_solve!(scft, updater)
Fs_hex[i], μs_hex[i] = Polyorder.F(scft), Polyorder.μ̃(scft, 1)
# Store extra information
info = (convgence=conv, fA=fAs_hex[i],
F = Polyorder.F(scft),
Lx=first(Polyorder.unitcell(scft).edges),
Nx=first(size(first(scft.ϕfields))))
push!(info_hex, info)
end
end[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: PicardMann iteration with α=0.2.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: PicardMann iteration with α=0.2.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [3.6, 3.6]
└ * Angles: [2π/3, 0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: final loss: 9.797643604529494e-7
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3150938261
[ Info: final loss: 9.8e-7
[ Info: final stress norm: 9.81e-8
┌ Info: final unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.0306822253173475, 4.0306822253173475]
└ * Angles: [2π/3, 0]
[ Info: iterations: 160
[ Info: time per iteration: 10 milliseconds, 130 microseconds, 100 nanoseconds
[ Info: Run time: 00:00:01.620816
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.0306822253173475, 4.0306822253173475]
└ * Angles: [2π/3, 0]
[ Info: Final F: 2.31509382607038
[ Info: Final loss: 9.797643604529494e-7
[ Info: Final stress: 9.806045297014538e-8
[ Info: Total solve! calls: 16
[ Info: Total SCFT iterations: 160
[ Info: Total time: 00:00:02
[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: PicardMann iteration with α=0.2.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: PicardMann iteration with α=0.2.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.0306822253173475, 4.0306822253173475]
└ * Angles: [2π/3, 0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: final loss: 9.674475752807772e-7
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3579593364
[ Info: final loss: 9.67e-7
[ Info: final stress norm: 2.52e-9
┌ Info: final unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.104234539756489, 4.104234539756489]
└ * Angles: [2π/3, 0]
[ Info: iterations: 160
[ Info: time per iteration: 1 millisecond, 633 microseconds, 595 nanoseconds
[ Info: Run time: 00:00:00.261375209
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.104234539756489, 4.104234539756489]
└ * Angles: [2π/3, 0]
[ Info: Final F: 2.357959336365453
[ Info: Final loss: 9.674475752807772e-7
[ Info: Final stress: 2.5181214110697884e-9
[ Info: Total solve! calls: 16
[ Info: Total SCFT iterations: 160
[ Info: Total time: 00:00:01
[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: PicardMann iteration with α=0.2.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: PicardMann iteration with α=0.2.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.104234539756489, 4.104234539756489]
└ * Angles: [2π/3, 0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: final loss: 9.347951324412535e-7
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.393925361
[ Info: final loss: 9.35e-7
[ Info: final stress norm: 1.29e-7
┌ Info: final unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.172558777630803, 4.172558777630803]
└ * Angles: [2π/3, 0]
[ Info: iterations: 160
[ Info: time per iteration: 1 millisecond, 847 microseconds, 199 nanoseconds
[ Info: Run time: 00:00:00.295551959
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.172558777630803, 4.172558777630803]
└ * Angles: [2π/3, 0]
[ Info: Final F: 2.3939253609651043
[ Info: Final loss: 9.347951324412535e-7
[ Info: Final stress: 1.2857142058946847e-7
[ Info: Total solve! calls: 16
[ Info: Total SCFT iterations: 160
[ Info: Total time: 00:00:01
[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: PicardMann iteration with α=0.2.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: PicardMann iteration with α=0.2.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.172558777630803, 4.172558777630803]
└ * Angles: [2π/3, 0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: final loss: 9.301131045571324e-7
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.4240940119
[ Info: final loss: 9.3e-7
[ Info: final stress norm: 1.37e-7
┌ Info: final unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.235022817670918, 4.235022817670918]
└ * Angles: [2π/3, 0]
[ Info: iterations: 160
[ Info: time per iteration: 1 millisecond, 641 microseconds, 28 nanoseconds
[ Info: Run time: 00:00:00.262564625
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.235022817670918, 4.235022817670918]
└ * Angles: [2π/3, 0]
[ Info: Final F: 2.424094011891566
[ Info: Final loss: 9.301131045571324e-7
[ Info: Final stress: 1.371729116417781e-7
[ Info: Total solve! calls: 16
[ Info: Total SCFT iterations: 160
[ Info: Total time: 00:00:01Free energy as a function of $f_A$ for HEX:
let
f = Figure()
ax = Axis(f[1, 1],
xlabel = L"f",
ylabel = L"F",
)
lines!(ax, fAs_hex, Fs_hex, label=nothing)
scatter!(ax, fAs_hex, Fs_hex, label="HEX")
f
end┌ Warning: Found `resolution` in the theme when creating a `Scene`. The `resolution` keyword for `Scene`s and `Figure`s has been deprecated. Use `Figure(; size = ...` or `Scene(; size = ...)` instead, which better reflects that this is a unitless size and not a pixel resolution. The key could also come from `set_theme!` calls or related theming functions.
└ @ Makie ~/.julia/packages/Makie/PpRC2/src/scenes.jl:264Exercises
- Compute the free energies of the HEX phase for the same system with χN=20.0 and fA=[0.36, 0.38, 0.40, 0.42].
Determine the phase boundary
Let us first visualize the curves by plotting them together:
let
f = Figure()
ax = Axis(f[1, 1],
xlabel = L"f",
ylabel = L"F",
)
lines!(ax, fAs_lam, Fs_lam, label=nothing)
scatter!(ax, fAs_lam, Fs_lam, label="LAM")
lines!(ax, fAs_hex, Fs_hex, label=nothing)
scatter!(ax, fAs_hex, Fs_hex, label="HEX")
f
end┌ Warning: Found `resolution` in the theme when creating a `Scene`. The `resolution` keyword for `Scene`s and `Figure`s has been deprecated. Use `Figure(; size = ...` or `Scene(; size = ...)` instead, which better reflects that this is a unitless size and not a pixel resolution. The key could also come from `set_theme!` calls or related theming functions.
└ @ Makie ~/.julia/packages/Makie/PpRC2/src/scenes.jl:264It can be easily seen that the phase boundary locates among the interval [0.38, 0.4]. A convenient approximation of the phase boundary point is connecting the free energy point by straight line segment for each phase and finding the intersection point.
fb_manual = let
fa_lam, Fa_lam, fb_lam, Fb_lam = 0.38, Fs_lam[2], 0.4, Fs_lam[3]
fa_hex, Fa_hex, fb_hex, Fb_hex = 0.38, Fs_hex[2], 0.4, Fs_hex[3]
# Line segment for LAM phase: y = k_lam (x - fa_lam) + Fa_lam
k_lam = (Fb_lam - Fa_lam) / (fb_lam - fa_lam)
# Line segment for HEX phase: y = k_hex (x - fa_hex) + Fa_hex
k_hex = (Fb_hex - Fa_hex) / (fb_hex - fa_hex)
# The intersection of two lines are found by solving: (k_lam-k_hex)x + (k_hex*fa_hex-k_lam*fa_lam) + (Fa_lam - Fa_hex) = 0
f_boundary = ((k_hex*fa_hex-k_lam*fa_lam) + (Fa_lam - Fa_hex)) / (k_hex - k_lam)
end0.39160550245693465The approximate boundary locates around $f_A=0.3916$. To increase the accuracy of the approximation, you can refine the grid, i.e. adding more points among the interval [0.38, 0.4].
Semi-automated construction
The above manual construction of phase diagrams can be automated. The determination of the phase boundary point is essentially a root-finding problem. Thus root-finding algorithms can be utilized to solve the problem. PhaseDiagram.jl has implemented such approach.
We first create a PolyorderModel instance which wraps the SCFT model and its full configuration:
using Polyorder: Andersonfunction model_lam()
# create a SCFT model
ds = 0.01
uc = UnitCell(3.0)
lat = BravaisLattice(uc)
system = AB_system(χN=15.0, fA=0.36)
scft = NoncyclicChainSCFT(system, lat, ds; rng=Xoshiro(3083))
io = Polyorder.IOConfig(base_dir="microphase")
config = Polyorder.Config(; io)
# prepare a well converged SCFT model via a stable SD updater
Polyorder.solve!(scft, config)
# opt = Polyorder.default(VariableCellOpt)
opt = VariableCellOpt(VariableCell(BB(1.0), SIS(1.0)))
return PolyorderModel(scft, opt, config, false)
endmodel_lam (generic function with 1 method)It is a good habit to check whether the initial model has the correct phase structure by plotting its density field. It is critical to make sure that the expected phase structrure is generated by the intial model before going to the next step.
let
m = model_lam()
Polyorder.solve!(m.scft, m.config) # one-step solving converts auxiliary fields to density fields.
plot_density(m.scft)
end[ Info: ******* SCFT Simulation Start *******
[ Info: Algorithm: PicardMann iteration with α=0.2.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.0]
└ * Angles: [0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: number: 100
[ Info: F: 2.3596143503
[ Info: resediual norm: 0.00376
[ Info: number: 200
[ Info: F: 2.3619067229
[ Info: resediual norm: 0.000168
[ Info: number: 300
[ Info: F: 2.3619040246
[ Info: resediual norm: 3.21e-5
[ Info: number: 400
[ Info: F: 2.3619039943
[ Info: resediual norm: 6.18e-6
[ Info: number: 500
[ Info: F: 2.3619039973
[ Info: resediual norm: 1.19e-6
[ Info: final loss: 9.94139049540598e-7
[ Info: Stop triggered by EarlyStopping.Threshold(1.0e-6) stopping criterion.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3619039975
[ Info: final loss: 9.94e-7
[ Info: final stress norm: 0.0939920283496345
┌ Info: final unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.0]
└ * Angles: [0]
[ Info: iterations: 511
[ Info: time per iteration: 39 microseconds, 369 nanoseconds
[ Info: Run time: 00:00:00.020117875
[ Info: =======================================
[ Info: ******* SCFT Simulation Start *******
[ Info: Algorithm: PicardMann iteration with α=0.2.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: 2.3619039975
[ Info: initial residual norm: 9.94e-7
[ Info: initial stress norm: 0.094
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.0]
└ * Angles: [0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: final loss: 9.779180336097139e-7
[ Info: Stop triggered by EarlyStopping.Threshold(1.0e-6) stopping criterion.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3619039975
[ Info: final loss: 9.78e-7
[ Info: final stress norm: 0.0939920282794355
┌ Info: final unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.0]
└ * Angles: [0]
[ Info: iterations: 1
[ Info: time per iteration: 4 milliseconds, 824 microseconds, 834 nanoseconds
[ Info: Run time: 00:00:00.004824834
[ Info: =======================================
┌ Warning: Found `resolution` in the theme when creating a `Scene`. The `resolution` keyword for `Scene`s and `Figure`s has been deprecated. Use `Figure(; size = ...` or `Scene(; size = ...)` instead, which better reflects that this is a unitless size and not a pixel resolution. The key could also come from `set_theme!` calls or related theming functions.
└ @ Makie ~/.julia/packages/Makie/PpRC2/src/scenes.jl:264function model_hex()
ds = 0.01
uc = UnitCell(Hexagonal2D(), 4.2) # A simple cell with side length 4.2 Rg
lat = BravaisLattice(uc)
system = AB_system(χN=15.0, fA=0.36)
scft = NoncyclicChainSCFT(system, lat, ds; rng=Xoshiro(3083))
io = Polyorder.IOConfig(base_dir="microphase")
config = Polyorder.Config(; io)
# prepare a well converged SCFT model via a stable SD updater
Polyorder.solve!(scft, config)
# opt = Polyorder.default(VariableCellOpt)
opt = VariableCellOpt(VariableCell(BB(1.0), Anderson(20; warmup=10)))
return PolyorderModel(scft, opt, config, false)
endmodel_hex (generic function with 1 method)Check whether the hexagonal cyclinder phase is generated by the model_hex function.
let
m = model_hex()
Polyorder.solve!(m.scft, m.config) # one-step solving converts auxiliary fields to density fields.
plot_density(m.scft)
end[ Info: ******* SCFT Simulation Start *******
[ Info: Algorithm: PicardMann iteration with α=0.2.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.2, 4.2]
└ * Angles: [2π/3, 0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: number: 100
[ Info: F: 2.322617458
[ Info: resediual norm: 0.0058
[ Info: number: 200
[ Info: F: 2.3169690915
[ Info: resediual norm: 0.000152
[ Info: number: 300
[ Info: F: 2.316961018
[ Info: resediual norm: 2.27e-5
[ Info: number: 400
[ Info: F: 2.3169608315
[ Info: resediual norm: 3.44e-6
[ Info: final loss: 9.911340765495542e-7
[ Info: Stop triggered by EarlyStopping.Threshold(1.0e-6) stopping criterion.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3169608293
[ Info: final loss: 9.91e-7
[ Info: final stress norm: 0.010818464586903642
┌ Info: final unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.2, 4.2]
└ * Angles: [2π/3, 0]
[ Info: iterations: 467
[ Info: time per iteration: 914 microseconds, 96 nanoseconds
[ Info: Run time: 00:00:00.426883125
[ Info: =======================================
┌ Warning: Timed out waiting for `Base.active_repl_backend.ast_transforms` to become available. Autoloads will not work.
└ @ BasicAutoloads ~/.julia/packages/BasicAutoloads/08hIo/src/BasicAutoloads.jl:117
[ Info: If you have a slow startup file, consider moving `register_autoloads` to the end of it.
[ Info: ******* SCFT Simulation Start *******
[ Info: Algorithm: PicardMann iteration with α=0.2.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: 2.3169608293
[ Info: initial residual norm: 9.91e-7
[ Info: initial stress norm: 0.0108
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.2, 4.2]
└ * Angles: [2π/3, 0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: final loss: 9.730749627292008e-7
[ Info: Stop triggered by EarlyStopping.Threshold(1.0e-6) stopping criterion.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3169608293
[ Info: final loss: 9.73e-7
[ Info: final stress norm: 0.010818464612850957
┌ Info: final unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.2, 4.2]
└ * Angles: [2π/3, 0]
[ Info: iterations: 1
[ Info: time per iteration: 999 microseconds, 167 nanoseconds
[ Info: Run time: 00:00:00.000999167
[ Info: =======================================
┌ Warning: Found `resolution` in the theme when creating a `Scene`. The `resolution` keyword for `Scene`s and `Figure`s has been deprecated. Use `Figure(; size = ...` or `Scene(; size = ...)` instead, which better reflects that this is a unitless size and not a pixel resolution. The key could also come from `set_theme!` calls or related theming functions.
└ @ Makie ~/.julia/packages/Makie/PpRC2/src/scenes.jl:264We use the microphase function to find the phase boundary point automatically using a root-finding algorithm enclosed in the RootsOptimizer instance. A MicrophaseModel object is required by the microphase function.
fb_auto = let
mipm = MicrophaseModel(model_lam(), model_hex(), fA_ctrl,
a=0.36, b=0.42, phase1=LAMPhase, phase2=HEXPhase,
cache=true)
f, tracker = microphase(RootsOptimizer(), mipm)
end[ Info: ******* SCFT Simulation Start *******
[ Info: Algorithm: PicardMann iteration with α=0.2.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.0]
└ * Angles: [0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: number: 100
[ Info: F: 2.3596143503
[ Info: resediual norm: 0.00376
[ Info: number: 200
[ Info: F: 2.3619067229
[ Info: resediual norm: 0.000168
[ Info: number: 300
[ Info: F: 2.3619040246
[ Info: resediual norm: 3.21e-5
[ Info: number: 400
[ Info: F: 2.3619039943
[ Info: resediual norm: 6.18e-6
[ Info: number: 500
[ Info: F: 2.3619039973
[ Info: resediual norm: 1.19e-6
[ Info: final loss: 9.94139049540598e-7
[ Info: Stop triggered by EarlyStopping.Threshold(1.0e-6) stopping criterion.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3619039975
[ Info: final loss: 9.94e-7
[ Info: final stress norm: 0.0939920283496345
┌ Info: final unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.0]
└ * Angles: [0]
[ Info: iterations: 511
[ Info: time per iteration: 42 microseconds, 690 nanoseconds
[ Info: Run time: 00:00:00.021814791
[ Info: =======================================
[ Info: ******* SCFT Simulation Start *******
[ Info: Algorithm: PicardMann iteration with α=0.2.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.2, 4.2]
└ * Angles: [2π/3, 0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: number: 100
[ Info: F: 2.322617458
[ Info: resediual norm: 0.0058
[ Info: number: 200
[ Info: F: 2.3169690915
[ Info: resediual norm: 0.000152
[ Info: number: 300
[ Info: F: 2.316961018
[ Info: resediual norm: 2.27e-5
[ Info: number: 400
[ Info: F: 2.3169608315
[ Info: resediual norm: 3.44e-6
[ Info: final loss: 9.911340765495542e-7
[ Info: Stop triggered by EarlyStopping.Threshold(1.0e-6) stopping criterion.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3169608293
[ Info: final loss: 9.91e-7
[ Info: final stress norm: 0.010818464586903642
┌ Info: final unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.2, 4.2]
└ * Angles: [2π/3, 0]
[ Info: iterations: 467
[ Info: time per iteration: 929 microseconds, 46 nanoseconds
[ Info: Run time: 00:00:00.433864833
[ Info: =======================================
[ Info: ======================================================
[ Info:
[ Info: f = 0.36 phase: LAM
[ Info:
[ Info: ======================================================
[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: 2.3619039975
[ Info: initial residual norm: 9.94e-7
[ Info: initial stress norm: 0.094
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.0]
└ * Angles: [0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: final loss: 9.594305439896204e-7
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3352553246
[ Info: final loss: 9.59e-7
[ Info: final stress norm: 3.9e-7
┌ Info: final unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.568902930382072]
└ * Angles: [0]
[ Info: iterations: 150
[ Info: time per iteration: 53 microseconds, 606 nanoseconds
[ Info: Run time: 00:00:00.008041
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.568902930382072]
└ * Angles: [0]
[ Info: Final F: 2.335255324634083
[ Info: Final loss: 9.594305439896204e-7
[ Info: Final stress: 3.8987997674233964e-7
[ Info: Total solve! calls: 15
[ Info: Total SCFT iterations: 150
[ Info: Total time: 00:00:01
[ Info: ======================================================
[ Info:
[ Info: f = 0.36 phase: HEX
[ Info:
[ Info: ======================================================
[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: Anderson acceleration AA(20)
│ * Warmup: 10 PicardMann iterations with α=0.2
│ * Precondition: PicardMann iteration with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: Anderson acceleration AA(20)
│ * Warmup: 10 PicardMann iterations with α=0.2
│ * Precondition: PicardMann iteration with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: 2.3169608293
[ Info: initial residual norm: 9.91e-7
[ Info: initial stress norm: 0.0108
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.2, 4.2]
└ * Angles: [2π/3, 0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: Init: F=2.3169608292771846, residual=8.248555811746507e-7
[ Info: Init: F=2.316902650720509, residual=7.132374015539926e-6
[ Info: final loss: 2.3412798099577415e-7
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.315093488
[ Info: final loss: 2.34e-7
[ Info: final stress norm: 9.15e-6
┌ Info: final unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.0308133919640134, 4.0308133919640134]
└ * Angles: [2π/3, 0]
[ Info: iterations: 148
[ Info: time per iteration: 14 milliseconds, 679 microseconds, 211 nanoseconds
[ Info: Run time: 00:00:02.172523375
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.0308133919640134, 4.0308133919640134]
└ * Angles: [2π/3, 0]
[ Info: Final F: 2.3150934880104455
[ Info: Final loss: 2.3412798099577415e-7
[ Info: Final stress: 9.152644181270898e-6
[ Info: Total solve! calls: 13
[ Info: Total SCFT iterations: 148
[ Info: Total time: 00:00:03
[ Info: ======================================================
[ Info:
[ Info: f = 0.42 phase: LAM
[ Info:
[ Info: ======================================================
[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Final state: n=14, #fevals=14, cell size=3.5689029304, residual=2.06e-6.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
│ Final state: n=130, #fevals=130, F=2.3352553246, residual=9.59e-7.
│ * Scheme: run fields updater 10 times per cell iteration.
└ * Final state: n=15, #fevals=150, F=2.3352553246, residual=9.59e-7, stress norm=3.9e-7.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Final state: n=14, #fevals=14, cell size=3.5689029304, residual=2.06e-6.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.568902930382072]
└ * Angles: [0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: final loss: 8.230989434217042e-7
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.4044852685
[ Info: final loss: 8.23e-7
[ Info: final stress norm: 2.41e-7
┌ Info: final unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.6755957570172404]
└ * Angles: [0]
[ Info: iterations: 170
[ Info: time per iteration: 51 microseconds, 406 nanoseconds
[ Info: Run time: 00:00:00.008739083
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.6755957570172404]
└ * Angles: [0]
[ Info: Final F: 2.4044852685047595
[ Info: Final loss: 8.230989434217042e-7
[ Info: Final stress: 2.412581413608461e-7
[ Info: Total solve! calls: 17
[ Info: Total SCFT iterations: 170
[ Info: Total time: 00:00:01
[ Info: ======================================================
[ Info:
[ Info: f = 0.42 phase: HEX
[ Info:
[ Info: ======================================================
[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Final state: n=12, #fevals=12, cell size=4.030813392, residual=1.45e-5.
│ * Fields updater: Anderson acceleration AA(20)
│ * Warmup: none
│ * Precondition: PicardMann iteration with α=1.0.
│ * Final state: n=120, k=0, m=0, #fevals=129, F=2.315093488, residual=2.34e-7.
│ * Scheme: run fields updater 10 times per cell iteration.
└ * Final state: n=13, #fevals=148, F=2.315093488, residual=2.34e-7, stress norm=9.15e-6.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Final state: n=12, #fevals=12, cell size=4.030813392, residual=1.45e-5.
│ * Fields updater: Anderson acceleration AA(20)
│ * Warmup: none
│ * Precondition: PicardMann iteration with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.0308133919640134, 4.0308133919640134]
└ * Angles: [2π/3, 0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: Init: F=2.492152621640556, residual=0.031210608720804302
[ Info: Init: F=2.4413097891292113, residual=0.004370908555672692
[ Info: final loss: 3.1556249665360186e-7
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.4240949673
[ Info: final loss: 3.16e-7
[ Info: final stress norm: 5.97e-6
┌ Info: final unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.234935089383124, 4.234935089383124]
└ * Angles: [2π/3, 0]
[ Info: iterations: 60
[ Info: time per iteration: 1 millisecond, 864 microseconds, 545 nanoseconds
[ Info: Run time: 00:00:00.11187275
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.234935089383124, 4.234935089383124]
└ * Angles: [2π/3, 0]
[ Info: Final F: 2.4240949672943377
[ Info: Final loss: 3.1556249665360186e-7
[ Info: Final stress: 5.970764026914987e-6
[ Info: Total solve! calls: 6
[ Info: Total SCFT iterations: 60
[ Info: Total time: 00:00:01
[ Info: ======================================================
[ Info:
[ Info: f = 0.39 phase: LAM
[ Info:
[ Info: ======================================================
[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Final state: n=30, #fevals=30, cell size=3.675595757, residual=5.81e-7.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
│ Final state: n=170, #fevals=170, F=2.4044852685, residual=8.23e-7.
│ * Scheme: run fields updater 10 times per cell iteration.
└ * Final state: n=17, #fevals=170, F=2.4044852685, residual=8.23e-7, stress norm=2.41e-7.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Final state: n=30, #fevals=30, cell size=3.675595757, residual=5.81e-7.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.6755957570172404]
└ * Angles: [0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: final loss: 7.663625693078213e-7
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3779073133
[ Info: final loss: 7.66e-7
[ Info: final stress norm: 9.71e-8
┌ Info: final unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.635192495340346]
└ * Angles: [0]
[ Info: iterations: 150
[ Info: time per iteration: 52 microseconds, 10 nanoseconds
[ Info: Run time: 00:00:00.007801583
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.635192495340346]
└ * Angles: [0]
[ Info: Final F: 2.3779073133139077
[ Info: Final loss: 7.663625693078213e-7
[ Info: Final stress: 9.708515153363657e-8
[ Info: Total solve! calls: 15
[ Info: Total SCFT iterations: 150
[ Info: Total time: 00:00:01
[ Info: ======================================================
[ Info:
[ Info: f = 0.39 phase: HEX
[ Info:
[ Info: ======================================================
[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Final state: n=17, #fevals=17, cell size=4.2349350894, residual=0.00016.
│ * Fields updater: Anderson acceleration AA(20)
│ * Warmup: none
│ * Precondition: PicardMann iteration with α=1.0.
│ * Final state: n=30, k=0, m=0, #fevals=30, F=2.4240949673, residual=3.16e-7.
│ * Scheme: run fields updater 10 times per cell iteration.
└ * Final state: n=6, #fevals=60, F=2.4240949673, residual=3.16e-7, stress norm=5.97e-6.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Final state: n=17, #fevals=17, cell size=4.2349350894, residual=0.00016.
│ * Fields updater: Anderson acceleration AA(20)
│ * Warmup: none
│ * Precondition: PicardMann iteration with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.234935089383124, 4.234935089383124]
└ * Angles: [2π/3, 0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: Init: F=2.3855010167613226, residual=0.01282095025981279
[ Info: Init: F=2.3713359414265605, residual=0.0018761810284536784
[ Info: final loss: 1.2800773021883275e-8
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3767252324
[ Info: final loss: 1.28e-8
[ Info: final stress norm: 1.01e-6
┌ Info: final unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.13906922036174, 4.13906922036174]
└ * Angles: [2π/3, 0]
[ Info: iterations: 50
[ Info: time per iteration: 2 milliseconds, 209 microseconds, 190 nanoseconds
[ Info: Run time: 00:00:00.1104595
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.13906922036174, 4.13906922036174]
└ * Angles: [2π/3, 0]
[ Info: Final F: 2.376725232445919
[ Info: Final loss: 1.2800773021883275e-8
[ Info: Final stress: 1.0073692494427355e-6
[ Info: Total solve! calls: 5
[ Info: Total SCFT iterations: 50
[ Info: Total time: 00:00:01
[ Info: ======================================================
[ Info:
[ Info: f = 0.391886 phase: LAM
[ Info:
[ Info: ======================================================
[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Final state: n=44, #fevals=44, cell size=3.6351924953, residual=2.34e-6.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
│ Final state: n=150, #fevals=150, F=2.3779073133, residual=7.66e-7.
│ * Scheme: run fields updater 10 times per cell iteration.
└ * Final state: n=15, #fevals=150, F=2.3779073133, residual=7.66e-7, stress norm=9.71e-8.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Final state: n=44, #fevals=44, cell size=3.6351924953, residual=2.34e-6.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.635192495340346]
└ * Angles: [0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: final loss: 7.746612960668281e-7
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3799736496
[ Info: final loss: 7.75e-7
[ Info: final stress norm: 7.67e-8
┌ Info: final unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.638349744604059]
└ * Angles: [0]
[ Info: iterations: 90
[ Info: time per iteration: 51 microseconds, 112 nanoseconds
[ Info: Run time: 00:00:00.004600083
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.638349744604059]
└ * Angles: [0]
[ Info: Final F: 2.3799736496154833
[ Info: Final loss: 7.746612960668281e-7
[ Info: Final stress: 7.666375008010251e-8
[ Info: Total solve! calls: 9
[ Info: Total SCFT iterations: 90
[ Info: Total time: 00:00:01
[ Info: ======================================================
[ Info:
[ Info: f = 0.391886 phase: HEX
[ Info:
[ Info: ======================================================
[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Final state: n=21, #fevals=21, cell size=4.1390692204, residual=9.66e-7.
│ * Fields updater: Anderson acceleration AA(20)
│ * Warmup: none
│ * Precondition: PicardMann iteration with α=1.0.
│ * Final state: n=30, k=0, m=0, #fevals=30, F=2.3767252324, residual=1.28e-8.
│ * Scheme: run fields updater 10 times per cell iteration.
└ * Final state: n=5, #fevals=50, F=2.3767252324, residual=1.28e-8, stress norm=1.01e-6.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Final state: n=21, #fevals=21, cell size=4.1390692204, residual=9.66e-7.
│ * Fields updater: Anderson acceleration AA(20)
│ * Warmup: none
│ * Precondition: PicardMann iteration with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.13906922036174, 4.13906922036174]
└ * Angles: [2π/3, 0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: Init: F=2.3806528696903086, residual=0.0008907684621282997
[ Info: final loss: 4.938015966423763e-7
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3800814329
[ Info: final loss: 4.94e-7
[ Info: final stress norm: 1.42e-6
┌ Info: final unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.145486848182285, 4.145486848182285]
└ * Angles: [2π/3, 0]
[ Info: iterations: 180
[ Info: time per iteration: 2 milliseconds, 413 microseconds, 60 nanoseconds
[ Info: Run time: 00:00:00.434350833
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.145486848182285, 4.145486848182285]
└ * Angles: [2π/3, 0]
[ Info: Final F: 2.380081432923534
[ Info: Final loss: 4.938015966423763e-7
[ Info: Final stress: 1.420941142952507e-6
[ Info: Total solve! calls: 18
[ Info: Total SCFT iterations: 180
[ Info: Total time: 00:00:01
[ Info: ======================================================
[ Info:
[ Info: f = 0.391727 phase: LAM
[ Info:
[ Info: ======================================================
[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Final state: n=52, #fevals=52, cell size=3.6383497446, residual=4.8e-6.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
│ Final state: n=90, #fevals=90, F=2.3799736496, residual=7.75e-7.
│ * Scheme: run fields updater 10 times per cell iteration.
└ * Final state: n=9, #fevals=90, F=2.3799736496, residual=7.75e-7, stress norm=7.67e-8.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Final state: n=52, #fevals=52, cell size=3.6383497446, residual=4.8e-6.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.638349744604059]
└ * Angles: [0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: final loss: 3.3850787908799684e-7
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3798020137
[ Info: final loss: 3.39e-7
[ Info: final stress norm: 4.93e-7
┌ Info: final unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.6380889100990936]
└ * Angles: [0]
[ Info: iterations: 60
[ Info: time per iteration: 58 microseconds, 821 nanoseconds
[ Info: Run time: 00:00:00.003529291
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.6380889100990936]
└ * Angles: [0]
[ Info: Final F: 2.3798020136562807
[ Info: Final loss: 3.3850787908799684e-7
[ Info: Final stress: 4.927200267701735e-7
[ Info: Total solve! calls: 6
[ Info: Total SCFT iterations: 60
[ Info: Total time: 00:00:01
[ Info: ======================================================
[ Info:
[ Info: f = 0.391727 phase: HEX
[ Info:
[ Info: ======================================================
[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Final state: n=38, #fevals=38, cell size=4.1454868482, residual=2.08e-6.
│ * Fields updater: Anderson acceleration AA(20)
│ * Warmup: none
│ * Precondition: PicardMann iteration with α=1.0.
│ * Final state: n=180, k=0, m=0, #fevals=180, F=2.3800814329, residual=4.94e-7.
│ * Scheme: run fields updater 10 times per cell iteration.
└ * Final state: n=18, #fevals=180, F=2.3800814329, residual=4.94e-7, stress norm=1.42e-6.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Final state: n=38, #fevals=38, cell size=4.1454868482, residual=2.08e-6.
│ * Fields updater: Anderson acceleration AA(20)
│ * Warmup: none
│ * Precondition: PicardMann iteration with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.145486848182285, 4.145486848182285]
└ * Angles: [2π/3, 0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: Init: F=2.3797595044265907, residual=7.471831076374242e-5
[ Info: final loss: 1.9540627446721682e-8
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 2.3797999655
[ Info: final loss: 1.95e-8
[ Info: final stress norm: 4.42e-6
┌ Info: final unit cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.144901455401329, 4.144901455401329]
└ * Angles: [2π/3, 0]
[ Info: iterations: 50
[ Info: time per iteration: 2 milliseconds, 125 microseconds, 160 nanoseconds
[ Info: Run time: 00:00:00.106258042
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Hexagonal2D
│ * Edges: [4.144901455401329, 4.144901455401329]
└ * Angles: [2π/3, 0]
[ Info: Final F: 2.3797999655147954
[ Info: Final loss: 1.9540627446721682e-8
[ Info: Final stress: 4.422840952374779e-6
[ Info: Total solve! calls: 5
[ Info: Total SCFT iterations: 50
[ Info: Total time: 00:00:01
(0.3917273233978745, Results of univariate zero finding:
* Converged to: 0.3917273233978745
* Algorithm: Roots.ITP{Float64, Int64}(0.2, 2, 1)
* iterations: 3
* function evaluations ≈ 5
* stopped as x_n ≈ x_{n-1} using atol=xatol, rtol=xrtol
Trace:
(a₀, b₀) = ( 0.35999999999999999, 0.41999999999999998 )
(a₁, b₁) = ( 0.39000000000000001, 0.41999999999999998 )
(a₂, b₂) = ( 0.39000000000000001, 0.39188559839627568 )
(a₃, b₃) = ( 0.39172732339787453, 0.39188559839627568 )
)The accuracy is controlled by the xatol keyword value of the RootsOptimizer’s kwargs field. Here, we use the default accuracy which is 0.001.
RootsOptimizer()RootsOptimizer(Roots.ITP{Float64, Int64}(0.2, 2, 1), (xatol = 0.001, maxevals = 20))We can compare the results by manual approach and semi-auto approach.
fb_manual - first(fb_auto)-0.00012182094093987628Exercises
- Draw a phase boudary curve between for LAM and HEX phase region by find phase boundary points betwen LAM and HEX phases for χN={12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 20.0, 25.0, 30.0}.
- Compare the resulted phase boundary with that shown in the phase diagram for AB diblock copolymer presented in the literature, for example Fig. 5.15 on P.265 of the book The Equilibrium Theory of Inhomogeneous Polymers by GH Fredrickson. Explain the difference.
Order-disorder transition (ODT)
The previous stragety to compute the phase boundary point is only applicable to order-order phase transition where we can compare the free energies of two ordered phases. However, for order-disorder transition, in the disorder region the ordered structure is not stable (not even meta-stable) and cannot be computed directly. A two-step strategy is recommended to deal with the order-disorder phase transition:
- Compute the stability limit to set a lower bound for searching the ODT.
- Start the computation from the ordered phase region and modify the parameters towards the stability limit until the free energy difference between DIS and the ordered structure lower than a tolerance.
Stability limit
The stability limit can be computed via the function RPA.compute_stability_limit provided by Polyorder. Note that currently only two-specie polymer system is supported.
The first returned value is the χN at the stability limit, and the second returned value is the periodic length in unit Rg. The χN should be 10.495 for AB diblock copolymer with fA=0.5. Note that (0.5, 10.495) is not only a stability limit point but also a critical point. It is also the ODT point.
let
system = AB_system(fA=0.5)
RPA.compute_stability_limit(system)
end(10.494868245363868, 3.2294860249515214)For $f_A \neq 0.5$, the ODT is not necessary to coincide with the stability limit. Moreover, ODT for different ordered phases may be different.
let
system = AB_system(fA=0.4)
RPA.compute_stability_limit(system)
end(11.343968614645187, 3.2049981319608962)LAM-DIS phase boundary
From above calculation, we see that the stability limit for AB diblock copolymer with fA=0.4 is 11.344. The ODT between LAM-DIS should locate close to 11.344 but slight higher than this value. We can compute a LAM and DIS energy for a guess χN, say 11.4, and use the periodic length 3.205 for the unit cell size.
# compute DIS free energy is easy
F_AB_f04_χN11_4_dis = Polyorder.F_DIS(AB_system(χN=11.4, fA=0.4))1.7360000000000002scft_opt_AB_f04_χN11_4_lam = let
ds = 0.01
uc = UnitCell(3.205)
lat = BravaisLattice(uc)
system = AB_system(χN=11.4, fA=0.4)
scft = NoncyclicChainSCFT(system, lat, ds)
Nx = length(scft.wfields[1])
wA = sin.(range(0, 2π*(1-1/21), length=21))
Polyorder.initialize!(scft, [wA, 1 .- wA, wA * 0])
Polyorder.solve!(scft)
cell_solve!(scft, VariableCell(BB(1.0), SIS(1.0)))
scft
end[ Info: ******* SCFT Simulation Start *******
[ Info: Algorithm: PicardMann iteration with α=0.2.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: Inf
[ Info: initial residual norm: 0.0
[ Info: initial stress norm: NaN
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.205]
└ * Angles: [0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: number: 100
[ Info: F: 1.735959682
[ Info: resediual norm: 0.000453
[ Info: number: 200
[ Info: F: 1.7359485771
[ Info: resediual norm: 0.000326
[ Info: number: 300
[ Info: F: 1.7359422917
[ Info: resediual norm: 0.000241
[ Info: number: 400
[ Info: F: 1.7359384976
[ Info: resediual norm: 0.000182
[ Info: number: 500
[ Info: F: 1.7359360896
[ Info: resediual norm: 0.000139
[ Info: number: 600
[ Info: F: 1.7359344988
[ Info: resediual norm: 0.000108
[ Info: number: 700
[ Info: F: 1.7359334129
[ Info: resediual norm: 8.44e-5
[ Info: number: 800
[ Info: F: 1.7359326509
[ Info: resediual norm: 6.64e-5
[ Info: number: 900
[ Info: F: 1.7359321038
[ Info: resediual norm: 5.25e-5
[ Info: number: 1000
[ Info: F: 1.7359317032
[ Info: resediual norm: 4.17e-5
[ Info: final loss: 4.169936652744658e-5
[ Info: Stop triggered by EarlyStopping.NumberLimit(1000) stopping criterion.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Acceptable()
[ Info: final F: 1.7359317032
[ Info: final loss: 4.17e-5
[ Info: final stress norm: 7.807190809413638e-5
┌ Info: final unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.205]
└ * Angles: [0]
[ Info: iterations: 1000
[ Info: time per iteration: 83 microseconds, 21 nanoseconds
[ Info: Run time: 00:00:00.083021958
[ Info: =======================================
[ Info: ###### Cell Optimization Start ######
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: Cell optimization starts ...
[ Info: ******* SCFT Simulation Start *******
┌ Info: Algorithm: Variable cell method
│ * Cell updater: Barzilai-Borwein (BB2) method
│ * max step size: 1.0
│ * step size: 0.2.
│ * Fields updater: 1S semi-implicit method (SIS-1) with α=1.0.
└ * Scheme: run fields updater 10 times per cell iteration.
[ Info: MDE solvers: ["OSF"]
[ Info: tolerance: 1.0e-5 (stress norm)
[ Info: tolerance: 1.0e-6 (Residual)
[ Info: initial F: 1.7359317032
[ Info: initial residual norm: 4.17e-5
[ Info: initial stress norm: 7.81e-5
┌ Info: initial unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.205]
└ * Angles: [0]
[ Info:
[ Info: Simulation starts > > > > > >
[ Info: number: 100
[ Info: F: 1.735930152
[ Info: resediual norm: 1.6e-6
[ Info: stress norm: 1.84e-9
[ Info: cell: [3.21458]
[ Info: final loss: 9.891160822438854e-7
[ Info: Stop triggered by a `ThresholdStress` control.
[ Info: > > > > > > Simulation finished.
[ Info:
[ Info: ------ SCFT Simulation Summary ------
[ Info: convergence: Polyorder.Successful()
[ Info: final F: 1.7359301347
[ Info: final loss: 9.89e-7
[ Info: final stress norm: 3.45e-9
┌ Info: final unit cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.2145756467548114]
└ * Angles: [0]
[ Info: iterations: 1160
[ Info: time per iteration: 106 microseconds, 455 nanoseconds
[ Info: Run time: 00:00:00.123488958
[ Info: =======================================
[ Info: Cell optimization finished.
[ Info: ------ Cell Optimization Summary ------
[ Info: Convergence: Polyorder.Successful()
┌ Info: Stress-free cell: UnitCell
│ * Crystal system: Line
│ * Edges: [3.2145756467548114]
└ * Angles: [0]
[ Info: Final F: 1.7359301347341538
[ Info: Final loss: 9.891160822438854e-7
[ Info: Final stress: 3.4525447305922956e-9
[ Info: Total solve! calls: 116
[ Info: Total SCFT iterations: 1160
[ Info: Total time: 00:00:01
Noncyclic Chain SCFT model:
* Free energy: 1.7359301347
* Residual: 3.002e-6
* Stress norm: 3.453e-9
* Model type: SimpleFieldModel
* Model compressiblity: Incompressible
-----
PolymerSystem (AB) contains 1 components:
Component AB with ϕ=1.0 and α=1.0 contains BlockCopolymer AB with 2 blocks:
* PolymerBlock A with f=0.4 of specie A
* PolymerBlock B with f=0.6 of specie B
with Flory-Huggins interaction parameters betwen species:
(A, B) => 11.4
and confined by BulkConfinement()-----
Simulation Cell: BravaisLattice
* Centering: p
* Space group: #1 (p1)
* Crystal system: Line
* Unit cell: [3.2145756467548114] [0]
* Free lattice parameters: [a]
-----
* Spatial resolution: (21,)
* Contour steps: Dict{Pair, Float64}[Dict((2 => 3) => 0.01, (2 => 1) => 0.01, (1 => 2) => 0.01, (3 => 2) => 0.01)]
* MDE solvers: Dict{Pair, Type{<:MDEAlgorithm}}[Dict((2 => 3) => OSF, (2 => 1) => OSF, (1 => 2) => OSF, (3 => 2) => OSF)]
-----
SCFT updater: PicardMann iteration with α=0.2.
Final state: n=1000, #fevals=1000, F=1.7359317032, residual=4.17e-5.
-----
* First density field: 0.4 [0.3293, 0.4748]
* First auxiliary field: 1.64 [0.6251, 2.655]plot_density(scft_opt_AB_f04_χN11_4_lam)┌ Warning: Found `resolution` in the theme when creating a `Scene`. The `resolution` keyword for `Scene`s and `Figure`s has been deprecated. Use `Figure(; size = ...` or `Scene(; size = ...)` instead, which better reflects that this is a unitless size and not a pixel resolution. The key could also come from `set_theme!` calls or related theming functions.
└ @ Makie ~/.julia/packages/Makie/PpRC2/src/scenes.jl:264F_AB_f04_χN11_4_lam = Polyorder.F(scft_opt_AB_f04_χN11_4_lam)1.7359301347341538We see that the free energy of LAM phase is $\approx 7\times 10^{-5}$ lower than the free energy of DIS phase when χN=11.4 for fA=0.4. It suggests that χN=11.4 is actually a very good approximation to the ODT of LAM-DIS phase transition. Also note that the equilibrium cell size is 3.214 which is a little bit larger than 3.205 as expected.
F_AB_f04_χN11_4_lam - F_AB_f04_χN11_4_dis-6.986526584640274e-5Polyorder.unitcell(scft_opt_AB_f04_χN11_4_lam)UnitCell
* Crystal system: Line
* Edges: [3.2145756467548114]
* Angles: [0]To increase the accuracy, we can further decrease χN to a value much closer to the stability limit as long as you can ensure that the LAM phase is actually being computed. Note that the closer to the ODT, the harder to compute the LAM phase because LAM phase easily transforms to the DIS phase for such weak segregation strength.
Exercises
- Find the ODT of HEX-DIS transition for AB diblock copolymer with fA=0.4.
- Compare the above result to LAM-DIS ODT. Are they identical?