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[]) {
67 bool verbose1 =
false;
74 MPI_Init(&argc, &argv);
84 paramlist.
set(
"absolute_threshold", 44.0);
85 paramlist.
set(
"level_fill", 2);
86 paramlist.
set(
"LEVEL_OVERLAP", 2);
87 paramlist.
set(
"relative_threshold", 1.e-2);
88 paramlist.
set(
"fill_tolerance", 2.0);
89 paramlist.
set(
"use_reciprocal",
false);
90 paramlist.
set(
"level_overlap", 2);
91 paramlist.
set(
"overlap_mode",
Add);
97 cerr <<
"SetParameters test failed to correctly set absolute_threshold."<<endl;
103 int my_pid = Comm.
MyPID();
104 int num_procs = Comm.
NumProc();
105 int global_n = num_procs*local_n;
109 int first_global_row = my_pid*local_n;
111 for(i=0; i<local_n; ++i) {
112 int row = first_global_row + i;
127 for(i=0; i<local_n; ++i) {
128 int row = first_global_row + i;
133 Ifpack_CrsIct crsict(A, 1.0, 1);
138 if (levelfill != 2) {
139 cerr <<
"SetParameters test failed to correctly set level_fill."
145 if (leveloverlap != 2) {
146 cerr <<
"SetParameters test failed to correctly set level_overlap."
154 if (athresh != 44.0) {
155 cerr <<
"SetParameters test failed to correctly set absolute_threshold."
161 if (overlapmode !=
Add) {
162 cerr <<
"SetParameters test failed to correctly set overlapmode."
167 crsict.SetParameters(paramlist);
169 double rthresh = crsict.GetRelativeThreshold();
170 if (rthresh != 1.e-2) {
171 cerr <<
"SetParameters test failed to correctly set relative_threshold."
176 overlapmode = crsict.GetOverlapMode();
177 if (overlapmode !=
Add) {
178 cerr <<
"SetParameters test failed to correctly set overlapmode."
187 if (overlaplevel != 2) {
188 cerr <<
"SetParameters test failed to correctly set overlaplevel."
194 if (verbose1==
true) {
195 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.
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
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...
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.