-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ifpack move parameters and options to xml file #400
Draft
dharinib98
wants to merge
8
commits into
4C-multiphysics:main
Choose a base branch
from
dharinib98:1361-ifpack-move-parameters-and-options-to-xml-file
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+153
−290
Draft
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
571d2dd
Add Ifpack xml file
dharinib98 ad77c44
Add xml file for ifpack
dharinib98 2764b4f
Add parameter list
dharinib98 d4ca631
Refactor gfilloverlap parameter in tests
dharinib98 0cdbd4a
Refactor all testcases
dharinib98 aae3c1e
Minor Changes
dharinib98 0a76006
Move xml file location
dharinib98 a60306e
Const qualifiers
dharinib98 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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 | ||||||||||
|
||||||||||
//------------------------------------------------------------------------------ | ||||||||||
|
@@ -18,7 +21,6 @@ Core::LinearSolver::IFPACKPreconditioner::IFPACKPreconditioner( | |||||||||
Teuchos::ParameterList& ifpacklist, Teuchos::ParameterList& solverlist) | ||||||||||
: ifpacklist_(ifpacklist), solverlist_(solverlist) | ||||||||||
{ | ||||||||||
return; | ||||||||||
} | ||||||||||
|
||||||||||
//------------------------------------------------------------------------------ | ||||||||||
|
@@ -44,24 +46,30 @@ void Core::LinearSolver::IFPACKPreconditioner::setup(bool create, Epetra_Operato | |||||||||
|
||||||||||
pmatrix_ = std::make_shared<Epetra_CrsMatrix>(*A_crs); | ||||||||||
|
||||||||||
// 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); | ||||||||||
std::string xmlFileName = ifpacklist_.get<std::string>("IFPACK_XML_FILE"); | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
if (xmlFileName == "none") FOUR_C_THROW("IFPACK_XML_FILE parameter not set!"); | ||||||||||
|
||||||||||
Teuchos::ParameterList ifpack_params; | ||||||||||
|
||||||||||
auto comm = Core::Communication::to_teuchos_comm<int>( | ||||||||||
Core::Communication::unpack_epetra_comm(pmatrix_->Comm())); | ||||||||||
|
||||||||||
Teuchos::updateParametersFromXmlFileAndBroadcast( | ||||||||||
xmlFileName, Teuchos::Ptr(&ifpack_params), *comm); | ||||||||||
|
||||||||||
auto prectype = ifpack_params.get<std::string>("Preconditioner type"); | ||||||||||
auto overlap = ifpack_params.get<int>("Overlap"); | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Const qualifiers?
Suggested change
|
||||||||||
|
||||||||||
// 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; | ||||||||||
} | ||||||||||
} | ||||||||||
|
||||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,6 @@ SOLVER Belos | |
AZSOLVE GMRES | ||
AZPREC ILU | ||
AZREUSE 0 | ||
IFPACKGFILL 0 | ||
AZCONV AZ_r0 | ||
AZTOL 1.0E-3 | ||
AZITER 200 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.