コード例 #1
0
def elem_dep_data_h20r(na, nb, nt):
    fens, fes = h8_block(a, b, t, na, nb, nt)
    fens, fes = h8_to_h20(fens, fes)
    femm = FEMMDeforLinear(material=m,
                           fes=fes,
                           integration_rule=GaussRule(dim=3, order=2))
    bfes = mesh_boundary(femm.fes)
    fesel = fe_select(fens, bfes, box=[a, a, 0, b, 0, t], inflate=htol)
    tsfes = bfes.subset(fesel)
    sfemm = FEMMDeforLinear(fes=tsfes,
                            integration_rule=GaussRule(dim=2, order=2))
    return fens, femm, sfemm
コード例 #2
0
def elem_dep_data_h20r(na, nb, nts):
    print(na, nb, nts)
    # fens, fes = t4_block(a, b, t, na, nb, nt, orientation='a')
    fens, fes = h8_composite_plate(a, b, ts, na, nb, nts)
    fens, fes = h8_to_h20(fens, fes)
    bfes = mesh_boundary(fes)
    t = sum(ts)
    fesel = fe_select(fens, bfes, box=[0, a, 0, b, t, t], inflate=htol)
    tsfes = bfes.subset(fesel)
    femms = []
    for layer in range(len(nts)):
        aangle = angles[layer] / 180. * math.pi
        mcsys = CSys(matrix=rotmat(numpy.array([0.0, 0.0, aangle])))
        el = fe_select(fens, fes, bylabel=True, label=layer)
        femms.append(
            FEMMDeforLinear(material=m,
                            material_csys=mcsys,
                            fes=fes.subset(el),
                            integration_rule=GaussRule(dim=3, order=2)))
    sfemm = FEMMDeforLinear(fes=tsfes,
                            integration_rule=GaussRule(dim=2, order=2))
    return fens, femms, sfemm
コード例 #3
0
start0 = time.time()
E = 200e9
nu = 0.3
rho = 8000
a = 10.0
b = a
h = 0.05

htol = h / 1000
na, nb, nh = 6,6,4
m = MatDeforTriaxLinearIso(rho=rho, e=E, nu=nu)

start = time.time()
fens, fes = h8_block(a, b, h, na, nb, nh)
fens, fes = h8_to_h20(fens, fes)
print('Mesh generation', time.time() - start)
geom = NodalField(fens=fens)
u = NodalField(nfens=fens.count(), dim=3)
cn = fenode_select(fens, box=numpy.array([0, 0, 0, b, 0, h]), inflate=htol)
for j in cn:
    u.set_ebc([j], comp=0, val=0.0)
    u.set_ebc([j], comp=1, val=0.0)
    u.set_ebc([j], comp=2, val=0.0)
u.apply_ebc()
femmk = FEMMDeforLinear(material=m, fes=fes, integration_rule=GaussRule(dim=3, order=2))
femmk.associate_geometry(geom)
u.numberdofs()
print('Number of degrees of freedom', u.nfreedofs)
start = time.time()
K = femmk.stiffness(geom, u)