Skip to content

Commit c3500e1

Browse files
author
chmerdon
committed
bump to GridVisualize 1.20
1 parent 4416175 commit c3500e1

7 files changed

Lines changed: 19 additions & 28 deletions

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ExplicitImports = "1"
3535
ExtendableGrids = "1.13.0"
3636
ExtendableSparse = "1.5.1, 2"
3737
ForwardDiff = "0.10.35, 1"
38-
GridVisualize = "1.8.1"
38+
GridVisualize = "1.20"
3939
LinearAlgebra = "1.9"
4040
Polynomials = "2.0.21, 3, 4"
4141
Printf = "1.9"

examples/Example200_LowLevelPoisson.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ using ExtendableFEMBase
2727
using ExtendableGrids
2828
using ExtendableSparse
2929
using GridVisualize
30-
using UnicodePlots
31-
using Term
30+
using UnicodePlots, Term
3231
using Test #
3332

3433
function main(;

examples/Example205_LowLevelSpaceTimePoisson.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ using ExtendableFEMBase
2727
using ExtendableGrids
2828
using ExtendableSparse
2929
using GridVisualize
30-
using UnicodePlots
31-
using Term
30+
using UnicodePlots, Term
3231
using Test #
3332

3433
## data for Poisson problem

examples/Example210_LowLevelNavierStokes.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ using ExtendableFEMBase
3535
using ExtendableGrids
3636
using ExtendableSparse
3737
using GridVisualize
38-
using UnicodePlots
39-
using Term
38+
using UnicodePlots, Term
4039
using ForwardDiff
4140
using DiffResults
4241

examples/Example280_BasisPlotter.jl

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ module Example280_BasisPlotter
1515
using ExtendableFEMBase
1616
using ExtendableGrids
1717
using GridVisualize
18-
using UnicodePlots
19-
using Term
18+
using UnicodePlots, Term
2019

2120
## everything is wrapped in a main function
2221
function main(; dim = 1, order = 3, Plotter = UnicodePlots)
@@ -49,27 +48,24 @@ function main(; dim = 1, order = 3, Plotter = UnicodePlots)
4948
if dim == 1
5049
layout = (1, 1) # everything is plotted into one plot
5150
size = (600, 600)
51+
colors = [:red, :green, :blue, :white, :yellow, :cyan, :magenta]
5252
elseif dim == 2
53-
if order in [1, 2]
54-
layout = (order, 3)
55-
size = (900, 300 * order)
56-
elseif order == 3
57-
layout = (2, 5)
58-
size = (1000, 400)
59-
elseif order == 4
60-
layout = (3, 5)
61-
size = (1000, 600)
53+
l = round(Int, ceil(sqrt(ndofs)))
54+
if l^2 - l >= ndofs
55+
layout = (l - 1, l)
56+
else
57+
layout = (l, l)
6258
end
59+
size = (1000, 1000)
60+
p = permutedims(reshape(1:prod(layout), layout))[:]
6361
end
6462
plt = GridVisualizer(; Plotter = Plotter, layout = layout, size = size)
65-
colors = [:red, :green, :blue, :white, :yellow, :cyan, :magenta]
66-
r, c = 1, 1
6763
for j in 1:ndofs
68-
if dim == 2
69-
c = mod(j - 1, layout[2]) + 1
70-
r = Int(ceil((j - 0.5) / layout[2]))
64+
if dim == 1
65+
ExtendableFEMBase.scalarplot!(plt[1], I[1], IdentityComponent{j}; Plotter = Plotter, clear = false, title = "dof $j", color = dim == 1 ? colors[j] : :white)
66+
else
67+
ExtendableFEMBase.scalarplot!(plt[p[j]], I[1], IdentityComponent{j}; Plotter = Plotter, clear = false, title = "dof $j", color = dim == 1 ? colors[j] : :white)
7168
end
72-
GridVisualize.scalarplot!(plt[r, c], I[1], IdentityComponent{j}; Plotter = Plotter, clear = false, title = "dof $j", color = dim == 1 ? colors[j] : :white)
7369
end
7470
reveal(plt)
7571
return FEFunc, plt

examples/Example281_DiscontinuousPlot.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ module Example281_DiscontinuousPlot
1616
using ExtendableFEMBase
1717
using ExtendableGrids
1818
using GridVisualize
19-
using UnicodePlots
20-
using Term
19+
using UnicodePlots, Term
2120

2221
## function to interpolate
2322
function u!(result, qpinfo)

examples/Example290_InterpolationBetweenMeshes.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ module Example290_InterpolationBetweenMeshes
1616
using ExtendableFEMBase
1717
using ExtendableGrids
1818
using GridVisualize
19-
using UnicodePlots
20-
using Term
19+
using UnicodePlots, Term
2120

2221
## function to interpolate
2322
function u!(result, qpinfo)

0 commit comments

Comments
 (0)