Page MenuHomec4science

rod_3d.py
No OneTemporary

File Metadata

Created
Thu, Oct 31, 18:32

rod_3d.py

# Copyright (C) 2018 by the RROMPy authors
#
# This file is part of RROMPy.
#
# RROMPy is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# RROMPy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with RROMPy. If not, see <http://www.gnu.org/licenses/>.
#
import fenics as fen
from rrompy.hfengines.vector_linear_problem import (
LinearElasticityProblemEngine)
def rod3Dsolver():
mesh = fen.Mesh("./tests/test_2_hfengines/rod.xml")
rho_ = 1e3
nu = .45
E = 1e6
g = 1e3
solver = LinearElasticityProblemEngine(verbosity = 0)
solver.V = fen.VectorFunctionSpace(mesh, "P", 1)
solver.lambda_ = E * nu / (1. + nu) / (1. - 2 * nu)
solver.mu_ = E / (1. + nu)
solver.forcingTerm = [fen.Constant((0., - rho_ * g / E, 0.)),
fen.Constant((0., 0., 0.))]
solver.DirichletBoundary = lambda x, on_b: on_b and fen.near(x[2], 0.)
solver.NeumannBoundary = "REST"
return solver

Event Timeline