Skip to main content

Rayse

A fast hp-FEA library for linear elasticity and the relaxed micromorphic model. The library exposes models for full three-dimensional-, plane-strain- and antiplane-shear models with a common user interface.

Installation

Use the package manager pip to install Rayse:

pip install rayse

Usage

Example for a relaxed micromorphic model of plane-strain. In this example, the python library meshzoo is used to generate the mesh.

from rayse.relaxed_plane_strain import *
from rayse.plot import *
from rayse.consts import *
import meshzoo

# Example mesh generation with meshzoo
h = 0.25

pts, cells = meshzoo.ngon(4, int(1. / h))
pts, cells = pts.tolist(), cells.tolist()

# Define element power and plot resolution
p = 7
res = 5

# Initialize the mesh object
mesh = Mesh(pts, cells, 2)
# Create a group for the outher boundary
outer = mesh.def_outer()

# Initialize the computational domain
dom = Dom(mesh)

# Define group "outer" as the Dirichlet boundary
dom.set_boundary(outer)

# Get the number of degrees of freedom
free_dofs, constrained_dofs = dom.dofs()

# Plot the mesh
sys = plot_curves(*dom.plot_sys())
plot(sys).show()

# Define material constants
lam = 11.54
mu = 7.69
c_ec = venant(lam, mu, 2)
c_ecm = venant(2. * lam, 2. * mu, 2)
mulc = 1.

# Set material constants
dom.set_consts(c_ec, c_ecm, mulc)

# Embed a Dirichlet boundary condition on the outer group
dom.embed_bcond(lambda x, y: [sin(x), cos(y)], outer)

# Set force and micro-moment
dom.set_force(lambda x, y: [0., 0.])

# Solve
dom.solve()

# Retrieve results
dom.set_vals()

# Plot results
curves = plot_curves(*dom.plot_curves(res))
surface = plot_surf(*dom.plot_disp(res), opacity=0.9)
plot(curves, surface).show()

# Plot the flux of the microdistorion for the x-axis
flux = plot_flux(*dom.plot_flux(res, 1))
plot(sys, flux).show()

License

Rayse is licensed under GNU LGPLv3.

This software relies on the PyO3 library under the Apache-2.0 license for ffi and on the rayon crate under the MIT and Apache-2.0 licenses for parallelism. The library also exposes a small wrapper for the Plotly library under the MIT license for the purpose of visualization.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rayse-0.1.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file rayse-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rayse-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.1

File hashes

Hashes for rayse-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bce4689c96821bf377658a80c274284c8f0500509a9a025027323d514920254c
MD5 b233128d26d1fc7ba2a69253872e8516
BLAKE2b-256 d23a96b500363660fe453906dc7e95707b01d8ae947aed7af1ef2381f0cdc89d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page