Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.DS_Store
/build
build
__pycache__
doc/source/generated
*.egg-info
17 changes: 17 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2

build:
os: ubuntu-24.04
tools:
python: "3.11"

sphinx:
configuration: doc/source/conf.py
fail_on_warning: true

python:
install:
- requirements: requirements.txt
- requirements: doc/requirements.txt
- method: pip
path: .
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ if(FLYFT_TESTING)
endif()

add_subdirectory(src)

if(FLYFT_PYTHON)
add_subdirectory(python)
# set(PYTHON_SITE_INSTALL_DIR "${_python_site_package_rel}/flyft" CACHE PATH "Python site-packages directory (relative to CMAKE_INSTALL_PREFIX)" FORCE)
endif()

find_package(Python REQUIRED COMPONENTS Interpreter Development)
execute_process(
COMMAND ${Python_EXECUTABLE} -c "import site; print(site.getsitepackages()[0])"
OUTPUT_VARIABLE _python_site_packages
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_VARIABLE _error
)

if(_error)
message(FATAL_ERROR "Failed to find Python site-packages: ${_error}")
endif()

set(CMAKE_INSTALL_PREFIX ${_python_site_packages} CACHE PATH "Install prefix" FORCE)
message(STATUS "Setting CMAKE_INSTALL_PREFIX to Python site-packages: ${CMAKE_INSTALL_PREFIX}")
26 changes: 26 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright (c) 2021-2025, Auburn University

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20 changes: 20 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions doc/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
7 changes: 7 additions & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
furo
ipython==9.3.0
MyST-Parser
nbsphinx==0.9.7
sphinx==8.1.3
sphinx_design==0.6.1
sphinx_favicon==1.0.1
30 changes: 30 additions & 0 deletions doc/source/_images/flyft_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions doc/source/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}

{% block methods %}
{% if methods %}
.. rubric:: {{ _('Methods:') }}

.. autosummary::
{% for item in methods %}
{%- if not item in ['__init__'] %}
~{{ name }}.{{ item }}
{%- endif -%}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes:') }}

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
67 changes: 67 additions & 0 deletions doc/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
API
---

Free-energy models for hard-sphere fluids
-----------------------------------------

Free-energy functionals is an important component of the dynamic density functional functional
theory (DDFT) framework. Free-energy functional has three components: ideal-gas, excess, and external
potential contributions. ``flyft`` package provides several built-in free-energy
functionals for hard-sphere fluids to model the different excess and external contributions.

Excess free-energy functional
=============================

Depending on the required accuracy and density of the system, different
free-energy functionals can be employed.

.. autosummary::
:nosignatures:
:toctree: generated/

flyft.functional.IdealGas
flyft.functional.VirialExpansion
flyft.functional.BoublikHardSphere
flyft.functional.RosenfeldFMT

External free-energy functional
===============================

We also provide several built-in external potential models to represent
various confinement geometries and external fields for hard-sphere fluids.

.. autosummary::
:nosignatures:
:toctree: generated/

flyft.external.LinearPotential
flyft.external.HardWall
flyft.external.HarmonicWall

Mobility tensor for hard-sphere fluids
--------------------------------------

In addition to free-energy functionals, flux models are also a key component of the DDFT
framework. Mobility tensor define how particles move in response to gradients in chemical potential
and external forces. The ``flyft`` package provides several built-in flux models for hard-sphere
fluids. These include:

.. autosummary::
:nosignatures:
:toctree: generated/

flyft.dynamics.BrownianDiffusiveFlux
flyft.dynamics.CompositeFlux
flyft.dynamics.RPYDiffusiveFlux

Iterative solvers
-----------------

The ``flyft`` package also provides iterative solvers to find equilibrium density profiles
for hard-sphere fluids under various free-energy functionals and external potentials.

.. autosummary::
:nosignatures:
:toctree: generated/

flyft.solver.PicardIteration
73 changes: 73 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

import datetime

project = "flyft"
year = datetime.date.today().year
copyright = f"2021-{year}, Auburn University"
author = "Michael P. Howard"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
"IPython.sphinxext.ipython_console_highlighting",
"nbsphinx",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"sphinx_design",
"sphinx_favicon",
"myst_parser",
]

templates_path = ["_templates"]
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "furo"
html_static_path = []
html_theme_options = {
"navigation_with_keys": True,
"top_of_page_buttons": [],
"dark_css_variables": {
"color-brand-primary": "#ef904d",
"color-brand-content": "#ef904d",
"color-admonition-background": "#ef904d",
},
"light_css_variables": {
"color-brand-primary": "#e86100",
"color-brand-content": "#e86100",
"color-admonition-background": "#e86100",
},
"sidebar_hide_name": True,
}
html_logo = "_images/flyft_logo.svg"
# html_favicon = "_images/flyft_icon.svg"

# -- Options for autodoc & autosummary ---------------------------------------

autosummary_generate = True

autodoc_member_order = "bysource"

autodoc_default_options = {"inherited-members": None, "special-members": False}
autodoc_typehints = "none"

# -- Options for intersphinx -------------------------------------------------

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/doc/stable", None),
}
30 changes: 30 additions & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. flyft documentation master file, created by
sphinx-quickstart on Thu Dec 4 19:14:04 2025.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

flyft documentation
===================

flyft is a Python package for conducting dynamic density functional theory (DDFT)
simulations of hard-sphere fluids. It provides a flexible framework for defining
free-energy functionals, external potentials, and numerical solvers to study the
time evolution of density profiles in various geometries.

.. toctree::
:maxdepth: 1
:caption: Getting started

./install

.. toctree::
:maxdepth: 2
:caption: Reference

./api

.. toctree::
:maxdepth: 1
:caption: Additional information

./license
Loading