changed: default preconditioner to 'asm' in parallel simulations
This commit is contained in:
parent
695e7cfefd
commit
de9ba8912b
@ -65,7 +65,7 @@ bool SettingMap::hasValue(const std::string& key) const
|
||||
LinSolParams::BlockParams::BlockParams() :
|
||||
basis(1), comps(0)
|
||||
{
|
||||
addValue("pc", "ilu");
|
||||
addValue("pc", "default");
|
||||
addValue("multigrid_ksp", "defrichardson");
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,9 @@ void PETScSolParams::setupPC(PC& pc,
|
||||
{
|
||||
// Set preconditioner
|
||||
std::string prec = params.getBlock(block).getStringValue("pc");
|
||||
if (prec == "default")
|
||||
prec = adm.getNoProcs() > 1 ? "asm" : "ilu";
|
||||
|
||||
if (prec == "compositedir") {
|
||||
Mat mat;
|
||||
Mat Pmat;
|
||||
@ -297,8 +300,12 @@ void PETScSolParams::setupSmoothers(PC& pc, size_t iBlock,
|
||||
noSmooth = params.getBlock(iBlock).getIntValue("multigrid_no_smooth");;
|
||||
}
|
||||
|
||||
if (smoother.empty())
|
||||
smoother = "ilu";
|
||||
if (smoother.empty()) {
|
||||
if (adm.getNoProcs() > 1)
|
||||
smoother = "asm";
|
||||
else
|
||||
smoother = "ilu";
|
||||
}
|
||||
|
||||
KSPSetTolerances(preksp,PETSC_DEFAULT,PETSC_DEFAULT,PETSC_DEFAULT,noSmooth);
|
||||
KSPGetPC(preksp,&prepc);
|
||||
|
Loading…
Reference in New Issue
Block a user