mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-11-19 15:25:29 +01:00
rework loading/saving GroupRingElems
This commit is contained in:
parent
10d319f48b
commit
0614bf268d
@ -207,11 +207,12 @@ function check_property_T(sett::Settings)
|
|||||||
|
|
||||||
if isfile(filename(sett,:Δ))
|
if isfile(filename(sett,:Δ))
|
||||||
# cached
|
# cached
|
||||||
Δ = loadLaplacian(filename(sett,:Δ), sett.G)
|
@info("Loading precomputed Δ...")
|
||||||
|
Δ = loadGRElem(filename(sett,:Δ), sett.G)
|
||||||
else
|
else
|
||||||
# compute
|
# compute
|
||||||
Δ = Laplacian(sett.S, sett.radius)
|
Δ = Laplacian(sett.S, sett.radius)
|
||||||
saveLaplacian(filename(sett, :Δ), Δ)
|
saveGRElem(filename(sett, :Δ), Δ)
|
||||||
end
|
end
|
||||||
|
|
||||||
if !sett.warmstart && isfile(filename(sett, :solution))
|
if !sett.warmstart && isfile(filename(sett, :solution))
|
||||||
|
@ -45,19 +45,24 @@ function Laplacian(S, Id, radius)
|
|||||||
return Δ
|
return Δ
|
||||||
end
|
end
|
||||||
|
|
||||||
function saveGRElem(filename::String, g::GroupRingElem)
|
function saveGRElem(fname::String, g::GroupRingElem)
|
||||||
RG = parent(g)
|
RG = parent(g)
|
||||||
JLD.save(filename, "coeffs", g.coeffs, "pm", RG.pm, "G", RG.group)
|
JLD.save(fname, "coeffs", g.coeffs, "pm", RG.pm, "G", RG.group)
|
||||||
|
end
|
||||||
|
|
||||||
|
function loadGRElem(fname::String, RG::GroupRing)
|
||||||
|
coeffs = load(fname, "coeffs")
|
||||||
|
return GroupRingElem(coeffs, RG)
|
||||||
end
|
end
|
||||||
|
|
||||||
function loadGRElem(fname::String, G::Group)
|
function loadGRElem(fname::String, G::Group)
|
||||||
if isfile(fname)
|
pm = load(fname, "pm")
|
||||||
@info("Loading precomputed Δ...")
|
RG = GroupRing(G, pm)
|
||||||
coeffs, pm = load(fname, "coeffs", "pm")
|
return loadGRElem(fname, RG)
|
||||||
RG = GroupRing(G, pm)
|
end
|
||||||
Δ = GroupRingElem(coeffs, RG)
|
|
||||||
else
|
function loadGRElem(fname::String)
|
||||||
throw(ErrorException("You need to precompute $fname first!"))
|
pm, G = load(fname, "pm", "G")
|
||||||
end
|
RG = GroupRing(G, pm)
|
||||||
return Δ
|
return loadGRElem(fname, RG)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user