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];
63 for (
int i=0; i<NumMyElements; i++)
65 if (MyGlobalElements[i]==0)
73 else if (MyGlobalElements[i] == NumGlobalElements-1)
75 Indices[0] = NumGlobalElements-1;
76 Indices[1] = NumGlobalElements-2;
83 Indices[0] = MyGlobalElements[i]-1;
84 Indices[1] = MyGlobalElements[i];
85 Indices[2] = MyGlobalElements[i]+1;
92 assert(
A.InsertGlobalValues(MyGlobalElements[i], NumEntries, Values, Indices)==0);
98 assert(
A.FillComplete()==0);
101 delete[] MyGlobalElements;
110 Epetra_Map Map =
A.RowMap();
111 int NumMyElements = Map.NumMyElements();
112 int NumGlobalElements = Map.NumGlobalElements();
114 int * MyGlobalElements =
new int[NumMyElements];
115 Map.MyGlobalElements(MyGlobalElements);
122 double *Values =
new double[3];
123 int *Indices =
new int[3];
126 for (
int i=0; i<NumMyElements; i++)
128 if (MyGlobalElements[i]==0)
132 Indices[2] = NumGlobalElements-1;
138 else if (MyGlobalElements[i] == NumGlobalElements-1)
140 Indices[0] = NumGlobalElements-1;
141 Indices[1] = NumGlobalElements-2;
150 Indices[0] = MyGlobalElements[i]-1;
151 Indices[1] = MyGlobalElements[i];
152 Indices[2] = MyGlobalElements[i]+1;
159 assert(
A.InsertGlobalValues(MyGlobalElements[i], NumEntries, Values, Indices)==0);
165 assert(
A.FillComplete()==0);
168 delete[] MyGlobalElements;
int CreateTridi(Epetra_CrsMatrix &A)
int CreateTridiPlus(Epetra_CrsMatrix &A)