Exemple #1
0
# vtkxml
vtkxmlModule = liboofem.vtkxml(1,
                               problem,
                               tstep_step=10000,
                               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)),
# engngModel
problem = liboofem.engngModel("nldeidynamic",1,nSteps=10,dumpCoef=0,deltaT=1,outFile="/tmp/contact1_oofem.out")

# 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)