示例#1
0
                               tstep_all=True,
                               vars=[1, 4],
                               primvars=[1])

# time functions (time functions parameter f(t) has to be written as f_t - due to the parenthesis, otherwise all kw keys match oofem input file ones)
# if no domain specified, ltf is asigned to the last one created (valid for all FEMComponents classes)
# if no number is specified, domain.umberOfLoadTimeFunctions+1 is used (valid for all FEMComponents classes, e.g. domain.numberOfElements+1 is used for elements instead ot numberOfLoadTimeFunctions)
ltf1 = liboofem.peakFunction(1, domain, t=1, f_t=1)
ltf2 = liboofem.peakFunction(2, domain, t=2, f_t=1)
ltf3 = liboofem.peakFunction(3, domain, t=3, f_t=1)
ltfs = (ltf1, ltf2, ltf3)

# boundary conditions
# loadTimeFunction parameter can be specified as int value or as LoadTimeFunction itself (valid for all objects with giveNumber() method)
bc1 = liboofem.boundaryCondition(1,
                                 domain,
                                 loadTimeFunction=1,
                                 prescribedValue=0.0)
bc2 = liboofem.boundaryCondition(2,
                                 domain,
                                 loadTimeFunction=2,
                                 prescribedValue=-.006e-3)
eLoad = liboofem.constantEdgeLoad(3,
                                  domain,
                                  loadTimeFunction=ltf1,
                                  components=(0., 10., 0.),
                                  loadType=3,
                                  ndofs=3)
nLoad = liboofem.nodalLoad(4,
                           domain,
                           loadTimeFunction=1,
                           components=(-18., 24., 0.))
示例#2
0
                               vars=[1, 4],
                               primvars=[1],
                               cellvars=[47])
exportModuleManager = problem.giveExportModuleManager()
exportModuleManager.resizeModules(1)
exportModuleManager.setModule(1, vtkxmlModule)

# boundary condition and time function
ltf = liboofem.loadTimeFunction("pieceWiseLinFunction",
                                1,
                                nSteps=2,
                                t=(0, 2e-1),
                                f_t=(0, 1))
bcs = [
    liboofem.boundaryCondition(i + 1,
                               domain,
                               loadTimeFunction=1,
                               prescribedValue=v)
    for i, v in enumerate((0, -1.0))
]

# nodes
nodes = (
    liboofem.node(1, domain, coords=(0, 0, 3), bc=(1, 1, 2)),
    liboofem.node(2, domain, coords=(0, 1, 3), bc=(1, 1, 2)),
    liboofem.node(3, domain, coords=(1, 1, 3), bc=(1, 1, 2)),
    liboofem.node(4, domain, coords=(1, 0, 3), bc=(1, 1, 2)),
    liboofem.node(5, domain, coords=(0, 0, 2), bc=(1, 1, 0)),
    liboofem.node(6, domain, coords=(0, 1, 2), bc=(1, 1, 0)),
    liboofem.node(7, domain, coords=(1, 1, 2), bc=(1, 1, 0)),
    liboofem.node(8, domain, coords=(1, 0, 2), bc=(1, 1, 0)),
    liboofem.node(9, domain, coords=(0, 0, 1), bc=(1, 1, 0)),
示例#3
0
文件: test2.py 项目: Micket/oofem
domain = liboofem.domain(1, 1, problem, liboofem.domainType._2dBeamMode, tstep_all=True, dofman_all=True, element_all=True)
problem.setDomain(1, domain, True)
vtkxmlModule = liboofem.vtkxml(1,problem,tstep_all=True,vars=[1,4],primvars=[1])


# time functions (time functions parameter f(t) has to be written as f_t - due to the parenthesis, otherwise all kw keys match oofem input file ones)
# if no domain specified, ltf is asigned to the last one created (valid for all FEMComponents classes)
# if no number is specified, domain.umberOfLoadTimeFunctions+1 is used (valid for all FEMComponents classes, e.g. domain.numberOfElements+1 is used for elements instead ot numberOfLoadTimeFunctions)
ltf1 = liboofem.peakFunction(1, domain, t=1, f_t=1)
ltf2 = liboofem.peakFunction(2, domain, t=2, f_t=1)
ltf3 = liboofem.peakFunction(3, domain, t=3, f_t=1)
ltfs = (ltf1, ltf2, ltf3)

# boundary conditions
# loadTimeFunction parameter can be specified as int value or as LoadTimeFunction itself (valid for all objects with giveNumber() method)
bc1   = liboofem.boundaryCondition(    1, domain, loadTimeFunction=1,    prescribedValue=0.0)
bc2   = liboofem.boundaryCondition(    2, domain, loadTimeFunction=2,    prescribedValue=-.006e-3)
eLoad = liboofem.constantEdgeLoad(     3, domain, loadTimeFunction=1, components=(0.,10.,0.), loadType=3, ndofs=3)
nLoad = liboofem.nodalLoad(            4, domain, loadTimeFunction=1,    components=(-18.,24.,0.))
tLoad = liboofem.structTemperatureLoad(5, domain, loadTimeFunction=3, components=(30.,-20.))
bcs = (bc1, bc2, eLoad, nLoad, tLoad)

# nodes
# if one value is passed as parameter where oofem expects array of values, it must be passed as tuple or list (see load in n4)
n1 = liboofem.node(1, domain, coords=(0., 0.,0. ), bc=(0,1,0))
n2 = liboofem.node(2, domain, coords=(2.4,0.,0. ), bc=(0,0,0))
n3 = liboofem.node(3, domain, coords=(3.8,0.,0. ), bc=(0,0,bc1))
n4 = liboofem.node(4, domain, coords=(5.8,0.,1.5), bc=(0,0,0), load=(4,))
n5 = liboofem.node(5, domain, coords=(7.8,0.,3.0), bc=(0,1,0))
n6 = liboofem.node(6, domain, coords=(2.4,0.,3.0), bc=(bc1,1,bc2))
nodes = (n1, n2, n3, n4, n5, n6)