コード例 #1
0
def ebc_sin(ts, coors, **kwargs):
    val = 0.01 * nm.sin(2.0*nm.pi*ts.nt)
    return nm.tile(val, (coors.shape[0],))

equations = {
    'balance_of_forces in time' :
    """dw_volume_dot.i.Omega( solid.c, v, du/dt )
     + dw_lin_elastic_iso.i.Omega( solid.lam, solid.mu, v, u ) = 0""",
}

solvers = deepcopy(solvers) # Do not spoil linear_elastic.py namespace in tests.
solvers.update({
    'ts' : ('ts.adaptive', {
        't0' : 0.0,
        't1' : 1.0,
        'dt' : None,
        'n_step' : 101,

        'adapt_fun' : 'adapt_time_step',
    }),
})

def adapt_time_step(ts, status, adt, problem):
    if ts.time > 0.5:
        ts.set_time_step(0.1)

    return True

ls = solvers['ls']
ls[1].update({'presolve' : True})

functions = {
コード例 #2
0
def ebc_sin(ts, coors, **kwargs):
    val = 0.01 * nm.sin(2.0*nm.pi*ts.nt)
    return nm.tile(val, (coors.shape[0],))

functions = {
    'ebc_sin' : (ebc_sin,),
}

equations = {
    'balance_of_forces in time' :
    """dw_volume_dot.i1.Omega( solid.c, v, du/dt )
     + dw_lin_elastic_iso.i1.Omega( solid.lam, solid.mu, v, u ) = 0""",
}

solvers.update({
    'ts' : ('ts.simple',
            {'t0' : 0.0,
             't1' : 1.0,
             'dt' : None,
             'n_step' : 101
             }),
})

# Pre-assemble and factorize the matrix prior to time-stepping.
newton = solvers['newton']
newton[1].update({'problem' : 'linear'})

ls = solvers['ls']
ls[1].update({'presolve' : True})
コード例 #3
0
def ebc_sin(ts, coors, bc=None):
    val = 0.01 * nm.sin(2.0*nm.pi*ts.nt)
    return nm.tile(val, (coors.shape[0],))

functions = {
    'ebc_sin' : (ebc_sin,),
}

equations = {
    'balance_of_forces in time' :
    """dw_mass_vector.i1.Omega( solid.rho, v, du/dt )
     + dw_lin_elastic_iso.i1.Omega( solid.lam, solid.mu, v, u ) = 0""",
}

solvers.update({
    'ts' : ('ts.simple',
            {'t0' : 0.0,
             't1' : 1.0,
             'dt' : None,
             'n_step' : 101
             }),
})

# Pre-assemble and factorize the matrix prior to time-stepping.
newton = solvers['newton']
newton[1].update({'problem' : 'linear'})

ls = solvers['ls']
ls[1].update({'presolve' : True})
コード例 #4
0
    return nm.tile(val, (coors.shape[0], ))


equations = {
    'balance_of_forces in time':
    """dw_volume_dot.i.Omega( solid.c, v, du/dt )
     + dw_lin_elastic_iso.i.Omega( solid.lam, solid.mu, v, u ) = 0""",
}

solvers = deepcopy(
    solvers)  # Do not spoil linear_elastic.py namespace in tests.
solvers.update({
    'ts': ('ts.adaptive', {
        't0': 0.0,
        't1': 1.0,
        'dt': None,
        'n_step': 101,
        'adapt_fun': 'adapt_time_step',
    }),
})


def adapt_time_step(ts, status, adt, problem):
    if ts.time > 0.5:
        ts.set_time_step(0.1)

    return True


ls = solvers['ls']
ls[1].update({'presolve': True})