Skip to content
/ MolSim Public

Group project for the practical course: PSE Molecular Dynamic WS 21/22

Notifications You must be signed in to change notification settings

wngTn/MolSim

Repository files navigation

@mainpage PSE Molecular Dynamics

📜: Practical Course: Molecular Dynamics

Project for the Practical Course: PSE Molecular Dynamics by Group C: Lukas, Severin, Tony.

NOTE: This is not the complete README. This document only contains compiling instructions and an overview. The READMEs in the ./doc_pages directory contain detailed feature overviews and examples.

Warning

⚠️ If you have slow internet: We fetch three packages with FetchContent, thus the initial CMake-build may take some time (~1min)

⚠️ File structure: Please put the build directory (the directory you execute make) directly in the root project path, else the automatically generated files will not work properly. Like such:

MolSim
.
├── CMakeLists.txt
├── Doxyfile
├── README.md
├── build/
├── cmake/
├── doc_pages/
├── input/
├── libs/
├── media/
├── src/
└── test/

Getting Started

Prerequisites

Basics for compiling a CMake program:

  • gcc/g++ version 11.10 (used by us)
  • CMake 3.20 (used by us)

Also, you need the xerces-c library for the parsers we use in the program:

  • Ubuntu
    sudo apt install libxerces-c-dev
  • Arch
    sudo pacman -S xerces-c
  • Homebrew
    brew install xerces-c

Installation

  1. Clone the repo

    git clone https://github.com/wngTn/MolSim.git
  2. Create the build directory and cd into it:

    mkdir build && cd build 
  3. Build the Makefile without our tests

    cmake .. -DBUILD_TEST=OFF
  4. Compile everything (without our tests)

    make # use "make -j" for faster compilation

Usage

The general program call is:

./MolSim [-x <XML_file>] [-i <input_file>] [-g <generator input>] [-e <end_time>] [-d <delta_t>] [-w <writer>] [-c <calculator>] [-b <brownian_motion_velocity_mean>] [-r] [-m <execution_mode>]
Flag Possible Values Explanation Default
i path/to/file This is the relative or absolute path to your input_file. None
x path/to/file This is the relative or absolute path to your XML_file. None
g path/to/file Specify an input file used for the ParticleGenerator. None
e <double> The end_time value 1000
d <double> The delta_t value 0.14
w v, vtk, x, xyz Specifies the output writer, consequently also the output file format v (vtk)
c g, grav, gravitation, lj, lennardjones Declares what forces between the particles should be calculated lj (lennardjones)
b <double> The brownian motion velocity mean. Will be discarded for the JSON file generated particles None
r None Specifies whether random particles should be generated. None
m normal, debug, benchmark Specifies which execution mode should be used. Debug to enable logging, normal to disable logging or benchmark to disable all output files normal

⚠️ Random generated files only support the input file format of assignment 1. Also, you will need Python 3 to use it.

⚠️ You should mostly use XML input files only

Example:

./MolSim -g ../input_assignment_2.json -e 5 -d 0.0002

This will use:

  • input_assignment_2.json as input_file for the ParticleGenerator
  • 5 as end_time,
  • 0.0002 as delta_t
  • vtk as writer (default)
  • lennardjones as calculator (default)
  • 0.1 as brownian motion velocity mean (set in the input_file)
  • normal execution mode (default)

You should mostly just need the XML option, which is the preferred mode of input and the only inputmode that supports all features.

Running the tests

  1. Create the build directory and cd into it:
mkdir build && cd build 
  1. Build everything, including the tests in the build directory by turning on the option:
cmake .. -DBUILD_TEST=ON
  1. Compile everything, including the tests:
make # use "make -j6" for faster compilation
  1. Simply run ctestin the build directory:
ctest

Disabling the tests

If you do not want to compile the tests, you can turn off the build option in the CMake by executing cmake without any arguments (Step 2):

cmake .. # Makefile won't build the tests anymore

Features and Examples

See the different READMEs in /doc_pages/ for in depth explanations of all features, examples, media and more.

  • Basics with gravitational force
  • GTest
  • Logging
  • LennardJonesPotential
  • JSON input files
  • First Benchmarks
  • XML Parser using the xsdcxx compiler
  • Linked Cell method
  • boundary conditions
  • more benchmarks
  • Thermostat
  • Gravity
  • Checkpointing
  • Performance measurements on Linux Cluster
  • profiling & optimizations
  • Benchmarking
  • Membranes
  • multiple Parallelization strategies using OpenMP
  • different statistic writers
  • immovable particles
  • smoothed LennardJones and new Thermostat
  • data plotting using R

Miscellaneous

Running the program on an M1 processor

  1. Install homebrew (taken from https://brew.sh/)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Install xerces-c:
brew install xerces-c
  1. Install GCC 11.1.0:
brew install gcc
  1. Create a build directory and cd into it:
mkdir build && cd build
  1. Execute CMake and set gcc and g++ compiler you just installed:
cmake .. -DCMAKE_C_COMPILER=<path to your gcc-11> -DCMAKE_CXX_COMPILER=<path to your g++-11>

If you have installed gcc via homebrew on an M1 (Pro), then the default path to your gcc-11 is: /opt/homebrew/Cellar/gcc/11.2.0_1/bin/gcc-11.

The default path to your g++-11 is: /opt/homebrew/Cellar/gcc/11.2.0_1/bin/g++-11.

  1. And finally you can compile everything:
make -j

About

Group project for the practical course: PSE Molecular Dynamic WS 21/22

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages