Skip to content

Commit

Permalink
remove useless lines form the code
Browse files Browse the repository at this point in the history
  • Loading branch information
alessiofumagalli committed Jun 11, 2018
1 parent a315132 commit b6b9e48
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions src/porepy/numerics/time_stepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,6 @@

logger = logging.getLogger(__name__)

def color(g):
val = np.zeros(g.num_cells, dtype=np.int)
x = g.cell_centers[0, :]
y = g.cell_centers[1, :]
z = g.cell_centers[2, :]

val[np.logical_and.reduce((x>.5, y<.5, z<.5))] = 1
val[np.logical_and.reduce((x<.5, y>.5, z<.5))] = 2
val[np.logical_and.reduce((x>.5, y>.5, z<.5))] = 3
val[np.logical_and.reduce((x<.5, y<.5, z>.5))] = 4
val[np.logical_and.reduce((x>.5, y<.5, z>.5))] = 5
val[np.logical_and.reduce((x<.5, y>.5, z>.5))] = 6

val[np.logical_and.reduce((x>.75, y>.75, z>.75))] = 7
val[np.logical_and.reduce((x>.75, y>.5, y<.75, z>.75))] = 8
val[np.logical_and.reduce((x>.5, x<.75, y>.75, z>.75))] = 9
val[np.logical_and.reduce((x>.5, x<.75, y>.5, y<.75, z>.75))] = 10
val[np.logical_and.reduce((x>.75, y>.75, z>.5, z<.75))] = 11
val[np.logical_and.reduce((x>.75, y>.5, y<.75, z>.5, z<.75))] = 12
val[np.logical_and.reduce((x>.5, x<.75, y>.75, z>.5, z<.75))] = 13

val[np.logical_and.reduce((x>.5, x<.625, y>.5, y<.625, z>.5, z<.625))] = 14
val[np.logical_and.reduce((x>.625, x<.75, y>.5, y<.625, z>.5, z<.625))] = 15
val[np.logical_and.reduce((x>.5, x<.625, y>.625, y<.75, z>.5, z<.625))] = 16
val[np.logical_and.reduce((x>.625, x<.75, y>.625, y<.75, z>.5, z<.625))] = 17
val[np.logical_and.reduce((x>.5, x<.625, y>.5, y<.625, z>.625, z<.75))] = 18
val[np.logical_and.reduce((x>.625, x<.75, y>.5, y<.625, z>.625, z<.75))] = 19
val[np.logical_and.reduce((x>.5, x<.625, y>.625, y<.75, z>.625, z<.75))] = 20
val[np.logical_and.reduce((x>.625, x<.75, y>.625, y<.75, z>.625, z<.75))] = 21

return val

class AbstractSolver(object):
"""
Abstract base class for solving a general first order time pde problem.
Expand Down Expand Up @@ -108,21 +76,6 @@ def solve(self, save_as=None, save_every=1):
logger.info('Saving solution')
self.problem.split(save_as)

#########
# self.g.add_node_prop('color')
# for g, d in self.g:
# if g.dim < 3:
# d['color'] = -np.ones(g.num_cells)
# if g.dim == 3:
# d['color'] = color(g)
# for c in np.arange(d['color'].max()+1):
# mask = d['color'] == c
# av_conc = np.average(d[save_as][mask])
# with open("UiB_VEM_c_"+str(c)+".csv", 'a') as f:
# f.write(str(t)+", "+str(av_conc)+"\n")

#self.problem.exporter.write_vtk(['color'], time_step=counter)
########
self.problem.exporter.write_vtk([save_as], time_step=counter)
times.append(t)
logger.info('Finished saving')
Expand Down

0 comments on commit b6b9e48

Please sign in to comment.