47 #include <Ifpack_CrsIct.h>
50 #include <Epetra_CombineMode.h>
51 #include <Epetra_CrsGraph.h>
52 #include <Epetra_CrsMatrix.h>
53 #include <Epetra_Map.h>
55 #include <Teuchos_ParameterList.hpp>
58 #include <Epetra_SerialComm.h>
62 #include <Epetra_MpiComm.h>
65 int main(
int argc,
char* argv[]) {
71 bool verbose1 =
false;
78 MPI_Init(&argc, &argv);
88 paramlist.
set(
"absolute_threshold", 44.0);
89 paramlist.
set(
"level_fill", 2);
90 paramlist.
set(
"LEVEL_OVERLAP", 2);
91 paramlist.
set(
"relative_threshold", 1.e-2);
92 paramlist.
set(
"fill_tolerance", 2.0);
93 paramlist.
set(
"use_reciprocal",
false);
94 paramlist.
set(
"level_overlap", 2);
95 paramlist.
set(
"overlap_mode",
Add);
101 cerr <<
"SetParameters test failed to correctly set absolute_threshold."<<endl;
107 int my_pid = Comm.
MyPID();
108 int num_procs = Comm.
NumProc();
109 int global_n = num_procs*local_n;
113 int first_global_row = my_pid*local_n;
115 for(i=0; i<local_n; ++i) {
116 int row = first_global_row + i;
131 for(i=0; i<local_n; ++i) {
132 int row = first_global_row + i;
137 Ifpack_CrsIct crsict(A, 1.0, 1);
142 if (levelfill != 2) {
143 cerr <<
"SetParameters test failed to correctly set level_fill."
149 if (leveloverlap != 2) {
150 cerr <<
"SetParameters test failed to correctly set level_overlap."
158 if (athresh != 44.0) {
159 cerr <<
"SetParameters test failed to correctly set absolute_threshold."
165 if (overlapmode !=
Add) {
166 cerr <<
"SetParameters test failed to correctly set overlapmode."
171 crsict.SetParameters(paramlist);
173 double rthresh = crsict.GetRelativeThreshold();
174 if (rthresh != 1.e-2) {
175 cerr <<
"SetParameters test failed to correctly set relative_threshold."
180 overlapmode = crsict.GetOverlapMode();
181 if (overlapmode !=
Add) {
182 cerr <<
"SetParameters test failed to correctly set overlapmode."
191 if (overlaplevel != 2) {
192 cerr <<
"SetParameters test failed to correctly set overlaplevel."
198 if (verbose1==
true) {
199 cout <<
"********* Test passed **********" << endl;
Ifpack_OverlapGraph: Constructs a graph for use with Ifpack preconditioners.
Ifpack_CrsRiluk: A class for constructing and using an incomplete lower/upper (ILU) factorization of ...
double double_params[FIRST_INT_PARAM]
Epetra_CombineMode GetOverlapMode()
Get overlap mode type.
int SetParameters(const Teuchos::ParameterList ¶meterlist, bool cerr_warning_if_unused=false)
Set parameters using Teuchos::ParameterList object.
virtual int SumIntoGlobalValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices)
Ifpack_IlukGraph: A class for constructing level filled graphs for use with ILU(k) class precondition...
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
int InsertGlobalIndices(int_type GlobalRow, int NumIndices, int_type *Indices)
virtual int LevelFill() const
Returns the level of fill used to construct this graph.
int SetParameters(const Teuchos::ParameterList ¶meterlist, bool cerr_warning_if_unused=false)
Set parameters using a Teuchos::ParameterList object.
int main(int argc, char *argv[])
double GetAbsoluteThreshold()
Get absolute threshold value.
int SetParameters(const Teuchos::ParameterList ¶meterlist, bool cerr_warning_if_unused=false)
Set parameters using a Teuchos::ParameterList object.
virtual int LevelOverlap() const
Returns the level of overlap used to construct this graph.
void set_parameters(const Teuchos::ParameterList ¶meterlist, param_struct ¶ms, bool cerr_warning_if_unused)
int OverlapLevel() const
Returns the level of overlap used to create this graph.