Skip to main content

No project description provided

Project description

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.

Project details


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

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rayse-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fed7c268ec1ca637b4917dd9adfe590b0c171becbff1042fe96ae90111413823
MD5 804eb19a0c465b245ae30d6b1dd0b894
BLAKE2b-256 bc2a5ed3ab9785a253aee9d744f8d14f97da22b59a5a18c777c620d8e8fe02c3

See more details on using hashes here.

Supported by

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