Ejemplo n.º 1
0
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!")
Ejemplo n.º 2
0
        # 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