Beispiel #1
0
 def coreProcess(self, meshctxt, subp):
     subp.solver_mode = solvermode.AdvancedSolverMode(
         time_stepper=staticstep.StaticDriver(),
         nonlinear_solver=nonlinearsolver.NoNonlinearSolver(),
         symmetric_solver=matrixmethod.ConjugateGradient(
             preconditioner.ILUPreconditioner(),
             1.e-5,          # tolerance
             1000            # max_iterations
             ),
         asymmetric_solver=matrixmethod.BiConjugateGradient(
             preconditioner.ILUPreconditioner(),
             1.e-5,          # tolerance
             1000            # max_iterations
             )
         )
     meshctxt.begin_writing()
     try:
         try:
             evolve.evolve(meshctxt, 0.0)
         except:
             # TODO: Be more explicit about what exceptions
             # should be handled here, to distinguish actual
             # convergence failures from programming errors.
             self.solver_converged = False
         else:
             self.solver_converged = True
     finally:
         meshctxt.end_writing()
Beispiel #2
0
    def coreProcess(self, meshctxt, subp):
        subp.solver = staticstep.StaticDriver(
            matrixmethod.ConjugateGradient(
                preconditioner.ILUPreconditioner(),
                1.e-5,  # tolerance
                1000  # max_iterations
            ))
        subp.solver_linearity = linearity.Linear()

        meshctxt.begin_writing()
        try:
            meshctxt.solver_precompute()
            try:
                evolve.evolve(meshctxt, 0.0, 0.0, False)
            except:
                # TODO 3.1: Be more explicit about what exceptions should
                # be handled here, to distinguish actual convergence
                # failures from programming errors.
                self.solver_converged = False
            else:
                self.solver_converged = True
        finally:
            meshctxt.end_writing()
Beispiel #3
0
 def resolve(self, subproblemcontext, existingStepper):
     from ooflib.engine import staticstep
     if isinstance(existingStepper, staticstep.StaticDriver):
         return existingStepper
     return staticstep.StaticDriver()