Exemplo n.º 1
0
def well_delta(w):
    delta = Function(V)
    node_w = utils.GetNodeClosestToCoordinate(V, w)
    vec = delta.vector().get_local()
    if node_w >= 0:
        vec[node_w] = 1.0
    delta.vector().set_local(vec)
    normalise = L**2/float(Nx)/float(Ny)
    return delta.assign(delta/normalise)
Exemplo n.º 2
0
 def well_delta(self, w):
     delta = Function(self.V)
     node_w = utils.GetNodeClosestToCoordinate(self.V, w)
     vec = delta.vector().get_local()
     if node_w >= 0:
         vec[node_w] = 1.0
     delta.vector().set_local(vec)
     normalise = assemble(delta*dx)
     return delta.assign(delta/normalise)
Exemplo n.º 3
0
 def well_delta(self, w):
     delta = Function(self.V)
     node_w = utils.GetNodeClosestToCoordinate(self.V, w)
     vec = delta.vector().get_local()
     if node_w >= 0:
         vec[node_w] = 1.0
     delta.vector().set_local(vec)
     #normalise = assemble(delta*dx) # This would work for non-rectangular cells
     if self.geo.dim == 2:
         normalise = self.geo.Dx * self.geo.Dy
     elif self.geo.dim == 3:
         normalise = self.geo.Dx * self.geo.Dy * self.geo.Dz
     return delta.assign(delta / normalise)
Exemplo n.º 4
0
 def make_deltas(self, ws):
     deltas = Function(self.V)
     vec = deltas.vector().get_local()
     for w in ws:
         node_w = utils.GetNodeClosestToCoordinate(self.V, w)
         if node_w >= 0:
             vec[node_w] = 1.0
     deltas.vector().set_local(vec)
     if self.geo.dim == 2:
         normalise = self.geo.Dx * self.geo.Dy
     elif self.geo.dim == 3:
         normalise = self.geo.Dx * self.geo.Dy * self.geo.Dz
     deltas.assign(deltas / normalise)
     return deltas