本文整理汇总了Python中ibvpy.api.TLoop.eval方法的典型用法代码示例。如果您正苦于以下问题:Python TLoop.eval方法的具体用法?Python TLoop.eval怎么用?Python TLoop.eval使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ibvpy.api.TLoop
的用法示例。
在下文中一共展示了TLoop.eval方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: example_1d
# 需要导入模块: from ibvpy.api import TLoop [as 别名]
# 或者: from ibvpy.api.TLoop import eval [as 别名]
def example_1d():
from ibvpy.mats.mats1D.mats1D_elastic.mats1D_elastic import MATS1DElastic
from ibvpy.fets.fets1D.fets1D2l import FETS1D2L
fets_eval = FETS1D2L(mats_eval=MATS1DElastic())
# Discretization
fe_domain = FEDomain()
fe_level1 = FERefinementGrid(domain=fe_domain, fets_eval=fets_eval)
fe_domain1 = FEGrid(coord_max=(3., 0., 0.),
shape=(3,),
level=fe_level1,
fets_eval=fets_eval)
fe_child_domain = FERefinementGrid(parent_domain=fe_level1,
fine_cell_shape=(2,))
fe_child_domain.refine_elem((1,))
ts = TS(domain=fe_domain,
dof_resultants=True,
sdomain=fe_domain,
bcond_list=[BCDof(var='u', dof=0, value=0.),
BCDof(var='f', dof=3, value=1.)]
)
# Add the time-loop control
tloop = TLoop(tstepper=ts, debug=True,
tline=TLine(min=0.0, step=1, max=1.0))
print tloop.eval()
示例2: ghost_bar
# 需要导入模块: from ibvpy.api import TLoop [as 别名]
# 或者: from ibvpy.api.TLoop import eval [as 别名]
def ghost_bar( ):
fets_eval = FETS1D2L( mats_eval = MATS1DElastic() )
discr = ( 3, )
# Discretization
fe_domain1 = FEGrid( coord_min = (0,0,0),
coord_max = (2,0,0),
shape = discr,
inactive_elems = [0],
fets_eval = fets_eval )
ts = TS( sdomain = fe_domain1,
dof_resultants = True,
bcond_list = [ BCDof( var='u', value = 0., dof = 0 ),
BCDof( var='u', value = 0., dof = 3 ),
BCDof( var='f', value = 1., dof = 1 ) ],
)
# Add the time-loop control
global tloop
tloop = TLoop( tstepper = ts, tolerance = 1e-4, KMAX = 50,
tline = TLine( min = 0.0, step = 1.0, max = 1.0 ))
print tloop.eval()
示例3: combined_fe2D4q_with_fe2D4q8u
# 需要导入模块: from ibvpy.api import TLoop [as 别名]
# 或者: from ibvpy.api.TLoop import eval [as 别名]
def combined_fe2D4q_with_fe2D4q8u():
fets_eval_4u = FETS2D4Q(mats_eval = MATS2DElastic(E= 1.,nu = 0.))
fets_eval_8u = FETS2D4Q8U(mats_eval = MATS2DElastic())
xfets_eval = FETSCrack(parent_fets = fets_eval_4u) # should be set automatically
# Discretization
fe_domain1 = FEGridDomain( coord_max = (2.,6.,0.),
shape = (1,3),
fets_eval = fets_eval_4u )
fe_subdomain = FESubGridDomain( parent_domain = fe_domain1,
#fets_eval = fets_eval_8u,
fets_eval = fets_eval_4u,
#fets_eval = xfets_eval,
fine_cell_shape = (1,1) )
fe_subdomain.refine_elem( (0,1) )
elem = fe_subdomain.elements
m_elem = fe_domain1.elements
print "nodes ",elem[0]
fe_domain = FEDomainList( subdomains = [ fe_domain1 ] )
ts = TS( dof_resultants = True,
sdomain = fe_domain,
bcond_list = [BCDofGroup(var='u', value = 1., dims = [1],
get_dof_method = fe_domain1.get_top_dofs ),
BCDofGroup(var='u', value = 0., dims = [1],
get_dof_method = fe_domain1.get_bottom_dofs ),
BCDofGroup(var='u', value = 0., dims = [0],
get_dof_method = fe_domain1.get_bottom_left_dofs ),
],
rtrace_list = [
# RTraceGraph(name = 'Fi,right over u_right (iteration)' ,
# var_y = 'F_int', idx_y = 0,
# var_x = 'U_k', idx_x = 1),
RTraceDomainListField(name = 'Stress' ,
var = 'sig_app', idx = 1, warp = True ),
RTraceDomainListField(name = 'Displ' ,
var = 'u', idx = 1, warp = True ),
# RTraceDomainField(name = 'Displacement' ,
# var = 'u', idx = 0),
# RTraceDomainField(name = 'N0' ,
# var = 'N_mtx', idx = 0,
# record_on = 'update')
]
)
# Add the time-loop control
tloop = TLoop( tstepper = ts,
tline = TLine( min = 0.0, step = 1, max = 1.0 ))
print tloop.eval()
print "nodes after",elem[0]
from ibvpy.plugins.ibvpy_app import IBVPyApp
ibvpy_app = IBVPyApp( ibv_resource = tloop )
ibvpy_app.main()
示例4: eval
# 需要导入模块: from ibvpy.api import TLoop [as 别名]
# 或者: from ibvpy.api.TLoop import eval [as 别名]
def eval( self ):
'''Run the time loop.
'''
#
avg_processor = None
if self.avg_radius > 0.0:
avg_processor = RTNonlocalAvg( sd = self.fe_domain,
avg_fn = QuarticAF( radius = self.avg_radius,
correction = True ) )
ts = TS( u_processor = avg_processor,
dof_resultants = True,
sdomain = self.fe_domain,
bcond_list = self.bc_list,
rtrace_list = self.rt_list
)
# Add the time-loop control
tloop = TLoop( tstepper = ts, KMAX = 300, tolerance = 1e-8,
debug = False,
verbose_iteration = False,
verbose_time = False,
tline = TLine( min = 0.0, step = self.step_size, max = 1.0 ) )
tloop.eval()
tloop.accept_time_step()
self.plot_time_function()
self.plot_tracers()
示例5: example_with_new_domain
# 需要导入模块: from ibvpy.api import TLoop [as 别名]
# 或者: from ibvpy.api.TLoop import eval [as 别名]
def example_with_new_domain():
from ibvpy.api import \
TStepper as TS, RTraceGraph, RTraceDomainListField, TLoop, \
TLine, BCDof, IBVPSolve as IS, DOTSEval
from ibvpy.mats.mats1D.mats1D_elastic.mats1D_elastic import MATS1DElastic
fets_eval = FETS1D2L3U( mats_eval = MATS1DElastic( E = 10. ) )
from ibvpy.mesh.fe_grid import FEGrid
# Discretization
domain = FEGrid( coord_max = ( 3., ),
shape = ( 3, ),
fets_eval = fets_eval )
ts = TS( dof_resultants = True,
sdomain = domain,
# conversion to list (square brackets) is only necessary for slicing of
# single dofs, e.g "get_left_dofs()[0,1]"
# bcond_list = [ BCDof(var='u', dof = 0, value = 0.) ] +
# [ BCDof(var='u', dof = 2, value = 0.001 ) ]+
# [ ) ],
bcond_list = [BCDof( var = 'u', dof = 0, value = 0. ),
# BCDof(var='u', dof = 1, link_dofs = [2], link_coeffs = [0.5],
# value = 0. ),
# BCDof(var='u', dof = 2, link_dofs = [3], link_coeffs = [1.],
# value = 0. ),
BCDof( var = 'f', dof = 6, value = 1,
#link_dofs = [2], link_coeffs = [2]
) ],
rtrace_list = [ RTraceGraph( name = 'Fi,right over u_right (iteration)' ,
var_y = 'F_int', idx_y = 0,
var_x = 'U_k', idx_x = 1 ),
RTraceDomainListField( name = 'Stress' ,
var = 'sig_app', idx = 0 ),
RTraceDomainListField( name = 'Displacement' ,
var = 'u', idx = 0 ),
RTraceDomainListField( name = 'N0' ,
var = 'N_mtx', idx = 0,
record_on = 'update' )
]
)
# Add the time-loop control
tloop = TLoop( tstepper = ts,
tline = TLine( min = 0.0, step = 1, max = 1.0 ) )
print '---- result ----'
print tloop.eval()
print ts.F_int
print ts.rtrace_list[0].trace.ydata
# Put the whole stuff into the simulation-framework to map the
# individual pieces of definition into the user interface.
#
from ibvpy.plugins.ibvpy_app import IBVPyApp
app = IBVPyApp( ibv_resource = tloop )
app.main()
示例6: example_with_new_domain
# 需要导入模块: from ibvpy.api import TLoop [as 别名]
# 或者: from ibvpy.api.TLoop import eval [as 别名]
def example_with_new_domain():
from ibvpy.api import \
TStepper as TS, RTraceGraph, RTraceDomainListField, TLoop, \
TLine, IBVPSolve as IS, DOTSEval
from ibvpy.api import BCDofGroup
from ibvpy.mats.mats1D5.mats1D5bond_elastic_frictional import MATS1D5Bond
from ibvpy.mesh.fe_grid import FEGrid
from mathkit.mfn.mfn_line.mfn_line import MFnLineArray
fets_eval = FETS1D52B6ULRH(mats_eval = MATS1D5Bond(Ef = 17000.,
Af = 2.65e-6/4.,
Am = 2.65e-6/4.,
Em = 17000.,
tau_max = 8.23 * 2,
tau_fr = 8.23 * 2 ,
s_cr = 0.030e-3 * 10 ))
# Discretization
domain = FEGrid( coord_max = (1.,.1,0.), #new domain
shape = (1,1),
fets_eval = fets_eval)
ts = TS( dof_resultants = True,
sdomain = domain,
# conversion to list (square brackets) is only necessary for slicing of
# single dofs, e.g "get_left_dofs()[0,1]"
bcond_list = [BCDofGroup(var='u', value = 0.,dims = [0],
get_dof_method = domain.get_left_dofs),\
# imposed displacement for all right dofs in y-direction:
# BCDofGroup(var='u', value = 0., dims = [0],
# get_dof_method = domain.get_top_right_dofs ),
BCDofGroup(var='u', value = 1.e-3, dims = [0],
get_dof_method = domain.get_bottom_right_dofs )],
rtrace_list = [ RTraceGraph(name = 'Fi,right over u_right (iteration)' ,
var_y = 'F_int', idx_y = 1,
var_x = 'U_k', idx_x = 1),
RTraceDomainListField(name = 'Debonding' ,
var = 'debonding', idx = 0 ),
RTraceDomainListField(name = 'Displacement' ,
var = 'u', idx = 0),
# RTraceDomainListField(name = 'N0' ,
# var = 'N_mtx', idx = 0,
# record_on = 'update')
]
)
# Add the time-loop control
tloop = TLoop( tstepper = ts,
DT = 1.,
tline = TLine( min = 0.0, max = 1.0 ))
tloop.eval()
# Put the whole stuff into the simulation-framework to map the
# individual pieces of definition into the user interface.
#
from ibvpy.plugins.ibvpy_app import IBVPyApp
app = IBVPyApp( ibv_resource = tloop )
app.main()
示例7: screwed_chess_board
# 需要导入模块: from ibvpy.api import TLoop [as 别名]
# 或者: from ibvpy.api.TLoop import eval [as 别名]
def screwed_chess_board( ):
'''Clamped bar 3 domains, each with 2 elems (displ at right end)
[0]-[1]-[2] [3]-[4]-[5] [6]-[7]-[8]
u[0] = 0, u[2] = u[3], u[5] = u[6], u[8] = 1'''
mp = MATS2DElastic( E = 34.e3,
nu = 0.2 )
fets_eval = FETS2D4Q(mats_eval = mp )
#fets_eval = FETS2D4Q8U(mats_eval = mp )
nx = 8
ny = 8
discr = ( nx, ny )
inactive_elems = []
for j in range( ny / 2 ):
inactive_elems += [ i*2*ny+(j*2) for i in range( nx / 2 ) ] + \
[ (ny+1)+i*2*ny+(j*2) for i in range( nx / 2 ) ]
load_dof = (ny+1) * 2 * (nx / 2) + ny
# Discretization
fe_domain1 = FEGrid( coord_min = (0,0,0),
coord_max = (2.,2.,0.),
shape = discr,
inactive_elems = inactive_elems,
fets_eval = fets_eval )
ts = TS( sdomain = fe_domain1,
dof_resultants = True,
bcond_list = [ BCDofGroup( var='u', value = 0., dims = [0,1],
get_dof_method = fe_domain1.get_bottom_dofs ),
BCDofGroup( var='u', value = 0, dims = [0,1],
get_dof_method = fe_domain1.get_top_dofs ),
BCDofGroup( var='u', value = 0, dims = [0,1],
get_dof_method = fe_domain1.get_left_dofs ),
BCDofGroup( var='u', value = 0, dims = [0,1],
get_dof_method = fe_domain1.get_right_dofs ),
BCDof( var='f', value = 100., dof = load_dof ),
BCDof( var='f', value = 100., dof = load_dof+1 ),
],
rtrace_list = [ RTraceDomainListField( name = 'Displacement',
var = 'u',
idx = 1, warp = False ),
RTraceDomainListField(name = 'Stress' ,
var = 'sig_app', idx = 0,
record_on = 'update',
warp = True),
]
)
# Add the time-loop control
global tloop
tloop = TLoop( tstepper = ts, tolerance = 1e-4, KMAX = 50,
tline = TLine( min = 0.0, step = 1.0, max = 1.0 ))
tloop.eval()
from ibvpy.plugins.ibvpy_app import IBVPyApp
app = IBVPyApp( ibv_resource = tloop )
app.main()
示例8: run
# 需要导入模块: from ibvpy.api import TLoop [as 别名]
# 或者: from ibvpy.api.TLoop import eval [as 别名]
def run():
from ibvpy.api import \
TStepper as TS, RTraceGraph, RTraceDomainListField, TLoop, \
TLine, BCDof, IBVPSolve as IS, DOTSEval
from ibvpy.mats.mats1D.mats1D_elastic.mats1D_elastic import MATS1DElastic
from ibvpy.mats.mats1D.mats1D_damage.mats1D_damage import MATS1DDamage
from ibvpy.fets.fets1D.fets1D2l import FETS1D2L
#fets_eval = FETS1D2L( mats_eval = MATS1DElastic( E = 10. ) )
fets_eval = FETS1D2L( mats_eval = MATS1DDamage( E = 10. ) )
from ibvpy.mesh.fe_grid import FEGrid
# Discretization
domain = FEGrid( coord_max = ( 1., 0., 0. ),
shape = ( 10, ),
fets_eval = fets_eval )
right_dof = domain[-1, -1].dofs[0, 0, 0]
ts = TS( nonlocal_avg = True,
dof_resultants = True,
sdomain = domain,
# conversion to list (square brackets) is only necessary for slicing of
# single dofs, e.g "get_left_dofs()[0,1]"
# bcond_list = [ BCDof(var='u', dof = 0, value = 0.) ] +
# [ BCDof(var='u', dof = 2, value = 0.001 ) ]+
# [ ) ],
bcond_list = [BCDof( var = 'u', dof = 0, value = 0. ),
# BCDof(var='u', dof = 1, link_dofs = [2], link_coeffs = [0.5],
# value = 0. ),
# BCDof(var='u', dof = 2, link_dofs = [3], link_coeffs = [1.],
# value = 0. ),
BCDof( var = 'f', dof = right_dof, value = 1,
#link_dofs = [2], link_coeffs = [2]
) ],
rtrace_list = [ RTraceGraph( name = 'Fi,right over u_right (iteration)' ,
var_y = 'F_int', idx_y = 0,
var_x = 'U_k', idx_x = 1 ),
RTraceDomainListField( name = 'Stress' ,
var = 'sig_app', idx = 0 ),
RTraceDomainListField( name = 'Displacement' ,
var = 'u', idx = 0,
warp = True ),
RTraceDomainListField( name = 'N0' ,
var = 'N_mtx', idx = 0,
record_on = 'update' )
]
)
# Add the time-loop control
tloop = TLoop( tstepper = ts,
tline = TLine( min = 0.0, step = 0.5, max = 1.0 ) )
print '---- result ----'
print tloop.eval()
print ts.F_int
print ts.rtrace_list[0].trace.ydata
示例9: example_2d
# 需要导入模块: from ibvpy.api import TLoop [as 别名]
# 或者: from ibvpy.api.TLoop import eval [as 别名]
def example_2d():
from ibvpy.mats.mats2D.mats2D_elastic.mats2D_elastic import MATS2DElastic
from ibvpy.fets.fets2D.fets2D4q import FETS2D4Q
fets_eval = FETS2D4Q(mats_eval = MATS2DElastic( E = 2.1e5 ))
# Discretization
fe_domain1 = FEGrid( coord_max = (2.,5.,0.),
shape = (10,10),
fets_eval = fets_eval )
fe_subgrid1 = FERefinementLevelGrid( parent_domain = fe_domain1,
fine_cell_shape = (1,1) )
print 'children'
print fe_domain1.children
fe_subgrid1.refine_elem( (5,5) )
fe_subgrid1.refine_elem( (6,5) )
fe_subgrid1.refine_elem( (7,5) )
fe_subgrid1.refine_elem( (8,5) )
fe_subgrid1.refine_elem( (9,5) )
fe_domain = FEDomainList( subdomains = [ fe_domain1 ] )
ts = TS( dof_resultants = True,
sdomain = fe_domain,
bcond_list = [BCDofGroup(var='f', value = 0.1, dims = [0],
get_dof_method = fe_domain1.get_top_dofs ),
BCDofGroup(var='u', value = 0., dims = [0,1],
get_dof_method = fe_domain1.get_bottom_dofs ),
],
rtrace_list = [ RTraceGraph(name = 'Fi,right over u_right (iteration)' ,
var_y = 'F_int', idx_y = 0,
var_x = 'U_k', idx_x = 1),
RTraceDomainListField(name = 'Stress' ,
var = 'sig_app', idx = 0, warp = True ),
# RTraceDomainField(name = 'Displacement' ,
# var = 'u', idx = 0),
# RTraceDomainField(name = 'N0' ,
# var = 'N_mtx', idx = 0,
# record_on = 'update')
]
)
# Add the time-loop control
tloop = TLoop( tstepper = ts,
tline = TLine( min = 0.0, step = 1, max = 1.0 ))
#
print tloop.eval()
from ibvpy.plugins.ibvpy_app import IBVPyApp
ibvpy_app = IBVPyApp( ibv_resource = tloop )
ibvpy_app.main()
示例10: example_with_new_domain
# 需要导入模块: from ibvpy.api import TLoop [as 别名]
# 或者: from ibvpy.api.TLoop import eval [as 别名]
def example_with_new_domain():
from ibvpy.api import \
TStepper as TS, RTraceGraph, RTraceDomainField, TLoop, \
TLine, BCDofGroup, IBVPSolve as IS, DOTSEval
from ibvpy.mats.mats1D.mats1D_elastic.mats1D_elastic import MATS1DElastic
fets_eval = FETS1D2Lxfem(mats_eval = MATS1DElastic(E=10., A=1.))
# Tseval for a discretized line domain
tseval = DOTSEval( fets_eval = fets_eval )
from ibvpy.mesh.fe_grid import FEGrid
# Discretization
domain = FEGrid( coord_max = (1.,0.,0.),
shape = (1,),
n_nodal_dofs = fets_eval.n_nodal_dofs,
dof_r = fets_eval.dof_r,
geo_r = fets_eval.geo_r)
ts = TS( tse = tseval,
dof_resultants = True,
sdomain = domain,
bcond_list = [ BCDofGroup( var='u', value = 0., dims = [0],
get_dof_method = domain.get_left_dofs ),
BCDofGroup( var='u', value = 1., dims = [0],
get_dof_method = domain.get_right_dofs ) ],
rtrace_list = [ RTraceGraph(name = 'Fi,right over u_right (iteration)' ,
var_y = 'F_int', idx_y = 0,
var_x = 'U_k', idx_x = 1),
RTraceDomainField(name = 'Stress' ,
var = 'sig_app', idx = 0),
RTraceDomainField(name = 'Displacement' ,
var = 'u', idx = 0)
]
)
# Add the time-loop control
tloop = TLoop( tstepper = ts,
tline = TLine( min = 0.0, step = 1, max = 1.0 ))
print '---- result ----'
print tloop.eval()
print ts.F_int
print ts.rtrace_list[0].trace.ydata
# Put the whole stuff into the simulation-framework to map the
# individual pieces of definition into the user interface.
#
from ibvpy.plugins.ibvpy_app import IBVPyApp
app = IBVPyApp( ibv_resource = tloop )
app.main()
示例11: test_bar2
# 需要导入模块: from ibvpy.api import TLoop [as 别名]
# 或者: from ibvpy.api.TLoop import eval [as 别名]
def test_bar2( ):
'''Clamped bar composed of two linked bars loaded at the right end
[00]-[01]-[02]-[03]-[04]-[05]-[06]-[07]-[08]-[09]-[10]
[11]-[12]-[13]-[14]-[15]-[16]-[17]-[18]-[19]-[20]-[21]
u[0] = 0, u[5] = u[16], R[-1] = R[21] = 10
'''
fets_eval = FETS1D2L(mats_eval = MATS1DElastic(E=10., A=1.))
# Discretization
fe_domain1 = FEGrid( coord_max = (10.,0.,0.),
shape = (10,),
n_nodal_dofs = 1,
dof_r = fets_eval.dof_r,
geo_r = fets_eval.geo_r )
fe_domain2 = FEGrid( coord_min = (10.,0.,0.),
coord_max = (20.,0.,0.),
shape = (10,),
n_nodal_dofs = 1,
dof_r = fets_eval.dof_r,
geo_r = fets_eval.geo_r )
ts = TS( iterms = [ ( fets_eval, fe_domain1 ), (fets_eval, fe_domain2 ) ],
dof_resultants = True,
bcond_list = [BCDof(var='u', dof = 0, value = 0.),
BCDof(var='u', dof = 5, link_dofs = [16], link_coeffs = [1.],
value = 0. ),
BCDof(var='f', dof = 21, value = 10 ) ],
rtrace_list = [ RTraceGraph(name = 'Fi,right over u_right (iteration)' ,
var_y = 'F_int', idx_y = 0,
var_x = 'U_k', idx_x = 1),
]
)
# Add the time-loop control
tloop = TLoop( tstepper = ts,
tline = TLine( min = 0.0, step = 1, max = 1.0 ))
u = tloop.eval()
print 'u', u
#
# '---------------------------------------------------------------'
# 'Clamped bar composed of two linked bars control displ at right'
# 'u[0] = 0, u[5] = u[16], u[21] = 1'
# Remove the load and put a unit displacement at the right end
# Note, the load is irrelevant in this case and will be rewritten
#
ts.bcond_list = [BCDof(var='u', dof = 0, value = 0.),
BCDof(var='u', dof = 5, link_dofs = [16], link_coeffs = [1.],
value = 0. ),
BCDof(var='u', dof = 21, value = 1. ) ]
# system solver
u = tloop.eval()
print 'u',u
示例12: example_3d
# 需要导入模块: from ibvpy.api import TLoop [as 别名]
# 或者: from ibvpy.api.TLoop import eval [as 别名]
def example_3d():
from ibvpy.mats.mats3D.mats3D_elastic.mats3D_elastic import MATS3DElastic
from ibvpy.fets.fets3D.fets3D8h import FETS3D8H
fets_eval = FETS3D8H(mats_eval=MATS3DElastic())
fe_domain = FEDomain()
fe_level1 = FERefinementGrid(domain=fe_domain, fets_eval=fets_eval)
# Discretization
fe_domain1 = FEGrid(coord_max=(2., 5., 3.),
shape=(2, 3, 2),
level=fe_level1,
fets_eval=fets_eval)
fe_child_domain = FERefinementGrid(parent=fe_domain1,
fine_cell_shape=(2, 2, 2))
fe_child_domain.refine_elem((1, 1, 0))
fe_child_domain.refine_elem((0, 1, 0))
fe_child_domain.refine_elem((1, 1, 1))
fe_child_domain.refine_elem((0, 1, 1))
ts = TS(dof_resultants=True,
sdomain=fe_domain,
bcond_list=[BCDofGroup(var='f', value=1., dims=[0],
get_dof_method=fe_domain1.get_top_dofs),
BCDofGroup(var='u', value=0., dims=[0, 1],
get_dof_method=fe_domain1.get_bottom_dofs),
],
rtrace_list=[ RTraceGraph(name='Fi,right over u_right (iteration)' ,
var_y='F_int', idx_y=0,
var_x='U_k', idx_x=1),
# RTraceDomainListField(name = 'Stress' ,
# var = 'sig_app', idx = 0, warp = True ),
# RTraceDomainField(name = 'Displacement' ,
# var = 'u', idx = 0),
# RTraceDomainField(name = 'N0' ,
# var = 'N_mtx', idx = 0,
# record_on = 'update')
]
)
# Add the time-loop control
tloop = TLoop(tstepper=ts,
tline=TLine(min=0.0, step=1, max=1.0))
print tloop.eval()
from ibvpy.plugins.ibvpy_app import IBVPyApp
ibvpy_app = IBVPyApp(ibv_resource=tloop)
ibvpy_app.main()
示例13: test_bar4
# 需要导入模块: from ibvpy.api import TLoop [as 别名]
# 或者: from ibvpy.api.TLoop import eval [as 别名]
def test_bar4( ):
'''Clamped bar 3 domains, each with 2 elems (displ at right end)
[0]-[1]-[2] [3]-[4]-[5] [6]-[7]-[8]
u[0] = 0, u[2] = u[3], u[5] = u[6], u[8] = 1'''
fets_eval = FETS1D2L(mats_eval = MATS1DElastic(E=10., A=1.))
# Discretization
fe_domain1 = FEGrid( coord_max = (2.,0.,0.),
shape = (2,),
n_nodal_dofs = 1,
dof_r = fets_eval.dof_r,
geo_r = fets_eval.geo_r )
fe_domain2 = FEGrid( coord_min = (2.,0.,0.),
coord_max = (4.,0.,0.),
shape = (2,),
n_nodal_dofs = 1,
dof_r = fets_eval.dof_r,
geo_r = fets_eval.geo_r )
fe_domain3 = FEGrid( coord_min = (4.,0.,0.),
coord_max = (6.,0.,0.),
shape = (2,),
n_nodal_dofs = 1,
dof_r = fets_eval.dof_r,
geo_r = fets_eval.geo_r )
ts = TS( iterms = [ ( fets_eval, fe_domain1 ), (fets_eval, fe_domain2 ), (fets_eval, fe_domain3 ) ],
dof_resultants = True,
bcond_list = [BCDof(var='u', dof = 0, value = 0.),
BCDof(var='u', dof = 2, link_dofs = [3], link_coeffs = [1.],
value = 0. ),
BCDof(var='u', dof = 5, link_dofs = [6], link_coeffs = [1.],
value = 0. ),
BCDof(var='u', dof = 8, value = 1) ],
rtrace_list = [ RTraceGraph(name = 'Fi,right over u_right (iteration)' ,
var_y = 'F_int', idx_y = 0,
var_x = 'U_k', idx_x = 1),
RTraceDomainListField( name = 'Displacement', var = 'u', idx = 0 )
]
)
# Add the time-loop control
tloop = TLoop( tstepper = ts,
tline = TLine( min = 0.0, step = 1, max = 1.0 ))
print tloop.eval()
from ibvpy.plugins.ibvpy_app import IBVPyApp
app = IBVPyApp( ibv_resource = tloop )
app.main()
示例14: run_example
# 需要导入模块: from ibvpy.api import TLoop [as 别名]
# 或者: from ibvpy.api.TLoop import eval [as 别名]
def run_example():
from ibvpy.api import \
TStepper as TS, RTraceGraph, RTraceDomainListField, \
RTraceDomainListInteg, TLoop, \
TLine, BCDof, IBVPSolve as IS, DOTSEval
from ibvpy.mats.mats2D.mats2D_conduction.mats2D_conduction import MATS2DConduction
from ibvpy.api import BCDofGroup
fets_eval = FETS2D4Q4T(mats_eval=MATS2DConduction(k=1.))
print fets_eval.vtk_node_cell_data
from ibvpy.mesh.fe_grid import FEGrid
from ibvpy.mesh.fe_refinement_grid import FERefinementGrid
from ibvpy.mesh.fe_domain import FEDomain
from mathkit.mfn import MFnLineArray
# Discretization
fe_grid = FEGrid(coord_max=(1., 1., 0.),
shape=(2, 2),
fets_eval=fets_eval)
tstepper = TS(sdomain=fe_grid,
bcond_list=[BCDofGroup(var='u', value=0., dims=[0],
get_dof_method=fe_grid.get_left_dofs),
# BCDofGroup( var='u', value = 0., dims = [1],
# get_dof_method = fe_grid.get_bottom_dofs ),
BCDofGroup(var='u', value=.005, dims=[0],
get_dof_method=fe_grid.get_top_right_dofs)],
rtrace_list=[
# RTraceDomainListField(name = 'Damage' ,
# var = 'omega', idx = 0,
# record_on = 'update',
# warp = True),
# RTraceDomainListField(name = 'Displacement' ,
# var = 'u', idx = 0,
# record_on = 'update',
# warp = True),
# RTraceDomainListField(name = 'N0' ,
# var = 'N_mtx', idx = 0,
# record_on = 'update')
]
)
print tstepper.setup()
return
# Add the time-loop control
tloop = TLoop(tstepper=tstepper, debug=False,
tline=TLine(min=0.0, step=1.0, max=1.0))
tloop.eval()
示例15: notched_bended_beam
# 需要导入模块: from ibvpy.api import TLoop [as 别名]
# 或者: from ibvpy.api.TLoop import eval [as 别名]
def notched_bended_beam():
fets_eval_4u = FETS2D4Q( mats_eval = MATS2DScalarDamage() )
fets_eval_cracked = FETSLSEval( parent_fets = fets_eval_4u )
# Discretization
fe_domain1 = FEGrid( coord_max = (5.,2.,0.),
shape = (3,2),
fets_eval = fets_eval_4u )
fe_child_domain = FERefinementGrid( parent_domain = fe_domain1,
fets_eval = fets_eval_cracked,
fine_cell_shape = (1,1) )
crack_level_set = lambda X: X[0] - 2.5
fe_child_domain.refine_elem( (1,0), crack_level_set )
dots = fe_child_domain.new_dots()
fe_domain = FEDomainList( subdomains = [ fe_domain1 ] )
fe_domain_tree = FEDomainTree( domain_list = fe_domain )
ts = TS( dof_resultants = True,
sdomain = [ fe_domain1, fe_child_domain ],
bcond_list = [BCDofGroup(var='u', value = 0., dims = [0,1],
get_dof_method = fe_domain1.get_left_dofs ),
BCDofGroup(var='u', value = 0., dims = [0,1],
get_dof_method = fe_domain1.get_right_dofs ),
BCDofGroup(var='f', value = -1., dims = [1],
get_dof_method = fe_domain1.get_top_dofs ),
],
rtrace_list = [
# RTraceGraph(name = 'Fi,right over u_right (iteration)' ,
# var_y = 'F_int', idx_y = 0,
# var_x = 'U_k', idx_x = 1),
# RTraceDomainListField(name = 'Stress' ,
# var = 'sig_app', idx = 0, warp = True ),
# RTraceDomainField(name = 'Displacement' ,
# var = 'u', idx = 0),
# RTraceDomainField(name = 'N0' ,
# var = 'N_mtx', idx = 0,
# record_on = 'update')
#
]
)
# Add the time-loop control
tloop = TLoop( tstepper = ts,
tline = TLine( min = 0.0, step = 1, max = 1.0 ))
print tloop.eval()