diff options
Diffstat (limited to 'c++')
-rw-r--r-- | c++/SConscript | 37 | ||||
-rw-r--r-- | c++/examples/cavity_2d.cpp | 9 | ||||
-rw-r--r-- | c++/lattice.h | 19 |
3 files changed, 65 insertions, 0 deletions
diff --git a/c++/SConscript b/c++/SConscript new file mode 100644 index 0000000..d696204 --- /dev/null +++ b/c++/SConscript @@ -0,0 +1,37 @@ +#!/bin/false + +import os +import os.path +import glob + + +Import('env') + +dir_path = Dir('.').abspath + +# Environment for base library +core_env = env.Clone(); + +core_env.sources = sorted(glob.glob(dir_path + "/*.cpp")); +core_env.headers = sorted(glob.glob(dir_path + "/*.h")); + +env.sources += core_env.sources; +env.headers += core_env.headers; + + +## Shared lib +objects = [] +core_env.add_source_files(objects, core_env.sources, shared=False); + +# Cavity2D +core_env.cavity_2d_source = sorted(glob.glob(dir_path + "/examples/cavity_2d.cpp")); +env.sources += core_env.cavity_2d_source; +core_env.cavity_2d = core_env.Program('#bin/cavity_2d', [core_env.cavity_2d_source, core_env.objects]); + +# Set Alias +env.Alias('examples', [core_env.cavity_2d]); + +env.targets += ['examples']; + +# Install +env.Install('$prefix/bin', ['examples']); diff --git a/c++/examples/cavity_2d.cpp b/c++/examples/cavity_2d.cpp new file mode 100644 index 0000000..bb21e96 --- /dev/null +++ b/c++/examples/cavity_2d.cpp @@ -0,0 +1,9 @@ +#include "../lattice.h" + +#include <forstio/codec/data.h> + +int main(){ + saw::data<schema::Lattice2D<saw::schema::Float32>, saw::encode::Native> lattice{512, 512}; + + return 0; +} diff --git a/c++/lattice.h b/c++/lattice.h new file mode 100644 index 0000000..62752e8 --- /dev/null +++ b/c++/lattice.h @@ -0,0 +1,19 @@ +#pragma once + +#include <forstio/codec/schema.h> + +namespace kel { +namespace lbm { +namespace schema { +template<typename T, size_t D> +using Lattice = Array<T,D>; + +template<typename T> +using Lattice2D = Lattice<T,2>; + +template<typename T> +using Lattice3D = Lattice<T,3>; +} +} +} +} |