Skip to content

Commit

Permalink
Merge pull request #180 from sandialabs/wlc
Browse files Browse the repository at this point in the history
WLC isotensional
  • Loading branch information
mrbuche authored May 8, 2023
2 parents 3feb915 + fda75f2 commit 64ff14a
Show file tree
Hide file tree
Showing 43 changed files with 10,888 additions and 85 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polymers"
version = "0.3.4"
version = "0.3.5"
edition = "2021"
description = "Polymers Modeling Library"
license = "BSD-3-Clause"
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Polymers"
uuid = "8aef037c-a721-4e8a-9d81-eb7093daef2c"
authors = ["mrbuche <[email protected]>"]
version = "0.3.4"
version = "0.3.5"

[deps]
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Expand Down
30 changes: 3 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ The library can be installed as a Python package:
pip install polymers
```

If Rust is installed, the latest edition of the library can be installed from the GitHub repository:

```shell
git clone [email protected]:sandialabs/Polymers.git
cd Polymers/
pip install maturin
maturin build --features python
pip install target/wheels/*.whl
```

## Julia

[![docs (stable)](https://raw.githubusercontent.com/sandialabs/Polymers/main/pages/assets/images/julia-docs-stable.svg)](https://sandialabs.github.io/Polymers/julia/docs/stable)
Expand All @@ -40,30 +30,16 @@ using Pkg
Pkg.add("Polymers")
```

If Rust is installed, the latest edition of the library can be installed from the GitHub repository:

```julia
using Pkg
Pkg.add(url="https://github.com/sandialabs/Polymers")
```

## Rust

[![docs (stable)](https://img.shields.io/badge/Docs-stable-e57300?logo=rust&logoColor=000000)](https://docs.rs/crate/polymers)
[![docs (latest)](https://img.shields.io/badge/Docs-latest-e57300?logo=rust&logoColor=000000)](https://sandialabs.github.io/Polymers/rust/docs/latest)
[![crates](https://img.shields.io/crates/v/polymers?logo=rust&logoColor=000000&label=Crates&color=32592f)](https://crates.io/crates/polymers)

The library can be used in an existing Rust project by adding the `polymers` crate to Cargo.toml:
The library can be added to an existing Rust project:

```toml
[dependencies]
polymers = "*"
```
To use the latest edition of the library, add the GitHub repository to Cargo.toml:

```toml
[dependencies]
regex = { git = "https://github.com/sandialabs/polymers" }
```shell
cargo add polymers
```

## Citation
Expand Down
10 changes: 0 additions & 10 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ The library can be installed as a Python package:
pip install polymers
If Rust is installed, the latest edition of the library can be installed from the GitHub repository:

.. code-block:: sh
git clone [email protected]:sandialabs/Polymers.git
cd Polymers/
pip install maturin
maturin build --features python
pip install target/wheels/*.whl
Citation
--------

Expand Down
2 changes: 2 additions & 0 deletions docs/source/physics/single_chain/wlc/thermodynamics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ WLC model thermodynamics
:maxdepth: 1

Isometric <thermodynamics/isometric>
Isometric <thermodynamics/isotensional>

.. autoclass:: polymers.physics.single_chain.wlc.thermodynamics::WLC(number_of_links, link_length, hinge_mass, persistance_length)

Expand All @@ -13,3 +14,4 @@ WLC model thermodynamics
.. autoattribute:: hinge_mass
.. autoattribute:: persistance_length
.. autoattribute:: isometric
.. autoattribute:: isotensional
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
WLC model thermodynamics (isotensional)
=======================================

.. toctree::
:maxdepth: 1

Legendre <isotensional/legendre>

.. autoclass:: polymers.physics.single_chain.wlc.thermodynamics.isotensional::WLC(number_of_links, link_length, hinge_mass, persistance_length)

.. autoattribute:: number_of_links
.. autoattribute:: link_length
.. autoattribute:: hinge_mass
.. autoattribute:: persistance_length
.. autoattribute:: legendre
.. automethod:: end_to_end_length(force, temperature)
.. automethod:: end_to_end_length_per_link(force, temperature)
.. automethod:: nondimensional_end_to_end_length(nondimensional_force)
.. automethod:: nondimensional_end_to_end_length_per_link(nondimensional_force)
.. automethod:: gibbs_free_energy(force, temperature)
.. automethod:: gibbs_free_energy_per_link(force, temperature)
.. automethod:: relative_gibbs_free_energy(force, temperature)
.. automethod:: relative_gibbs_free_energy_per_link(force, temperature)
.. automethod:: nondimensional_gibbs_free_energy(nondimensional_force, temperature)
.. automethod:: nondimensional_gibbs_free_energy_per_link(nondimensional_force, temperature)
.. automethod:: nondimensional_relative_gibbs_free_energy(nondimensional_force)
.. automethod:: nondimensional_relative_gibbs_free_energy_per_link(nondimensional_force)

.. raw::
html
<hr>
.. footbibliography::
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
WLC model thermodynamics (isotensional/legendre)
================================================

.. autoclass:: polymers.physics.single_chain.wlc.thermodynamics.isotensional.legendre::WLC(number_of_links, link_length, hinge_mass, persistance_length)

.. autoattribute:: number_of_links
.. autoattribute:: link_length
.. autoattribute:: hinge_mass
.. autoattribute:: persistance_length
.. automethod:: helmholtz_free_energy(force, temperature)
.. automethod:: helmholtz_free_energy_per_link(force, temperature)
.. automethod:: relative_helmholtz_free_energy(force, temperature)
.. automethod:: relative_helmholtz_free_energy_per_link(force, temperature)
.. automethod:: nondimensional_helmholtz_free_energy(nondimensional_force, temperature)
.. automethod:: nondimensional_helmholtz_free_energy_per_link(nondimensional_force, temperature)
.. automethod:: nondimensional_relative_helmholtz_free_energy(nondimensional_force)
.. automethod:: nondimensional_relative_helmholtz_free_energy_per_link(nondimensional_force)
7 changes: 0 additions & 7 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ using Pkg
Pkg.add("Polymers")
```

If Rust is installed, the latest edition of the library can be installed from the GitHub repository:

```julia
using Pkg
Pkg.add(url="https://github.com/sandialabs/Polymers")
```

## Citation

[![doi](https://img.shields.io/badge/Zenodo-10.5281%2Fzenodo.7041983-blue)](https://doi.org/10.5281/zenodo.7041983)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/physics/single_chain/wlc.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
* [WLC model thermodynamics](../../thermodynamics)

```@autodocs
Modules = [Polymers.Physics.SingleChain.WLC]
Modules = [Polymers.Physics.SingleChain.Wlc]
```
3 changes: 2 additions & 1 deletion docs/src/physics/single_chain/wlc/thermodynamics.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# WLC model thermodynamics

* [WLC model thermodynamics (isometric)](../../../isometric)
* [WLC model thermodynamics (isotensional)](../../../isotensional)

```@autodocs
Modules = [Polymers.Physics.SingleChain.WLC.Thermodynamics]
Modules = [Polymers.Physics.SingleChain.Wlc.Thermodynamics]
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
* [WLC model thermodynamics (isometric/legendre)](../../../../legendre)

```@autodocs
Modules = [Polymers.Physics.SingleChain.WLC.Thermodynamics.Isometric]
Modules = [Polymers.Physics.SingleChain.Wlc.Thermodynamics.Isometric]
```
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# WLC model thermodynamics (isometric/legendre)

```@autodocs
Modules = [Polymers.Physics.SingleChain.WLC.Thermodynamics.Isometric.Legendre]
Modules = [Polymers.Physics.SingleChain.Wlc.Thermodynamics.Isometric.Legendre]
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# WLC model thermodynamics (isotensional)

* [WLC model thermodynamics (isotensional/legendre)](../../../../legendre)

```@autodocs
Modules = [Polymers.Physics.SingleChain.Wlc.Thermodynamics.Isotensional]
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# WLC model thermodynamics (isotensional/legendre)

```@autodocs
Modules = [Polymers.Physics.SingleChain.Wlc.Thermodynamics.Isotensional.Legendre]
```
2 changes: 2 additions & 0 deletions src/physics/single_chain/mod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ struct Parameters
link_stiffness_scale::Float64
link_energy_reference::Float64
link_energy_scale::Float64
nondimensional_persistance_length_small::Float64
nondimensional_link_stiffness_large::Float64
nondimensional_link_stiffness_big::Float64
nondimensional_link_stiffness_medium::Float64
Expand Down Expand Up @@ -80,6 +81,7 @@ parameters = Parameters(
99e4,
5e4,
99e3,
2e-2,
1e4,
1e3,
1e1,
Expand Down
1 change: 1 addition & 0 deletions src/physics/single_chain/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def __init__(self):
self.link_stiffness_scale = 99e4
self.link_energy_reference = 5e4
self.link_energy_scale = 99e3
self.nondimensional_persistance_length_small = 2e-2
self.nondimensional_link_stiffness_large = 1e4
self.nondimensional_link_stiffness_big = 1e3
self.nondimensional_link_stiffness_medium = 1e1
Expand Down
2 changes: 2 additions & 0 deletions src/physics/single_chain/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub struct Parameters
pub link_stiffness_scale: f64,
pub link_energy_reference: f64,
pub link_energy_scale: f64,
pub nondimensional_persistance_length_small: f64,
pub nondimensional_link_stiffness_large: f64,
pub nondimensional_link_stiffness_big: f64,
pub nondimensional_link_stiffness_medium: f64,
Expand Down Expand Up @@ -74,6 +75,7 @@ impl Default for Parameters
link_stiffness_scale: 99e4,
link_energy_reference: 5e4,
link_energy_scale: 99e3,
nondimensional_persistance_length_small: 2e-2,
nondimensional_link_stiffness_large: 1e4,
nondimensional_link_stiffness_big: 1e3,
nondimensional_link_stiffness_medium: 1e1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ end

"""
The Gibbs free energy ``\\varphi`` as a function of the applied end-to-end length ``\\xi`` and temperature ``T``,
parameterized by the number of links ``N_b``, link length ``\\ell_b``, and hinge mass ``m``,
parameterized by the number of links ``N_b``, link length ``\\ell_b``, hinge mass ``m``, and persistance length ``\\ell_p``,
```math
\\varphi(\\xi, T) \\sim \\psi(\\xi, T) - \\xi f(\\xi, T) \\quad \\text{for } N_b\\gg 1,
Expand Down Expand Up @@ -115,7 +115,7 @@ end

"""
The Gibbs free energy per link ``\\varphi/N_b`` as a function of the applied end-to-end length ``\\xi`` and temperature ``T``,
parameterized by the number of links ``N_b``, link length ``\\ell_b``, and hinge mass ``m``.
parameterized by the number of links ``N_b``, link length ``\\ell_b``, hinge mass ``m``, and persistance length ``\\ell_p``.
$(TYPEDSIGNATURES)
"""
Expand Down Expand Up @@ -160,7 +160,7 @@ end

"""
The relative Helmholtz free energy ``\\Delta\\varphi\\equiv\\varphi(\\xi,T)-\\varphi(0,T)`` as a function of the applied end-to-end length ``\\xi`` and temperature ``T``,
parameterized by the number of links ``N_b`` and link length ``\\ell_b``.
parameterized by the number of links ``N_b``, link length ``\\ell_b``, and persistance length ``\\ell_p``.
$(TYPEDSIGNATURES)
"""
Expand Down Expand Up @@ -201,7 +201,7 @@ end

"""
The relative Gibbs free energy per link ``\\Delta\\varphi/N_b`` as a function of the applied end-to-end length ``\\xi`` and temperature ``T``,
parameterized by the number of links ``N_b`` and link length ``\\ell_b``.
parameterized by the number of links ``N_b``, link length ``\\ell_b``, and persistance length ``\\ell_p``.
$(TYPEDSIGNATURES)
"""
Expand Down Expand Up @@ -242,7 +242,7 @@ end

"""
The nondimensional Gibbs free energy ``N_b\\varrho=\\beta\\varphi`` as a function of the applied nondimensional end-to-end length per link ``\\gamma`` and temperature ``T``,
parameterized by the number of links ``N_b``, link length ``\\ell_b``, and hinge mass ``m``.
parameterized by the number of links ``N_b``, link length ``\\ell_b``, hinge mass ``m``, and nondimensional persistance length ``\\zeta``.
$(TYPEDSIGNATURES)
"""
Expand Down Expand Up @@ -287,7 +287,7 @@ end

"""
The nondimensional Gibbs free energy per link ``\\varrho\\equiv\\beta\\varphi/N_b`` as a function of the applied nondimensional end-to-end length per link ``\\gamma`` and temperature ``T``,
parameterized by the number of links ``N_b``, link length ``\\ell_b``, and hinge mass ``m``.
parameterized by the number of links ``N_b``, link length ``\\ell_b``, hinge mass ``m``, and nondimensional persistance length ``\\zeta``.
$(TYPEDSIGNATURES)
"""
Expand Down Expand Up @@ -332,7 +332,7 @@ end

"""
The nondimensional relative Gibbs free energy ``N_b\\Delta\\varrho=\\beta\\Delta\\varphi`` as a function of the applied nondimensional end-to-end length per link ``\\gamma`` and temperature ``T``,
parameterized by the number of links ``N_b``.
parameterized by the number of links ``N_b`` and nondimensional persistance length ``\\zeta``.
$(TYPEDSIGNATURES)
"""
Expand Down Expand Up @@ -365,7 +365,7 @@ end

"""
The nondimensional relative Helmholtz free energy per link ``\\Delta\\varrho\\equiv\\beta\\Delta\\varphi/N_b`` as a function of the applied nondimensional end-to-end length per link ``\\gamma`` and temperature ``T``,
parameterized by the number of links ``N_b``.
parameterized by the number of links ``N_b`` and nondimensional persistance length ``\\zeta``.
$(TYPEDSIGNATURES)
"""
Expand Down
Loading

2 comments on commit 64ff14a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/83144

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.5 -m "<description of version>" 64ff14ac01ea4d1a03f8d610f2d02bb74ed3098e
git push origin v0.3.5

Please sign in to comment.