All Projects → acgetchell → CDT-plusplus

acgetchell / CDT-plusplus

Licence: BSD-3-Clause License
Causal Dynamical Triangulations in C++ using CGAL

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects
shell
77523 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to CDT-plusplus

commonpp
Small library helping you with basic stuff like getting metrics out of your code, thread naming, etc.
Stars: ✭ 29 (-40.82%)
Mutual labels:  boost, tbb
cpptemplate
A template project (library and executable) for C++ projects with cmake, ctest, vcpkg, circleci, and automated document deploymend via doxygen to gh-pages
Stars: ✭ 30 (-38.78%)
Mutual labels:  doxygen, vcpkg
get-cmake
Install and Cache latest CMake and ninja executables for your workflows on your GitHub
Stars: ✭ 52 (+6.12%)
Mutual labels:  ninja, vcpkg
CppBuildTasks
Build C++ software with vcpkg and CMake (with CMakeLists.txt or CMakeSettings.json). Samples provided use both self-hosted or Microsoft hosted agent, using Docker and Pipeline Caching as well. The same tasks are available as GitHub actions at https://github.com/lukka/run-cmake https://github.com/lukka/run-vcpkg -=-
Stars: ✭ 26 (-46.94%)
Mutual labels:  ninja, vcpkg
FFmpegPlayer
Simple FFmpeg video player
Stars: ✭ 72 (+46.94%)
Mutual labels:  boost, vcpkg
firejailed-tor-browser
HOWTO: Firejailed Tor Browser
Stars: ✭ 18 (-63.27%)
Mutual labels:  tbb
doxybook2
Doxygen XML to Markdown (or JSON)
Stars: ✭ 140 (+185.71%)
Mutual labels:  doxygen
malloy
A C++ library providing embeddable server & client components for both HTTP and WebSocket.
Stars: ✭ 29 (-40.82%)
Mutual labels:  boost
boost beast websocket echo
A collection of Demo applications to try to help you understand how Asio and Beast work
Stars: ✭ 12 (-75.51%)
Mutual labels:  boost
CGAL.jl
CGAL meets Julia
Stars: ✭ 21 (-57.14%)
Mutual labels:  cgal
getboost
NuGet packages for Boost framework.
Stars: ✭ 49 (+0%)
Mutual labels:  boost
foxy
Session-based Beast/Asio wrapper requiring C++14
Stars: ✭ 61 (+24.49%)
Mutual labels:  catch2
tracer
Renderer using C++, Embree and USD to achieve Path Tracing techniques on the CPU
Stars: ✭ 40 (-18.37%)
Mutual labels:  tbb
rdoxygen
Create doxygen documentation for R package C++ code
Stars: ✭ 15 (-69.39%)
Mutual labels:  doxygen
openload dl
A python library and CLI tool that makes easy to download files from openload.co
Stars: ✭ 36 (-26.53%)
Mutual labels:  docopt
invoice-ninja
Invoice Ninja
Stars: ✭ 12 (-75.51%)
Mutual labels:  ninja
DynAdjust
Least squares adjustment software
Stars: ✭ 43 (-12.24%)
Mutual labels:  tbb
microframeworks-showcase
A simple grocery list webapplication implemented with the Microframeworks Spark Java, Jodd, Ninja, Javalite, Pippo and Ratpack
Stars: ✭ 29 (-40.82%)
Mutual labels:  ninja
docopt.swift
A command-line interface description language and parser that will make you smile http://docopt.org/
Stars: ✭ 53 (+8.16%)
Mutual labels:  docopt
lanceroid
Lancer, Berserker, Ninja Barrage/Punish/HarmoniusBurningBreath Auto Attack Macro
Stars: ✭ 11 (-77.55%)
Mutual labels:  ninja

CDT-plusplus

Build Status Windows Build status Language grade: C/C++ Language grade: Python CodeQL codecov Quality Gate Status Open Issues Join the chat at https://gitter.im/acgetchell/CDT-plusplus Gitpod Ready-to-Code

Quantize spacetime on your laptop.

Small foliated Delaunay triangulation

Introduction

For an introduction to Causal Dynamical Triangulations, including the foundations and recent results, please see the wiki.

Causal Dynamical Triangulations in C++ uses the Computational Geometry Algorithms Library, Boost, TBB, and Eigen. Arbitrary-precision numbers and functions are by MPFR and GMP. Docopt provides a beautiful command-line interface. Melissa E. O'Neill's Permuted Congruential Generators library provides high-quality RNGs that pass L'Ecuyer's TestU01 statistical tests. Catch provides BDD/TDD. vcpkg provides library management and building. Doxygen provides automated document generation. {fmt} provides a safe and fast alternative to iostream. spdlog provides fast, multithreaded logging. PVS-Studio and LGTM provide commercial-grade static analysis and security checks. CometML provides machine learning for model building.

Goals

  • Cross-platform support on Linux, macOS (x64 & arm64), and Windows
  • Cross-compiler support on gcc, clang, and MSVC
  • Develop with literate programming using Doxygen
  • Efficient Pure Functional Programming in C++ Using Move Semantics
  • Test using CTest
  • Develop using Behavior-driven development (BDD) with Catch
  • Continuous integration by Travis-CI on macOS and Linux with gcc/Clang
  • Continuous integration by AppVeyor on Windows with MSVC
  • Continuous integration by Github Actions on the leading edge
  • 3D Simplex
  • 3D Spherical triangulation
  • 2+1 foliation
  • Integrate Docopt CLI
  • S3 Bulk action
  • 3D Ergodic moves
  • High-quality Random Number Generation with M.E. O'Neill's PCG library
  • Multithreading via TBB
  • Automated code analysis with LGTM
  • Build/debug with Visual Studio 2019
  • Use {fmt} library (instead of iostream)
  • Static code analysis with PVS-Studio
  • 3D Metropolis algorithm
  • Multithreaded logging with spdlog
  • Output via HDF5
  • A Surface mesh manifold of 3D Triangulation
  • 4D Simplex
  • 4D Spherical triangulation
  • 3+1 foliation
  • S4 Bulk action
  • 4D Ergodic moves
  • Initialize two masses
  • The shortest path algorithm
  • Einstein tensor
  • Complete test coverage
  • Complete documentation
  • Quantize Spacetime!

Quickstart

Open in Gitpod

Setup

This project uses CMake+Ninja to build and vcpkg to manage C++ libraries. Using C++20 features, it successfully builds with AppleClang, gcc-10, clang-10, and Visual Studio 2019.

Short

If you use Docker:

docker pull acgetchell/cdt-plusplus
docker run -it --name cdt cdt-plusplus

Binaries will be in /CDT-plusplus/build/src. Proceed to Use.

Long

On macOS or Linux, you will first need to install some prerequisites using your favorite package manager (e.g. homebrew or apt):

  • build-essential (Linux only)
  • automake
  • autoconf
  • autoconf-archive
  • libtool (macOS) or libtool-bin (Linux)
  • pkg-config
  • texinfo
  • yasm
  • ninja (macOS) or ninja-build (Linux)

Next, install vcpkg:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install

vcpkg is then invoked by CMake in vcpkg manifest mode and install the project dependencies listed in vcpkg.json into a local vcpkg_installed directory.

Proceed to Build.

Build

You'll need a reasonably modern compiler that supports C++20 features.

Clone the repo:

git clone https://github.com/acgetchell/CDT-plusplus.git

To get CMake and the build scripts to run correctly, you'll need to set $VCPKG_ROOT to wherever you cloned vcpkg, e.g.

export VCPKG_ROOT="$HOME/vcpkg"

This will set the CMAKE_TOOLCHAIN_FILE option for CMake.

You can optionally pre-build the project dependencies (100+ packages) by running at the top level of the project:

vcpkg install --feature-flags=manifests

At this point, you can build via the scripts in scripts, which will build the project and install the dependencies into vcpkg_installed.

Project Layout

The project is similar to PitchFork Layout, as follows:

  • .github - GitHub specific settings
  • build - Ephemeral out-of-source build directory
  • cmake - Cmake configurations
  • docs - Documentation
  • external - Includes submodules of external projects (none so far, all using vcpkg)
  • include - Header files
  • scripts - Build, test, and run scripts
  • src - Source files
  • tests - Unit tests

Run

If you want to get started right away, run fast-build.sh or fast-build.bat, depending on your operating system, from scripts. This will compile the appropriate executables in RELEASE mode with no tests.

This should result in the main program executable, cdt in build/src or build\Debug, along with several others.

  • cdt-opt is a simplified version with hard-coded inputs, mainly useful for debugging and scripting
  • initialize is used by CometML to run parameter optimization

Use

CDT-plusplus uses Docopt to parse options from the help message, and so understands long or short argument formats, provided the short argument given is an unambiguous match to a longer one. The help message should be instructive:

./build/src/cdt --help
cdt started at 2021-08-08.20:18:58PDT
Causal Dynamical Triangulations in C++ using CGAL.

Copyright (c) 2014-2021 Adam Getchell

A program that generates d-dimensional triangulated spacetimes
with a defined causal structure and evolves them according
to the Metropolis algorithm. Specify the number of passes to control
how much evolution is desired. Each pass attempts a number of ergodic
moves equal to the number of simplices in the simulation.

Usage:./cdt (--spherical | --toroidal) -n SIMPLICES -t TIMESLICES [-d DIM]
            [--init INITIAL] [--foliate FOLIATION] -k K --alpha ALPHA
            --lambda LAMBDA [-p PASSES] [-c CHECKPOINT]

Examples:
./cdt --spherical -n 32000 -t 11 --alpha 0.6 -k 1.1 --lambda 0.1 --passes 1000
./cdt --s -n32000 -t11 -a.6 -k1.1 -l.1 -p1000

Options:
  -h --help                   Show this message
  --version                   Show program version
  -n SIMPLICES                Approximate number of simplices
  -t TIMESLICES               Number of timeslices
  -d DIM                      Dimensionality [default: 3]
  -i --init INITIAL           Initial radius [default: 1]
  --foliate FOLIATION         Foliation spacing between timeslices [default: 1]
  -a --alpha ALPHA            Negative squared geodesic length of 1-d
                              timelike edges
  -k K                        K = 1/(8*pi*G_newton)
  -l --lambda LAMBDA          K * Cosmological constant
  -p --passes PASSES          Number of passes [default: 100]
  -c --checkpoint CHECKPOINT  Checkpoint every n passes [default: 10]


The dimensionality of the spacetime is such that each slice of spacetime is d-1-dimensional, so setting d=3 generates 2 spacelike dimensions and one timelike dimension, with a defined global time foliation. A d-dimensional simplex will have some d-1 sub-simplices that are purely spacelike (all on the same timeslice) as well as some that are timelike (span two timeslices). In CDT we actually care more about the timelike links (in 2+1 spacetime), and the timelike faces (in 3+1 spacetime).

Document

Online documentation is at https://adamgetchell.org/CDT-plusplus/ automatically generated by Travis-CI.

If you have Doxygen installed you can generate the same information locally using the configuration file in docs\Doxyfile by simply typing at the top level directory (Doxygen will recursively search):

doxygen ./docs/Doxyfile

This will generate a docs/html/ directory containing documentation generated from CDT++ source files. USE_MATHJAX has been enabled in Doxyfile so that the LaTeX formulae can be rendered in the html documentation using MathJax. HAVE_DOT is set to YES which allows various graphs to be autogenerated by Doxygen using GraphViz. If you do not have GraphViz installed, set this option to NO (along with UML_LOOK).

Test

In the scripts directory, run build.sh or build.bat depending on your operating system.

Unit tests run (in build/tests or build\tests\Debug) via CDT_test, the Catch executable:

./CDT_test

or (Windows):

CDT_test.exe

You can also run both CTest integration and Catch unit tests in the build directory with:

cmake --build . --target test

or (Windows):

ctest -C Debug

In addition to the command line output, you can see detailed results in the build/Testing directory which is generated thereby.

Deactivate Unit tests with -D ENABLE_TESTING:BOOL=FALSE, e.g. scripts/fast-build.sh.

Static Analysis

This project follows the CppCore Guidelines as enforced by ClangTidy, which you can install and then run using the clang-tidy.sh script:

sudo apt-get install clang-tidy
cd scripts
./clang-tidy.sh

(Or use your favorite linter plugin for your editor/IDE.)

The cppcheck.sh script runs a quick static analysis using cppcheck.

brew install cppcheck
cd scripts
./cppcheck-build.sh

Clang comes with scan-build which can run a much more thorough, but slower static analysis integrated with CMake and Ninja.

./scan.sh

Sanitizers

AddressSanitizer + UndefinedBehaviorSanitizer, LeakSanitizer, MemorySanitizer, and ThreadSanitizer are run with scripts/asan.sh, scripts/lsan.sh, scripts/msan.sh, and scripts/tsan.sh. They are also checked by Travis-CI during commits.

Optimize Parameters

CometML is used to record Experiments which conduct Model Optimization. The script to do this is optimize-initialize.py. In order for this to work, you must install the following into your Python virtual environment.

pip install tensorflow
pip install comet-ml

You can then run experiments and look at results on https://www.comet.ml!

Visualize

Currently, looking for a good visualization library. GeomView has been deprecated and the interface with CGAL is not maintained.

Contribute

Please see CONTRIBUTING.md and our CODE_OF_CONDUCT.md.

Your code should pass Continuous Integration:

Optional:

Issues

vcpkg's version of date has an unfixed bug #23637 which produces use-of-uninitialized-value in MemorySanitizer.

Catch also produces (#2395) use-of-uninitialized-value in MemorySanitizer.

Docopt also has a use-of-uninitialized-value bug (#149) for which there is pull request #150.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].