コード例 #1
0
ファイル: 08.py プロジェクト: Richardma/hermes2d
#! /usr/bin/env python

from hermes2d import Mesh, H1Shapeset, PrecalcShapeset, H1Space, \
        LinSystem, WeakForm, DummySolver, Solution, ScalarView, VectorView

from hermes2d.examples.c08 import set_bc, set_forms
from hermes2d.examples import get_cylinder_mesh

mesh = Mesh()
mesh.load(get_cylinder_mesh())
#mesh.refine_element(0)
#mesh.refine_all_elements()
mesh.refine_towards_boundary(5, 3)
shapeset = H1Shapeset()
pss = PrecalcShapeset(shapeset)

# create an H1 space
xvel = H1Space(mesh, shapeset)
yvel = H1Space(mesh, shapeset)
press = H1Space(mesh, shapeset)
xvel.set_uniform_order(2)
yvel.set_uniform_order(2)
press.set_uniform_order(1)

set_bc(xvel, yvel, press)

ndofs = 0
ndofs += xvel.assign_dofs(ndofs)
ndofs += yvel.assign_dofs(ndofs)
ndofs += press.assign_dofs(ndofs)
コード例 #2
0
ファイル: test_examples.py プロジェクト: Zhonghua/hermes2d
    H1OrthoHP,
    RefSystem,
)
from hermes2d.forms import set_forms
from hermes2d.examples import (
    get_example_mesh,
    get_sample_mesh,
    get_cylinder_mesh,
    get_07_mesh,
    get_cathedral_mesh,
    get_bracket_mesh,
)

domain_mesh = get_example_mesh()
sample_mesh = get_sample_mesh()
cylinder_mesh = get_cylinder_mesh()


def test_example_01():
    mesh = Mesh()
    mesh.load(domain_mesh)
    mesh.refine_all_elements()
    mesh.refine_all_elements()
    mesh.refine_all_elements()


def test_example_02():
    set_verbose(False)

    mesh = Mesh()
    mesh.load(domain_mesh)
コード例 #3
0
from hermes2d import Mesh, H1Shapeset, PrecalcShapeset, H1Space, \
        LinSystem, WeakForm, Solution, ScalarView, VonMisesFilter, \
        set_verbose, set_warn_integration, DummySolver, H2D_EPS_HIGH, H2D_FN_DX, \
        H2D_FN_DY, \
    H1Adapt, H1ProjBasedSelector, CandList, \
    RefSystem
from hermes2d.forms import set_forms
from hermes2d.examples import get_example_mesh, get_sample_mesh, \
        get_cylinder_mesh, get_07_mesh, get_cathedral_mesh, get_bracket_mesh

domain_mesh = get_example_mesh()
sample_mesh = get_sample_mesh()
cylinder_mesh = get_cylinder_mesh()


def test_example_01():
    mesh = Mesh()
    mesh.load(domain_mesh)
    mesh.refine_all_elements()
    mesh.refine_all_elements()
    mesh.refine_all_elements()


def test_example_02():
    set_verbose(False)
    P_INIT = 3

    # Load the mesh file
    domain_mesh = get_example_mesh()  # Original L-shape domain
    mesh = Mesh()
    mesh.load(domain_mesh)