Example #1
0
def elem_dep_data_t4(na, nb, nt):
    fens, fes = t4_block(a, b, t, na, nb, nt, orientation='a')
    femm = FEMMDeforLinear(material=m,
                           fes=fes,
                           integration_rule=TetRule(npts=1))
    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=TriRule(npts=1))
    return fens, femm, sfemm
    def __init__(self, material=None, fes=None, integration_rule=None,
                 material_csys=CSys(), assoc_geom=None):
        """Constructor.

        :param material: Material object.
        :param fes: Finite element set object.
        :param integration_rule: Integration rule object.
        """
        integration_rule = TetRule(npts=4) if integration_rule is None else integration_rule
        super().__init__(fes=fes, material=material, integration_rule=integration_rule,
                         material_csys=material_csys, assoc_geom=assoc_geom)
        self._gamma = 2.6 #one of the stabilization parameters
        self._C = 1.e4 #the other stabilization parameter
Example #3
0
print(fes.conn.shape)
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, W, 0, 0, 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)
cn = fenode_select(fens, box=numpy.array([W, W, 0, L, 0, H]), inflate=htol)
for j in cn:
    u.set_ebc([j], comp=0, val=0.0)
u.apply_ebc()
femm = FEMMDeforLinearQT10MS(material=m,
                             fes=fes,
                             integration_rule=TetRule(npts=4))
femm.associate_geometry(geom)
S = femm.connection_matrix(geom)
perm = reverse_cuthill_mckee(S, symmetric_mode=True)
u.numberdofs(node_perm=perm)
#u.numberdofs()
print('Number of degrees of freedom', u.nfreedofs)
start = time.time()
bfes = mesh_boundary(fes)
fesel = fe_select(fens, bfes, box=[0, W, L, L, 0, H], inflate=htol)
fi = ForceIntensity(magn=lambda x, J: numpy.array([0, 0, magn]))
tsfes = bfes.subset(fesel)
sfemm = FEMMDeforLinear(fes=tsfes, integration_rule=TriRule(npts=3))
F = sfemm.distrib_loads(geom, u, fi, 2)
print(numpy.sum(F))
start = time.time()
Example #4
0
magn = -0.2 * 12.2334 / 4
Force = magn * W * H * 2
Force * L**3 / (3 * E * W * H**3 * 2 / 12)
uzex = -12.0935378981478
m = MatDeforTriaxLinearIso(e=E, nu=nu)

start = time.time()
fens, fes = t4_block(W, L, H, nW, nL, nH, orientation='ca')
fens, fes = t4_to_t10(fens, fes)
print('Mesh generation', time.time() - start)

model_data = {}
model_data['fens'] = fens
model_data['regions'] = [{
    'femm':
    FEMMDeforLinear(material=m, fes=fes, integration_rule=TetRule(npts=4))
}]

algo_common.plot_mesh(model_data)

model_data['boundary_conditions'] = {}
# Clamped face
cn = fenode_select(fens, box=numpy.array([0, W, 0, 0, 0, H]), inflate=htol)
essential = [
    {
        'node_list': cn,
        'comp': 0,
        'value': lambda x: 0.0
    },
    {
        'node_list': cn,