Skip to content

Commit d98ad3d

Browse files
committed
Add some debug logs for periodic examples
1 parent 7958ec5 commit d98ad3d

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

examples/Example212_PeriodicElasticity2D.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ function main(;
125125
threads = 1,
126126
kwargs...
127127
)
128+
## print options for better logs
129+
@info "selected options" use_LM_restrictions threads
130+
128131
xgrid = create_grid(; h, width, height)
129132

130133
## create finite element space and solution vector
@@ -166,6 +169,10 @@ function main(;
166169
sol, SC = solve(PD, FES, return_config = true)
167170
residual(SC) < 1.0e-10 || error("Residual is not zero!")
168171

172+
if use_LM_restrictions
173+
@info "Lagrange residuals" SC.statistics[:restriction_residuals]
174+
end
175+
169176
plt = GridVisualizer(; Plotter, size = (1300, 800))
170177

171178
magnification = 1

examples/Example312_PeriodicElasticity3D.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ function main(;
139139
threads = 1,
140140
kwargs...
141141
)
142+
## print options for better logs
143+
@info "selected options" periodic_coupling threads
142144

143145
xgrid = create_grid(; h, width, height, depth)
144146

@@ -187,6 +189,10 @@ function main(;
187189
sol, SC = solve(PD, FES; return_config = true, kwargs...)
188190
residual(SC) < 1.0e-10 || error("Residual is not zero!")
189191

192+
if use_LM_restrictions
193+
@info "Lagrange residuals" SC.statistics[:restriction_residuals]
194+
end
195+
190196
displace_mesh!(xgrid, sol[u])
191197
plt = plot([grid(u)], sol; Plotter, do_vector_plots = false, width = 1200, height = 800, title = "displaced mesh", scene3d = :LScene)
192198

examples/Example313_PeriodicPoisson.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ function main(;
8888
periodic = true,
8989
kwargs...
9090
)
91+
## print options for better logs
92+
@info "selected options" periodic
9193

9294
xgrid = create_grid(; h)
9395

@@ -112,6 +114,8 @@ function main(;
112114
sol, SC = solve(PD, FES; return_config = true, kwargs...)
113115
residual(SC) < 1.0e-10 || error("Residual is not zero!")
114116

117+
@info "Lagrange residuals" SC.statistics[:restriction_residuals]
118+
115119
function exact_error!(out, u, qpinfo)
116120
# exact solution here is u(x,y,z) = 2z - 1
117121
val = qpinfo.x[3] * 2 - 1

0 commit comments

Comments
 (0)