Ejemplo n.º 1
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)
n_x_e = 30
n_y_e = 5
L_x = 300.0
R_in = 5.0
R_out = 75.0 / 2
xd1 = XDomainFEGridAxiSym(coord_min=(0, 0),
                          coord_max=(L_x, R_in),
                          shape=(n_x_e, 2),
                          fets=FETS2D4Q())
xd2 = XDomainFEGridAxiSym(coord_min=(0, R_in),
                          coord_max=(L_x, R_out),
                          shape=(n_x_e, n_y_e),
                          integ_factor=2 * np.pi,
                          fets=FETS2D4Q())
m1 = MATS3DDesmorat(E_1=210000, nu=0.3, tau_bar=2000.0)
m2 = MATS3DDesmorat(tau_bar=2.0)

xd12 = XDomainFEInterface(
    I=xd1.mesh.I[:, -1],
    J=xd2.mesh.I[:, 0],
    fets=FETS1D52ULRH()
)

u_max = 0.6 * 3
left_y = BCSlice(slice=xd1.mesh[0, 0, 0, 0],
                 var='u', dims=[1], value=0)
left_x = BCSlice(slice=xd1.mesh[0, :, 0, :],
                 var='u', dims=[0], value=-u_max)
right_x = BCSlice(slice=xd1.mesh[-1, :, -1, :],
                  var='u', dims=[0], value=u_max)
Ejemplo n.º 3
0
import numpy as np

from .mlab_decorators import decorate_figure

thickness = 1

xdomain = XDomainFEGrid(coord_max=(1, 1),
                        shape=(1, 1),
                        integ_factor=thickness,
                        fets=FETS2D4Q())

# print(xdomain.B1_Eimabc.shape)
# print(xdomain.B0_Eimabc.shape)

m = MATS3DDesmorat()
m = MATS2DElastic(E=1, nu=0)

left_y = BCSlice(slice=xdomain.mesh[0, :, 0, :], var='u', dims=[1], value=0)
left_x = BCSlice(slice=xdomain.mesh[0, :, 0, :], var='u', dims=[0], value=-1)
right_x = BCSlice(slice=xdomain.mesh[-1, :, -1, :],
                  var='u',
                  dims=[0],
                  value=0.0)

m = TStepBC(
    domains=[(xdomain, m)],
    bc=[left_x, right_x, left_y],
    record={
        'strain': Vis3DTensorField(var='eps_ab'),
        #        'damage': Vis3DStateField(var='omega_a'),
Ejemplo n.º 4
0
fixed_right_bc = BCSlice(slice=dgrid1.mesh[-1, 0, -1, 0, :, :],
                         var='u',
                         dims=[1],
                         value=0)
fixed_x = BCSlice(slice=dgrid1.mesh[0, n_a:, :, 0, :, :],
                  var='u',
                  dims=[0],
                  value=0)
control_bc = BCSlice(slice=dgrid1.mesh[0, -1, :, 0, -1, :],
                     var='u',
                     dims=[1],
                     value=-w_max)

m = MATS3DDesmorat(tau_bar=6.0,
                   E_1=16000,
                   E_2=19000,
                   S=470e-6,
                   K=1300,
                   gamma=1100)

m_mic = MATS3DMplDamageEEQ(E=27000,
                           nu=0.2,
                           epsilon_0=59.0e-6,
                           epsilon_f=250.0e-7,
                           c_T=0.01)

model = TStepBC(
    domains=[(dgrid1, m_mic)],
    bc=[fixed_right_bc, fixed_x, control_bc],
    record={
        'strain': Vis3DTensorField(var='eps_ab'),
        'stress': Vis3DTensorField(var='sig_ab'),
Ejemplo n.º 5
0
    return np.c_[x, 50 * np.sin(x / 150 * np.pi) + y]


xdomain = XDomainFEGridTransform(coord_max=(150, 50),
                                 shape=(15, 5),
                                 geo_transform=geo_trans,
                                 fets=FETS2D4Q())

left_y = BCSlice(slice=xdomain.mesh[0, 0, 0, 0], var='u', dims=[1], value=0)
left_x = BCSlice(slice=xdomain.mesh[0, :, 0, :], var='u', dims=[0], value=-0.4)
right_x = BCSlice(slice=xdomain.mesh[-1, :, -1, :],
                  var='u',
                  dims=[0],
                  value=0.0)

mats = MATS3DDesmorat()
m = TStepBC(
    domains=[(xdomain, mats)],
    bc=[left_x, right_x, left_y],
    record={
        'strain': Vis3DTensorField(var='eps_ab'),
        #        'damage': Vis3DStateField(var='omega_a'),
        #        'kinematic hardening': Vis3DStateField(var='z_a')
    })
s = m.sim
s.tloop.verbose = True
s.tloop.k_max = 1000
s.tline.step = 0.05
s.run()
time.sleep(2)
Ejemplo n.º 6
0
from bmcs.time_functions import \
    LoadingScenario
from ibvpy.bcond import BCDof
from ibvpy.mats.mats3D.mats3D_plastic.vmats3D_desmorat import \
    MATS3DDesmorat
from simulator.api import TStepBC, XDomainSinglePoint

bc = BCDof(var='f', dof=0, value=-0.001, time_function=LoadingScenario())
model = TStepBC(domains=[(XDomainSinglePoint(), MATS3DDesmorat())],
                bc=[bc],
                debug=False)
s = model.sim
s.tloop.verbose = True
s.run_thread()
s.join_thread()

print(model.hist.F_t)
print(model.hist.U_t)
Ejemplo n.º 7
0
 def _model_default(self):
     return MATS3DDesmorat()
Ejemplo n.º 8
0
n_x_e = 20
n_y_e = 5
L_x = 30.0
R_in = 1.0
R_out = 20.0
xd1 = XDomainFEGridAxiSym(coord_min=(0, 0),
                          coord_max=(L_x, R_in),
                          shape=(n_x_e, 2),
                          fets=FETS2D4Q())
xd2 = XDomainFEGridAxiSym(coord_min=(0, R_in),
                          coord_max=(L_x, R_out),
                          shape=(n_x_e, n_y_e),
                          integ_factor=2 * np.pi,
                          fets=FETS2D4Q())
m1 = MATS3DDesmorat(E_1=280000, tau_bar=200.0)
m2 = MATS3DDesmorat()

xd12 = XDomainFEInterface(I=xd1.mesh.I[:, -1],
                          J=xd2.mesh.I[:, 0],
                          fets=FETS1D52ULRH())

left_y = BCSlice(slice=xd1.mesh[0, 0, 0, 0], var='u', dims=[1], value=0)
left_x = BCSlice(slice=xd1.mesh[0, :, 0, :], var='u', dims=[0], value=-0)
right_x = BCSlice(slice=xd1.mesh[-1, :, -1, :], var='u', dims=[0], value=0.1)
bc1 = [left_y, left_x, right_x]

m = TStepBC(
    domains=[
        (xd1, m1),
        (xd2, m2),