from scipy import * from core import Solver test = zeros((5,5)) test[2,2] = 1 S = Solver(test, (1,0), sol_method = "trilinos") S.converge() S.regrid() S._fill_DM(0) for x in range(S.ndim): print all(S.GM[x].todense() == S.VEL_RHS[x].todense())
from scipy import * from core import Solver import hdf5 test = zeros((5,5)) test[2,2] = 1 sol = Solver(test, (1,0), sol_method="trilinos", printing=3) sol.converge() sol.sync("Extern") hdf5.write_solver_to_h5("mpitest-results.h5", sol) sol.dbprint("Completed without error!")
from lra import * from core import Solver # # var = s.variables.pop() # # s.trail.decide(var, var.decide()) # # w = s.clauses.watches # c = s.solve() # # s.clausal_propagate() # # s.semantic_propagate() # # x = Var('x', 'Rat') # y = Var('y', 'Rat') # problem = [ # Clause([ReLU(x, y)]), # Clause([LinearConstraint('Lt0', RationalCombination({y: 2}))]) # ] # s = Solver() x = s.BoolVar('x') y = s.BoolVar('y') lit1 = s.Literal(x, False) lit2 = s.Literal(y, True) clause = s.Clause(lit1, lit2) lit1 = s.Literal(x, False) lit2 = s.Literal(y, False) clause = s.Clause(lit1, lit2) print(s.solve())
# Check to see if a simulation has been done if hdf5.has_dP_sim(save_path, dP) and options.force: print "\tSimulation Detected! Results will be overwritten!" elif hdf5.has_dP_sim(save_path, dP) and not options.force: print "\tSimulation Detected! Skipping!" continue # If bigmode, just pass the filename instead of the solid if options.bigmode: S = save_path else: S = hdf5.get_S(save_path) # Setup solver, printing full debug info, using the solver specified sol = Solver(S, dP, printing=int(options.verb), sol_method=options.solver) # setup is now implicit # sol.setup() #if we want to solve monolithically . . . or use the iterative solver if options.mono: sol.monolithic_solve() else: sol.converge(options.converge) # Save dis shit. print "Saving . . ." hdf5.write_solver_to_h5(save_path, sol) del sol