Skip to content

Commit 4011c9b

Browse files
authoredMar 1, 2023
Merge pull request #162 from sandialabs/dev
julia tests and related bug fixes
2 parents e786f99 + 8d0e59b commit 4011c9b

File tree

40 files changed

+8147
-139
lines changed

40 files changed

+8147
-139
lines changed
 

‎Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "polymers"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
edition = "2021"
55
description = "Polymers Modeling Library"
66
license = "BSD-3-Clause"

‎Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Polymers"
22
uuid = "8aef037c-a721-4e8a-9d81-eb7093daef2c"
33
authors = ["mrbuche <mrbuche@sandia.gov>"]
4-
version = "0.1.1"
4+
version = "0.1.2"
55

66
[deps]
77
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"

‎src/physics/single_chain/efjc/thermodynamics/isotensional/asymptotic/alternative/ex.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_a
3434
super::relative_gibbs_free_energy(&number_of_links, &link_length, &link_stiffness, &force, &temperature)
3535
}
3636
#[no_mangle]
37-
pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_alternative_relative_gibbs_free_energy_per_link(link_length: f64, force: f64, link_stiffness: f64, temperature: f64) -> f64
37+
pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_alternative_relative_gibbs_free_energy_per_link(link_length: f64, link_stiffness: f64, force: f64, temperature: f64) -> f64
3838
{
3939
super::relative_gibbs_free_energy_per_link(&link_length, &link_stiffness, &force, &temperature)
4040
}
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
#[no_mangle]
2-
pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_alternative_helmholtz_free_energy(number_of_links: u8, link_length: f64, hinge_mass: f64, link_stiffness: f64, force: f64, temperature: f64) -> f64
2+
pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_alternative_legendre_helmholtz_free_energy(number_of_links: u8, link_length: f64, hinge_mass: f64, link_stiffness: f64, force: f64, temperature: f64) -> f64
33
{
44
super::helmholtz_free_energy(&number_of_links, &link_length, &hinge_mass, &link_stiffness, &force, &temperature)
55
}
66
#[no_mangle]
7-
pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_alternative_helmholtz_free_energy_per_link(link_length: f64, hinge_mass: f64, link_stiffness: f64, force: f64, temperature: f64) -> f64
7+
pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_alternative_legendre_helmholtz_free_energy_per_link(link_length: f64, hinge_mass: f64, link_stiffness: f64, force: f64, temperature: f64) -> f64
88
{
99
super::helmholtz_free_energy_per_link(&link_length, &hinge_mass, &link_stiffness, &force, &temperature)
1010
}
1111
#[no_mangle]
12-
pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_alternative_relative_helmholtz_free_energy(number_of_links: u8, link_length: f64, link_stiffness: f64, force: f64, temperature: f64) -> f64
12+
pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_alternative_legendre_relative_helmholtz_free_energy(number_of_links: u8, link_length: f64, link_stiffness: f64, force: f64, temperature: f64) -> f64
1313
{
1414
super::relative_helmholtz_free_energy(&number_of_links, &link_length, &link_stiffness, &force, &temperature)
1515
}
1616
#[no_mangle]
17-
pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_alternative_relative_helmholtz_free_energy_per_link(link_length: f64, force: f64, link_stiffness: f64, temperature: f64) -> f64
17+
pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_alternative_legendre_relative_helmholtz_free_energy_per_link(link_length: f64, link_stiffness: f64, force: f64, temperature: f64) -> f64
1818
{
1919
super::relative_helmholtz_free_energy_per_link(&link_length, &link_stiffness, &force, &temperature)
2020
}
2121
#[no_mangle]
22-
pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_alternative_nondimensional_helmholtz_free_energy(number_of_links: u8, link_length: f64, hinge_mass: f64, nondimensional_link_stiffness: f64, nondimensional_force: f64, temperature: f64) -> f64
22+
pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_alternative_legendre_nondimensional_helmholtz_free_energy(number_of_links: u8, link_length: f64, hinge_mass: f64, nondimensional_link_stiffness: f64, nondimensional_force: f64, temperature: f64) -> f64
2323
{
2424
super::nondimensional_helmholtz_free_energy(&number_of_links, &link_length, &hinge_mass, &nondimensional_link_stiffness, &nondimensional_force, &temperature)
2525
}
2626
#[no_mangle]
27-
pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_alternative_nondimensional_helmholtz_free_energy_per_link(link_length: f64, hinge_mass: f64, nondimensional_link_stiffness: f64, nondimensional_force: f64, temperature: f64) -> f64
27+
pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_alternative_legendre_nondimensional_helmholtz_free_energy_per_link(link_length: f64, hinge_mass: f64, nondimensional_link_stiffness: f64, nondimensional_force: f64, temperature: f64) -> f64
2828
{
2929
super::nondimensional_helmholtz_free_energy_per_link(&link_length, &hinge_mass, &nondimensional_link_stiffness, &nondimensional_force, &temperature)
3030
}
3131
#[no_mangle]
32-
pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_alternative_nondimensional_relative_helmholtz_free_energy(number_of_links: u8, nondimensional_link_stiffness: f64, nondimensional_force: f64) -> f64
32+
pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_alternative_legendre_nondimensional_relative_helmholtz_free_energy(number_of_links: u8, nondimensional_link_stiffness: f64, nondimensional_force: f64) -> f64
3333
{
3434
super::nondimensional_relative_helmholtz_free_energy(&number_of_links, &nondimensional_link_stiffness, &nondimensional_force)
3535
}
3636
#[no_mangle]
37-
pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_alternative_nondimensional_relative_helmholtz_free_energy_per_link(nondimensional_link_stiffness: f64, nondimensional_force: f64) -> f64
37+
pub extern fn physics_single_chain_efjc_thermodynamics_isotensional_asymptotic_alternative_legendre_nondimensional_relative_helmholtz_free_energy_per_link(nondimensional_link_stiffness: f64, nondimensional_force: f64) -> f64
3838
{
3939
super::nondimensional_relative_helmholtz_free_energy_per_link(&nondimensional_link_stiffness, &nondimensional_force)
4040
}

‎src/physics/single_chain/efjc/thermodynamics/isotensional/asymptotic/alternative/legendre/mod.jl

+45-11
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,38 @@ struct EFJC
2929
The stiffness of each link in the chain ``k_0`` in units of J/(mol⋅nm^2).
3030
"""
3131
link_stiffness::Float64
32+
"""
33+
The Helmholtz free energy ``\\psi`` as a function of the applied force ``f`` and temperature ``T``.
34+
"""
35+
helmholtz_free_energy::Function
36+
"""
37+
The Helmholtz free energy per link ``\\psi/N_b`` as a function of the applied force ``f`` and temperature ``T``.
38+
"""
39+
helmholtz_free_energy_per_link::Function
40+
"""
41+
The relative helmholtz free energy ``\\Delta\\psi\\equiv\\psi(f,T)-\\psi(0,T)`` as a function of the applied force ``f`` and temperature ``T``.
42+
"""
43+
relative_helmholtz_free_energy::Function
44+
"""
45+
The relative helmholtz free energy per link ``\\Delta\\psi/N_b`` as a function of the applied force ``f`` and temperature ``T``.
46+
"""
47+
relative_helmholtz_free_energy_per_link::Function
48+
"""
49+
The nondimensional helmholtz free energy ``N_b\\vartheta=\\beta\\psi`` as a function of the applied nondimensional force ``\\eta`` and temperature ``T``.
50+
"""
51+
nondimensional_helmholtz_free_energy::Function
52+
"""
53+
The nondimensional helmholtz free energy per link ``\\vartheta\\equiv\\beta\\psi/N_b`` as a function of the applied nondimensional force ``\\eta`` and temperature ``T``.
54+
"""
55+
nondimensional_helmholtz_free_energy_per_link::Function
56+
"""
57+
The nondimensional relative helmholtz free energy ``N_b\\Delta\\vartheta=\\beta\\Delta\\psi`` as a function of the applied nondimensional force ``\\eta``.
58+
"""
59+
nondimensional_relative_helmholtz_free_energy::Function
60+
"""
61+
The nondimensional relative helmholtz free energy per link ``\\Delta\\vartheta\\equiv\\beta\\Delta\\psi/N_b`` as a function of the applied nondimensional force ``\\eta``.
62+
"""
63+
nondimensional_relative_helmholtz_free_energy_per_link::Function
3264
end
3365

3466
"""
@@ -294,7 +326,6 @@ function nondimensional_relative_helmholtz_free_energy(
294326
nondimensional_force_i,
295327
),
296328
number_of_links,
297-
link_length,
298329
nondimensional_link_stiffness,
299330
nondimensional_force,
300331
)
@@ -337,6 +368,7 @@ function EFJC(
337368
hinge_mass::Float64,
338369
link_stiffness::Float64,
339370
)
371+
BOLTZMANN_CONSTANT::Float64 = 8.314462618
340372
return EFJC(
341373
number_of_links,
342374
link_length,
@@ -352,8 +384,8 @@ function EFJC(
352384
),
353385
(force, temperature) -> helmholtz_free_energy_per_link(
354386
link_length,
355-
link_stiffness,
356387
hinge_mass,
388+
link_stiffness,
357389
force,
358390
temperature,
359391
),
@@ -386,15 +418,17 @@ function EFJC(
386418
nondimensional_force,
387419
temperature,
388420
),
389-
nondimensional_force -> nondimensional_relative_helmholtz_free_energy(
390-
number_of_links,
391-
link_stiffness * link_length^2 / BOLTZMANN_CONSTANT / temperature,
392-
nondimensional_force,
393-
),
394-
nondimensional_force -> nondimensional_relative_helmholtz_free_energy_per_link(
395-
link_stiffness * link_length^2 / BOLTZMANN_CONSTANT / temperature,
396-
nondimensional_force,
397-
),
421+
(nondimensional_force, temperature) ->
422+
nondimensional_relative_helmholtz_free_energy(
423+
number_of_links,
424+
link_stiffness * link_length^2 / BOLTZMANN_CONSTANT / temperature,
425+
nondimensional_force,
426+
),
427+
(nondimensional_force, temperature) ->
428+
nondimensional_relative_helmholtz_free_energy_per_link(
429+
link_stiffness * link_length^2 / BOLTZMANN_CONSTANT / temperature,
430+
nondimensional_force,
431+
),
398432
)
399433
end
400434

7 commit comments

Comments
 (7)

mrbuche commented on Mar 1, 2023

@mrbuche
CollaboratorAuthor

@JuliaRegistrator register branch=main

mrbuche commented on Mar 1, 2023

@mrbuche
CollaboratorAuthor

JuliaRegistrator commented on Mar 1, 2023

@JuliaRegistrator

Registration pull request created: JuliaRegistries/General/78772

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.1.2 -m "<description of version>" 4011c9ba0e70d090aa4a9c50677c3cb316363926
git push origin v0.1.2

Also, note the warning: Version 0.1.2 skips over 0.1.1
This can be safely ignored. However, if you want to fix this you can do so. Call register() again after making the fix. This will update the Pull request.

mrbuche commented on Mar 1, 2023

@mrbuche
CollaboratorAuthor

JuliaRegistrator commented on Mar 1, 2023

@JuliaRegistrator

Registration pull request updated: JuliaRegistries/General/78772

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.1.2 -m "<description of version>" 4011c9ba0e70d090aa4a9c50677c3cb316363926
git push origin v0.1.2

Also, note the warning: Version 0.1.2 skips over 0.1.1
This can be safely ignored. However, if you want to fix this you can do so. Call register() again after making the fix. This will update the Pull request.

mrbuche commented on Mar 1, 2023

@mrbuche
CollaboratorAuthor

JuliaRegistrator commented on Mar 1, 2023

@JuliaRegistrator

Registration pull request updated: JuliaRegistries/General/78772

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.1.2 -m "<description of version>" 4011c9ba0e70d090aa4a9c50677c3cb316363926
git push origin v0.1.2
Please sign in to comment.