How to use the pyansys.examples function in pyansys

To help you get started, we’ve selected a few pyansys examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github akaszynski / pyansys / tests / archive / test_archive.py View on Github external
def test_writesector(tmpdir):
    archive = pyansys.Archive(examples.sector_archive_file)
    filename = str(tmpdir.mkdir("tmpdir").join('tmp.cdb'))
    pyansys.save_as_archive(filename, archive.grid)
    archive_new = pyansys.Archive(filename)

    assert np.allclose(archive.grid.points, archive_new.grid.points)
    assert np.allclose(archive.grid.cells, archive_new.grid.cells)
github akaszynski / pyansys / tests / test_binary_reader.py View on Github external
def result():
    return pyansys.read_binary(examples.rstfile)
github akaszynski / pyansys / tests / test_solid186.py View on Github external
def result():
    return pyansys.read_binary(examples.rstfile)
github akaszynski / pyansys / tests / elements / test_solid239_240.py View on Github external
def result():
    return pyansys.examples.downloads._download_solid239_240()
github akaszynski / pyansys / tests / test_write_archive.py View on Github external
def test_writesector(tmpdir):
    archive = pyansys.ReadArchive(examples.sector_archive_file)
    grid = archive.ParseVTK()

    temp_archive = str(tmpdir.mkdir("tmpdir").join('tmp.cdb'))
    pyansys.WriteArchive(temp_archive, grid)

    archive2 = pyansys.ReadArchive(temp_archive)
    grid2 = archive.ParseVTK()

    assert np.allclose(grid.points, grid2.points)
    assert np.allclose(grid.cells, grid2.cells)
github akaszynski / pyansys / tests / test_examples.py View on Github external
def test_show_hex_archive():
    examples.show_hex_archive(off_screen=True)
github akaszynski / pyansys / tests / test_database.py View on Github external
import pytest
import numpy as np
import pyansys

archive = pyansys.Archive(pyansys.examples.hexarchivefile)
d_v150 = pyansys.read_binary(pyansys.examples.hex_database_v150, debug=True)
d_v194 = pyansys.read_binary(pyansys.examples.hex_database_v194, debug=True)


@pytest.mark.parametrize('database', [d_v150, d_v194])
def test_nodes(database):
    assert np.allclose(database.nodes, archive.nodes[:, :3])


@pytest.mark.parametrize('database', [d_v150, d_v194])
def test_node_num(database):
    assert np.allclose(database.nnum, archive.nnum)


@pytest.mark.parametrize('database', [d_v150, d_v194])
def test_enum(database):
    assert np.allclose(database.enum, archive.enum)