bubble-dynamics

Spherical bubble dynamics simulator
git clone https://git.0xfab.ch/bubble-dynamics.git
Log | Files | Refs | README | LICENSE

commit e1a4f02bfedf3f5ab57e06318a789d03546937ca
parent 3b2ccbbab9d8323b0b26d148298ccc8c81de841d
Author: Fabian Wermelinger <fabianw@mavt.ethz.ch>
Date:   Sat, 19 Dec 2020 18:12:07 +0100

Add meson build files

Diffstat:
DMakefile | 75---------------------------------------------------------------------------
Dmake.wrapper.sh | 11-----------
Ameson.build | 11+++++++++++
Ameson_options.txt | 1+
Drebuild.sh | 1-
Asrc/meson.build | 12++++++++++++
6 files changed, 24 insertions(+), 87 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,75 +0,0 @@ -CC = g++ - -debug ?= 0 -omp ?= 0 -prec ?= double -sse ?= 0 -align ?= 16 -sundials ?= 0 -eigen ?= 0 -pos ?= 0 -sos = sg - -LIBS = -CXXFLAGS = -std=c++11 -g -D_ALIGN_=$(align) -CXXFLAGS += $(extra) - -ifeq "$(debug)" "0" - CXXFLAGS += -O3 -DNDEBUG - CXXFLAGS += -fno-expensive-optimizations -falign-functions=16 -else - CXXFLAGS += -O0 -endif -ifeq "$(omp)" "1" - CXXFLAGS += -fopenmp -D_OMP_ -endif -ifeq "$(prec)" "float" - CXXFLAGS += -D_FLOAT_PRECISION_ - ifeq "$(sundials)" "1" - CXXFLAGS += -DSUNDIALS_SINGLE_PRECISION - endif -else - CXXFLAGS += -D_DOUBLE_PRECISION_ - ifeq "$(sundials)" "1" - CXXFLAGS += -DSUNDIALS_DOUBLE_PRECISION - endif -endif -ifeq "$(sse)" "1" - CXXFLAGS += -msse -msse2 -endif -# ifeq "$(sos)" "prescribed" # default is sg (stiffened gas) -# CXXFLAGS += -D_PRESCRIBED_SOS_ -# endif - -CXXFLAGS += -Iode_toolbox -Iode_toolbox/TimeStepper -Isrc -ifeq "$(sundials)" "1" - CXXFLAGS += -D_USE_SUNDIALS_ - CXXFLAGS += -IthirdParty/sundials/build/include - LIBS += -LthirdParty/sundials/build/lib -lsundials_cvode -lsundials_nvecserial -endif -ifeq "$(eigen)" "1" - CXXFLAGS += -D_USE_EIGEN_ - CXXFLAGS += -I/usr/local/opt/eigen/include/eigen3 -endif - -ifeq "$(pos)" "1" - CXXFLAGS += -D_POS_STATE_ -endif - -VPATH := src -SRC = src/bubbleDynamics.cpp -HDR = $(wildcard *.h) - -.DEFAULT_GOAL := bubbleDynamics -.PHONY := clean - -bubbleDynamics: $(SRC) $(HDR) - $(CC) $(CXXFLAGS) $(SRC) -o bubbleDynamics $(LIBS) - -clean: - rm -f *~ bubbleDynamics - rm -rf *.dSYM - -deepclean: - rm -f bubbleDynamics - find . -iname "*~" -exec rm -f {} \; diff --git a/make.wrapper.sh b/make.wrapper.sh @@ -1,11 +0,0 @@ -#!/bin/bash -# File : make.wrapper.sh -# Created : Fri Jun 09 2017 11:34:17 AM (-0700) -# Author : Fabian Wermelinger -# Description: make wrapper for vim -# Copyright 2017 ETH Zurich. All Rights Reserved. -time make -B \ - -j CC=g++-6 \ - eigen=1 pos=0 \ - prec=double \ - debug=0 diff --git a/meson.build b/meson.build @@ -0,0 +1,11 @@ +project('bubble_dynamics', 'cpp', + version: + '1.0', + default_options: ['cpp_std=c++11', 'b_ndebug=if-release'] +) + +lib_ode = subproject('ode_toolbox') +lib_ode_deps = lib_ode.get_variable('deps') +add_project_arguments(lib_ode.get_variable('cpp_args'), language: 'cpp') + +subdir('src') diff --git a/meson_options.txt b/meson_options.txt @@ -0,0 +1 @@ +option('position', type : 'boolean', value: false, description : 'Enable DoF for bubble translation') diff --git a/rebuild.sh b/rebuild.sh @@ -1 +0,0 @@ -make clean; make eigen=1 pos=1 diff --git a/src/meson.build b/src/meson.build @@ -0,0 +1,12 @@ +cpp_args = ['-D_USE_EIGEN_'] +eigen_dependency = dependency('eigen3', fallback: ['eigen', 'eigen_dep']) +if get_option('position') + cpp_args += ['-D_POS_STATE_'] +endif + +executable('rpbd', 'bubbleDynamics.cpp', + include_directories: 'kernels', + cpp_args: cpp_args, + dependencies: [lib_ode_deps, eigen_dependency], + install: true, +)