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, p)
# 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 y-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.

Metadata

Release files for rayse 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for rayse 0.1.1
File Interpreter ABI Platform Actions
rayse-0.1.1-py3-none-any.whl Python 3 none any Details for rayse-0.1.1-py3-none-any.whl

Release files / rayse-0.1.1-py3-none-any.whl

Download URL rayse-0.1.1-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fed7c268ec1ca637b4917dd9adfe590b0c171becbff1042fe96ae90111413823
BLAKE2b-256 checksum
How to use checksums
bc2a5ed3ab9785a253aee9d744f8d14f97da22b59a5a18c777c620d8e8fe02c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.2

Security for rayse 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page