20 February 2020 08:27:57 AM CLENSHAW_CURTIS_GRID_TEST C++ version Test the routines in the CLENSHAW_CURTIS_GRID library. TEST005: CC_GRID returns a grid of Clenshaw-Curtis points. Here, we simply call for grids in the 1D case Spatial dimension of grid = 1 1 0 1 -1 2 1 1 -1 2 6.12323e-17 3 1 1 -1 2 -0.5 3 0.5 4 1 1 -1 2 -0.707107 3 6.12323e-17 4 0.707107 5 1 1 -1 2 -0.809017 3 -0.309017 4 0.309017 5 0.809017 6 1 1 -1 2 -0.866025 3 -0.5 4 6.12323e-17 5 0.5 6 0.866025 7 1 1 -1 2 -0.900969 3 -0.62349 4 -0.222521 5 0.222521 6 0.62349 7 0.900969 8 1 1 -1 2 -0.92388 3 -0.707107 4 -0.382683 5 6.12323e-17 6 0.382683 7 0.707107 8 0.92388 9 1 1 -1 2 -0.939693 3 -0.766044 4 -0.5 5 -0.173648 6 0.173648 7 0.5 8 0.766044 9 0.939693 10 1 TEST01: CC_GRID returns a grid of Clenshaw-Curtis points. Here, we simply call for a specific grid. Spatial dimension of grid = 3 Total number of points in the grid = 24 I Q Grid orders: 1 9 3 4 2 Grid points: 1 -1 -1 -1 2 -1 -1 1 3 -1 -0.5 1 4 -1 -0.5 -1 5 -1 0.5 -1 6 -1 0.5 1 7 -1 1 1 8 -1 1 -1 9 6.12323e-17 1 -1 10 6.12323e-17 1 1 11 6.12323e-17 0.5 1 12 6.12323e-17 0.5 -1 13 6.12323e-17 -0.5 -1 14 6.12323e-17 -0.5 1 15 6.12323e-17 -1 1 16 6.12323e-17 -1 -1 17 1 -1 -1 18 1 -1 1 19 1 -0.5 1 20 1 -0.5 -1 21 1 0.5 -1 22 1 0.5 1 23 1 1 1 24 1 1 -1 TEST015: CC_GRID_INDEX returns an indexed grid of Clenshaw-Curtis points. Spatial dimension of grid = 3 Total number of points in the grid = 24 I Q Grid orders: 1 9 3 4 2 Grid indexed points: 1 0 0 0 2 0 0 1 3 0 1 1 4 0 1 0 5 0 2 0 6 0 2 1 7 0 3 1 8 0 3 0 9 1 3 0 10 1 3 1 11 1 2 1 12 1 2 0 13 1 1 0 14 1 1 1 15 1 0 1 16 1 0 0 17 2 0 0 18 2 0 1 19 2 1 1 20 2 1 0 21 2 2 0 22 2 2 1 23 2 3 1 24 2 3 0 TEST02: CC_GRIDS_MINMAX returns all Clenshaw Curtis grids whose Q value satisfies Q_MIN <= Q <= Q_MAX. Here, Q is the sum of the orders of the 1D rules, and Q_MIN = 3 Q_MAX = 5 Spatial dimension of grids = 2 Number of grids = 9 Number of points in the grids = 34 I Q Grid orders: 1 3 2 1 2 3 1 2 3 4 3 1 4 4 2 2 5 4 1 3 6 5 4 1 7 5 3 2 8 5 2 3 9 5 1 4 Grid points: 1 -1 0 2 1 0 3 0 -1 4 0 1 5 -1 0 6 6.12323e-17 0 7 1 0 8 -1 -1 9 -1 1 10 1 1 11 1 -1 12 0 -1 13 0 6.12323e-17 14 0 1 15 -1 0 16 -0.5 0 17 0.5 0 18 1 0 19 -1 -1 20 -1 1 21 6.12323e-17 1 22 6.12323e-17 -1 23 1 -1 24 1 1 25 -1 -1 26 -1 6.12323e-17 27 -1 1 28 1 1 29 1 6.12323e-17 30 1 -1 31 0 -1 32 0 -0.5 33 0 0.5 34 0 1 TEST025: CC_LEVELS_MINMAX returns all Clenshaw Curtis grids whose LEVEL value satisfies LEVEL_MIN <= LEVEL <= LEVEL_MAX. Here, LEVEL is the sum of the levels of the 1D rules, and the order of the rule is 2**LEVEL - 1. LEVEL_MIN = 2 LEVEL_MAX = 2 Spatial dimension of grids = 2 Number of grids = 3 Number of points in the grids = 19 Grid Level Grid Levels Grid orders: ---- ----- ------------ ------------ 1 2 2 0 5 1 2 2 1 1 3 3 3 2 0 2 1 5 Grid points: 1 -1 0 2 -0.707107 0 3 6.12323e-17 0 4 0.707107 0 5 1 0 6 -1 -1 7 -1 6.12323e-17 8 -1 1 9 6.12323e-17 1 10 6.12323e-17 6.12323e-17 11 6.12323e-17 -1 12 1 -1 13 1 6.12323e-17 14 1 1 15 0 -1 16 0 -0.707107 17 0 6.12323e-17 18 0 0.707107 19 0 1 LEVEL_MIN = 0 LEVEL_MAX = 3 Spatial dimension of grids = 2 Number of grids = 10 Number of points in the grids = 74 Grid Level Grid Levels Grid orders: ---- ----- ------------ ------------ 1 0 0 0 1 1 2 1 1 0 3 1 3 1 0 1 1 3 4 2 2 0 5 1 5 2 1 1 3 3 6 2 0 2 1 5 7 3 3 0 9 1 8 3 2 1 5 3 9 3 1 2 3 5 10 3 0 3 1 9 Grid points: 1 0 0 2 -1 0 3 6.12323e-17 0 4 1 0 5 0 -1 6 0 6.12323e-17 7 0 1 8 -1 0 9 -0.707107 0 10 6.12323e-17 0 11 0.707107 0 12 1 0 13 -1 -1 14 -1 6.12323e-17 15 -1 1 16 6.12323e-17 1 17 6.12323e-17 6.12323e-17 18 6.12323e-17 -1 19 1 -1 20 1 6.12323e-17 21 1 1 22 0 -1 23 0 -0.707107 24 0 6.12323e-17 25 0 0.707107 26 0 1 27 -1 0 28 -0.92388 0 29 -0.707107 0 30 -0.382683 0 31 6.12323e-17 0 32 0.382683 0 33 0.707107 0 34 0.92388 0 35 1 0 36 -1 -1 37 -1 6.12323e-17 38 -1 1 39 -0.707107 1 40 -0.707107 6.12323e-17 41 -0.707107 -1 42 6.12323e-17 -1 43 6.12323e-17 6.12323e-17 44 6.12323e-17 1 45 0.707107 1 46 0.707107 6.12323e-17 47 0.707107 -1 48 1 -1 49 1 6.12323e-17 50 1 1 51 -1 -1 52 -1 -0.707107 53 -1 6.12323e-17 54 -1 0.707107 55 -1 1 56 6.12323e-17 1 57 6.12323e-17 0.707107 58 6.12323e-17 6.12323e-17 59 6.12323e-17 -0.707107 60 6.12323e-17 -1 61 1 -1 62 1 -0.707107 63 1 6.12323e-17 64 1 0.707107 65 1 1 66 0 -1 67 0 -0.92388 68 0 -0.707107 69 0 -0.382683 70 0 6.12323e-17 71 0 0.382683 72 0 0.707107 73 0 0.92388 74 0 1 LEVEL_MIN = 3 LEVEL_MAX = 3 Spatial dimension of grids = 2 Number of grids = 4 Number of points in the grids = 48 Grid Level Grid Levels Grid orders: ---- ----- ------------ ------------ 1 3 3 0 9 1 2 3 2 1 5 3 3 3 1 2 3 5 4 3 0 3 1 9 Grid points: 1 -1 0 2 -0.92388 0 3 -0.707107 0 4 -0.382683 0 5 6.12323e-17 0 6 0.382683 0 7 0.707107 0 8 0.92388 0 9 1 0 10 -1 -1 11 -1 6.12323e-17 12 -1 1 13 -0.707107 1 14 -0.707107 6.12323e-17 15 -0.707107 -1 16 6.12323e-17 -1 17 6.12323e-17 6.12323e-17 18 6.12323e-17 1 19 0.707107 1 20 0.707107 6.12323e-17 21 0.707107 -1 22 1 -1 23 1 6.12323e-17 24 1 1 25 -1 -1 26 -1 -0.707107 27 -1 6.12323e-17 28 -1 0.707107 29 -1 1 30 6.12323e-17 1 31 6.12323e-17 0.707107 32 6.12323e-17 6.12323e-17 33 6.12323e-17 -0.707107 34 6.12323e-17 -1 35 1 -1 36 1 -0.707107 37 1 6.12323e-17 38 1 0.707107 39 1 1 40 0 -1 41 0 -0.92388 42 0 -0.707107 43 0 -0.382683 44 0 6.12323e-17 45 0 0.382683 46 0 0.707107 47 0 0.92388 48 0 1 TEST03: CC_GRIDS_CONSTRAINED returns all Clenshaw Curtis grids satisfying a set of constraints. ORDER(I), the order of the 1D rule in dimension I, is constrained by ORDER_MIN(I) <= ORDER(I) <= ORDER_MAX(I) We also define the total weighted order Q Q = ALPHA(1) * ORDER(1) + ... + ALPHA(N) * ORDER(N) and further constrain our grids to satisfy Q <= Q_MAX = 13 Spatial dimension of grids = 2 Dimension Order_min Order_max Alpha 1 1 5 2 2 1 5 3 Number of grids = 10 Number of points in the grids = 36 I Q Grid orders: 1 5 1 1 2 7 2 1 3 9 3 1 4 11 4 1 5 13 5 1 6 8 1 2 7 10 2 2 8 12 3 2 9 11 1 3 10 13 2 3 Grid points: 1 0 0 2 -1 0 3 1 0 4 -1 0 5 6.12323e-17 0 6 1 0 7 -1 0 8 -0.5 0 9 0.5 0 10 1 0 11 -1 0 12 -0.707107 0 13 6.12323e-17 0 14 0.707107 0 15 1 0 16 0 -1 17 0 1 18 -1 -1 19 -1 1 20 1 1 21 1 -1 22 -1 -1 23 -1 1 24 6.12323e-17 1 25 6.12323e-17 -1 26 1 -1 27 1 1 28 0 -1 29 0 6.12323e-17 30 0 1 31 -1 -1 32 -1 6.12323e-17 33 -1 1 34 1 1 35 1 6.12323e-17 36 1 -1 TEST035: CC_LEVELS_CONSTRAINED returns all Clenshaw Curtis grids satisfying a set of constraints. The constraint on the levels of the 1D Clenshaw Curtis rule in spatial dimension I is: LEVEL_MIN(I) <= LEVEL(I) <= LEVEL_MAX(I) The constraint on the levels making up a rule is: Sum ( 1 <= I <= DIM_NUM ) ALPHA(I) * LEVEL(I) <= Q_MAX. where Q_MAX = 13 The relationship of level to order is roughly ORDER = 2^LEVEL+1. Spatial dimension of grids = 2 Dimension Level_min Level_max Alpha 1 1 5 2 2 1 5 3 Number of grids = 10 Number of points in the grids = 358 I Q Grid levels: 1 5 1 1 2 7 2 1 3 9 3 1 4 11 4 1 5 13 5 1 6 8 1 2 7 10 2 2 8 12 3 2 9 11 1 3 10 13 2 3 Grid points: 1 -1 -1 2 -1 6.12323e-17 3 -1 1 4 6.12323e-17 1 5 6.12323e-17 6.12323e-17 6 6.12323e-17 -1 7 1 -1 8 1 6.12323e-17 9 1 1 10 -1 -1 11 -1 6.12323e-17 12 -1 1 13 -0.707107 1 14 -0.707107 6.12323e-17 15 -0.707107 -1 16 6.12323e-17 -1 17 6.12323e-17 6.12323e-17 18 6.12323e-17 1 19 0.707107 1 20 0.707107 6.12323e-17 21 0.707107 -1 22 1 -1 23 1 6.12323e-17 24 1 1 25 -1 -1 26 -1 6.12323e-17 27 -1 1 28 -0.92388 1 29 -0.92388 6.12323e-17 30 -0.92388 -1 31 -0.707107 -1 32 -0.707107 6.12323e-17 33 -0.707107 1 34 -0.382683 1 35 -0.382683 6.12323e-17 36 -0.382683 -1 37 6.12323e-17 -1 38 6.12323e-17 6.12323e-17 39 6.12323e-17 1 40 0.382683 1 41 0.382683 6.12323e-17 42 0.382683 -1 43 0.707107 -1 44 0.707107 6.12323e-17 45 0.707107 1 46 0.92388 1 47 0.92388 6.12323e-17 48 0.92388 -1 49 1 -1 50 1 6.12323e-17 51 1 1 52 -1 -1 53 -1 6.12323e-17 54 -1 1 55 -0.980785 1 56 -0.980785 6.12323e-17 57 -0.980785 -1 58 -0.92388 -1 59 -0.92388 6.12323e-17 60 -0.92388 1 61 -0.83147 1 62 -0.83147 6.12323e-17 63 -0.83147 -1 64 -0.707107 -1 65 -0.707107 6.12323e-17 66 -0.707107 1 67 -0.55557 1 68 -0.55557 6.12323e-17 69 -0.55557 -1 70 -0.382683 -1 71 -0.382683 6.12323e-17 72 -0.382683 1 73 -0.19509 1 74 -0.19509 6.12323e-17 75 -0.19509 -1 76 6.12323e-17 -1 77 6.12323e-17 6.12323e-17 78 6.12323e-17 1 79 0.19509 1 80 0.19509 6.12323e-17 81 0.19509 -1 82 0.382683 -1 83 0.382683 6.12323e-17 84 0.382683 1 85 0.55557 1 86 0.55557 6.12323e-17 87 0.55557 -1 88 0.707107 -1 89 0.707107 6.12323e-17 90 0.707107 1 91 0.83147 1 92 0.83147 6.12323e-17 93 0.83147 -1 94 0.92388 -1 95 0.92388 6.12323e-17 96 0.92388 1 97 0.980785 1 98 0.980785 6.12323e-17 99 0.980785 -1 100 1 -1 101 1 6.12323e-17 102 1 1 103 -1 -1 104 -1 6.12323e-17 105 -1 1 106 -0.995185 1 107 -0.995185 6.12323e-17 108 -0.995185 -1 109 -0.980785 -1 110 -0.980785 6.12323e-17 111 -0.980785 1 112 -0.95694 1 113 -0.95694 6.12323e-17 114 -0.95694 -1 115 -0.92388 -1 116 -0.92388 6.12323e-17 117 -0.92388 1 118 -0.881921 1 119 -0.881921 6.12323e-17 120 -0.881921 -1 121 -0.83147 -1 122 -0.83147 6.12323e-17 123 -0.83147 1 124 -0.77301 1 125 -0.77301 6.12323e-17 126 -0.77301 -1 127 -0.707107 -1 128 -0.707107 6.12323e-17 129 -0.707107 1 130 -0.634393 1 131 -0.634393 6.12323e-17 132 -0.634393 -1 133 -0.55557 -1 134 -0.55557 6.12323e-17 135 -0.55557 1 136 -0.471397 1 137 -0.471397 6.12323e-17 138 -0.471397 -1 139 -0.382683 -1 140 -0.382683 6.12323e-17 141 -0.382683 1 142 -0.290285 1 143 -0.290285 6.12323e-17 144 -0.290285 -1 145 -0.19509 -1 146 -0.19509 6.12323e-17 147 -0.19509 1 148 -0.0980171 1 149 -0.0980171 6.12323e-17 150 -0.0980171 -1 151 6.12323e-17 -1 152 6.12323e-17 6.12323e-17 153 6.12323e-17 1 154 0.0980171 1 155 0.0980171 6.12323e-17 156 0.0980171 -1 157 0.19509 -1 158 0.19509 6.12323e-17 159 0.19509 1 160 0.290285 1 161 0.290285 6.12323e-17 162 0.290285 -1 163 0.382683 -1 164 0.382683 6.12323e-17 165 0.382683 1 166 0.471397 1 167 0.471397 6.12323e-17 168 0.471397 -1 169 0.55557 -1 170 0.55557 6.12323e-17 171 0.55557 1 172 0.634393 1 173 0.634393 6.12323e-17 174 0.634393 -1 175 0.707107 -1 176 0.707107 6.12323e-17 177 0.707107 1 178 0.77301 1 179 0.77301 6.12323e-17 180 0.77301 -1 181 0.83147 -1 182 0.83147 6.12323e-17 183 0.83147 1 184 0.881921 1 185 0.881921 6.12323e-17 186 0.881921 -1 187 0.92388 -1 188 0.92388 6.12323e-17 189 0.92388 1 190 0.95694 1 191 0.95694 6.12323e-17 192 0.95694 -1 193 0.980785 -1 194 0.980785 6.12323e-17 195 0.980785 1 196 0.995185 1 197 0.995185 6.12323e-17 198 0.995185 -1 199 1 -1 200 1 6.12323e-17 201 1 1 202 -1 -1 203 -1 -0.707107 204 -1 6.12323e-17 205 -1 0.707107 206 -1 1 207 6.12323e-17 1 208 6.12323e-17 0.707107 209 6.12323e-17 6.12323e-17 210 6.12323e-17 -0.707107 211 6.12323e-17 -1 212 1 -1 213 1 -0.707107 214 1 6.12323e-17 215 1 0.707107 216 1 1 217 -1 -1 218 -1 -0.707107 219 -1 6.12323e-17 220 -1 0.707107 221 -1 1 222 -0.707107 1 223 -0.707107 0.707107 224 -0.707107 6.12323e-17 225 -0.707107 -0.707107 226 -0.707107 -1 227 6.12323e-17 -1 228 6.12323e-17 -0.707107 229 6.12323e-17 6.12323e-17 230 6.12323e-17 0.707107 231 6.12323e-17 1 232 0.707107 1 233 0.707107 0.707107 234 0.707107 6.12323e-17 235 0.707107 -0.707107 236 0.707107 -1 237 1 -1 238 1 -0.707107 239 1 6.12323e-17 240 1 0.707107 241 1 1 242 -1 -1 243 -1 -0.707107 244 -1 6.12323e-17 245 -1 0.707107 246 -1 1 247 -0.92388 1 248 -0.92388 0.707107 249 -0.92388 6.12323e-17 250 -0.92388 -0.707107 251 -0.92388 -1 252 -0.707107 -1 253 -0.707107 -0.707107 254 -0.707107 6.12323e-17 255 -0.707107 0.707107 256 -0.707107 1 257 -0.382683 1 258 -0.382683 0.707107 259 -0.382683 6.12323e-17 260 -0.382683 -0.707107 261 -0.382683 -1 262 6.12323e-17 -1 263 6.12323e-17 -0.707107 264 6.12323e-17 6.12323e-17 265 6.12323e-17 0.707107 266 6.12323e-17 1 267 0.382683 1 268 0.382683 0.707107 269 0.382683 6.12323e-17 270 0.382683 -0.707107 271 0.382683 -1 272 0.707107 -1 273 0.707107 -0.707107 274 0.707107 6.12323e-17 275 0.707107 0.707107 276 0.707107 1 277 0.92388 1 278 0.92388 0.707107 279 0.92388 6.12323e-17 280 0.92388 -0.707107 281 0.92388 -1 282 1 -1 283 1 -0.707107 284 1 6.12323e-17 285 1 0.707107 286 1 1 287 -1 -1 288 -1 -0.92388 289 -1 -0.707107 290 -1 -0.382683 291 -1 6.12323e-17 292 -1 0.382683 293 -1 0.707107 294 -1 0.92388 295 -1 1 296 6.12323e-17 1 297 6.12323e-17 0.92388 298 6.12323e-17 0.707107 299 6.12323e-17 0.382683 300 6.12323e-17 6.12323e-17 301 6.12323e-17 -0.382683 302 6.12323e-17 -0.707107 303 6.12323e-17 -0.92388 304 6.12323e-17 -1 305 1 -1 306 1 -0.92388 307 1 -0.707107 308 1 -0.382683 309 1 6.12323e-17 310 1 0.382683 311 1 0.707107 312 1 0.92388 313 1 1 314 -1 -1 315 -1 -0.92388 316 -1 -0.707107 317 -1 -0.382683 318 -1 6.12323e-17 319 -1 0.382683 320 -1 0.707107 321 -1 0.92388 322 -1 1 323 -0.707107 1 324 -0.707107 0.92388 325 -0.707107 0.707107 326 -0.707107 0.382683 327 -0.707107 6.12323e-17 328 -0.707107 -0.382683 329 -0.707107 -0.707107 330 -0.707107 -0.92388 331 -0.707107 -1 332 6.12323e-17 -1 333 6.12323e-17 -0.92388 334 6.12323e-17 -0.707107 335 6.12323e-17 -0.382683 336 6.12323e-17 6.12323e-17 337 6.12323e-17 0.382683 338 6.12323e-17 0.707107 339 6.12323e-17 0.92388 340 6.12323e-17 1 341 0.707107 1 342 0.707107 0.92388 343 0.707107 0.707107 344 0.707107 0.382683 345 0.707107 6.12323e-17 346 0.707107 -0.382683 347 0.707107 -0.707107 348 0.707107 -0.92388 349 0.707107 -1 350 1 -1 351 1 -0.92388 352 1 -0.707107 353 1 -0.382683 354 1 6.12323e-17 355 1 0.382683 356 1 0.707107 357 1 0.92388 358 1 1 TEST04 CLENSHAW_CURTIS_COMPUTE computes a Clenshaw-Curtis quadrature rule over [-1,1] of given order. Order W X 1 2 0 2 1 -1 1 1 3 0.333333 -1 1.33333 6.12323e-17 0.333333 1 4 0.111111 -1 0.888889 -0.5 0.888889 0.5 0.111111 1 5 0.0666667 -1 0.533333 -0.707107 0.8 6.12323e-17 0.533333 0.707107 0.0666667 1 6 0.04 -1 0.360743 -0.809017 0.599257 -0.309017 0.599257 0.309017 0.360743 0.809017 0.04 1 7 0.0285714 -1 0.253968 -0.866025 0.457143 -0.5 0.520635 6.12323e-17 0.457143 0.5 0.253968 0.866025 0.0285714 1 8 0.0204082 -1 0.190141 -0.900969 0.352242 -0.62349 0.437208 -0.222521 0.437208 0.222521 0.352242 0.62349 0.190141 0.900969 0.0204082 1 9 0.015873 -1 0.146219 -0.92388 0.279365 -0.707107 0.361718 -0.382683 0.393651 6.12323e-17 0.361718 0.382683 0.279365 0.707107 0.146219 0.92388 0.015873 1 10 0.0123457 -1 0.116567 -0.939693 0.225284 -0.766044 0.30194 -0.5 0.343863 -0.173648 0.343863 0.173648 0.30194 0.5 0.225284 0.766044 0.116567 0.939693 0.0123457 1 TEST045 To compute a single Clenshaw Curtis weight or abscissa, CC_ABSCISSA computes one abscissa, CC_WEIGHT computes one weight. We use these routines wastefully, to compute the order 10 rule one value at a time. Order W X 10 0.0123457 -1 0.116567 -0.939693 0.225284 -0.766044 0.30194 -0.5 0.343863 -0.173648 0.343863 0.173648 0.30194 0.5 0.225284 0.766044 0.116567 0.939693 0.0123457 1 TEST05 CLENSHAW_CURTIS_COMPUTE computes a Clenshaw-Curtis rule; The integration interval is [-1,1]. Quadrature order will vary. Integrand will vary. Order F1 F2 F3 1 -0.16 2.22222 1.41421 2 1.75866 0.689655 1.93185 3 0.479555 1.71137 1.58676 4 0.479555 1.54284 1.10354 5 0.479377 1.58133 1.52315 6 0.479422 1.58446 1.49143 7 0.479428 1.58181 1.33096 8 0.479428 1.5823 1.48396 9 0.479428 1.58222 1.47649 10 0.479428 1.58223 1.39131 11 0.479428 1.58223 1.47392 12 0.479428 1.58223 1.47059 13 0.479428 1.58223 1.41541 14 0.479428 1.58223 1.46934 15 0.479428 1.58223 1.46761 16 0.479428 1.58223 1.42832 Exact 0.479428 1.58223 1.46045 TEST06 CLENSHAW_CURTIS_SET sets up a Clenshaw-Curtis rule; The integration interval is [-1,1]. Quadrature order will vary. Integrand will vary. Order F1 F2 F3 1 -0.16 2.22222 1.41421 2 1.75866 0.689655 1.93185 3 0.479555 1.71137 1.58676 4 0.479555 1.54284 1.10354 5 0.479377 1.58133 1.52315 6 0.479422 1.58446 1.49143 7 0.479428 1.58181 1.33096 8 0.479428 1.5823 1.48396 9 0.479428 1.58222 1.47649 10 0.479428 1.58223 1.39131 11 0.479428 1.58223 1.47392 12 0.479428 1.58223 1.47059 13 0.479428 1.58223 1.41541 14 0.479428 1.58223 1.46934 15 0.479428 1.58223 1.46761 16 0.479428 1.58223 1.42832 Exact 0.479428 1.58223 1.46045 TEST07 DTABLE_WRITE0 writes a Clenshaw-Curtis quadrature rule to a file. Spatial dimension = 1 Computing the rule of order = 9 Write abscissas to file "cc_x_d1_o9.txt". Write weights to file "cc_w_d1_o9.txt". Write region to file "cc_r_d1_o9.txt". TEST08 CLENSHAW_CURTIS_COMPUTE_ND computes a multidimensional Clenshaw-Curtis quadrature rule over the hypercube [-1,1]^ND of given (possibly different) orders in each dimension. In this example, we use the SAME ORDER in all dimensions. Spatial dimension DIM_NUM = 2 1D orders = 5 5 Number of points = 25 Weight X(1) X(2) -------------- -------------- -------------- 0.00444444 -1 -1 0.0355556 -1 -0.707107 0.0533333 -1 6.12323e-17 0.0355556 -1 0.707107 0.00444444 -1 1 0.0355556 -0.707107 -1 0.284444 -0.707107 -0.707107 0.426667 -0.707107 6.12323e-17 0.284444 -0.707107 0.707107 0.0355556 -0.707107 1 0.0533333 6.12323e-17 -1 0.426667 6.12323e-17 -0.707107 0.64 6.12323e-17 6.12323e-17 0.426667 6.12323e-17 0.707107 0.0533333 6.12323e-17 1 0.0355556 0.707107 -1 0.284444 0.707107 -0.707107 0.426667 0.707107 6.12323e-17 0.284444 0.707107 0.707107 0.0355556 0.707107 1 0.00444444 1 -1 0.0355556 1 -0.707107 0.0533333 1 6.12323e-17 0.0355556 1 0.707107 0.00444444 1 1 4 TEST09 CLENSHAW_CURTIS_COMPUTE_ND computes a multidimensional Clenshaw-Curtis quadrature rule over the hypercube [-1,1]^ND of given (possibly different) orders in each dimension. In this example, we use DIFFERENT ORDERS in each dimension. Spatial dimension DIM_NUM = 3 1D orders = 2 4 3 Number of points = 24 Weight X(1) X(2) X(3) -------------- -------------- -------------- -------------- 0.037037 -1 -1 -1 0.148148 -1 -1 6.12323e-17 0.037037 -1 -1 1 0.296296 -1 -0.5 -1 1.18519 -1 -0.5 6.12323e-17 0.296296 -1 -0.5 1 0.296296 -1 0.5 -1 1.18519 -1 0.5 6.12323e-17 0.296296 -1 0.5 1 0.037037 -1 1 -1 0.148148 -1 1 6.12323e-17 0.037037 -1 1 1 0.037037 1 -1 -1 0.148148 1 -1 6.12323e-17 0.037037 1 -1 1 0.296296 1 -0.5 -1 1.18519 1 -0.5 6.12323e-17 0.296296 1 -0.5 1 0.296296 1 0.5 -1 1.18519 1 0.5 6.12323e-17 0.296296 1 0.5 1 0.037037 1 1 -1 0.148148 1 1 6.12323e-17 0.037037 1 1 1 8 TEST10 Use DTABLE_WRITE0 to write out a multidimensional rule. CLENSHAW_CURTIS_COMPUTE_ND computes a multidimensional Clenshaw-Curtis quadrature rule over the hypercube [-1,1]^ND of given (possibly different) orders in each dimension. In this example, we use the SAME ORDER in all dimensions. Spatial dimension DIM_NUM = 4 1D orders = 3 3 3 3 Number of points = 81 Write abscissas to file "cc_x_d4_o81.txt". Write weights to file "cc_w_d4_o81.txt". Write region to file "cc_r_d4_o81.txt". TEST11 CC_ABSCISSA_LEVEL_1D reports the level on which a Clenshaw Curtis abscissa of given index will first be generated, assuming a series of grids that grow in order as 2^LEVEL+1. Base B = 5 ORDER 2^B+1 = 33 I Level(I) 0 1 1 5 2 4 3 5 4 3 5 5 6 4 7 5 8 2 9 5 10 4 11 5 12 3 13 5 14 4 15 5 16 0 17 5 18 4 19 5 20 3 21 5 22 4 23 5 24 2 25 5 26 4 27 5 28 3 29 5 30 4 31 5 32 1 TEST12 CC_ABSCISSA_LEVEL_1D can also be called for values outside the standard range of 0 through 2^LEVEL_MAX. In that case, a MOD operation is applied first, to make a sensible result. Base B = 5 ORDER = 2^B+1 = 33 I Mod(I,O) Level(I) 6 6 4 95 29 5 80 14 4 47 14 4 30 30 4 -12 21 5 11 11 5 -7 26 4 -15 18 4 56 23 5 -13 20 3 34 1 5 28 28 3 71 5 5 76 10 4 -20 13 5 88 22 4 22 22 4 -9 24 2 -19 14 4 TEST13 CC_ABSCISSA_LEVEL_ND reports the level on which a Clenshaw Curtis abscissa of given index will first be generated, assuming a series of grids that grow in order as 2^LEVEL+1. This routine is applied for multidimensional cases. Base B = 3 ORDER 2^B+1 = 9 DIM_NUM = 2 I J Level(I,J) 0 0 2 0 1 4 0 2 3 0 3 4 0 4 1 0 5 4 0 6 3 0 7 4 0 8 2 1 0 4 1 1 6 1 2 5 1 3 6 1 4 3 1 5 6 1 6 5 1 7 6 1 8 4 2 0 3 2 1 5 2 2 4 2 3 5 2 4 2 2 5 5 2 6 4 2 7 5 2 8 3 3 0 4 3 1 6 3 2 5 3 3 6 3 4 3 3 5 6 3 6 5 3 7 6 3 8 4 4 0 1 4 1 3 4 2 2 4 3 3 4 4 0 4 5 3 4 6 2 4 7 3 4 8 1 5 0 4 5 1 6 5 2 5 5 3 6 5 4 3 5 5 6 5 6 5 5 7 6 5 8 4 6 0 3 6 1 5 6 2 4 6 3 5 6 4 2 6 5 5 6 6 4 6 7 5 6 8 3 7 0 4 7 1 6 7 2 5 7 3 6 7 4 3 7 5 6 7 6 5 7 7 6 7 8 4 8 0 2 8 1 4 8 2 3 8 3 4 8 4 1 8 5 4 8 6 3 8 7 4 8 8 2 CLENSHAW_CURTIS_GRID_TEST Normal end of execution. 20 February 2020 08:27:57 AM