41 #include "Epetra_Map.h" 42 #include "Epetra_CrsMatrix.h" 47 Epetra_Map Map = A.RowMap();
48 int NumMyElements = Map.NumMyElements();
49 int NumGlobalElements = Map.NumGlobalElements();
51 int * MyGlobalElements =
new int[NumMyElements];
52 Map.MyGlobalElements(MyGlobalElements);
59 double *Values =
new double[3];
60 int *Indices =
new int[3];
64 for (
int i=0; i<NumMyElements; i++)
66 if (MyGlobalElements[i]==0)
76 else if (MyGlobalElements[i] == NumGlobalElements-1)
78 Indices[0] = NumGlobalElements-1;
79 Indices[1] = NumGlobalElements-2;
88 Indices[0] = MyGlobalElements[i]-1;
89 Indices[1] = MyGlobalElements[i];
90 Indices[2] = MyGlobalElements[i]+1;
99 assert(A.InsertGlobalValues(MyGlobalElements[i], NumEntries, Values, Indices)==0);
105 assert(A.FillComplete()==0);
108 delete[] MyGlobalElements;
117 Epetra_Map Map = A.RowMap();
118 int NumMyElements = Map.NumMyElements();
119 int NumGlobalElements = Map.NumGlobalElements();
121 int * MyGlobalElements =
new int[NumMyElements];
122 Map.MyGlobalElements(MyGlobalElements);
129 double *Values =
new double[3];
130 int *Indices =
new int[3];
134 for (
int i=0; i<NumMyElements; i++)
136 if (MyGlobalElements[i]==0)
140 Indices[2] = NumGlobalElements-1;
148 else if (MyGlobalElements[i] == NumGlobalElements-1)
150 Indices[0] = NumGlobalElements-1;
151 Indices[1] = NumGlobalElements-2;
162 Indices[0] = MyGlobalElements[i]-1;
163 Indices[1] = MyGlobalElements[i];
164 Indices[2] = MyGlobalElements[i]+1;
173 assert(A.InsertGlobalValues(MyGlobalElements[i], NumEntries, Values, Indices)==0);
179 assert(A.FillComplete()==0);
182 delete[] MyGlobalElements;
int CreateTridi(Epetra_CrsMatrix &A)
int CreateTridiPlus(Epetra_CrsMatrix &A)