Skip to content

Commit

Permalink
Merge branch 'tempering_update' of github.com:mlund/faunus into tempe…
Browse files Browse the repository at this point in the history
…ring_update
  • Loading branch information
IVinterbladh committed Dec 21, 2023
2 parents 22c6aa7 + 29da4d4 commit db288ce
Show file tree
Hide file tree
Showing 30 changed files with 960 additions and 441 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-22.04
runs-on: ubuntu-latest

steps:

- name: Set up Clang
uses: egor-tensin/setup-clang@v1
with:
version: latest
- name: Install newer Clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh 17
- uses: actions/checkout@v2

Expand All @@ -36,13 +36,20 @@ jobs:
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_OPENMP=on -DENABLE_PYTHON=off -DENABLE_TBB=off
# Force libc++ due to https://github.com/actions/runner-images/issues/8659
run: |
export CXX=clang++-17
export CC=clang-17
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_OPENMP=on -DENABLE_PYTHON=off -DENABLE_TBB=off -DCMAKE_C_COMPILER=clang-17 -DCMAKE_CXX_COMPILER=clang++-17
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE --target faunus -j 2
run: |
export CXX=clang++-17
export CC=clang-17
cmake --build . --config $BUILD_TYPE --target faunus -j 2
- name: Test
working-directory: ${{github.workspace}}/build
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include/
examples/
_deps/
sids/

docs/html/
unittests.log
a.out

Expand Down
46 changes: 6 additions & 40 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/editor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion .readthedocs.yml → .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
sphinx:
configuration: docs/conf.py

formats: [htmlzip,pdf]
python:
version: 3.7
install:
- requirements: docs/requirements.txt

12 changes: 6 additions & 6 deletions cmake/ExternalTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ include(FetchContent)
# CPM Packages
###############

CPMAddPackage("gh:gabime/spdlog@1.11.0")
CPMAddPackage("gh:gabime/spdlog@1.12.0")
CPMAddPackage("gh:ericniebler/range-v3#0.12.0")
CPMAddPackage("gh:docopt/docopt.cpp#v0.6.3")
CPMAddPackage("gh:doctest/doctest#v2.4.9")
CPMAddPackage("gh:mateidavid/zstr#v1.0.6")
CPMAddPackage("gh:martinus/nanobench#v4.3.9")
CPMAddPackage("gh:pybind/pybind11#v2.10.1")
CPMAddPackage("gh:doctest/doctest#v2.4.11")
CPMAddPackage("gh:mateidavid/zstr#v1.0.7")
CPMAddPackage("gh:martinus/nanobench#v4.3.11")
CPMAddPackage("gh:pybind/pybind11#v2.11.1")
CPMAddPackage("gh:imneme/pcg-cpp#ffd522e7188bef30a00c74dc7eb9de5faff90092")
CPMAddPackage("gh:ArashPartow/exprtk#93a9f44f99b910bfe07cd1e933371e83cea3841c")

CPMAddPackage(
NAME mpl GITHUB_REPOSITORY rabauke/mpl DOWNLOAD_ONLY YES
GIT_TAG ff9512fc61195b6c7e643e234789b0b937d28ee3
GIT_TAG v0.3.0
)

CPMAddPackage(
Expand Down
9 changes: 4 additions & 5 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ if (HAS_JSONSCHEMA EQUAL 1)
message("python: missing `jsonschema` package is highly recommended")
endif()

execute_process(COMMAND ${Python_EXECUTABLE} -c "import ruamel_yaml as yaml" RESULT_VARIABLE HAS_YAML1 ERROR_QUIET)
execute_process(COMMAND ${Python_EXECUTABLE} -c "import ruamel.yaml as yaml" RESULT_VARIABLE HAS_YAML2 ERROR_QUIET)
execute_process(COMMAND ${Python_EXECUTABLE} -c "import yaml" RESULT_VARIABLE HAS_YAML3 ERROR_QUIET)
if ((HAS_YAML1 EQUAL 1) AND (HAS_YAML2 EQUAL 1) AND (HAS_YAML3 EQUAL 1))
message("python: missing `ruamel_yaml` (preferred) or `yaml` packages are highly recommended")
execute_process(COMMAND ${Python_EXECUTABLE} -c "import ruamel.yaml as yaml" RESULT_VARIABLE HAS_YAML1 ERROR_QUIET)
execute_process(COMMAND ${Python_EXECUTABLE} -c "import yaml" RESULT_VARIABLE HAS_YAML2 ERROR_QUIET)
if ((HAS_YAML1 EQUAL 1) AND (HAS_YAML2 EQUAL 1))
message("python: missing `ruamel.yaml` (preferred) or `yaml` packages are highly recommended")
endif()

find_program(PANDOC pandoc)
Expand Down
49 changes: 38 additions & 11 deletions docs/_docs/analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,29 @@ with gzip.open('distances.mtx.gz', 'rt') as f:
print(np.sort(counts)) # cluster size distribution
~~~

### Surface Area

Calculates surface areas using different sample policies
that selects by:

1. atoms types (`atomic`)
2. molecule types (`molecular`)
3. atom types in specific molecules (`atoms_in_molecule`)

In addition to the optional `file` streaming, a histogram of observed areas
is filed to disk, `sasa_histogram.dat`.

`sasa` | Description
-------------- | ---------------------------
`nstep` | Interval between samples
`nskip=0` | Number of initial steps excluded from the analysis
`policy` | Sample policy: `atomic`, `molecular`, `atoms_in_molecule`
`molecule` | Molecule name to sample if `molecular` or `atoms_in_molecule` policies
`atom` | Atom name to sample if `atomic` policy
`atomlist` | List of atom names if `atoms_in_molecule` policy
`file` | Optionally stream area for each `nstep` to file (`.dat|.dat.gz`)
`radius=1.4` | Probe radius (Å)

## Charge Properties

### Molecular Multipoles
Expand All @@ -352,6 +375,7 @@ Calculates average molecular multipolar moments and their fluctuations.
`nstep` | Interval between samples.

The output from the multipole analysis gives the following:

`multipole` | Description
-------------- | ----------------------
`C` | Capacitance, eV⁻¹
Expand All @@ -360,34 +384,34 @@ The output from the multipole analysis gives the following:
`μ` | Dipole moment, eÅ
`μ2` | Squared dipole moment, (eÅ)²

The capacitance, $C$, is defined accordingly:
The capacitance, `C`, is defined accordingly:

$$
c = < z² > - < z
C = \langle z^2 \rangle - \langle z \rangle^2
$$

Where $Z$ is defined as the average charge/valency:
Where `Z` is defined as the average charge/valency:

$$
< z > = < \sum_i z_i >
Z = \langle \sum_i z_i \rangle
$$

This gives that $Z2$ is just the squared average charge/valency:
This gives that `Z2` is just the squared average charge/valency:

$$
< z² > = < \sum_i z²_i >
\text{Z2} = \langle \sum_i z^2_i \rangle
$$

Continuing, the dipole moment, $μ$ , is defined as:
Continuing, the dipole moment, `μ`, is defined as:

$$
μ = < \mu > = < | \sum_i z_i (r_i - r_{cm}) | >
\mu = \langle | \sum_i z_i (r_i - r_{cm}) | \rangle
$$

Lastly, the $μ2$ is defined as the mean squared dipole moment:
Lastly, the `μ2` is defined as the mean squared dipole moment:

$$
μ2 = < \mu² >
\mu^2 = \langle \mu^2 \rangle
$$

### Multipole Moments
Expand Down Expand Up @@ -457,7 +481,7 @@ $$
$$

$$
u_{\text{ion-quad}} = \frac{ q_a \boldsymbol{R}^T \boldsymbol{Q}_b \boldsymbol{R} }{R^5}-\frac{q_a \mbox{tr}(\boldsymbol{Q}_b) }{R^3}+ ...
u_{\text{ion-quad}} = \frac{ q_a \boldsymbol{R}^T \boldsymbol{Q}_b \boldsymbol{R} }{R^5}-\frac{q_a \text{tr}(\boldsymbol{Q}_b) }{R^3}+ ...
$$

$$
Expand Down Expand Up @@ -505,6 +529,7 @@ atomic species can be saved.
`nstep` | Interval between samples
`nskip=0` | Number of initial steps excluded from the analysis
`epsr` | Dielectric constant
`file=potential` | Filename prefix for output files
`type` | Coulomb type, `plain` etc. -- see energies
`structure` | Either a _filename_ (pqr, aam, gro etc) or a _list_ of positions
`policy=fixed` | Policy used to augment positions before each sample event, see below
Expand Down Expand Up @@ -619,6 +644,8 @@ All units in $k\_BT$.
-------------- | -------------------------------------------
`file` | Output filename (`.dat`, `.csv`, `.dat.gz`)
`nstep` | Interval between samples
`nskip=0` | Number of initial steps excluded from the analysis
`save_min_conf=false` | Dump minimum energy configuration to `PQR` file


### Penalty function
Expand Down
37 changes: 0 additions & 37 deletions docs/_docs/gallery.md

This file was deleted.

35 changes: 0 additions & 35 deletions docs/_docs/header.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/_docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ but compile on most unix operating systems, including the Windows Subsystem for
- CMake 3.24+
- C++20 compiler (clang, g++, intel ixpc, ...)
- Python 3.7+ with the following packages:
- `jinja2`, `ruamel_yaml` or `yaml`
- `jinja2`, `ruamel.yaml` or `yaml`

The following are optional:

Expand Down
3 changes: 3 additions & 0 deletions docs/_docs/moves.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ _Warning:_ Untested for cylinders, slits.

## Gibbs Ensemble (unstable)

_Note: this is marked unstable or experimental, meaning that it is still being tested and
may see significant changes over time._

[Gibbs ensemble](https://dx.doi.org/10/cvzgw9)
can be used to investigate phase transitions by _matter_ and _volume_ exchange between two cells.
The `examples/gibbs-ensemble/` directory contains a Jupyter Notebook with a worked example of a simple Lennard-Jones system.
Expand Down
8 changes: 6 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ def getCurrentYear():
author = 'Mikael Lund'
source_suffix = ['.rst', '.md']
master_doc = 'index'
extensions = ['recommonmark', 'sphinx_markdown_tables', 'sphinx.ext.autosectionlabel']
extensions = [
'recommonmark',
'sphinx_markdown_tables',
'sphinx.ext.autosectionlabel',
'sphinx_rtd_theme']
html_theme = "sphinx_rtd_theme"
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

autosectionlabel_prefix_document = True
Loading

0 comments on commit db288ce

Please sign in to comment.