@@ -203,6 +203,8 @@ void HypreIJIface::init_preconditioner (
203203 boomeramg_precond_configure (prefix);
204204 } else if (name == " euclid" ) {
205205 euclid_precond_configure (prefix);
206+ } else if (name == " ILU" ) {
207+ ilu_precond_configure (prefix);
206208 } else {
207209 amrex::Abort (" Invalid HYPRE preconditioner specified: " + name);
208210 }
@@ -324,6 +326,10 @@ void HypreIJIface::boomeramg_precond_configure (const std::string& prefix)
324326 hpp (" bamg_ilu_level" , HYPRE_BoomerAMGSetILULevel);
325327 hpp (" bamg_ilu_max_iter" , HYPRE_BoomerAMGSetILUMaxIter);
326328#if defined(HYPRE_RELEASE_NUMBER) && (HYPRE_RELEASE_NUMBER >= 22900)
329+ hpp (" bamg_ilu_iterative_algorithm_type" , HYPRE_BoomerAMGSetILUIterSetupType);
330+ hpp (" bamg_ilu_iterative_setup_type" , HYPRE_BoomerAMGSetILUIterSetupOption);
331+ hpp (" bamg_ilu_iterative_max_iter" , HYPRE_BoomerAMGSetILUIterSetupMaxIter);
332+ hpp (" bamg_ilu_iterative_tolerance" , HYPRE_BoomerAMGSetILUIterSetupTolerance);
327333 hpp (" bamg_ilu_reordering_type" , HYPRE_BoomerAMGSetILULocalReordering);
328334 hpp (" bamg_ilu_tri_solve" , HYPRE_BoomerAMGSetILUTriSolve);
329335 hpp (" bamg_ilu_lower_jacobi_iters" , HYPRE_BoomerAMGSetILULowerJacobiIters);
@@ -373,6 +379,46 @@ void HypreIJIface::euclid_precond_configure (const std::string& prefix)
373379 hpp (" euclid_mem" , HYPRE_EuclidSetMem, 0 );
374380}
375381
382+ void HypreIJIface::ilu_precond_configure (const std::string& prefix)
383+ {
384+ if (m_verbose > 2 ) {
385+ amrex::Print () << " Creating ILU preconditioner" << ' \n ' ;
386+ }
387+ HYPRE_ILUCreate (&m_precond);
388+
389+ // Setup the pointers
390+ m_precondDestroyPtr = &HYPRE_ILUDestroy;
391+ m_precondSetupPtr = &HYPRE_ILUSetup;
392+ m_precondSolvePtr = &HYPRE_ILUSolve;
393+
394+
395+ HypreOptParse hpp (prefix, m_precond);
396+ #if defined(HYPRE_RELEASE_NUMBER) && (HYPRE_RELEASE_NUMBER >= 22100)
397+ // Process ILU smoother parameters
398+ // ParILUK
399+ hpp (" ilu_type" , HYPRE_ILUSetType);
400+ hpp (" ilu_max_iter" , HYPRE_ILUSetMaxIter);
401+ hpp (" ilu_tolerance" , HYPRE_ILUSetTol);
402+ hpp (" ilu_reordering_type" , HYPRE_ILUSetLocalReordering);
403+ hpp (" ilu_print_level" , HYPRE_ILUSetPrintLevel);
404+
405+ // ILUK
406+ hpp (" ilu_fill" , HYPRE_ILUSetLevelOfFill);
407+ // ILUT
408+ hpp (" ilu_max_nnz_per_row" , HYPRE_ILUSetMaxNnzPerRow);
409+ hpp (" ilu_drop_threshold" , HYPRE_ILUSetDropThreshold);
410+ #if defined(HYPRE_RELEASE_NUMBER) && (HYPRE_RELEASE_NUMBER >= 22900)
411+ hpp (" ilu_iterative_algorithm_type" , HYPRE_ILUSetIterativeSetupType);
412+ hpp (" ilu_iterative_setup_type" , HYPRE_ILUSetIterativeSetupOption);
413+ hpp (" ilu_iterative_max_iter" , HYPRE_ILUSetIterativeSetupMaxIter);
414+ hpp (" ilu_iterative_tolerance" , HYPRE_ILUSetIterativeSetupTolerance);
415+ hpp (" ilu_tri_solve" , HYPRE_ILUSetTriSolve);
416+ hpp (" ilu_lower_jacobi_iters" , HYPRE_ILUSetLowerJacobiIters);
417+ hpp (" ilu_upper_jacobi_iters" , HYPRE_ILUSetUpperJacobiIters);
418+ #endif
419+ #endif
420+ }
421+
376422void HypreIJIface::boomeramg_solver_configure (const std::string& prefix)
377423{
378424 if (m_has_preconditioner) {
0 commit comments