def generate_random(self): # Generate random vectors S = FunctionsList(self.V) for _ in range(self.N): b = RandomDolfinFunction(self.V) S.enrich(b) F = RandomDolfinFunction(self.V) # Return return (S, F)
def generate_random(self): # Generate random vectors v1 = RandomDolfinFunction(self.V).vector() v2 = RandomDolfinFunction(self.V).vector() k = RandomDolfinFunction(self.V) # Generate random matrix A = assemble(self.a(k)) # Return return (v1, v2, A)
def generate_random(self): # Generate random vectors Z = BasisFunctionsMatrix(self.V) Z.init("u") for _ in range(self.N): b = RandomDolfinFunction(self.V) Z.enrich(b) F = RandomDolfinFunction(self.V) # Return return (Z, F)
def generate_random(self): # Generate random vectors S = FunctionsList(self.V) for _ in range(self.N): b = RandomDolfinFunction(self.V) S.enrich(b) k = RandomDolfinFunction(self.V) # Generate random matrix A = assemble(self.a(k)) # Return return (S, A)
def generate_random(self): # Generate random vectors Z = BasisFunctionsMatrix(self.V) Z.init("u") for i in range(self.N): b = RandomDolfinFunction(self.V) Z.enrich(b) # Generate random matrix k = RandomDolfinFunction(self.V) A = assemble(self.a(k)) # Generate random function z = RandomDolfinFunction(self.V) # Return return (Z, A, z.vector())
def generate_random(self): # Generate random forcing g = RandomDolfinFunction(self.V) # Generate correspondingly residual and jacobian forms r = self.r(self.u, g) j = self.j(self.u, r) # Prepare problem wrapper class ProblemWrapper(NonlinearProblemWrapper): # Residual and jacobian functions def residual_eval(self_, solution): return self.callback(r) def jacobian_eval(self_, solution): return self.callback(j) # Define boundary condition def bc_eval(self_): return None # Empty solution monitor def monitor(self_, solution): pass problem_wrapper = ProblemWrapper() # Return return (r, j, problem_wrapper)
def generate_random(self): f = () for i in range(self.Q): # Generate random vector g = RandomDolfinFunction(self.V) # Generate random form f += (self.f(g), ) F = AffineExpansionStorage(f) # Genereate random theta theta = RandomTuple(self.Q) # Return return (theta, F)
def generate_random(self): a = () for i in range(self.Q): # Generate random vector k = RandomDolfinFunction(self.V) # Generate random form a += (self.a(k), ) A = AffineExpansionStorage(a) # Genereate random theta theta = RandomTuple(self.Q) # Return return (theta, A)
def generate_random(self): # Generate random vectors v1 = RandomDolfinFunction(self.V).vector() v2 = RandomDolfinFunction(self.V).vector() # Return return (v1, v2)
def generate_random(self): # Generate random rhs g = RandomDolfinFunction(self.V) # Return return (self.a, self.f(g))