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);
79 Epetra_MpiComm Comm(MPI_COMM_WORLD);
81 Epetra_SerialComm Comm;
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;
111 Epetra_Map map(global_n, 0, Comm);
112 Epetra_CrsGraph graph(
Copy, map, 1);
113 int first_global_row = my_pid*local_n;
115 for(i=0; i<local_n; ++i) {
116 int row = first_global_row + i;
117 graph.InsertGlobalIndices(row, 1, &row);
120 graph.FillComplete();
129 Epetra_CrsMatrix
A(
Copy, graph);
131 for(i=0; i<local_n; ++i) {
132 int row = first_global_row + i;
134 A.SumIntoGlobalValues(row, 1, &val, &row);
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.
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 LevelOverlap() const
Returns the level of overlap used to construct this graph.
Ifpack_IlukGraph: A class for constructing level filled graphs for use with ILU(k) class precondition...
virtual int LevelFill() const
Returns the level of fill used to construct this graph.
int main(int argc, char *argv[])
int SetParameters(const Teuchos::ParameterList ¶meterlist, bool cerr_warning_if_unused=false)
Set parameters using a Teuchos::ParameterList object.
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.
int OverlapLevel() const
Returns the level of overlap used to create this graph.
void set_parameters(const Teuchos::ParameterList ¶meterlist, param_struct ¶ms, bool cerr_warning_if_unused)