Пример #1
0
                                       loadTimeFunction=ltf3,
                                       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)

# material and cross section
mat = liboofem.isoLE(1, domain, d=1., E=30.e6, n=0.2, tAlpha=1.2e-5)
cs = liboofem.simpleCS(1,
                       domain,
                       area=0.162,
                       Iy=0.0039366,
                       beamShearCoeff=1.e18,
                       thick=0.54)

# elements
e1 = liboofem.beam2d(1,
                     domain,
                     nodes=(1, n2),
                     mat=1,
                     crossSect=1,
                     boundaryLoads=(3, 1),
                     bodyLoads=(5, ))
Пример #2
0
# domain
domain = liboofem.domain(1, 1, problem, liboofem.domainType._3dMode, tstep_step=10000, dofman_all=True, element_all=True)
problem.setDomain(1, domain, True)

# vtkxml
vtkxmlModule = liboofem.vtkxml(1,problem,tstep_step=10000,vars=[1,4],primvars=[1])
exportModuleManager = problem.giveExportModuleManager()
exportModuleManager.resizeModules(1)
exportModuleManager.setModule(1,vtkxmlModule)

# boundary condition and time function
ltf = liboofem.loadTimeFunction("ConstantFunction",1,f_t=1.)

# material and cross section
mat = liboofem.isoLE(1, domain, d=3000, E=3e6, n=0.2, tAlpha=0)
cs  = liboofem.simpleCS(1, domain)

nodes, elems, ics = createNodesAndElemsAndIcs(sphereVals)

# add eveything to domain (resize container first)
domain.resizeDofManagers(len(nodes))
for n in nodes:
	domain.setDofManager(n.number, n)
domain.resizeElements(len(elems))
for e in elems:
	domain.setElement(e.number, e)
domain.resizeMaterials(1)
domain.setMaterial(1, mat)
domain.resizeCrossSectionModels(1)
domain.setCrossSection(1, cs)
Пример #3
0
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)

# material and cross section
mat = liboofem.isoLE(1, domain, d=1., E=30.e6, n=0.2, tAlpha=1.2e-5)
cs  = liboofem.simpleCS(1, domain, area=0.162, Iy=0.0039366, beamShearCoeff=1.e18, thick=0.54)

# elements
e1 = liboofem.beam2d(1, domain, nodes=(1,n2),  mat=1,   crossSect=1,  boundaryLoads=(3,1), bodyLoads=(5,))
e2 = liboofem.beam2d(2, domain, nodes=(2,3),   mat=mat, crossSect=1,  DofsToCondense=(6,), bodyLoads=[tLoad])
e3 = liboofem.beam2d(3, domain, nodes=(n3,4),  mat=1,   crossSect=cs, dofstocondense=[3])
e4 = liboofem.beam2d(4, domain, nodes=(n4,n5), mat=mat, crossSect=cs)
e5 = liboofem.beam2d(5, domain, nodes=(n6,2),  mat=1,   crossSect=1,  DofsToCondense=(6,))
elems = (e1, e2, e3, e4, e5)

# add eveything to domain (resize container first to save some time, but it is not necessary 0 see ltfs)
domain.resizeDofManagers(len(nodes))
for n in nodes:
   domain.setDofManager(n.number, n)
domain.resizeElements(len(elems))
Пример #4
0
# boundary condition and time function
ltf = liboofem.loadTimeFunction("pieceWiseLinFunction",
                                1,
                                nSteps=2,
                                t=(0, 1e-1),
                                f_t=(0, 1))
bc = liboofem.boundaryCondition(1,
                                domain,
                                loadTimeFunction=1,
                                prescribedValue=0.0)

# nodes
nodes = createOofemNodes()

# material and cross section
mat = liboofem.isoLE(1, domain, d=2000, E=1e9, n=0.2, tAlpha=0)
cs = liboofem.simpleCS(1, domain, thick=.01)

# elements
elems = createOofemElems()

# add eveything to domain (resize container first)
domain.resizeDofManagers(len(nodes))
for n in nodes:
    domain.setDofManager(n.number, n)
domain.resizeElements(len(elems))
for e in elems:
    domain.setElement(e.number, e)
domain.resizeMaterials(1)
domain.setMaterial(1, mat)
domain.resizeCrossSectionModels(1)