You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- `B::Union{AbstractArray, Nothing}`: The **near null space** in SA-AMG represents the low energy that cannot be attenuated by relaxtion, and thus needs to be perserved across the coarse grid.
298
+
299
+
- `B` can be:
300
+
- a `Vector` (e.g., for scalar PDEs),
301
+
- a `Matrix` (e.g., for vector PDEs or systems with multiple equations),
302
+
- or `nothing`.
303
+
304
+
# Notes
305
+
If `B` is set to `nothing`, it will be internally defaulted to `B = ones(T, n)`, where `T = eltype(A)` and `n = size(A, 1)`.
306
+
307
+
# Examples
308
+
309
+
**Poisson equation (scalar PDE):**
310
+
```julia
311
+
n = size(A, 1)
312
+
B = ones(Float64, n)
313
+
amg = SmoothedAggregationAMG(B)
314
+
```
315
+
316
+
**Linear elasticity equation in 2d (vector PDE):**
317
+
```julia
318
+
n = size(A, 1) # Ndof = 2 * number of nodes
319
+
B = zeros(Float64, n, 3)
320
+
B[1:2:end, :] = [1.0, 0.0, -y]
321
+
B[2:2:end, :] = [0.0, 1.0, x]
322
+
amg = SmoothedAggregationAMG(B)
323
+
```
292
324
"""
293
325
struct SmoothedAggregationAMG <:AMGAlg
294
326
B::Union{<:AbstractArray,Nothing}# `B` can be `Vector`, `Matrix`, or `nothing`
0 commit comments