@@ -22,18 +22,19 @@ function main(;
2222 decay = 2.0 , # decay factor for the random coefficient
2323 mean = problem == PoissonProblemPrimal ? 1.0 : 0.0 , # mean value of coefficient
2424 domain = " square" , # domain, e.g., "square" or "lshape"
25- initial_modes = [[0 ], [1 ,0 ], [0 ,1 ], [2 ,0 ], [0 ,0 , 1 ]], # initial multi-indices for stochastic basis
25+ initial_modes = [[0 ], [1 , 0 ], [0 , 1 ], [2 , 0 ], [0 , 0 , 1 ]], # initial multi-indices for stochastic basis
2626 f! = (result, qpinfo) -> (result[1 ] = 1 ), # right-hand side function
2727 use_iterative_solver = true , # use iterative solver ? (otherwise direct)
28- Plotter = nothing )
28+ Plotter = nothing
29+ )
2930
3031 # # prepare stochastic coefficient
3132 τ = (problem <: PoissonProblemPrimal ) ? 0.9 : 1.0
3233 if problem <: PoissonProblemPrimal
3334 @assert mean >= 1 " coefficient needs to be at least 1 to ensure ellipticity"
3435 end
3536 C = StochasticCoefficientCosinus (; τ = τ, decay = decay, mean = mean)
36-
37+
3738 # # prepare grid
3839 xgrid = if domain == " square"
3940 uniform_refine (grid_unitsquare (Triangle2D), nrefs)
@@ -44,24 +45,24 @@ function main(;
4445 end
4546
4647 # # prepare stochastic basis
47- multi_indices = Array {Array{Int,1},1} (initial_modes)
48+ multi_indices = Array {Array{Int, 1}, 1} (initial_modes)
4849 prepare_multi_indices! (multi_indices)
4950 M = maximum (length .(multi_indices))
5051 OBType = problem <: PoissonProblemPrimal ? LegendrePolynomials : HermitePolynomials
5152 ansatz_deg = maximum ([maximum (multi_indices[k]) for k in 1 : length (multi_indices)]) + 4
52- TensorBasis = TensorizedBasis (OBType, M, ansatz_deg, 2 * ansatz_deg, 2 * ansatz_deg, multi_indices = multi_indices)
53+ TensorBasis = TensorizedBasis (OBType, M, ansatz_deg, 2 * ansatz_deg, 2 * ansatz_deg, multi_indices = multi_indices)
5354
5455 # # prepare FE spaces
5556 if problem <: LogTransformedPoissonProblemDual
56- FEType = [HDIVRTk{2 ,order}, order == 0 ? L2P0{1 } : H1Pk{1 ,2 , order}]
57+ FEType = [HDIVRTk{2 , order}, order == 0 ? L2P0{1 } : H1Pk{1 , 2 , order}]
5758 FES = [FESpace {FEType[1]} (xgrid), FESpace {FEType[2]} (xgrid; broken = true )]
5859 unames = [" p" , " u" ]
5960 else
60- FEType = H1Pk{1 ,2 , order}
61+ FEType = H1Pk{1 , 2 , order}
6162 FES = FESpace {FEType} (xgrid)
6263 unames = [" u" ]
6364 end
64-
65+
6566 # # create solution vector
6667 sol = SGFEVector (FES, TensorBasis; active_modes = 1 : length (multi_indices), unames = unames)
6768
@@ -85,4 +86,4 @@ function main(;
8586 return sol
8687end
8788
88- end # module
89+ end # module
0 commit comments