コード例 #1
0
def _gen_lines_2_4(bbox, eps):
    from sfepy.discrete.probes import LineProbe

    LineProbe.__base__.cache = Struct(name='probe_shared_evaluate_cache')

    n_point = 100

    line0 = LineProbe([bbox[0, 0], -eps], [bbox[1, 0], -eps], n_point)
    line1 = LineProbe([bbox[0, 0], eps], [bbox[1, 0], eps], n_point)

    yield line0, line1

    line0 = LineProbe([-eps, bbox[0, 1]], [-eps, bbox[1, 1]], n_point)
    line1 = LineProbe([eps, bbox[0, 1]], [eps, bbox[1, 1]], n_point)

    yield line0, line1
コード例 #2
0
def gen_lines(problem):
    """
    Define a line probe and a circle probe.
    """
    # Use enough points for higher order approximations.
    n_point = 1000

    p0, p1 = nm.array([0.0, 0.0, 0.0]), nm.array([0.1, 0.0, 0.0])
    line = LineProbe(p0, p1, n_point)
    # Workaround current probe code shortcoming.
    line.set_options(close_limit=0.5)

    centre = 0.5 * (p0 + p1)
    normal = [0.0, 1.0, 0.0]
    r = 0.019
    circle = CircleProbe(centre, normal, r, n_point)
    circle.set_options(close_limit=0.0)

    probes = [line, circle]
    labels = ['%s -> %s' % (p0, p1), 'circle(%s, %s, %s' % (centre, normal, r)]

    return probes, labels
コード例 #3
0
ファイル: sfepy_example1.py プロジェクト: nikolajkiel/nikolaj
def gen_lines(problem):
    """
    Define a line probe and a circle probe.
    """
    # Use enough points for higher order approximations.
    n_point = 1000

    p0, p1 = nm.array([0.0, 0.0, 0.0]), nm.array([0.1, 0.0, 0.0])
    line = LineProbe(p0, p1, n_point)
    # Workaround current probe code shortcoming.
    line.set_options(close_limit=0.5)

    centre = 0.5 * (p0 + p1)
    normal = [0.0, 1.0, 0.0]
    r = 0.019
    circle = CircleProbe(centre, normal, r, n_point)
    circle.set_options(close_limit=0.0)

    probes = [line, circle]
    labels = ['%s -> %s' % (p0, p1),
              'circle(%s, %s, %s' % (centre, normal, r)]

    return probes, labels
コード例 #4
0
def gen_lines(problem):
    from sfepy.discrete.probes import LineProbe
    ps0 = [[0.0, 0.0], [0.0, 0.0]]
    ps1 = [[75.0, 0.0], [0.0, 75.0]]

    # Use adaptive probe with 10 inital points.
    n_point = -10

    labels = ['%s -> %s' % (p0, p1) for p0, p1 in zip(ps0, ps1)]
    probes = []
    for ip in range(len(ps0)):
        p0, p1 = ps0[ip], ps1[ip]
        probes.append(LineProbe(p0, p1, n_point))

    return probes, labels
コード例 #5
0
ファイル: its2D_interactive.py プロジェクト: uberstig/sfepy
def gen_lines(problem):
    """
    Define two line probes.

    Additional probes can be added by appending to `ps0` (start points) and
    `ps1` (end points) lists.
    """
    ps0 = [[0.0, 0.0], [0.0, 0.0]]
    ps1 = [[75.0, 0.0], [0.0, 75.0]]

    # Use enough points for higher order approximations.
    n_point = 1000

    labels = ['%s -> %s' % (p0, p1) for p0, p1 in zip(ps0, ps1)]
    probes = []
    for ip in xrange(len(ps0)):
        p0, p1 = ps0[ip], ps1[ip]
        probes.append(LineProbe(p0, p1, n_point))

    return probes, labels
コード例 #6
0
def gen_lines(problem):
    """
    Define three line probes in axial directions.

    Parameters
    ----------
    problem : Problem instance
        The current Problem instance.

    Returns
    -------
    probes : list
        The list of the probes.
    labels : list
        The list of probe labels.
    """
    from sfepy.discrete.probes import LineProbe

    mesh = problem.domain.mesh
    bbox = mesh.get_bounding_box()
    cx, cy, cz = 0.5 * bbox.sum(axis=0)
    print bbox
    print cx, cy, cz

    # Probe end points.
    ps0 = [[bbox[0, 0], cy, cz], [cx, bbox[0, 1], cz], [cx, cy, bbox[0, 2]]]
    ps1 = [[bbox[1, 0], cy, cz], [cx, bbox[1, 1], cz], [cx, cy, bbox[1, 2]]]

    # Use adaptive probe with 10 inital points.
    n_point = -10

    labels = ['%s -> %s' % (p0, p1) for p0, p1 in zip(ps0, ps1)]
    probes = []
    for ip in xrange(len(ps0)):
        p0, p1 = ps0[ip], ps1[ip]
        probes.append(LineProbe(p0, p1, n_point))

    return probes, labels