Commit a2fd3ede authored by Stefan's avatar Stefan
Browse files

Fix wrong index and add threshold as runtime parameter

parent 62bbe7fd
......@@ -10,7 +10,7 @@
&,'| |'
&,'| NEK5000: Open Source Spectral Element Solver |'
&,'| COPYRIGHT (c) 2008-2018 UCHICAGO ARGONNE, LLC |'
&,'| Version: 18.0-2 |'
&,'| Version: 18.0-3 |'
&,'| Web: http://nek5000.mcs.anl.gov |'
&,'| |'
&,'\\----------------------------------------------------------/'
......
......@@ -18,7 +18,7 @@ c
$ ,uparam(20)
$ ,atol(0:ldimt1)
$ ,restol(0:ldimt1)
$ ,fem_amg_param(7)
$ ,fem_amg_param(10)
$ ,filterType
common /input1/ param,rstim,vnekton,cpfld,cpgrp,qinteg,uparam,
......
......@@ -66,7 +66,7 @@ HYPRE_Solver amg_preconditioner;
struct comm comm;
struct gs_data *gsh;
#define NPARAM 7
#define NPARAM 10
double HYPREsettings[NPARAM];
/* Interface definition */
......@@ -142,20 +142,21 @@ void fem_amg_setup(const sint *n_x_, const sint *n_y_, const sint *n_z_,
HYPRE_BoomerAMGCreate(&amg_preconditioner);
HYPREsettings[0] = 6; /* Falgout */
HYPREsettings[0] = 10; /* Falgout */
HYPREsettings[1] = 6; /* Extended+i */
HYPREsettings[2] = 3; /* SOR */
HYPREsettings[3] = 1; /* V-cycles */
HYPREsettings[4] = 0.05; /* default NonGalerkinTol */
HYPREsettings[5] = 0.01; /* 2nd level NonGalerkinTol */
HYPREsettings[6] = 0.05; /* 3nd level NonGalerkinTol */
HYPREsettings[4] = 0.25; /* threshold */
HYPREsettings[5] = 0.05; /* default NonGalerkinTol */
HYPREsettings[6] = 0.01; /* 2nd level NonGalerkinTol */
HYPREsettings[7] = 0.05; /* 3nd level NonGalerkinTol */
int i;
if (param[0] != 0) {
for (i=0; i < NPARAM; i++) {
HYPREsettings[i] = param[i+1];
for (i=1; i < NPARAM; i++) {
HYPREsettings[i-1] = param[i];
if (comm.id == 0)
printf("Custom HYPREsettings[%d]: %.2f\n", i, HYPREsettings[i]);
printf("Custom HYPREsettings[%d]: %.2f\n", i, HYPREsettings[i-1]);
}
}
......@@ -164,16 +165,16 @@ void fem_amg_setup(const sint *n_x_, const sint *n_y_, const sint *n_z_,
HYPRE_BoomerAMGSetInterpType(amg_preconditioner, HYPREsettings[1]);
HYPRE_BoomerAMGSetPMaxElmts(amg_preconditioner, 4); /* Max number of elements per row for interpolation */
HYPRE_BoomerAMGSetAggNumLevels(amg_preconditioner, 0); /* 0 for no-aggressive coarsening */
HYPRE_BoomerAMGSetStrongThreshold(amg_preconditioner, 0.25);/* Strength threshold */
HYPRE_BoomerAMGSetStrongThreshold(amg_preconditioner, HYPREsettings[4]);/* Strength threshold */
HYPRE_BoomerAMGSetMaxCoarseSize(amg_preconditioner, 50); /* maximum number of rows in coarse level */
HYPRE_BoomerAMGSetRelaxType(amg_preconditioner, HYPREsettings[2]);
HYPRE_BoomerAMGSetMaxIter(amg_preconditioner, HYPREsettings[3]);
HYPRE_BoomerAMGSetTol(amg_preconditioner, 0); /* convergence tolerance */
HYPRE_BoomerAMGSetNonGalerkinTol(amg_preconditioner, HYPREsettings[4]);
HYPRE_BoomerAMGSetNonGalerkinTol(amg_preconditioner, HYPREsettings[5]);
HYPRE_BoomerAMGSetLevelNonGalerkinTol(amg_preconditioner, 0.0 , 0);
HYPRE_BoomerAMGSetLevelNonGalerkinTol(amg_preconditioner, HYPREsettings[5], 1);
HYPRE_BoomerAMGSetLevelNonGalerkinTol(amg_preconditioner, HYPREsettings[6], 2);
HYPRE_BoomerAMGSetLevelNonGalerkinTol(amg_preconditioner, HYPREsettings[6], 1);
HYPRE_BoomerAMGSetLevelNonGalerkinTol(amg_preconditioner, HYPREsettings[7], 2);
HYPRE_BoomerAMGSetPrintLevel(amg_preconditioner, 1);
......
......@@ -182,7 +182,7 @@ C
ifdp0dt = .false.
ifreguo = .false. ! dump on the GLL mesh
fem_amg_param(0) = 0
fem_amg_param(1) = 0
call izero(matype,16*ldimt1)
call rzero(cpgrp ,48*ldimt1)
......
......@@ -497,7 +497,7 @@ c SET DEFAULT TO 6, ADJUSTED IN USR FILE ONLY
param(59) = 1 ! No fast operator eval, ADJUSTED IN USR FILE ONLY
fem_amg_param(0) = 0
fem_amg_param(1) = 0
filterType = 0
if (param(103).gt.0) then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment