Esempio n. 1
0
# *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
# *   USA                                                                   *
# *                                                                         *
# ***************************************************************************

from __future__ import print_function, division
import math
import numpy as np

from dolfin import *
from FenicsSolver import LinearElasticitySolver
from FenicsSolver import NonlinearElasticitySolver
from FenicsSolver import SolverBase

from config import is_interactive
interactively = is_interactive()
set_log_level(ERROR)


def test():

    # Create mesh and define function space
    mesh = UnitCubeMesh(24, 16, 16)
    V = VectorFunctionSpace(mesh, "Lagrange", 1)

    B = Constant((0.0, -0.5, 0.0))  # Body force per unit volume
    T = Constant((0.1, 0.0, 0.0))  # Traction force on the boundary, for all?

    # Mark boundary subdomians
    left = CompiledSubDomain("near(x[0], side) && on_boundary", side=0.0)
    right = CompiledSubDomain("near(x[0], side) && on_boundary", side=1.0)
Esempio n. 2
0
# *   GNU Library General Public License for more details.                  *
# *                                                                         *
# *   You should have received a copy of the GNU Library General Public     *
# *   License along with this program; if not, write to the Free Software   *
# *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
# *   USA                                                                   *
# *                                                                         *
# ***************************************************************************

from __future__ import print_function, division
"""
This is outdated, served solver for FreeCAD CFD GUI 
"""

from config import is_interactive
interactively = is_interactive()  # manual set it False to debug solver

from FenicsSolver.main import load_settings
from FenicsSolver import ScalarTransportSolver


def test_elasticity():
    pass


def test_CFD():
    #
    raise NotImplementedError(
        "currently, CFD test is not usable, try CFD test in examples folder")
    df = '../data/TestCFD.json'
    settings = load_settings(df)  # force python2 load ascii string