コード例 #1
0
 def _bc_default(self):
     return [
         BCDof(var='u',
               dof=0,
               value=-0.001,
               time_function=LoadingScenario())
     ]
コード例 #2
0
 def _loading_scenario_default(self):
     return LoadingScenario()
コード例 #3
0
            while (k < self.k_max) and not self.user_wants_abort:
                if self.tstep.R_norm < self.acc:
                    print('\titer: %g' % k)
                    break
                self.tstep.make_iter()
                k += 1
            else:  # handle unfinished iteration loop
                if k >= self.k_max:  # add step size reduction
                    # no success abort the simulation
                    self.restart = True
                    print('Warning: '
                          'convergence not reached in %g iterations' % k)
                return
            # accept the time step and record the state in history
            self.tstep.make_incr()
            # update the line - launches notifiers to subscribers
            self.tline.val = t_n1
            # set a new target time
            t_n1 += dt
        return


class MATS3DDesmoratGrad(MATS3DDesmorat):
    tloop_type = BrentqTLoop


s = Simulator(model=MATS3DDesmorat())
bc = BCDof(var='u', dof=0, value=-0.001, time_function=LoadingScenario())
s.tstep.bcond_mngr.bcond_list = [bc]
run_rerun_test(s)