Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added nSCFT #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Added nSCFT #13

wants to merge 2 commits into from

Conversation

igresh
Copy link
Contributor

@igresh igresh commented Aug 10, 2023

Added nSCFT, adapted from the work of Paul Kienzle (NIST) and Richard Sheridan.

Added numerical self consistent theory code, adapted from the work Paul Kienzle and Richard Sheridan in Refl1D
black
def __init__(
self,
adsorbed_amount,
lattice_size,
Copy link
Contributor

Choose a reason for hiding this comment

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

lattice_size docstring missing

self,
adsorbed_amount,
lattice_size,
polymerMW,
Copy link
Contributor

Choose a reason for hiding this comment

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

polymerMW docstring missing. (it's referred to as mn)?

"""
Parameters
----------
Adsorbed Amount : Parameter or float
Copy link
Contributor

Choose a reason for hiding this comment

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

please order docstring in the same order that the parameters appear.


dist_model : function or None
The model used to turn the PDI paramter into a probability density function of chain lengths.
If none the SZdist model is used.
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this PDF specified?

rough : float
the (gaussian) roughness between slabs in the slab approximation of the profile

dist_model : function or None
Copy link
Contributor

Choose a reason for hiding this comment

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

What is dist_model, is it an rv_continuous, or a general callable? What is the call signature that the function should take?

problems arise when the distribution gets too uniform, so if we find them,
default to an exact uniform calculation.
"""
from scipy.special import gammaln
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be top level, doesn't need to be lazy import.


Shultz-Zimm is a "realistic" distribution for linear polymers. Numerical
problems arise when the distribution gets too uniform, so if we find them,
default to an exact uniform calculation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Parameters for docstring, what is PDI, what is nn?

Copy link
Contributor

Choose a reason for hiding this comment

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

What is the function supposed to return?


uniform = False

if pdi == 1.0:
Copy link
Contributor

Choose a reason for hiding this comment

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

comparing floats for equality can be a recipe for mistakes.

Uses a numerical self-consistent field profile.\ [#Cosgrove]_\ [#deVos]_\ [#Sheridan]_

**Parameters**
*chi*
Copy link
Contributor

Choose a reason for hiding this comment

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

Use numpydoc type formatting, e.g.

Parameters
-----------

Unless, this docstring is taken from refl1d, in which case leave as-is.


Using an OrderedDict because I want to prune keys FIFO
"""
from scipy.optimize.nonlin import NoConvergence
Copy link
Contributor

Choose a reason for hiding this comment

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

can be top level import

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants