Skip to main content

No project description provided

Project description

3pc-material

3pc-material is a Python package for material description, specifically designed to handle orthotropic materials and failure theories like Tsai-Wu.

Installation

The package is publicly available on PyPI. You can install it using pip:

pip install 3pc-material

API Reference

Orthotropic Class

The primary component of this package is the Orthotropic class, which holds material properties and dynamically calculates properties for failure theories.

from material.orthotropic import Orthotropic

Required Parameters

When initializing Orthotropic directly, the following parameters are required:

  • matID (str): Orthotropic material id.
  • E1 (float): Elastic modulus in direction 1.
  • E2 (float): Elastic modulus in direction 2.
  • G12 (float): Shear modulus in 12 plane.
  • G13 (float): Transverse shear modulus in 13 plane.
  • G23 (float): Transverse shear modulus in 23 plane.
  • v12 (float): Poisson's ratio in 21 plane.

Optional Physical Properties (Default: 0.0)

  • rho (float): Density.
  • alpha1 (float): Coefficient of thermal expansion in direction 1.
  • alpha2 (float): Coefficient of thermal expansion in direction 2.
  • beta1 (float): Coefficient of hygral expansion in direction 1.
  • beta2 (float): Coefficient of hygral expansion in direction 2.

Optional Allowable Properties for Failure Theories (Default: 0.0)

  • eps11_tension_allowable (float): Allowable tensile strain in direction 1.
  • eps11_compression_allowable (float): Allowable compressive strain in direction 1.
  • eps22_tension_allowable (float): Allowable tensile strain in direction 2.
  • eps22_compression_allowable (float): Allowable compressive strain in direction 2.
  • gamma12_allowable (float): Allowable shear strain in 12 plane.
  • gamma23_allowable (float): Allowable shear strain in 23 plane.
  • gamma13_allowable (float): Allowable shear strain in 13 plane.
  • sig11_tension_allowable (float): Allowable tensile stress in direction 1.
  • sig11_compression_allowable (float): Allowable compressive stress in direction 1.
  • sig22_tension_allowable (float): Allowable tensile stress in direction 2.
  • sig22_compression_allowable (float): Allowable compressive stress in direction 2.
  • tau12_allowable (float): Allowable shear stress in 12 plane.
  • tau23_allowable (float): Allowable shear stress in 23 plane.
  • tau13_allowable (float): Allowable shear stress in 13 plane.

Calculated Properties

The class automatically calculates the following properties lazily:

  • v21: Poisson's ratio in 21 plane. Formula: v12 * (E2 / E1).
  • F1: Tsai-Wu parameter. Formula: (1.0 / sig11_tension_allowable) + (1.0 / sig11_compression_allowable).
  • F2: Tsai-Wu parameter. Formula: (1.0 / sig22_tension_allowable) + (1.0 / sig22_compression_allowable).
  • F11: Tsai-Wu parameter. Formula: -1.0 / (sig11_tension_allowable * sig11_compression_allowable).
  • F22: Tsai-Wu parameter. Formula: -1.0 / (sig22_tension_allowable * sig22_compression_allowable).
  • F12: Tsai-Wu parameter. Formula: -0.5 * sqrt(F11 * F22).

Methods

Orthotropic.fromDict(**kwargs)

Initializes an Orthotropic instance using a dictionary of keyword arguments. This is ideal for loading configurations from JSON files or dictionaries. Defaults apply identically to standard initialization.


Usage Examples

Basic Initialization

from material.orthotropic import Orthotropic

ortho = Orthotropic(
    matID="zg",
    E1=181.0,
    E2=10.3,
    G12=7.17,
    G13=7.17,
    G23=7.17,
    v12=0.28,
    sig11_tension_allowable=1500.0,
    sig11_compression_allowable=-1500.0,
    sig22_tension_allowable=50.0,
    sig22_compression_allowable=-150.0
)

print(f"Poisson's ratio v21: {ortho.v21}")
print(f"Tsai-Wu F1 parameter: {ortho.F1}")

Initializing from a Dictionary

You can load your materials directly from a JSON source.

// examples/material.json
{
    "materials": [
        {
            "matID": "zg",
            "E1": 181.0,
            "E2": 10.3,
            "G12": 7.17,
            "G13": 7.17,
            "G23": 7.17,
            "v12": 0.28,
            "rho": 1.6,
            "sig11_tension_allowable": 1500.0,
            "sig11_compression_allowable": -1200.0,
            "sig22_tension_allowable": 50.0,
            "sig22_compression_allowable": -250.0
        }
    ]
}
import json
from material.orthotropic import Orthotropic

with open('examples/material.json', 'r') as f:
    data = json.load(f)

materials = [Orthotropic.fromDict(**mat_dict) for mat_dict in data["materials"]]

for mat in materials:
    print(f"Material ID: {mat.matID}")
    print(f"Calculated Tsai-Wu F11: {mat.F11}")
    print(f"Calculated Tsai-Wu F22: {mat.F22}")
    print(f"Calculated Tsai-Wu F12: {mat.F12}")

Commands

The package provides a command-line interface entry point. After installing, you can run the main application using:

material

(Currently, this serves as an entry point defined in material.main:main)

Project details


Download files

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

Source Distribution

3pc_material-1.0.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

3pc_material-1.0.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file 3pc_material-1.0.0.tar.gz.

File metadata

  • Download URL: 3pc_material-1.0.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for 3pc_material-1.0.0.tar.gz
Algorithm Hash digest
SHA256 96b27fe2212d47851804cfe6e8f4cc5b403c9933d64d492c249264f7bf294859
MD5 66f1d4ccaf0f019f976e9a2bf4ff52e3
BLAKE2b-256 1d71d62da03530fa748c659ac80b688750571685f2e56a9e48c57a38282e6ee5

See more details on using hashes here.

File details

Details for the file 3pc_material-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: 3pc_material-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for 3pc_material-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9c8173e37ea92964f86956c314a97b0f15b4ca900b9a37e1cf80b2c25952139
MD5 53b0651231221942325807bc87623210
BLAKE2b-256 546bd394f62eb6930fe0f7ecb01fa53a4d5e3be4256c456d96deb99e83a4b2e0

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