예제 #1
0
 def __init__(self, *args, **KWs):
   localKWs = self.extractLocalKWs(['staticNoise'], KWs)
   
   VectorElement.__init__(self, *args, **KWs)
   
   self.static = localKWs['staticNoise']
   
   args = []
   if not self.static:
     args.append(('real', '_step'))
   else:
     self.isComputed = True
   
   evaluateFunctionName = ''.join(['_', self.id, '_evaluate'])
   evaluateFunction = Function(
     name = evaluateFunctionName,
     args = args,
     implementation = self.evaluateFunctionContents
   )
   self.functions['evaluate'] = evaluateFunction
   
   if not self.static:
     splitFunctionName = ''.join(['_', self.id, '_split'])
     splitFunction = Function(
       name = splitFunctionName,
       args = [('real', '_new_step'), ('real', '_old_step'), (self.type + '*', '_old_array')],
       implementation = self.splitFunctionContents
     )
     self.functions['split'] = splitFunction
   
   self.basesNeeded.add(self.initialBasis)
   
   self.needsInitialisation = False
예제 #2
0
    def __init__(self, *args, **KWs):
        VectorElement.__init__(self, *args, **KWs)

        # Set default variables

        # Computed vectors don't need explicit initialisation.  If we're integrating over components, VectorElement will automatically set the vector to zero.
        self._integratingComponents = False
        self.initialiser = None

        evaluateFunctionName = "".join(["_", self.id, "_evaluate"])
        evaluateFunction = Function(name=evaluateFunctionName, args=[], implementation=self.evaluateFunctionContents)
        self.functions["evaluate"] = evaluateFunction