| 1 | /*BHEADER**********************************************************************
|
|---|
| 2 | * Copyright (c) 2008, Lawrence Livermore National Security, LLC.
|
|---|
| 3 | * Produced at the Lawrence Livermore National Laboratory.
|
|---|
| 4 | * This file is part of HYPRE. See file COPYRIGHT for details.
|
|---|
| 5 | *
|
|---|
| 6 | * HYPRE is free software; you can redistribute it and/or modify it under the
|
|---|
| 7 | * terms of the GNU Lesser General Public License (as published by the Free
|
|---|
| 8 | * Software Foundation) version 2.1 dated February 1999.
|
|---|
| 9 | *
|
|---|
| 10 | * $Revision: 2.4 $
|
|---|
| 11 | ***********************************************************************EHEADER*/
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 | /******************************************************************************
|
|---|
| 16 | *
|
|---|
| 17 | * HYPRE_ParAMG interface
|
|---|
| 18 | *
|
|---|
| 19 | *****************************************************************************/
|
|---|
| 20 |
|
|---|
| 21 | #include "headers.h"
|
|---|
| 22 |
|
|---|
| 23 | /*--------------------------------------------------------------------------
|
|---|
| 24 | * HYPRE_BoomerAMGCreate
|
|---|
| 25 | *--------------------------------------------------------------------------*/
|
|---|
| 26 |
|
|---|
| 27 | int
|
|---|
| 28 | HYPRE_BoomerAMGCreate( HYPRE_Solver *solver)
|
|---|
| 29 | {
|
|---|
| 30 | *solver = (HYPRE_Solver) hypre_BoomerAMGCreate( ) ;
|
|---|
| 31 | if (!solver)
|
|---|
| 32 | hypre_error_in_arg(1);
|
|---|
| 33 |
|
|---|
| 34 | return hypre_error_flag;
|
|---|
| 35 | }
|
|---|
| 36 |
|
|---|
| 37 | /*--------------------------------------------------------------------------
|
|---|
| 38 | * HYPRE_BoomerAMGDestroy
|
|---|
| 39 | *--------------------------------------------------------------------------*/
|
|---|
| 40 |
|
|---|
| 41 | int
|
|---|
| 42 | HYPRE_BoomerAMGDestroy( HYPRE_Solver solver )
|
|---|
| 43 | {
|
|---|
| 44 | return( hypre_BoomerAMGDestroy( (void *) solver ) );
|
|---|
| 45 | }
|
|---|
| 46 |
|
|---|
| 47 | /*--------------------------------------------------------------------------
|
|---|
| 48 | * HYPRE_BoomerAMGSetup
|
|---|
| 49 | *--------------------------------------------------------------------------*/
|
|---|
| 50 |
|
|---|
| 51 | int
|
|---|
| 52 | HYPRE_BoomerAMGSetup( HYPRE_Solver solver,
|
|---|
| 53 | HYPRE_ParCSRMatrix A,
|
|---|
| 54 | HYPRE_ParVector b,
|
|---|
| 55 | HYPRE_ParVector x )
|
|---|
| 56 | {
|
|---|
| 57 | return( hypre_BoomerAMGSetup( (void *) solver,
|
|---|
| 58 | (hypre_ParCSRMatrix *) A,
|
|---|
| 59 | (hypre_ParVector *) b,
|
|---|
| 60 | (hypre_ParVector *) x ) );
|
|---|
| 61 | }
|
|---|
| 62 |
|
|---|
| 63 | /*--------------------------------------------------------------------------
|
|---|
| 64 | * HYPRE_BoomerAMGSolve
|
|---|
| 65 | *--------------------------------------------------------------------------*/
|
|---|
| 66 |
|
|---|
| 67 | int
|
|---|
| 68 | HYPRE_BoomerAMGSolve( HYPRE_Solver solver,
|
|---|
| 69 | HYPRE_ParCSRMatrix A,
|
|---|
| 70 | HYPRE_ParVector b,
|
|---|
| 71 | HYPRE_ParVector x )
|
|---|
| 72 | {
|
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 | return( hypre_BoomerAMGSolve( (void *) solver,
|
|---|
| 76 | (hypre_ParCSRMatrix *) A,
|
|---|
| 77 | (hypre_ParVector *) b,
|
|---|
| 78 | (hypre_ParVector *) x ) );
|
|---|
| 79 | }
|
|---|
| 80 |
|
|---|
| 81 | /*--------------------------------------------------------------------------
|
|---|
| 82 | * HYPRE_BoomerAMGSetRestriction
|
|---|
| 83 | *--------------------------------------------------------------------------*/
|
|---|
| 84 |
|
|---|
| 85 | int
|
|---|
| 86 | HYPRE_BoomerAMGSetRestriction( HYPRE_Solver solver,
|
|---|
| 87 | int restr_par )
|
|---|
| 88 | {
|
|---|
| 89 | return( hypre_BoomerAMGSetRestriction( (void *) solver, restr_par ) );
|
|---|
| 90 | }
|
|---|
| 91 |
|
|---|
| 92 | /*--------------------------------------------------------------------------
|
|---|
| 93 | * HYPRE_BoomerAMGSetMaxLevels, HYPRE_BoomerAMGGetMaxLevels
|
|---|
| 94 | *--------------------------------------------------------------------------*/
|
|---|
| 95 |
|
|---|
| 96 | int
|
|---|
| 97 | HYPRE_BoomerAMGSetMaxLevels( HYPRE_Solver solver,
|
|---|
| 98 | int max_levels )
|
|---|
| 99 | {
|
|---|
| 100 | return( hypre_BoomerAMGSetMaxLevels( (void *) solver, max_levels ) );
|
|---|
| 101 | }
|
|---|
| 102 |
|
|---|
| 103 | int
|
|---|
| 104 | HYPRE_BoomerAMGGetMaxLevels( HYPRE_Solver solver,
|
|---|
| 105 | int * max_levels )
|
|---|
| 106 | {
|
|---|
| 107 | return( hypre_BoomerAMGGetMaxLevels( (void *) solver, max_levels ) );
|
|---|
| 108 | }
|
|---|
| 109 |
|
|---|
| 110 | /*--------------------------------------------------------------------------
|
|---|
| 111 | * HYPRE_BoomerAMGSetStrongThreshold, HYPRE_BoomerAMGGetStrongThreshold
|
|---|
| 112 | *--------------------------------------------------------------------------*/
|
|---|
| 113 |
|
|---|
| 114 | int
|
|---|
| 115 | HYPRE_BoomerAMGSetStrongThreshold( HYPRE_Solver solver,
|
|---|
| 116 | double strong_threshold )
|
|---|
| 117 | {
|
|---|
| 118 | return( hypre_BoomerAMGSetStrongThreshold( (void *) solver,
|
|---|
| 119 | strong_threshold ) );
|
|---|
| 120 | }
|
|---|
| 121 |
|
|---|
| 122 | int
|
|---|
| 123 | HYPRE_BoomerAMGGetStrongThreshold( HYPRE_Solver solver,
|
|---|
| 124 | double * strong_threshold )
|
|---|
| 125 | {
|
|---|
| 126 | return( hypre_BoomerAMGGetStrongThreshold( (void *) solver,
|
|---|
| 127 | strong_threshold ) );
|
|---|
| 128 | }
|
|---|
| 129 |
|
|---|
| 130 | /*--------------------------------------------------------------------------
|
|---|
| 131 | * HYPRE_BoomerAMGSetMaxRowSum, HYPRE_BoomerAMGGetMaxRowSum
|
|---|
| 132 | *--------------------------------------------------------------------------*/
|
|---|
| 133 |
|
|---|
| 134 | int
|
|---|
| 135 | HYPRE_BoomerAMGSetMaxRowSum( HYPRE_Solver solver,
|
|---|
| 136 | double max_row_sum )
|
|---|
| 137 | {
|
|---|
| 138 | return( hypre_BoomerAMGSetMaxRowSum( (void *) solver,
|
|---|
| 139 | max_row_sum ) );
|
|---|
| 140 | }
|
|---|
| 141 |
|
|---|
| 142 | int
|
|---|
| 143 | HYPRE_BoomerAMGGetMaxRowSum( HYPRE_Solver solver,
|
|---|
| 144 | double * max_row_sum )
|
|---|
| 145 | {
|
|---|
| 146 | return( hypre_BoomerAMGGetMaxRowSum( (void *) solver,
|
|---|
| 147 | max_row_sum ) );
|
|---|
| 148 | }
|
|---|
| 149 |
|
|---|
| 150 | /*--------------------------------------------------------------------------
|
|---|
| 151 | * HYPRE_BoomerAMGSetTruncFactor, HYPRE_BoomerAMGGetTruncFactor
|
|---|
| 152 | *--------------------------------------------------------------------------*/
|
|---|
| 153 |
|
|---|
| 154 | int
|
|---|
| 155 | HYPRE_BoomerAMGSetTruncFactor( HYPRE_Solver solver,
|
|---|
| 156 | double trunc_factor )
|
|---|
| 157 | {
|
|---|
| 158 | return( hypre_BoomerAMGSetTruncFactor( (void *) solver,
|
|---|
| 159 | trunc_factor ) );
|
|---|
| 160 | }
|
|---|
| 161 |
|
|---|
| 162 | int
|
|---|
| 163 | HYPRE_BoomerAMGGetTruncFactor( HYPRE_Solver solver,
|
|---|
| 164 | double * trunc_factor )
|
|---|
| 165 | {
|
|---|
| 166 | return( hypre_BoomerAMGGetTruncFactor( (void *) solver,
|
|---|
| 167 | trunc_factor ) );
|
|---|
| 168 | }
|
|---|
| 169 |
|
|---|
| 170 | /*--------------------------------------------------------------------------
|
|---|
| 171 | * HYPRE_BoomerAMGSetAggTruncFactor
|
|---|
| 172 | *--------------------------------------------------------------------------*/
|
|---|
| 173 |
|
|---|
| 174 | int
|
|---|
| 175 | HYPRE_BoomerAMGSetAggTruncFactor( HYPRE_Solver solver,
|
|---|
| 176 | double agg_trunc_factor )
|
|---|
| 177 | {
|
|---|
| 178 | return( hypre_BoomerAMGSetAggTruncFactor( (void *) solver,
|
|---|
| 179 | agg_trunc_factor ) );
|
|---|
| 180 | }
|
|---|
| 181 |
|
|---|
| 182 | /*--------------------------------------------------------------------------
|
|---|
| 183 | * HYPRE_BoomerAMGSetPMaxElmts, HYPRE_BoomerAMGGetPMaxElmts
|
|---|
| 184 | *--------------------------------------------------------------------------*/
|
|---|
| 185 |
|
|---|
| 186 | int
|
|---|
| 187 | HYPRE_BoomerAMGSetPMaxElmts( HYPRE_Solver solver,
|
|---|
| 188 | int P_max_elmts )
|
|---|
| 189 | {
|
|---|
| 190 | return( hypre_BoomerAMGSetPMaxElmts( (void *) solver,
|
|---|
| 191 | P_max_elmts ) );
|
|---|
| 192 | }
|
|---|
| 193 |
|
|---|
| 194 | int
|
|---|
| 195 | HYPRE_BoomerAMGGetPMaxElmts( HYPRE_Solver solver,
|
|---|
| 196 | int * P_max_elmts )
|
|---|
| 197 | {
|
|---|
| 198 | return( hypre_BoomerAMGGetPMaxElmts( (void *) solver,
|
|---|
| 199 | P_max_elmts ) );
|
|---|
| 200 | }
|
|---|
| 201 |
|
|---|
| 202 | /*--------------------------------------------------------------------------
|
|---|
| 203 | * HYPRE_BoomerAMGSetJacobiTruncThreshold, HYPRE_BoomerAMGGetJacobiTruncThreshold
|
|---|
| 204 | *--------------------------------------------------------------------------*/
|
|---|
| 205 |
|
|---|
| 206 | int
|
|---|
| 207 | HYPRE_BoomerAMGSetJacobiTruncThreshold( HYPRE_Solver solver,
|
|---|
| 208 | double jacobi_trunc_threshold )
|
|---|
| 209 | {
|
|---|
| 210 | return( hypre_BoomerAMGSetJacobiTruncThreshold( (void *) solver,
|
|---|
| 211 | jacobi_trunc_threshold ) );
|
|---|
| 212 | }
|
|---|
| 213 |
|
|---|
| 214 | int
|
|---|
| 215 | HYPRE_BoomerAMGGetJacobiTruncThreshold( HYPRE_Solver solver,
|
|---|
| 216 | double * jacobi_trunc_threshold )
|
|---|
| 217 | {
|
|---|
| 218 | return( hypre_BoomerAMGGetJacobiTruncThreshold( (void *) solver,
|
|---|
| 219 | jacobi_trunc_threshold ) );
|
|---|
| 220 | }
|
|---|
| 221 |
|
|---|
| 222 | /*--------------------------------------------------------------------------
|
|---|
| 223 | * HYPRE_BoomerAMGSetPostInterpType, HYPRE_BoomerAMGGetPostInterpType
|
|---|
| 224 | * If >0, specifies something to do to improve a computed interpolation matrix.
|
|---|
| 225 | * defaults to 0, for nothing.
|
|---|
| 226 | *--------------------------------------------------------------------------*/
|
|---|
| 227 |
|
|---|
| 228 | int
|
|---|
| 229 | HYPRE_BoomerAMGSetPostInterpType( HYPRE_Solver solver,
|
|---|
| 230 | int post_interp_type )
|
|---|
| 231 | {
|
|---|
| 232 | return( hypre_BoomerAMGSetPostInterpType( (void *) solver,
|
|---|
| 233 | post_interp_type ) );
|
|---|
| 234 | }
|
|---|
| 235 |
|
|---|
| 236 | int
|
|---|
| 237 | HYPRE_BoomerAMGGetPostInterpType( HYPRE_Solver solver,
|
|---|
| 238 | int * post_interp_type )
|
|---|
| 239 | {
|
|---|
| 240 | return( hypre_BoomerAMGGetPostInterpType( (void *) solver,
|
|---|
| 241 | post_interp_type ) );
|
|---|
| 242 | }
|
|---|
| 243 |
|
|---|
| 244 |
|
|---|
| 245 | /*--------------------------------------------------------------------------
|
|---|
| 246 | * HYPRE_BoomerAMGSetSCommPkgSwitch
|
|---|
| 247 | *--------------------------------------------------------------------------*/
|
|---|
| 248 |
|
|---|
| 249 | int
|
|---|
| 250 | HYPRE_BoomerAMGSetSCommPkgSwitch( HYPRE_Solver solver,
|
|---|
| 251 | double S_commpkg_switch )
|
|---|
| 252 | {
|
|---|
| 253 | return( hypre_BoomerAMGSetSCommPkgSwitch( (void *) solver,
|
|---|
| 254 | S_commpkg_switch ) );
|
|---|
| 255 | }
|
|---|
| 256 |
|
|---|
| 257 | /*--------------------------------------------------------------------------
|
|---|
| 258 | * HYPRE_BoomerAMGSetInterpType
|
|---|
| 259 | *--------------------------------------------------------------------------*/
|
|---|
| 260 |
|
|---|
| 261 | int
|
|---|
| 262 | HYPRE_BoomerAMGSetInterpType( HYPRE_Solver solver,
|
|---|
| 263 | int interp_type )
|
|---|
| 264 | {
|
|---|
| 265 | return( hypre_BoomerAMGSetInterpType( (void *) solver, interp_type ) );
|
|---|
| 266 | }
|
|---|
| 267 |
|
|---|
| 268 | /*--------------------------------------------------------------------------
|
|---|
| 269 | * HYPRE_BoomerAMGSetMinIter
|
|---|
| 270 | *--------------------------------------------------------------------------*/
|
|---|
| 271 |
|
|---|
| 272 | int
|
|---|
| 273 | HYPRE_BoomerAMGSetMinIter( HYPRE_Solver solver,
|
|---|
| 274 | int min_iter )
|
|---|
| 275 | {
|
|---|
| 276 | return( hypre_BoomerAMGSetMinIter( (void *) solver, min_iter ) );
|
|---|
| 277 | }
|
|---|
| 278 |
|
|---|
| 279 | /*--------------------------------------------------------------------------
|
|---|
| 280 | * HYPRE_BoomerAMGSetMaxIter
|
|---|
| 281 | *--------------------------------------------------------------------------*/
|
|---|
| 282 |
|
|---|
| 283 | int
|
|---|
| 284 | HYPRE_BoomerAMGSetMaxIter( HYPRE_Solver solver,
|
|---|
| 285 | int max_iter )
|
|---|
| 286 | {
|
|---|
| 287 | return( hypre_BoomerAMGSetMaxIter( (void *) solver, max_iter ) );
|
|---|
| 288 | }
|
|---|
| 289 |
|
|---|
| 290 | int
|
|---|
| 291 | HYPRE_BoomerAMGGetMaxIter( HYPRE_Solver solver,
|
|---|
| 292 | int * max_iter )
|
|---|
| 293 | {
|
|---|
| 294 | return( hypre_BoomerAMGGetMaxIter( (void *) solver, max_iter ) );
|
|---|
| 295 | }
|
|---|
| 296 |
|
|---|
| 297 | /*--------------------------------------------------------------------------
|
|---|
| 298 | * HYPRE_BoomerAMGSetCoarsenType, HYPRE_BoomerAMGGetCoarsenType
|
|---|
| 299 | *--------------------------------------------------------------------------*/
|
|---|
| 300 |
|
|---|
| 301 | int
|
|---|
| 302 | HYPRE_BoomerAMGSetCoarsenType( HYPRE_Solver solver,
|
|---|
| 303 | int coarsen_type )
|
|---|
| 304 | {
|
|---|
| 305 | return( hypre_BoomerAMGSetCoarsenType( (void *) solver, coarsen_type ) );
|
|---|
| 306 | }
|
|---|
| 307 |
|
|---|
| 308 | int
|
|---|
| 309 | HYPRE_BoomerAMGGetCoarsenType( HYPRE_Solver solver,
|
|---|
| 310 | int * coarsen_type )
|
|---|
| 311 | {
|
|---|
| 312 | return( hypre_BoomerAMGGetCoarsenType( (void *) solver, coarsen_type ) );
|
|---|
| 313 | }
|
|---|
| 314 |
|
|---|
| 315 | /*--------------------------------------------------------------------------
|
|---|
| 316 | * HYPRE_BoomerAMGSetMeasureType, HYPRE_BoomerAMGGetMeasureType
|
|---|
| 317 | *--------------------------------------------------------------------------*/
|
|---|
| 318 |
|
|---|
| 319 | int
|
|---|
| 320 | HYPRE_BoomerAMGSetMeasureType( HYPRE_Solver solver,
|
|---|
| 321 | int measure_type )
|
|---|
| 322 | {
|
|---|
| 323 | return( hypre_BoomerAMGSetMeasureType( (void *) solver, measure_type ) );
|
|---|
| 324 | }
|
|---|
| 325 |
|
|---|
| 326 | int
|
|---|
| 327 | HYPRE_BoomerAMGGetMeasureType( HYPRE_Solver solver,
|
|---|
| 328 | int * measure_type )
|
|---|
| 329 | {
|
|---|
| 330 | return( hypre_BoomerAMGGetMeasureType( (void *) solver, measure_type ) );
|
|---|
| 331 | }
|
|---|
| 332 |
|
|---|
| 333 | /*--------------------------------------------------------------------------
|
|---|
| 334 | * HYPRE_BoomerAMGSetSetupType
|
|---|
| 335 | *--------------------------------------------------------------------------*/
|
|---|
| 336 |
|
|---|
| 337 | int
|
|---|
| 338 | HYPRE_BoomerAMGSetSetupType( HYPRE_Solver solver,
|
|---|
| 339 | int setup_type )
|
|---|
| 340 | {
|
|---|
| 341 | return( hypre_BoomerAMGSetSetupType( (void *) solver, setup_type ) );
|
|---|
| 342 | }
|
|---|
| 343 |
|
|---|
| 344 | /*--------------------------------------------------------------------------
|
|---|
| 345 | * HYPRE_BoomerAMGSetCycleType, HYPRE_BoomerAMGGetCycleType
|
|---|
| 346 | *--------------------------------------------------------------------------*/
|
|---|
| 347 |
|
|---|
| 348 | int
|
|---|
| 349 | HYPRE_BoomerAMGSetCycleType( HYPRE_Solver solver,
|
|---|
| 350 | int cycle_type )
|
|---|
| 351 | {
|
|---|
| 352 | return( hypre_BoomerAMGSetCycleType( (void *) solver, cycle_type ) );
|
|---|
| 353 | }
|
|---|
| 354 |
|
|---|
| 355 | int
|
|---|
| 356 | HYPRE_BoomerAMGGetCycleType( HYPRE_Solver solver,
|
|---|
| 357 | int * cycle_type )
|
|---|
| 358 | {
|
|---|
| 359 | return( hypre_BoomerAMGGetCycleType( (void *) solver, cycle_type ) );
|
|---|
| 360 | }
|
|---|
| 361 |
|
|---|
| 362 | /*--------------------------------------------------------------------------
|
|---|
| 363 | * HYPRE_BoomerAMGSetTol, HYPRE_BoomerAMGGetTol
|
|---|
| 364 | *--------------------------------------------------------------------------*/
|
|---|
| 365 |
|
|---|
| 366 | int
|
|---|
| 367 | HYPRE_BoomerAMGSetTol( HYPRE_Solver solver,
|
|---|
| 368 | double tol )
|
|---|
| 369 | {
|
|---|
| 370 | return( hypre_BoomerAMGSetTol( (void *) solver, tol ) );
|
|---|
| 371 | }
|
|---|
| 372 |
|
|---|
| 373 | int
|
|---|
| 374 | HYPRE_BoomerAMGGetTol( HYPRE_Solver solver,
|
|---|
| 375 | double * tol )
|
|---|
| 376 | {
|
|---|
| 377 | return( hypre_BoomerAMGGetTol( (void *) solver, tol ) );
|
|---|
| 378 | }
|
|---|
| 379 |
|
|---|
| 380 | /*--------------------------------------------------------------------------
|
|---|
| 381 | * HYPRE_BoomerAMGSetNumGridSweeps
|
|---|
| 382 | * DEPRECATED. There are memory management problems associated with the
|
|---|
| 383 | * use of a user-supplied array (who releases it?).
|
|---|
| 384 | * Use SetNumSweeps and SetCycleNumSweeps instead.
|
|---|
| 385 | *--------------------------------------------------------------------------*/
|
|---|
| 386 |
|
|---|
| 387 | int
|
|---|
| 388 | HYPRE_BoomerAMGSetNumGridSweeps( HYPRE_Solver solver,
|
|---|
| 389 | int *num_grid_sweeps )
|
|---|
| 390 | {
|
|---|
| 391 | return( hypre_BoomerAMGSetNumGridSweeps( (void *) solver, num_grid_sweeps ) );
|
|---|
| 392 | }
|
|---|
| 393 |
|
|---|
| 394 | /*--------------------------------------------------------------------------
|
|---|
| 395 | * HYPRE_BoomerAMGSetNumSweeps
|
|---|
| 396 | * There is no corresponding Get function. Use GetCycleNumSweeps.
|
|---|
| 397 | *--------------------------------------------------------------------------*/
|
|---|
| 398 |
|
|---|
| 399 | int
|
|---|
| 400 | HYPRE_BoomerAMGSetNumSweeps( HYPRE_Solver solver,
|
|---|
| 401 | int num_sweeps )
|
|---|
| 402 | {
|
|---|
| 403 | return( hypre_BoomerAMGSetNumSweeps( (void *) solver, num_sweeps ) );
|
|---|
| 404 | }
|
|---|
| 405 |
|
|---|
| 406 | /*--------------------------------------------------------------------------
|
|---|
| 407 | * HYPRE_BoomerAMGSetCycleNumSweeps, HYPRE_BoomerAMGGetCycleNumSweeps
|
|---|
| 408 | *--------------------------------------------------------------------------*/
|
|---|
| 409 |
|
|---|
| 410 | int
|
|---|
| 411 | HYPRE_BoomerAMGSetCycleNumSweeps( HYPRE_Solver solver,
|
|---|
| 412 | int num_sweeps, int k )
|
|---|
| 413 | {
|
|---|
| 414 | return( hypre_BoomerAMGSetCycleNumSweeps( (void *) solver, num_sweeps, k ) );
|
|---|
| 415 | }
|
|---|
| 416 |
|
|---|
| 417 | int
|
|---|
| 418 | HYPRE_BoomerAMGGetCycleNumSweeps( HYPRE_Solver solver,
|
|---|
| 419 | int * num_sweeps, int k )
|
|---|
| 420 | {
|
|---|
| 421 | return( hypre_BoomerAMGGetCycleNumSweeps( (void *) solver, num_sweeps, k ) );
|
|---|
| 422 | }
|
|---|
| 423 |
|
|---|
| 424 | /*--------------------------------------------------------------------------
|
|---|
| 425 | * HYPRE_BoomerAMGInitGridRelaxation
|
|---|
| 426 | *--------------------------------------------------------------------------*/
|
|---|
| 427 |
|
|---|
| 428 | int
|
|---|
| 429 | HYPRE_BoomerAMGInitGridRelaxation( int **num_grid_sweeps_ptr,
|
|---|
| 430 | int **grid_relax_type_ptr,
|
|---|
| 431 | int ***grid_relax_points_ptr,
|
|---|
| 432 | int coarsen_type,
|
|---|
| 433 | double **relax_weights_ptr,
|
|---|
| 434 | int max_levels )
|
|---|
| 435 | { int i;
|
|---|
| 436 | int *num_grid_sweeps;
|
|---|
| 437 | int *grid_relax_type;
|
|---|
| 438 | int **grid_relax_points;
|
|---|
| 439 | double *relax_weights;
|
|---|
| 440 |
|
|---|
| 441 | *num_grid_sweeps_ptr = hypre_CTAlloc(int, 4);
|
|---|
| 442 | *grid_relax_type_ptr = hypre_CTAlloc(int, 4);
|
|---|
| 443 | *grid_relax_points_ptr = hypre_CTAlloc(int*, 4);
|
|---|
| 444 | *relax_weights_ptr = hypre_CTAlloc(double, max_levels);
|
|---|
| 445 |
|
|---|
| 446 | num_grid_sweeps = *num_grid_sweeps_ptr;
|
|---|
| 447 | grid_relax_type = *grid_relax_type_ptr;
|
|---|
| 448 | grid_relax_points = *grid_relax_points_ptr;
|
|---|
| 449 | relax_weights = *relax_weights_ptr;
|
|---|
| 450 |
|
|---|
| 451 | if (coarsen_type == 5)
|
|---|
| 452 | {
|
|---|
| 453 | /* fine grid */
|
|---|
| 454 | num_grid_sweeps[0] = 3;
|
|---|
| 455 | grid_relax_type[0] = 3;
|
|---|
| 456 | grid_relax_points[0] = hypre_CTAlloc(int, 4);
|
|---|
| 457 | grid_relax_points[0][0] = -2;
|
|---|
| 458 | grid_relax_points[0][1] = -1;
|
|---|
| 459 | grid_relax_points[0][2] = 1;
|
|---|
| 460 |
|
|---|
| 461 | /* down cycle */
|
|---|
| 462 | num_grid_sweeps[1] = 4;
|
|---|
| 463 | grid_relax_type[1] = 3;
|
|---|
| 464 | grid_relax_points[1] = hypre_CTAlloc(int, 4);
|
|---|
| 465 | grid_relax_points[1][0] = -1;
|
|---|
| 466 | grid_relax_points[1][1] = 1;
|
|---|
| 467 | grid_relax_points[1][2] = -2;
|
|---|
| 468 | grid_relax_points[1][3] = -2;
|
|---|
| 469 |
|
|---|
| 470 | /* up cycle */
|
|---|
| 471 | num_grid_sweeps[2] = 4;
|
|---|
| 472 | grid_relax_type[2] = 3;
|
|---|
| 473 | grid_relax_points[2] = hypre_CTAlloc(int, 4);
|
|---|
| 474 | grid_relax_points[2][0] = -2;
|
|---|
| 475 | grid_relax_points[2][1] = -2;
|
|---|
| 476 | grid_relax_points[2][2] = 1;
|
|---|
| 477 | grid_relax_points[2][3] = -1;
|
|---|
| 478 | }
|
|---|
| 479 | else
|
|---|
| 480 | {
|
|---|
| 481 | /* fine grid */
|
|---|
| 482 | num_grid_sweeps[0] = 2;
|
|---|
| 483 | grid_relax_type[0] = 3;
|
|---|
| 484 | grid_relax_points[0] = hypre_CTAlloc(int, 2);
|
|---|
| 485 | grid_relax_points[0][0] = 1;
|
|---|
| 486 | grid_relax_points[0][1] = -1;
|
|---|
| 487 |
|
|---|
| 488 | /* down cycle */
|
|---|
| 489 | num_grid_sweeps[1] = 2;
|
|---|
| 490 | grid_relax_type[1] = 3;
|
|---|
| 491 | grid_relax_points[1] = hypre_CTAlloc(int, 2);
|
|---|
| 492 | grid_relax_points[1][0] = 1;
|
|---|
| 493 | grid_relax_points[1][1] = -1;
|
|---|
| 494 |
|
|---|
| 495 | /* up cycle */
|
|---|
| 496 | num_grid_sweeps[2] = 2;
|
|---|
| 497 | grid_relax_type[2] = 3;
|
|---|
| 498 | grid_relax_points[2] = hypre_CTAlloc(int, 2);
|
|---|
| 499 | grid_relax_points[2][0] = -1;
|
|---|
| 500 | grid_relax_points[2][1] = 1;
|
|---|
| 501 | }
|
|---|
| 502 | /* coarsest grid */
|
|---|
| 503 | num_grid_sweeps[3] = 1;
|
|---|
| 504 | grid_relax_type[3] = 3;
|
|---|
| 505 | grid_relax_points[3] = hypre_CTAlloc(int, 1);
|
|---|
| 506 | grid_relax_points[3][0] = 0;
|
|---|
| 507 |
|
|---|
| 508 | for (i = 0; i < max_levels; i++)
|
|---|
| 509 | relax_weights[i] = 1.;
|
|---|
| 510 |
|
|---|
| 511 | return hypre_error_flag;
|
|---|
| 512 | }
|
|---|
| 513 |
|
|---|
| 514 | /*--------------------------------------------------------------------------
|
|---|
| 515 | * HYPRE_BoomerAMGSetGridRelaxType
|
|---|
| 516 | * DEPRECATED. There are memory management problems associated with the
|
|---|
| 517 | * use of a user-supplied array (who releases it?).
|
|---|
| 518 | * Use SetRelaxType and SetCycleRelaxType instead.
|
|---|
| 519 | *--------------------------------------------------------------------------*/
|
|---|
| 520 |
|
|---|
| 521 | int
|
|---|
| 522 | HYPRE_BoomerAMGSetGridRelaxType( HYPRE_Solver solver,
|
|---|
| 523 | int *grid_relax_type )
|
|---|
| 524 | {
|
|---|
| 525 | return( hypre_BoomerAMGSetGridRelaxType( (void *) solver, grid_relax_type ) );
|
|---|
| 526 | }
|
|---|
| 527 |
|
|---|
| 528 | /*--------------------------------------------------------------------------
|
|---|
| 529 | * HYPRE_BoomerAMGSetRelaxType
|
|---|
| 530 | *--------------------------------------------------------------------------*/
|
|---|
| 531 |
|
|---|
| 532 | int
|
|---|
| 533 | HYPRE_BoomerAMGSetRelaxType( HYPRE_Solver solver,
|
|---|
| 534 | int relax_type )
|
|---|
| 535 | {
|
|---|
| 536 | return( hypre_BoomerAMGSetRelaxType( (void *) solver, relax_type ) );
|
|---|
| 537 | }
|
|---|
| 538 |
|
|---|
| 539 | /*--------------------------------------------------------------------------
|
|---|
| 540 | * HYPRE_BoomerAMGSetCycleRelaxType, HYPRE_BoomerAMGetCycleRelaxType
|
|---|
| 541 | *--------------------------------------------------------------------------*/
|
|---|
| 542 |
|
|---|
| 543 | int
|
|---|
| 544 | HYPRE_BoomerAMGSetCycleRelaxType( HYPRE_Solver solver,
|
|---|
| 545 | int relax_type, int k )
|
|---|
| 546 | {
|
|---|
| 547 | return( hypre_BoomerAMGSetCycleRelaxType( (void *) solver, relax_type, k ) );
|
|---|
| 548 | }
|
|---|
| 549 |
|
|---|
| 550 | int
|
|---|
| 551 | HYPRE_BoomerAMGGetCycleRelaxType( HYPRE_Solver solver,
|
|---|
| 552 | int * relax_type, int k )
|
|---|
| 553 | {
|
|---|
| 554 | return( hypre_BoomerAMGGetCycleRelaxType( (void *) solver, relax_type, k ) );
|
|---|
| 555 | }
|
|---|
| 556 |
|
|---|
| 557 | /*--------------------------------------------------------------------------
|
|---|
| 558 | * HYPRE_BoomerAMGSetRelaxOrder
|
|---|
| 559 | *--------------------------------------------------------------------------*/
|
|---|
| 560 |
|
|---|
| 561 | int
|
|---|
| 562 | HYPRE_BoomerAMGSetRelaxOrder( HYPRE_Solver solver,
|
|---|
| 563 | int relax_order)
|
|---|
| 564 | {
|
|---|
| 565 | return( hypre_BoomerAMGSetRelaxOrder( (void *) solver, relax_order ) );
|
|---|
| 566 | }
|
|---|
| 567 |
|
|---|
| 568 | /*--------------------------------------------------------------------------
|
|---|
| 569 | * HYPRE_BoomerAMGSetGridRelaxPoints
|
|---|
| 570 | * DEPRECATED. There are memory management problems associated with the
|
|---|
| 571 | * use of a user-supplied array (who releases it?).
|
|---|
| 572 | * Ulrike Yang suspects that nobody uses this function.
|
|---|
| 573 | *--------------------------------------------------------------------------*/
|
|---|
| 574 |
|
|---|
| 575 | int
|
|---|
| 576 | HYPRE_BoomerAMGSetGridRelaxPoints( HYPRE_Solver solver,
|
|---|
| 577 | int **grid_relax_points )
|
|---|
| 578 | {
|
|---|
| 579 | return( hypre_BoomerAMGSetGridRelaxPoints( (void *) solver, grid_relax_points ) );
|
|---|
| 580 | }
|
|---|
| 581 |
|
|---|
| 582 | /*--------------------------------------------------------------------------
|
|---|
| 583 | * HYPRE_BoomerAMGSetRelaxWeight
|
|---|
| 584 | * DEPRECATED. There are memory management problems associated with the
|
|---|
| 585 | * use of a user-supplied array (who releases it?).
|
|---|
| 586 | * Use SetRelaxWt and SetLevelRelaxWt instead.
|
|---|
| 587 | *--------------------------------------------------------------------------*/
|
|---|
| 588 |
|
|---|
| 589 | int
|
|---|
| 590 | HYPRE_BoomerAMGSetRelaxWeight( HYPRE_Solver solver,
|
|---|
| 591 | double *relax_weight )
|
|---|
| 592 | {
|
|---|
| 593 | return( hypre_BoomerAMGSetRelaxWeight( (void *) solver, relax_weight ) );
|
|---|
| 594 | }
|
|---|
| 595 |
|
|---|
| 596 | /*--------------------------------------------------------------------------
|
|---|
| 597 | * HYPRE_BoomerAMGSetRelaxWt
|
|---|
| 598 | *--------------------------------------------------------------------------*/
|
|---|
| 599 |
|
|---|
| 600 | int
|
|---|
| 601 | HYPRE_BoomerAMGSetRelaxWt( HYPRE_Solver solver,
|
|---|
| 602 | double relax_wt )
|
|---|
| 603 | {
|
|---|
| 604 | return( hypre_BoomerAMGSetRelaxWt( (void *) solver, relax_wt ) );
|
|---|
| 605 | }
|
|---|
| 606 |
|
|---|
| 607 | /*--------------------------------------------------------------------------
|
|---|
| 608 | * HYPRE_BoomerAMGSetLevelRelaxWt
|
|---|
| 609 | *--------------------------------------------------------------------------*/
|
|---|
| 610 |
|
|---|
| 611 | int
|
|---|
| 612 | HYPRE_BoomerAMGSetLevelRelaxWt( HYPRE_Solver solver,
|
|---|
| 613 | double relax_wt,
|
|---|
| 614 | int level )
|
|---|
| 615 | {
|
|---|
| 616 | return( hypre_BoomerAMGSetLevelRelaxWt( (void *) solver, relax_wt, level ) );
|
|---|
| 617 | }
|
|---|
| 618 |
|
|---|
| 619 | /*--------------------------------------------------------------------------
|
|---|
| 620 | * HYPRE_BoomerAMGSetOmega
|
|---|
| 621 | *--------------------------------------------------------------------------*/
|
|---|
| 622 |
|
|---|
| 623 | int
|
|---|
| 624 | HYPRE_BoomerAMGSetOmega( HYPRE_Solver solver,
|
|---|
| 625 | double *omega )
|
|---|
| 626 | {
|
|---|
| 627 | return( hypre_BoomerAMGSetOmega( (void *) solver, omega ) );
|
|---|
| 628 | }
|
|---|
| 629 |
|
|---|
| 630 | /*--------------------------------------------------------------------------
|
|---|
| 631 | * HYPRE_BoomerAMGSetOuterWt
|
|---|
| 632 | *--------------------------------------------------------------------------*/
|
|---|
| 633 |
|
|---|
| 634 | int
|
|---|
| 635 | HYPRE_BoomerAMGSetOuterWt( HYPRE_Solver solver,
|
|---|
| 636 | double outer_wt )
|
|---|
| 637 | {
|
|---|
| 638 | return( hypre_BoomerAMGSetOuterWt( (void *) solver, outer_wt ) );
|
|---|
| 639 | }
|
|---|
| 640 |
|
|---|
| 641 | /*--------------------------------------------------------------------------
|
|---|
| 642 | * HYPRE_BoomerAMGSetLevelOuterWt
|
|---|
| 643 | *--------------------------------------------------------------------------*/
|
|---|
| 644 |
|
|---|
| 645 | int
|
|---|
| 646 | HYPRE_BoomerAMGSetLevelOuterWt( HYPRE_Solver solver,
|
|---|
| 647 | double outer_wt,
|
|---|
| 648 | int level )
|
|---|
| 649 | {
|
|---|
| 650 | return( hypre_BoomerAMGSetLevelOuterWt( (void *) solver, outer_wt, level ) );
|
|---|
| 651 | }
|
|---|
| 652 |
|
|---|
| 653 | /*--------------------------------------------------------------------------
|
|---|
| 654 | * HYPRE_BoomerAMGSetSmoothType, HYPRE_BoomerAMGGetSmoothType
|
|---|
| 655 | *--------------------------------------------------------------------------*/
|
|---|
| 656 |
|
|---|
| 657 | int
|
|---|
| 658 | HYPRE_BoomerAMGSetSmoothType( HYPRE_Solver solver,
|
|---|
| 659 | int smooth_type )
|
|---|
| 660 | {
|
|---|
| 661 | return( hypre_BoomerAMGSetSmoothType( (void *) solver, smooth_type ) );
|
|---|
| 662 | }
|
|---|
| 663 |
|
|---|
| 664 | int
|
|---|
| 665 | HYPRE_BoomerAMGGetSmoothType( HYPRE_Solver solver,
|
|---|
| 666 | int * smooth_type )
|
|---|
| 667 | {
|
|---|
| 668 | return( hypre_BoomerAMGGetSmoothType( (void *) solver, smooth_type ) );
|
|---|
| 669 | }
|
|---|
| 670 |
|
|---|
| 671 | /*--------------------------------------------------------------------------
|
|---|
| 672 | * HYPRE_BoomerAMGSetSmoothNumLevels, HYPRE_BoomerAMGGetSmoothNumLevels
|
|---|
| 673 | *--------------------------------------------------------------------------*/
|
|---|
| 674 |
|
|---|
| 675 | int
|
|---|
| 676 | HYPRE_BoomerAMGSetSmoothNumLevels( HYPRE_Solver solver,
|
|---|
| 677 | int smooth_num_levels )
|
|---|
| 678 | {
|
|---|
| 679 | return( hypre_BoomerAMGSetSmoothNumLevels((void *)solver,smooth_num_levels ));
|
|---|
| 680 | }
|
|---|
| 681 |
|
|---|
| 682 | int
|
|---|
| 683 | HYPRE_BoomerAMGGetSmoothNumLevels( HYPRE_Solver solver,
|
|---|
| 684 | int * smooth_num_levels )
|
|---|
| 685 | {
|
|---|
| 686 | return( hypre_BoomerAMGGetSmoothNumLevels((void *)solver,smooth_num_levels ));
|
|---|
| 687 | }
|
|---|
| 688 |
|
|---|
| 689 | /*--------------------------------------------------------------------------
|
|---|
| 690 | * HYPRE_BoomerAMGSetSmoothNumSweeps, HYPRE_BoomerAMGGetSmoothNumSweeps
|
|---|
| 691 | *--------------------------------------------------------------------------*/
|
|---|
| 692 |
|
|---|
| 693 | int
|
|---|
| 694 | HYPRE_BoomerAMGSetSmoothNumSweeps( HYPRE_Solver solver,
|
|---|
| 695 | int smooth_num_sweeps )
|
|---|
| 696 | {
|
|---|
| 697 | return( hypre_BoomerAMGSetSmoothNumSweeps((void *)solver,smooth_num_sweeps ));
|
|---|
| 698 | }
|
|---|
| 699 |
|
|---|
| 700 | int
|
|---|
| 701 | HYPRE_BoomerAMGGetSmoothNumSweeps( HYPRE_Solver solver,
|
|---|
| 702 | int * smooth_num_sweeps )
|
|---|
| 703 | {
|
|---|
| 704 | return( hypre_BoomerAMGGetSmoothNumSweeps((void *)solver,smooth_num_sweeps ));
|
|---|
| 705 | }
|
|---|
| 706 |
|
|---|
| 707 | /*--------------------------------------------------------------------------
|
|---|
| 708 | * HYPRE_BoomerAMGSetLogging, HYPRE_BoomerAMGGetLogging
|
|---|
| 709 | *--------------------------------------------------------------------------*/
|
|---|
| 710 |
|
|---|
| 711 | int
|
|---|
| 712 | HYPRE_BoomerAMGSetLogging( HYPRE_Solver solver,
|
|---|
| 713 | int logging )
|
|---|
| 714 | {
|
|---|
| 715 | /* This function should be called before Setup. Logging changes
|
|---|
| 716 | may require allocation or freeing of arrays, which is presently
|
|---|
| 717 | only done there.
|
|---|
| 718 | It may be possible to support logging changes at other times,
|
|---|
| 719 | but there is little need.
|
|---|
| 720 | */
|
|---|
| 721 | return( hypre_BoomerAMGSetLogging( (void *) solver, logging ) );
|
|---|
| 722 | }
|
|---|
| 723 |
|
|---|
| 724 | int
|
|---|
| 725 | HYPRE_BoomerAMGGetLogging( HYPRE_Solver solver,
|
|---|
| 726 | int * logging )
|
|---|
| 727 | {
|
|---|
| 728 | return( hypre_BoomerAMGGetLogging( (void *) solver, logging ) );
|
|---|
| 729 | }
|
|---|
| 730 |
|
|---|
| 731 | /*--------------------------------------------------------------------------
|
|---|
| 732 | * HYPRE_BoomerAMGSetPrintLevel, HYPRE_BoomerAMGGetPrintLevel
|
|---|
| 733 | *--------------------------------------------------------------------------*/
|
|---|
| 734 |
|
|---|
| 735 | int
|
|---|
| 736 | HYPRE_BoomerAMGSetPrintLevel( HYPRE_Solver solver,
|
|---|
| 737 | int print_level )
|
|---|
| 738 | {
|
|---|
| 739 | return( hypre_BoomerAMGSetPrintLevel( (void *) solver, print_level ) );
|
|---|
| 740 | }
|
|---|
| 741 |
|
|---|
| 742 | int
|
|---|
| 743 | HYPRE_BoomerAMGGetPrintLevel( HYPRE_Solver solver,
|
|---|
| 744 | int * print_level )
|
|---|
| 745 | {
|
|---|
| 746 | return( hypre_BoomerAMGGetPrintLevel( (void *) solver, print_level ) );
|
|---|
| 747 | }
|
|---|
| 748 |
|
|---|
| 749 | /*--------------------------------------------------------------------------
|
|---|
| 750 | * HYPRE_BoomerAMGSetPrintFileName
|
|---|
| 751 | *--------------------------------------------------------------------------*/
|
|---|
| 752 |
|
|---|
| 753 | int
|
|---|
| 754 | HYPRE_BoomerAMGSetPrintFileName( HYPRE_Solver solver,
|
|---|
| 755 | const char *print_file_name )
|
|---|
| 756 | {
|
|---|
| 757 | return( hypre_BoomerAMGSetPrintFileName( (void *) solver, print_file_name ) );
|
|---|
| 758 | }
|
|---|
| 759 |
|
|---|
| 760 | /*--------------------------------------------------------------------------
|
|---|
| 761 | * HYPRE_BoomerAMGSetDebugFlag, HYPRE_BoomerAMGGetDebugFlag
|
|---|
| 762 | *--------------------------------------------------------------------------*/
|
|---|
| 763 |
|
|---|
| 764 | int
|
|---|
| 765 | HYPRE_BoomerAMGSetDebugFlag( HYPRE_Solver solver,
|
|---|
| 766 | int debug_flag )
|
|---|
| 767 | {
|
|---|
| 768 | return( hypre_BoomerAMGSetDebugFlag( (void *) solver, debug_flag ) );
|
|---|
| 769 | }
|
|---|
| 770 |
|
|---|
| 771 | int
|
|---|
| 772 | HYPRE_BoomerAMGGetDebugFlag( HYPRE_Solver solver,
|
|---|
| 773 | int * debug_flag )
|
|---|
| 774 | {
|
|---|
| 775 | return( hypre_BoomerAMGGetDebugFlag( (void *) solver, debug_flag ) );
|
|---|
| 776 | }
|
|---|
| 777 |
|
|---|
| 778 | /*--------------------------------------------------------------------------
|
|---|
| 779 | * HYPRE_BoomerAMGGetNumIterations
|
|---|
| 780 | *--------------------------------------------------------------------------*/
|
|---|
| 781 |
|
|---|
| 782 | int
|
|---|
| 783 | HYPRE_BoomerAMGGetNumIterations( HYPRE_Solver solver,
|
|---|
| 784 | int *num_iterations )
|
|---|
| 785 | {
|
|---|
| 786 | return( hypre_BoomerAMGGetNumIterations( (void *) solver, num_iterations ) );
|
|---|
| 787 | }
|
|---|
| 788 |
|
|---|
| 789 | /*--------------------------------------------------------------------------
|
|---|
| 790 | * HYPRE_BoomerAMGGetCumNumIterations
|
|---|
| 791 | *--------------------------------------------------------------------------*/
|
|---|
| 792 |
|
|---|
| 793 | int
|
|---|
| 794 | HYPRE_BoomerAMGGetCumNumIterations( HYPRE_Solver solver,
|
|---|
| 795 | int *cum_num_iterations )
|
|---|
| 796 | {
|
|---|
| 797 | return( hypre_BoomerAMGGetCumNumIterations( (void *) solver, cum_num_iterations ) );
|
|---|
| 798 | }
|
|---|
| 799 |
|
|---|
| 800 | /*--------------------------------------------------------------------------
|
|---|
| 801 | * HYPRE_BoomerAMGGetResidual
|
|---|
| 802 | *--------------------------------------------------------------------------*/
|
|---|
| 803 |
|
|---|
| 804 | int
|
|---|
| 805 | HYPRE_BoomerAMGGetResidual( HYPRE_Solver solver, HYPRE_ParVector * residual )
|
|---|
| 806 | {
|
|---|
| 807 | return hypre_BoomerAMGGetResidual( (void *) solver,
|
|---|
| 808 | (hypre_ParVector **) residual );
|
|---|
| 809 | }
|
|---|
| 810 |
|
|---|
| 811 |
|
|---|
| 812 | /*--------------------------------------------------------------------------
|
|---|
| 813 | * HYPRE_BoomerAMGGetFinalRelativeResidualNorm
|
|---|
| 814 | *--------------------------------------------------------------------------*/
|
|---|
| 815 |
|
|---|
| 816 | int
|
|---|
| 817 | HYPRE_BoomerAMGGetFinalRelativeResidualNorm( HYPRE_Solver solver,
|
|---|
| 818 | double *rel_resid_norm )
|
|---|
| 819 | {
|
|---|
| 820 | return( hypre_BoomerAMGGetRelResidualNorm( (void *) solver, rel_resid_norm ) );
|
|---|
| 821 | }
|
|---|
| 822 |
|
|---|
| 823 | /*--------------------------------------------------------------------------
|
|---|
| 824 | * HYPRE_BoomerAMGSetVariant, HYPRE_BoomerAMGGetVariant
|
|---|
| 825 | *--------------------------------------------------------------------------*/
|
|---|
| 826 |
|
|---|
| 827 | int
|
|---|
| 828 | HYPRE_BoomerAMGSetVariant( HYPRE_Solver solver,
|
|---|
| 829 | int variant )
|
|---|
| 830 | {
|
|---|
| 831 | return( hypre_BoomerAMGSetVariant( (void *) solver, variant ) );
|
|---|
| 832 | }
|
|---|
| 833 |
|
|---|
| 834 | int
|
|---|
| 835 | HYPRE_BoomerAMGGetVariant( HYPRE_Solver solver,
|
|---|
| 836 | int * variant )
|
|---|
| 837 | {
|
|---|
| 838 | return( hypre_BoomerAMGGetVariant( (void *) solver, variant ) );
|
|---|
| 839 | }
|
|---|
| 840 |
|
|---|
| 841 | /*--------------------------------------------------------------------------
|
|---|
| 842 | * HYPRE_BoomerAMGSetOverlap, HYPRE_BoomerAMGGetOverlap
|
|---|
| 843 | *--------------------------------------------------------------------------*/
|
|---|
| 844 |
|
|---|
| 845 | int
|
|---|
| 846 | HYPRE_BoomerAMGSetOverlap( HYPRE_Solver solver,
|
|---|
| 847 | int overlap )
|
|---|
| 848 | {
|
|---|
| 849 | return( hypre_BoomerAMGSetOverlap( (void *) solver, overlap ) );
|
|---|
| 850 | }
|
|---|
| 851 |
|
|---|
| 852 | int
|
|---|
| 853 | HYPRE_BoomerAMGGetOverlap( HYPRE_Solver solver,
|
|---|
| 854 | int * overlap )
|
|---|
| 855 | {
|
|---|
| 856 | return( hypre_BoomerAMGGetOverlap( (void *) solver, overlap ) );
|
|---|
| 857 | }
|
|---|
| 858 |
|
|---|
| 859 | /*--------------------------------------------------------------------------
|
|---|
| 860 | * HYPRE_BoomerAMGSetDomainType, HYPRE_BoomerAMGGetDomainType
|
|---|
| 861 | *--------------------------------------------------------------------------*/
|
|---|
| 862 |
|
|---|
| 863 | int
|
|---|
| 864 | HYPRE_BoomerAMGSetDomainType( HYPRE_Solver solver,
|
|---|
| 865 | int domain_type )
|
|---|
| 866 | {
|
|---|
| 867 | return( hypre_BoomerAMGSetDomainType( (void *) solver, domain_type ) );
|
|---|
| 868 | }
|
|---|
| 869 |
|
|---|
| 870 | int
|
|---|
| 871 | HYPRE_BoomerAMGGetDomainType( HYPRE_Solver solver,
|
|---|
| 872 | int * domain_type )
|
|---|
| 873 | {
|
|---|
| 874 | return( hypre_BoomerAMGGetDomainType( (void *) solver, domain_type ) );
|
|---|
| 875 | }
|
|---|
| 876 |
|
|---|
| 877 | /*--------------------------------------------------------------------------
|
|---|
| 878 | * HYPRE_BoomerAMGSetSchwarzRlxWeight, HYPRE_BoomerAMGGetSchwarzRlxWeight
|
|---|
| 879 | *--------------------------------------------------------------------------*/
|
|---|
| 880 |
|
|---|
| 881 | int
|
|---|
| 882 | HYPRE_BoomerAMGSetSchwarzRlxWeight( HYPRE_Solver solver,
|
|---|
| 883 | double schwarz_rlx_weight)
|
|---|
| 884 | {
|
|---|
| 885 | return( hypre_BoomerAMGSetSchwarzRlxWeight( (void *) solver,
|
|---|
| 886 | schwarz_rlx_weight ) );
|
|---|
| 887 | }
|
|---|
| 888 |
|
|---|
| 889 | int
|
|---|
| 890 | HYPRE_BoomerAMGGetSchwarzRlxWeight( HYPRE_Solver solver,
|
|---|
| 891 | double * schwarz_rlx_weight)
|
|---|
| 892 | {
|
|---|
| 893 | return( hypre_BoomerAMGGetSchwarzRlxWeight( (void *) solver,
|
|---|
| 894 | schwarz_rlx_weight ) );
|
|---|
| 895 | }
|
|---|
| 896 |
|
|---|
| 897 | /*--------------------------------------------------------------------------
|
|---|
| 898 | * HYPRE_BoomerAMGSetNumFunctions, HYPRE_BoomerAMGGetNumFunctions
|
|---|
| 899 | *--------------------------------------------------------------------------*/
|
|---|
| 900 |
|
|---|
| 901 | int
|
|---|
| 902 | HYPRE_BoomerAMGSetNumFunctions( HYPRE_Solver solver,
|
|---|
| 903 | int num_functions )
|
|---|
| 904 | {
|
|---|
| 905 | return( hypre_BoomerAMGSetNumFunctions( (void *) solver, num_functions ) );
|
|---|
| 906 | }
|
|---|
| 907 |
|
|---|
| 908 | int
|
|---|
| 909 | HYPRE_BoomerAMGGetNumFunctions( HYPRE_Solver solver,
|
|---|
| 910 | int * num_functions )
|
|---|
| 911 | {
|
|---|
| 912 | return( hypre_BoomerAMGGetNumFunctions( (void *) solver, num_functions ) );
|
|---|
| 913 | }
|
|---|
| 914 |
|
|---|
| 915 | /*--------------------------------------------------------------------------
|
|---|
| 916 | * HYPRE_BoomerAMGSetNodal
|
|---|
| 917 | *--------------------------------------------------------------------------*/
|
|---|
| 918 |
|
|---|
| 919 | int
|
|---|
| 920 | HYPRE_BoomerAMGSetNodal( HYPRE_Solver solver,
|
|---|
| 921 | int nodal )
|
|---|
| 922 | {
|
|---|
| 923 | return( hypre_BoomerAMGSetNodal( (void *) solver, nodal ) );
|
|---|
| 924 | }
|
|---|
| 925 |
|
|---|
| 926 | /*--------------------------------------------------------------------------
|
|---|
| 927 | * HYPRE_BoomerAMGSetDofFunc
|
|---|
| 928 | *--------------------------------------------------------------------------*/
|
|---|
| 929 |
|
|---|
| 930 | int
|
|---|
| 931 | HYPRE_BoomerAMGSetDofFunc( HYPRE_Solver solver,
|
|---|
| 932 | int *dof_func )
|
|---|
| 933 | /* Warning about a possible memory problem: When the BoomerAMG object is destroyed
|
|---|
| 934 | in hypre_BoomerAMGDestroy, dof_func aka DofFunc will be destroyed (currently
|
|---|
| 935 | line 246 of par_amg.c). Normally this is what we want. But if the user provided
|
|---|
| 936 | dof_func by calling HYPRE_BoomerAMGSetDofFunc, this could be an unwanted surprise.
|
|---|
| 937 | As hypre is currently commonly used, this situation is likely to be rare. */
|
|---|
| 938 | {
|
|---|
| 939 | return( hypre_BoomerAMGSetDofFunc( (void *) solver, dof_func ) );
|
|---|
| 940 | }
|
|---|
| 941 |
|
|---|
| 942 | /*--------------------------------------------------------------------------
|
|---|
| 943 | * HYPRE_BoomerAMGSetAggInterpType
|
|---|
| 944 | *--------------------------------------------------------------------------*/
|
|---|
| 945 |
|
|---|
| 946 | int
|
|---|
| 947 | HYPRE_BoomerAMGSetAggInterpType( HYPRE_Solver solver,
|
|---|
| 948 | int agg_interp_type )
|
|---|
| 949 | {
|
|---|
| 950 | return( hypre_BoomerAMGSetAggInterpType( (void *) solver, agg_interp_type ) );
|
|---|
| 951 | }
|
|---|
| 952 |
|
|---|
| 953 | /*--------------------------------------------------------------------------
|
|---|
| 954 | * HYPRE_BoomerAMGSetAggPMaxElmts
|
|---|
| 955 | *--------------------------------------------------------------------------*/
|
|---|
| 956 |
|
|---|
| 957 | int
|
|---|
| 958 | HYPRE_BoomerAMGSetAggPMaxElmts( HYPRE_Solver solver,
|
|---|
| 959 | int agg_P_max_elmts )
|
|---|
| 960 | {
|
|---|
| 961 | return( hypre_BoomerAMGSetAggPMaxElmts( (void *) solver,
|
|---|
| 962 | agg_P_max_elmts ) );
|
|---|
| 963 | }
|
|---|
| 964 |
|
|---|
| 965 | /*--------------------------------------------------------------------------
|
|---|
| 966 | * HYPRE_BoomerAMGSetPMax1
|
|---|
| 967 | *--------------------------------------------------------------------------*/
|
|---|
| 968 |
|
|---|
| 969 | int
|
|---|
| 970 | HYPRE_BoomerAMGSetPMax1( HYPRE_Solver solver,
|
|---|
| 971 | int P_max1 )
|
|---|
| 972 | {
|
|---|
| 973 | return( hypre_BoomerAMGSetPMax1( (void *) solver,
|
|---|
| 974 | P_max1 ) );
|
|---|
| 975 | }
|
|---|
| 976 | /*--------------------------------------------------------------------------
|
|---|
| 977 | * HYPRE_BoomerAMGSetPMax2
|
|---|
| 978 | *--------------------------------------------------------------------------*/
|
|---|
| 979 |
|
|---|
| 980 | int
|
|---|
| 981 | HYPRE_BoomerAMGSetPMax2( HYPRE_Solver solver,
|
|---|
| 982 | int P_max2 )
|
|---|
| 983 | {
|
|---|
| 984 | return( hypre_BoomerAMGSetPMax2( (void *) solver,
|
|---|
| 985 | P_max2 ) );
|
|---|
| 986 | }
|
|---|
| 987 | /*--------------------------------------------------------------------------
|
|---|
| 988 | * HYPRE_BoomerAMGSetNumPaths
|
|---|
| 989 | *--------------------------------------------------------------------------*/
|
|---|
| 990 |
|
|---|
| 991 | int
|
|---|
| 992 | HYPRE_BoomerAMGSetNumPaths( HYPRE_Solver solver,
|
|---|
| 993 | int num_paths )
|
|---|
| 994 | {
|
|---|
| 995 | return( hypre_BoomerAMGSetNumPaths( (void *) solver, num_paths ) );
|
|---|
| 996 | }
|
|---|
| 997 |
|
|---|
| 998 | /*--------------------------------------------------------------------------
|
|---|
| 999 | * HYPRE_BoomerAMGSetAggNumLevels
|
|---|
| 1000 | *--------------------------------------------------------------------------*/
|
|---|
| 1001 |
|
|---|
| 1002 | int
|
|---|
| 1003 | HYPRE_BoomerAMGSetAggNumLevels( HYPRE_Solver solver,
|
|---|
| 1004 | int agg_num_levels )
|
|---|
| 1005 | {
|
|---|
| 1006 | return( hypre_BoomerAMGSetAggNumLevels( (void *) solver, agg_num_levels ) );
|
|---|
| 1007 | }
|
|---|
| 1008 |
|
|---|
| 1009 | /*--------------------------------------------------------------------------
|
|---|
| 1010 | * HYPRE_BoomerAMGSetNumCRRelaxSteps
|
|---|
| 1011 | *--------------------------------------------------------------------------*/
|
|---|
| 1012 |
|
|---|
| 1013 | int
|
|---|
| 1014 | HYPRE_BoomerAMGSetNumCRRelaxSteps( HYPRE_Solver solver,
|
|---|
| 1015 | int num_CR_relax_steps )
|
|---|
| 1016 | {
|
|---|
| 1017 | return( hypre_BoomerAMGSetNumCRRelaxSteps( (void *) solver, num_CR_relax_steps ) );
|
|---|
| 1018 | }
|
|---|
| 1019 |
|
|---|
| 1020 | /*--------------------------------------------------------------------------
|
|---|
| 1021 | * HYPRE_BoomerAMGSetCRRate
|
|---|
| 1022 | *--------------------------------------------------------------------------*/
|
|---|
| 1023 |
|
|---|
| 1024 | int
|
|---|
| 1025 | HYPRE_BoomerAMGSetCRRate( HYPRE_Solver solver,
|
|---|
| 1026 | double CR_rate )
|
|---|
| 1027 | {
|
|---|
| 1028 | return( hypre_BoomerAMGSetCRRate( (void *) solver, CR_rate ) );
|
|---|
| 1029 | }
|
|---|
| 1030 |
|
|---|
| 1031 | /*--------------------------------------------------------------------------
|
|---|
| 1032 | * HYPRE_BoomerAMGSetISType
|
|---|
| 1033 | *--------------------------------------------------------------------------*/
|
|---|
| 1034 |
|
|---|
| 1035 | int
|
|---|
| 1036 | HYPRE_BoomerAMGSetISType( HYPRE_Solver solver,
|
|---|
| 1037 | int IS_type )
|
|---|
| 1038 | {
|
|---|
| 1039 | return( hypre_BoomerAMGSetISType( (void *) solver, IS_type ) );
|
|---|
| 1040 | }
|
|---|
| 1041 |
|
|---|
| 1042 | /*--------------------------------------------------------------------------
|
|---|
| 1043 | * HYPRE_BoomerAMGSetCRUseCG
|
|---|
| 1044 | *--------------------------------------------------------------------------*/
|
|---|
| 1045 |
|
|---|
| 1046 | int
|
|---|
| 1047 | HYPRE_BoomerAMGSetCRUseCG( HYPRE_Solver solver,
|
|---|
| 1048 | int CR_use_CG )
|
|---|
| 1049 | {
|
|---|
| 1050 | return( hypre_BoomerAMGSetCRUseCG( (void *) solver, CR_use_CG ) );
|
|---|
| 1051 | }
|
|---|
| 1052 |
|
|---|
| 1053 | /*--------------------------------------------------------------------------
|
|---|
| 1054 | * HYPRE_BoomerAMGSetGSMG
|
|---|
| 1055 | *--------------------------------------------------------------------------*/
|
|---|
| 1056 |
|
|---|
| 1057 | int
|
|---|
| 1058 | HYPRE_BoomerAMGSetGSMG( HYPRE_Solver solver,
|
|---|
| 1059 | int gsmg )
|
|---|
| 1060 | {
|
|---|
| 1061 | return( hypre_BoomerAMGSetGSMG( (void *) solver, gsmg ) );
|
|---|
| 1062 | }
|
|---|
| 1063 |
|
|---|
| 1064 | /*--------------------------------------------------------------------------
|
|---|
| 1065 | * HYPRE_BoomerAMGSetNumSamples
|
|---|
| 1066 | *--------------------------------------------------------------------------*/
|
|---|
| 1067 |
|
|---|
| 1068 | int
|
|---|
| 1069 | HYPRE_BoomerAMGSetNumSamples( HYPRE_Solver solver,
|
|---|
| 1070 | int gsmg )
|
|---|
| 1071 | {
|
|---|
| 1072 | return( hypre_BoomerAMGSetNumSamples( (void *) solver, gsmg ) );
|
|---|
| 1073 | }
|
|---|
| 1074 | /*--------------------------------------------------------------------------
|
|---|
| 1075 | * HYPRE_BoomerAMGSetChebyOrder
|
|---|
| 1076 | *--------------------------------------------------------------------------*/
|
|---|
| 1077 |
|
|---|
| 1078 | int
|
|---|
| 1079 | HYPRE_BoomerAMGSetChebyOrder( HYPRE_Solver solver,
|
|---|
| 1080 | int order )
|
|---|
| 1081 | {
|
|---|
| 1082 | return( hypre_BoomerAMGSetChebyOrder( (void *) solver, order ) );
|
|---|
| 1083 | }
|
|---|
| 1084 | /*--------------------------------------------------------------------------
|
|---|
| 1085 | * HYPRE_BoomerAMGSetChebyEigRatio
|
|---|
| 1086 | *--------------------------------------------------------------------------*/
|
|---|
| 1087 |
|
|---|
| 1088 | int
|
|---|
| 1089 | HYPRE_BoomerAMGSetChebyEigRatio( HYPRE_Solver solver,
|
|---|
| 1090 | double ratio )
|
|---|
| 1091 | {
|
|---|
| 1092 | return( hypre_BoomerAMGSetChebyEigRatio( (void *) solver, ratio ) );
|
|---|
| 1093 | }
|
|---|
| 1094 |
|
|---|
| 1095 | int
|
|---|
| 1096 | HYPRE_BoomerAMGSetMaxCoarseSize( HYPRE_Solver solver,
|
|---|
| 1097 | int thresh )
|
|---|
| 1098 | {
|
|---|
| 1099 | return( hypre_BoomerAMGSetMaxCoarseSize( (void *) solver, thresh ) );
|
|---|
| 1100 | }
|
|---|
| 1101 | int
|
|---|
| 1102 | HYPRE_BoomerAMGSetSeqThreshold( HYPRE_Solver solver,
|
|---|
| 1103 | int thresh )
|
|---|
| 1104 | {
|
|---|
| 1105 | return( hypre_BoomerAMGSetSeqThreshold( (void *) solver, thresh ) );
|
|---|
| 1106 | }
|
|---|