Esempio n. 1
0
 def __call__(self, vector):
     conf = self.universe.configuration()
     r = ParticleProperties.ParticleScalar(self.universe)
     l = deformation(conf.array, vector.array, self.pairs,
                     None, r.array, self.cutoff, self.fc_length,
                     self.factor, self.normalize, 0, self.version)
     return r
 def __call__(self, vector):
     conf = self.universe.configuration()
     r = ParticleProperties.ParticleScalar(self.universe)
     l = deformation(conf.array, vector.array, self.pairs, None, r.array,
                     self.cutoff, self.fc_length, self.factor,
                     self.normalize, 0, self.version)
     return r
Esempio n. 3
0
 def __call__(self, vector, gradients = None):
     conf = self.universe.configuration()
     g = None
     if gradients is not None:
         if ParticleProperties.isParticleProperty(gradients):
             g = gradients
         elif isinstance(gradients, N.array_type):
             g = ParticleProperties.ParticleVector(self.universe, gradients)
         elif gradients:
             g = ParticleProperties.ParticleVector(self.universe)
     if g is None:
         g_array = None
     else:
         g_array = g.array
     l = deformation(conf.array, vector.array, self.pairs, g_array, None,
                     self.cutoff, self.fc_length, self.factor,
                     0, 1, self.version)
     if g is None:
         return l
     else:
         return l, g
 def __call__(self, vector, gradients=None):
     conf = self.universe.configuration()
     g = None
     if gradients is not None:
         if ParticleProperties.isParticleProperty(gradients):
             g = gradients
         elif type(gradients) == Numeric.arraytype:
             g = ParticleProperties.ParticleVector(self.universe, gradients)
         elif gradients:
             g = ParticleProperties.ParticleVector(self.universe)
     if g is None:
         g_array = None
     else:
         g_array = g.array
     l = deformation(conf.array, vector.array, self.pairs, g_array, None,
                     self.cutoff, self.fc_length, self.factor, 0, 1,
                     self.version)
     if g is None:
         return l
     else:
         return l, g