79 super( AssemblePETSCMatrixOnCellsAndFaces, self ).
__init__()
81 self.
d[
"SOLVER_INSTANCE"] = solver.instance_name()
82 self.
d[
"SOLVER_NAME"] = solver.typename()
83 self.
d[
"CELL_CARDINALITY"] = solver.number_of_cell_unknowns
84 self.
d[
"FACE_CARDINALITY"] = solver.number_of_face_unknowns
87 HANDLING THE STENCILS!
95 self.
d[
"stencilRowsFF"] = len(solver.stencilsFF[0])
96 self.
d[
"stencilColsFF"] = len(solver.stencilsFF[0][0])
97 numberOfCols = self.
d[
"stencilColsFF"]
98 self.
d[
"STENCILSFF"] = []
102 for stencil
in solver.stencilsFF:
104 stencil=[item
for sublist
in stencil
for item
in sublist]
105 stencilAsString =
"\n{" + str(stencil[0])
106 for index, el
in enumerate(stencil[1:]):
107 stencilAsString +=
", "
108 if index > 0
and (index-1) % numberOfCols == 1:
109 stencilAsString +=
"\n"
110 stencilAsString += str(el)
111 stencilAsString +=
"}"
114 self.
d[
"STENCILSFF"].append(stencilAsString)
120 self.
d[
"stencilRowsCF"] = len(solver.stencilsCF[0])
121 self.
d[
"stencilColsCF"] = len(solver.stencilsCF[0][0])
122 numberOfCols = self.
d[
"stencilColsCF"]
123 self.
d[
"STENCILSCF"] = []
127 for stencil
in solver.stencilsCF:
129 stencil=[item
for sublist
in stencil
for item
in sublist]
132 stencilAsString =
"\n{" + str(stencil[0])
133 for index, el
in enumerate(stencil[1:]):
134 stencilAsString +=
", "
135 if index > 0
and (index-1) % numberOfCols == 1:
136 stencilAsString +=
"\n"
137 stencilAsString += str(el)
138 stencilAsString +=
"}"
141 self.
d[
"STENCILSCF"].append(stencilAsString)
147 self.
d[
"stencilRowsFC"] = len(solver.stencilsFC[0])
148 self.
d[
"stencilColsFC"] = len(solver.stencilsFC[0][0])
149 numberOfCols = self.
d[
"stencilColsFC"]
150 self.
d[
"STENCILSFC"] = []
154 for stencil
in solver.stencilsFC:
155 stencil=[item
for sublist
in stencil
for item
in sublist]
156 stencilAsString =
"\n{" + str(stencil[0])
157 for index, el
in enumerate(stencil[1:]):
158 stencilAsString +=
", "
159 if index > 0
and (index-1) % numberOfCols == 1:
160 stencilAsString +=
"\n"
161 stencilAsString += str(el)
162 stencilAsString +=
"}"
165 self.
d[
"STENCILSFC"].append(stencilAsString)
170 self.
d[
"stencilRowsCC"] = len(solver.stencilCC)
171 self.
d[
"stencilColsCC"] = len(solver.stencilCC[0])
172 numberOfCols = len(solver.stencilCC[0])
176 stencil=[item
for sublist
in solver.stencilCC
for item
in sublist]
177 self.
d[
"STENCILCC"] =
"\n{" + str(stencil[0])
178 for index, el
in enumerate(stencil[1:]):
179 self.
d[
"STENCILCC"] +=
", "
180 if index > 0
and (index-1) % numberOfCols == 1:
181 self.
d[
"STENCILCC"] +=
"\n"
182 self.
d[
"STENCILCC"] += str(el)
183 self.
d[
"STENCILCC"] +=
"}"