From 94d3e79a8617f88dc0219cfdeedfa3147833719d Mon Sep 17 00:00:00 2001
From: Adrian Kummerlaender
Date: Mon, 24 Jun 2019 14:43:36 +0200
Subject: Initialize at openlb-1-3
---
src/dynamics/descriptorFunction.h | 190 ++++++++++++++++++++++++++++++++++++++
1 file changed, 190 insertions(+)
create mode 100644 src/dynamics/descriptorFunction.h
(limited to 'src/dynamics/descriptorFunction.h')
diff --git a/src/dynamics/descriptorFunction.h b/src/dynamics/descriptorFunction.h
new file mode 100644
index 0000000..00da7dc
--- /dev/null
+++ b/src/dynamics/descriptorFunction.h
@@ -0,0 +1,190 @@
+/* This file is part of the OpenLB library
+ *
+ * Copyright (C) 2019 Adrian Kummerlaender
+ * E-mail contact: info@openlb.net
+ * The most recent release of OpenLB can be downloaded at
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef DESCRIPTOR_FUNCTION_H
+#define DESCRIPTOR_FUNCTION_H
+
+#include
+#include
+
+#include "descriptorTag.h"
+#include "utilities/fraction.h"
+
+namespace olb {
+
+template class Vector;
+
+namespace descriptors {
+
+/// \defgroup descriptor_interface Descriptor functions
+/// \ingroup descriptor
+//@{
+
+/// \defgroup descriptor_interface_details Descriptor data
+/// \ingroup descriptor_interface
+//@{
+
+namespace data {
+
+using utilities::Fraction;
+
+template
+constexpr int vicinity = {};
+
+template
+constexpr int c[Q][D] = {};
+
+template
+constexpr int opposite[Q] = {};
+
+template
+constexpr Fraction t[Q] = {};
+
+template
+constexpr Fraction cs2 = {};
+
+template
+constexpr Fraction lambda_e = {};
+
+template
+constexpr Fraction lambda_h = {};
+
+}
+
+template
+constexpr int vicinity()
+{
+ return data::vicinity;
+}
+
+template
+constexpr int c(unsigned iPop, unsigned iDim)
+{
+ return data::c[iPop][iDim];
+}
+
+template
+constexpr Vector c(unsigned iPop)
+{
+ return Vector(data::c[iPop]);
+}
+
+template
+constexpr int opposite(unsigned iPop)
+{
+ return data::opposite[iPop];
+}
+
+template
+constexpr T t(unsigned iPop, tag::DEFAULT)
+{
+ return data::t[iPop].template as();
+}
+
+template
+constexpr T invCs2()
+{
+ return data::cs2.template inverseAs();
+}
+
+template
+constexpr T lambda_e()
+{
+ return data::lambda_e.template inverseAs();
+}
+
+template
+constexpr T lambda_h()
+{
+ return data::lambda_h.template inverseAs();
+}
+
+//@}
+
+template
+constexpr int d()
+{
+ return DESCRIPTOR::d;
+}
+
+template
+constexpr int q()
+{
+ return DESCRIPTOR::q;
+}
+
+template
+constexpr int vicinity()
+{
+ return vicinity();
+}
+
+template
+constexpr int c(unsigned iPop, unsigned iDim)
+{
+ return c(iPop, iDim);
+}
+
+template
+constexpr Vector c(unsigned iPop)
+{
+ return c(iPop);
+}
+
+template
+constexpr int opposite(unsigned iPop)
+{
+ return opposite(iPop);
+}
+
+template
+constexpr T t(unsigned iPop)
+{
+ return t(iPop, typename DESCRIPTOR::category_tag());
+}
+
+template
+constexpr T invCs2()
+{
+ return invCs2();
+}
+
+template
+constexpr T lambda_e()
+{
+ return lambda_e();
+}
+
+template
+constexpr T lambda_h()
+{
+ return lambda_h();
+}
+
+//@}
+
+}
+
+}
+
+#endif
--
cgit v1.2.3