Skip to content

Commit

Permalink
Refactor gfilloverlap parameter in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dharinib98 committed Feb 13, 2025
1 parent e679350 commit a430b10
Show file tree
Hide file tree
Showing 105 changed files with 126 additions and 152 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@

#include "4C_linear_solver_preconditioner_ifpack.hpp"

#include "4C_comm_utils.hpp"
#include "4C_linalg_blocksparsematrix.hpp"
#include "4C_utils_exceptions.hpp"

#include <Teuchos_XMLParameterListHelpers.hpp>

FOUR_C_NAMESPACE_OPEN

//------------------------------------------------------------------------------
Expand All @@ -18,7 +21,6 @@ Core::LinearSolver::IFPACKPreconditioner::IFPACKPreconditioner(
Teuchos::ParameterList& ifpacklist, Teuchos::ParameterList& solverlist)
: ifpacklist_(ifpacklist), solverlist_(solverlist)
{
return;
}

//------------------------------------------------------------------------------
Expand All @@ -44,34 +46,30 @@ void Core::LinearSolver::IFPACKPreconditioner::setup(bool create, Epetra_Operato

pmatrix_ = std::make_shared<Epetra_CrsMatrix>(*A_crs);

Teuchos::ParameterList& inverseList = ifpacklist_.sublist("IFPACK Parameters");

std::string xmlFileName = inverseList.get<std::string>("IFPACK_XML_FILE");
std::string xmlFileName = ifpacklist_.get<std::string>("IFPACK_XML_FILE");
if (xmlFileName == "none") FOUR_C_THROW("IFPACK_XML_FILE parameter not set!");

Teuchos::RCP<Teuchos::ParameterList> ifpack_params =
Teuchos::make_rcp<Teuchos::ParameterList>();
auto comm = pmatrix_->getRowMap()->getComm();
Teuchos::updateParametersFromXmlFileAndBroadcast(xmlFileName, ifpack_params.ptr(), *comm);
Teuchos::ParameterList ifpack_params;

auto comm = Core::Communication::to_teuchos_comm<int>(
Core::Communication::unpack_epetra_comm(pmatrix_->Comm()));

// get the type of ifpack preconditioner from solver parameter list
/*std::string prectype = solverlist_.get("Preconditioner Type", "ILU");
const int overlap = ifpacklist_.get("IFPACKOVERLAP", 0);*/
Teuchos::updateParametersFromXmlFileAndBroadcast(
xmlFileName, Teuchos::Ptr(&ifpack_params), *comm);

auto prectype = ifpack_params.get<std::string>("Preconditioner type");
auto overlap = ifpack_params.get<int>("Overlap");

// create the preconditioner
Ifpack Factory;
prec_ =
std::shared_ptr<Ifpack_Preconditioner>(Factory.Create(prectype, pmatrix_.get(), overlap));

if (!prec_)
FOUR_C_THROW("Creation of IFPACK preconditioner of type '%s' failed.", prectype.c_str());

// setup
prec_->SetParameters(ifpacklist_);
prec_->SetParameters(ifpack_params);
prec_->Initialize();
prec_->Compute();

return;
}
}

Expand Down
12 changes: 0 additions & 12 deletions src/inpar/4C_inpar_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,6 @@ namespace Inpar::SOLVER
"IFPACK_XML_FILE", "none", "xml file defining any IFPACK options", &list);
}

/*{
Core::Utils::int_parameter("IFPACKOVERLAP", 0,
"The amount of overlap used for the ifpack \"ilu\" preconditioner.", &list);
Core::Utils::int_parameter("IFPACKGFILL", 0,
"The amount of fill allowed for an internal \"ilu\" preconditioner.", &list);
std::vector<std::string> ifpack_combine_valid_input = {"Add", "Insert", "Zero"};
Core::Utils::string_parameter("IFPACKCOMBINE", "Add",
"Combine mode for Ifpack Additive Schwarz", &list, ifpack_combine_valid_input);
}*/

// Iterative solver options
{
Core::Utils::int_parameter("AZITER", 1000,
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/constr2D_MPC_angle.dat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ AZCONV AZ_r0
IFPACKGFILL 0
AZITER 1000
AZOUTPUT 0
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
AZPREC ILU
AZREUSE 0
AZSOLVE GMRES
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/constr2D_MPC_dist.dat
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ AZCONV AZ_r0
IFPACKGFILL 0
AZITER 1000
AZOUTPUT 0
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
AZPREC ILU
AZREUSE 0
AZSOLVE GMRES
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/constr3D_NormComp_STI.dat
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ AZCONV AZ_r0
IFPACKGFILL 0
AZITER 1000
AZOUTPUT 0
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
AZPREC ILU
AZREUSE 0
AZSOLVE GMRES
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/elch_RCE_rotsymm_pbc.dat
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ AZTOL 1.0E-10
AZCONV AZ_r0
AZITER 100
AZSUB 40
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
-------------------------------------------------------------------MATERIALS
MAT 1 MAT_fluid DYNVISCOSITY 1.0 DENSITY 1.0
MAT 2 MAT_ion DIFFUSIVITY 0.00072 VALENCE 2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,10 @@ AZOUTPUT 0
AZSOLVE GMRES
AZPREC ILU
AZREUSE 20
//IFPACKGFILL 0
AZTOL 1.0E-10
AZCONV AZ_r0
AZITER 500
AZSUB 200
//IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
-------------------------------------------------------------------MATERIALS
MAT 1 MAT_ion DIFFUSIVITY 0.0006666666666 VALENCE +0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ AZTOL 1.0E-10
AZCONV AZ_r0
AZITER 500
AZSUB 200
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
-------------------------------------------------------------------MATERIALS
MAT 1 MAT_elchmat NUMDOF 2 NUMSCAL 1 NUMPHASE 1 PHASEIDS 2
MAT 2 MAT_elchphase EPSILON 1.0 TORTUOSITY 1.0 NUMMAT 1 MATIDS 3
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/elch_gaussian_hill_pbc_genalpha.dat
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ AZTOL 1.0E-10
AZCONV AZ_r0
AZITER 500
AZSUB 200
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
-------------------------------------------------------------------MATERIALS
MAT 1 MAT_ion DIFFUSIVITY 0.0006666666666 VALENCE +0.0
MAT 2 MAT_ion DIFFUSIVITY 0.0005 VALENCE +1.0 DENSIFICATION 0.0 ELIM_DIFFUSIVITY 0.001 ELIM_VALENCE -1.0
Expand Down
4 changes: 2 additions & 2 deletions tests/input_files/elch_natconv_enc_pde_elim.dat
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ IFPACKGFILL 0
AZTOL 1.0E-10
AZITER 1000
AZSUB 25
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
AZCONV AZ_r0
--------------------------------------------------------------------SOLVER 2
NAME Fluid_Solver
Expand All @@ -114,7 +114,7 @@ AZTOL 1.0E-10
AZCONV AZ_r0
AZITER 1000
AZSUB 25
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
-------------------------------------------------------------------MATERIALS
MAT 1 MAT_fluid DYNVISCOSITY 1e-2 DENSITY 1.0
MAT 2 MAT_ion DIFFUSIVITY 5e-6 VALENCE 1.0 DENSIFICATION 0.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ IFPACKGFILL 0
AZTOL 1.0E-10
AZITER 1000
AZSUB 25
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
AZCONV AZ_r0
-------------------------------------------------------------------MATERIALS
MAT 1 MAT_matlist LOCAL No NUMMAT 2 MATIDS 2 3
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/f2_drivencavity32x32_Re1000_stat.dat
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ IFPACKGFILL 0
AZTOL 1.0E-7
AZITER 1000
AZSUB 25
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
//AZCONV AZ_r0
----------------------------------------------DESIGN POINT DIRICH CONDITIONS
// DOBJECT FLAG FLAG FLAG FLAG FLAG FLAG VAL VAL VAL VAL VAL VAL CURVE CURVE CURVE CURVE CURVE CURVE
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/f2_kimmoin25x25_oseen_instat.dat
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ AZTOL 1.0E-14
AZCONV AZ_r0
AZITER 1000
AZSUB 1000
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
-------------------------------------------------------------------MATERIALS
MAT 1 MAT_fluid DYNVISCOSITY 0.0001 DENSITY 1.0 GAMMA 1.0
----------------------------------------------------------------------FUNCT1 // adapt the rhs function
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/f3_beltrami_4x4x4_hdg_lagrange.dat
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ TOL_PRES_INC 1e-04
SOLVER Belos
AZSOLVE GMRES
AZPREC ILU
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
IFPACKGFILL 0
IFPACKCOMBINE Add
AZSUB 100
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/f3_beltrami_4x4x4_hdg_legendre.dat
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ TOL_PRES_INC 1e-04
SOLVER Belos
AZSOLVE GMRES
AZPREC ILU
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
IFPACKGFILL 0
IFPACKCOMBINE Add
AZSUB 100
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/f3_beltrami_8x8_meshtying_ale.dat
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ AZSOLVE GMRES
AZPREC ILU
AZREUSE 0
IFPACKGFILL 0
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
AZTOL 1.0E-9
AZCONV AZ_r0
AZITER 1000
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/f3_beltrami_8x8_meshtying_ale_euler.dat
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ AZSOLVE GMRES
AZPREC ILU
AZREUSE 0
IFPACKGFILL 0
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
AZTOL 1.0E-9
AZCONV AZ_r0
AZITER 1000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ AZSOLVE GMRES
AZPREC ILU
AZREUSE 0
IFPACKGFILL 0
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
AZTOL 1.0E-9
AZCONV AZ_r0
AZITER 1000
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/f3_beltrami_8x8_meshtying_smat.dat
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ AZSOLVE GMRES
AZPREC ILU
AZREUSE 0
IFPACKGFILL 0
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
AZTOL 1.0E-9
AZCONV AZ_r0
AZITER 1000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ AZSOLVE GMRES
AZPREC ILU
AZREUSE 0
IFPACKGFILL 0
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
AZTOL 1.0E-9
AZCONV AZ_r0
AZITER 1000
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/f3_beltrami_sphere_hdg_legendre.dat
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ TOL_PRES_INC 1e-04
SOLVER Belos
AZSOLVE GMRES
AZPREC ILU
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
IFPACKGFILL 0
IFPACKCOMBINE Add
AZSUB 100
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/f3_channel_meshtying_DCmaster.dat
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ AZSOLVE GMRES
AZPREC ILU
AZREUSE 5
IFPACKGFILL 0
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
AZTOL 1.0E-9
AZCONV AZ_r0
AZITER 1000
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/f3_channel_mixedhybrid.dat
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ AZTOL 1.0E-4
AZCONV AZ_r0
AZITER 1000
AZSUB 40
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
-------------------------------------------------------------------MATERIALS
MAT 1 MAT_fluid DYNVISCOSITY 0.0001472 DENSITY 1.0 GAMMA 1.0
----------------------------------------------------------------------FUNCT1
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/f3_drivencavity_stat.dat
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ AZTOL 1.0E-8
AZCONV AZ_r0
AZPREC ILU
IFPACKGFILL 0
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
AZOUTPUT 0
AZREUSE 0
----------------------------------------------DESIGN POINT DIRICH CONDITIONS
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/f3_drivencavity_stat_recongradL2.dat
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ IFPACKGFILL 5
AZTOL 1.0E-17
AZITER 1500
AZSUB 100
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
AZCONV AZ_r0
--------------------------------------------------------------------SOLVER 2
NAME L2_Fluid_Solver
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/f3_forced_hit_geogen_hdg.dat
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ AZTOL 1.0E-10
AZCONV AZ_r0
AZITER 1000
AZSUB 80
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
-------------------------------------------------------------------MATERIALS
MAT 1 MAT_fluid DYNVISCOSITY 0.01 DENSITY 1.0
----------------------------------------------------------RESULT DESCRIPTION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ AZTOL 1.0E-13
AZCONV AZ_r0
AZITER 1000
AZSUB 1000
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
-------------------------------------------------------------------MATERIALS
MAT 1 MAT_fluid DYNVISCOSITY 0.0001 DENSITY 1.0 GAMMA 1.0
----------------------------------------------------------------------FUNCT1
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/f3_nurbs27_AfGenAlpha.dat
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ AZSOLVE GMRES
AZPREC ILU
AZREUSE 5
IFPACKGFILL 0
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
AZTOL 1.0E-7
AZCONV AZ_r0
AZITER 1000
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/f3_periodic_hill_w_forcing_24x12x12.dat
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ AZTOL 1.0E-20
AZCONV AZ_r0
AZITER 1000
AZSUB 40
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
----------------------------------------------------------MATERIALS
MAT 1 MAT_fluid DYNVISCOSITY 0.0000182 DENSITY 0.000001225
-------------------------------------------------------------FUNCT1
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/f3_turbinflow_doublechan.dat
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ AZCONV AZ_r0
AZITER 1000
AZSUB 40
IFPACKGFILL 0
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
IFPACKCOMBINE Add
-------------------------------------------------------------------MATERIALS
MAT 1 MAT_fluid DYNVISCOSITY 1.0 DENSITY 1.0 GAMMA 1.0
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/fpsi_ofsiinterface.dat
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ NAME ALE_Solver
SOLVER UMFPACK
AZSOLVE GMRES
AZPREC ILU
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
IFPACKGFILL 0
IFPACKCOMBINE Add
AZSUB 50
Expand Down
6 changes: 3 additions & 3 deletions tests/input_files/fsi_ow3D_mtr_drt.dat
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ AZCONV AZ_r0
IFPACKGFILL 0
AZITER 1000
AZOUTPUT 0
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
AZPREC ILU
AZREUSE 0
AZSOLVE GMRES
Expand All @@ -123,7 +123,7 @@ AZCONV AZ_r0
IFPACKGFILL 0
AZITER 1000
AZOUTPUT 0
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
AZPREC ILU
AZREUSE 0
AZSOLVE GMRES
Expand All @@ -136,7 +136,7 @@ AZCONV AZ_r0
IFPACKGFILL 0
AZITER 1000
AZOUTPUT 0
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
AZPREC ILU
AZREUSE 0
AZSOLVE GMRES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ GEOMETRY full
SOLVER UMFPACK
AZSOLVE GMRES
AZPREC ILU
IFPACKOVERLAP 0
IFPACK_XML_FILE xml/ifpack.xml
IFPACKGFILL 0
IFPACKCOMBINE Add
AZSUB 5000
Expand Down
Loading

0 comments on commit a430b10

Please sign in to comment.