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/functors/analytical/indicator/MakeHeader | 37 ++
src/functors/analytical/indicator/indicCalc2D.cpp | 56 ++
src/functors/analytical/indicator/indicCalc2D.h | 127 ++++
src/functors/analytical/indicator/indicCalc2D.hh | 202 ++++++
src/functors/analytical/indicator/indicCalc3D.cpp | 50 ++
src/functors/analytical/indicator/indicCalc3D.h | 92 +++
src/functors/analytical/indicator/indicCalc3D.hh | 110 ++++
src/functors/analytical/indicator/indicator2D.h | 34 +
src/functors/analytical/indicator/indicator2D.hh | 34 +
src/functors/analytical/indicator/indicator3D.h | 34 +
src/functors/analytical/indicator/indicator3D.hh | 35 +
.../analytical/indicator/indicatorBaseF2D.cpp | 35 +
.../analytical/indicator/indicatorBaseF2D.h | 106 +++
.../analytical/indicator/indicatorBaseF2D.hh | 210 ++++++
.../analytical/indicator/indicatorBaseF3D.cpp | 34 +
.../analytical/indicator/indicatorBaseF3D.h | 77 +++
.../analytical/indicator/indicatorBaseF3D.hh | 321 +++++++++
src/functors/analytical/indicator/indicatorF2D.cpp | 41 ++
src/functors/analytical/indicator/indicatorF2D.h | 123 ++++
src/functors/analytical/indicator/indicatorF2D.hh | 256 ++++++++
src/functors/analytical/indicator/indicatorF3D.cpp | 57 ++
src/functors/analytical/indicator/indicatorF3D.h | 241 +++++++
src/functors/analytical/indicator/indicatorF3D.hh | 731 +++++++++++++++++++++
src/functors/analytical/indicator/module.mk | 27 +
.../indicator/smoothIndicatorBaseF2D.cpp | 34 +
.../analytical/indicator/smoothIndicatorBaseF2D.h | 144 ++++
.../analytical/indicator/smoothIndicatorBaseF2D.hh | 302 +++++++++
.../indicator/smoothIndicatorBaseF3D.cpp | 34 +
.../analytical/indicator/smoothIndicatorBaseF3D.h | 146 ++++
.../analytical/indicator/smoothIndicatorBaseF3D.hh | 342 ++++++++++
.../indicator/smoothIndicatorCalcF2D.cpp | 35 +
.../analytical/indicator/smoothIndicatorCalcF2D.h | 55 ++
.../analytical/indicator/smoothIndicatorCalcF2D.hh | 75 +++
.../indicator/smoothIndicatorCalcF3D.cpp | 34 +
.../analytical/indicator/smoothIndicatorCalcF3D.h | 55 ++
.../analytical/indicator/smoothIndicatorCalcF3D.hh | 73 ++
.../analytical/indicator/smoothIndicatorF2D.cpp | 39 ++
.../analytical/indicator/smoothIndicatorF2D.h | 79 +++
.../analytical/indicator/smoothIndicatorF2D.hh | 239 +++++++
.../analytical/indicator/smoothIndicatorF3D.cpp | 40 ++
.../analytical/indicator/smoothIndicatorF3D.h | 95 +++
.../analytical/indicator/smoothIndicatorF3D.hh | 439 +++++++++++++
42 files changed, 5330 insertions(+)
create mode 100644 src/functors/analytical/indicator/MakeHeader
create mode 100644 src/functors/analytical/indicator/indicCalc2D.cpp
create mode 100644 src/functors/analytical/indicator/indicCalc2D.h
create mode 100644 src/functors/analytical/indicator/indicCalc2D.hh
create mode 100644 src/functors/analytical/indicator/indicCalc3D.cpp
create mode 100644 src/functors/analytical/indicator/indicCalc3D.h
create mode 100644 src/functors/analytical/indicator/indicCalc3D.hh
create mode 100644 src/functors/analytical/indicator/indicator2D.h
create mode 100644 src/functors/analytical/indicator/indicator2D.hh
create mode 100644 src/functors/analytical/indicator/indicator3D.h
create mode 100644 src/functors/analytical/indicator/indicator3D.hh
create mode 100644 src/functors/analytical/indicator/indicatorBaseF2D.cpp
create mode 100644 src/functors/analytical/indicator/indicatorBaseF2D.h
create mode 100644 src/functors/analytical/indicator/indicatorBaseF2D.hh
create mode 100644 src/functors/analytical/indicator/indicatorBaseF3D.cpp
create mode 100644 src/functors/analytical/indicator/indicatorBaseF3D.h
create mode 100644 src/functors/analytical/indicator/indicatorBaseF3D.hh
create mode 100644 src/functors/analytical/indicator/indicatorF2D.cpp
create mode 100644 src/functors/analytical/indicator/indicatorF2D.h
create mode 100644 src/functors/analytical/indicator/indicatorF2D.hh
create mode 100644 src/functors/analytical/indicator/indicatorF3D.cpp
create mode 100644 src/functors/analytical/indicator/indicatorF3D.h
create mode 100644 src/functors/analytical/indicator/indicatorF3D.hh
create mode 100644 src/functors/analytical/indicator/module.mk
create mode 100644 src/functors/analytical/indicator/smoothIndicatorBaseF2D.cpp
create mode 100644 src/functors/analytical/indicator/smoothIndicatorBaseF2D.h
create mode 100644 src/functors/analytical/indicator/smoothIndicatorBaseF2D.hh
create mode 100644 src/functors/analytical/indicator/smoothIndicatorBaseF3D.cpp
create mode 100644 src/functors/analytical/indicator/smoothIndicatorBaseF3D.h
create mode 100644 src/functors/analytical/indicator/smoothIndicatorBaseF3D.hh
create mode 100644 src/functors/analytical/indicator/smoothIndicatorCalcF2D.cpp
create mode 100644 src/functors/analytical/indicator/smoothIndicatorCalcF2D.h
create mode 100644 src/functors/analytical/indicator/smoothIndicatorCalcF2D.hh
create mode 100644 src/functors/analytical/indicator/smoothIndicatorCalcF3D.cpp
create mode 100644 src/functors/analytical/indicator/smoothIndicatorCalcF3D.h
create mode 100644 src/functors/analytical/indicator/smoothIndicatorCalcF3D.hh
create mode 100644 src/functors/analytical/indicator/smoothIndicatorF2D.cpp
create mode 100644 src/functors/analytical/indicator/smoothIndicatorF2D.h
create mode 100644 src/functors/analytical/indicator/smoothIndicatorF2D.hh
create mode 100644 src/functors/analytical/indicator/smoothIndicatorF3D.cpp
create mode 100644 src/functors/analytical/indicator/smoothIndicatorF3D.h
create mode 100644 src/functors/analytical/indicator/smoothIndicatorF3D.hh
(limited to 'src/functors/analytical/indicator')
diff --git a/src/functors/analytical/indicator/MakeHeader b/src/functors/analytical/indicator/MakeHeader
new file mode 100644
index 0000000..66496d7
--- /dev/null
+++ b/src/functors/analytical/indicator/MakeHeader
@@ -0,0 +1,37 @@
+# This file is part of the OpenLB library
+#
+# Copyright (C) 2007 Mathias Krause
+# 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.
+
+
+generic :=
+
+precompiled := indicatorBaseF2D \
+ indicatorBaseF3D \
+ indicatorF2D \
+ indicatorF3D \
+ indicCalc2D \
+ indicCalc3D \
+ smoothIndicatorF2D \
+ smoothIndicatorF3D \
+ smoothIndicatorBaseF2D \
+ smoothIndicatorBaseF3D \
+ smoothIndicatorCalcF2D \
+ smoothIndicatorCalcF3D
diff --git a/src/functors/analytical/indicator/indicCalc2D.cpp b/src/functors/analytical/indicator/indicCalc2D.cpp
new file mode 100644
index 0000000..ba54bde
--- /dev/null
+++ b/src/functors/analytical/indicator/indicCalc2D.cpp
@@ -0,0 +1,56 @@
+/* This file is part of the OpenLB library
+ *
+ * Copyright (C) 2014-2016 Mathias J. Krause, Cyril Masquelier,
+ * Benjamin Förster, Albert Mink
+ * 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.
+*/
+
+#include "indicCalc2D.h"
+#include "indicCalc2D.hh"
+
+
+namespace olb {
+
+// arithmetic helper class for Indical 1d functors
+template class IndicCalc1D;
+template class IndicPlus1D;
+template class IndicMinus1D;
+template class IndicMultiplication1D;
+
+// arithmetic helper class for Indical 2d functors
+template class IndicCalc2D;
+template class IndicCalc2D;
+template class IndicCalc2D;
+
+template std::shared_ptr> operator+(std::shared_ptr> lhs,
+ std::shared_ptr> rhs);
+template std::shared_ptr> operator-(std::shared_ptr> lhs,
+ std::shared_ptr> rhs);
+template std::shared_ptr> operator*(std::shared_ptr> lhs,
+ std::shared_ptr> rhs);
+
+template std::shared_ptr> operator+(IndicatorIdentity2D & lhs,
+ std::shared_ptr>);
+template std::shared_ptr> operator-(IndicatorIdentity2D & lhs,
+ std::shared_ptr>);
+template std::shared_ptr> operator*(IndicatorIdentity2D & lhs,
+ std::shared_ptr>);
+
+}
diff --git a/src/functors/analytical/indicator/indicCalc2D.h b/src/functors/analytical/indicator/indicCalc2D.h
new file mode 100644
index 0000000..a5f6449
--- /dev/null
+++ b/src/functors/analytical/indicator/indicCalc2D.h
@@ -0,0 +1,127 @@
+/* This file is part of the OpenLB library
+ *
+ * Copyright (C) 2014-2016 Mathias J. Krause, Cyril Masquelier,
+ * Benjamin Förster, Albert Mink
+ * 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 INDIC_CALC_2D_H
+#define INDIC_CALC_2D_H
+
+#include "indicatorBaseF2D.h"
+#include "utilities/arithmetic.h"
+
+namespace olb {
+
+
+/*
+ * arithmetic helper classes for IndicatorF1D, IndicatorF2D, smoothIndicator2D
+ * UNION +
+ * WITHOUT -
+ * INTERSECTION *
+*/
+
+//////////////////////////////// IndicCalc1D ////////////////////////////////
+/// arithmetic helper class for Indicator 1d functors
+template
+class IndicCalc1D : public IndicatorF1D {
+protected:
+ IndicatorF1D& _f;
+ IndicatorF1D& _g;
+public:
+ // set image/target dimensions of IndicCalc1D as well
+ IndicCalc1D(IndicatorF1D& f, IndicatorF1D& g);
+};
+
+/// addition functor acts as union
+template
+class IndicPlus1D : public IndicCalc1D {
+public:
+ IndicPlus1D(IndicatorF1D& f, IndicatorF1D& g);
+ bool operator() (bool output[], const S input[]) override;
+};
+
+/// subtraction functor acts as without
+template
+class IndicMinus1D : public IndicCalc1D {
+public:
+ IndicMinus1D(IndicatorF1D& f, IndicatorF1D& g);
+ bool operator() (bool output[], const S input[]) override;
+};
+
+/// multiplication functor acts as intersection
+template
+class IndicMultiplication1D : public IndicCalc1D {
+public:
+ IndicMultiplication1D(IndicatorF1D& f, IndicatorF1D& g);
+ bool operator() (bool output[], const S input[]) override;
+};
+
+
+
+//////////////////////////////// indicCalc2D ////////////////////////////////
+/// arithmetic helper class for Indicator 2D functors
+template class F>
+class IndicCalc2D : public IndicatorF2D {
+protected:
+ std::shared_ptr> _f;
+ std::shared_ptr> _g;
+public:
+ IndicCalc2D( std::shared_ptr> f, std::shared_ptr> g );
+
+ bool operator() (bool output[], const S input[2]) override;
+};
+
+/// Addition functor (W==bool: Union)
+template
+using IndicPlus2D = IndicCalc2D;
+template
+using IndicMinus2D = IndicCalc2D;
+template
+using IndicMultiplication2D = IndicCalc2D;
+
+template class F1, template class F2,
+ typename=typename std::enable_if, F1>::value>::type>
+std::shared_ptr> operator+(std::shared_ptr> lhs, std::shared_ptr> rhs);
+
+template class F1, template class F2,
+ typename=typename std::enable_if, F1>::value>::type>
+std::shared_ptr> operator-(std::shared_ptr> lhs, std::shared_ptr> rhs);
+
+template class F1, template class F2,
+ typename=typename std::enable_if, F1>::value>::type>
+std::shared_ptr> operator*(std::shared_ptr> lhs, std::shared_ptr> rhs);
+
+template class F1, template class F2,
+ typename=typename std::enable_if, F1>::value>::type>
+std::shared_ptr> operator+(F1 & lhs, std::shared_ptr> rhs);
+
+template class F1, template class F2,
+ typename=typename std::enable_if, F1>::value>::type>
+std::shared_ptr> operator-(F1 & lhs, std::shared_ptr> rhs);
+
+template class F1, template class F2,
+ typename=typename std::enable_if, F1>::value>::type>
+std::shared_ptr> operator*(F1 & lhs, std::shared_ptr> rhs);
+
+
+} // end namespace olb
+
+#endif
diff --git a/src/functors/analytical/indicator/indicCalc2D.hh b/src/functors/analytical/indicator/indicCalc2D.hh
new file mode 100644
index 0000000..f325bc7
--- /dev/null
+++ b/src/functors/analytical/indicator/indicCalc2D.hh
@@ -0,0 +1,202 @@
+/* This file is part of the OpenLB library
+ *
+ * Copyright (C) 2014-2016 Mathias J. Krause, Cyril Masquelier,
+ * Benjamin Förster, Albert Mink
+ * 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 INDIC_CALC_2D_HH
+#define INDIC_CALC_2D_HH
+
+#include "indicCalc2D.h"
+
+namespace olb {
+
+
+//////////////////////////////// IndicCalc1D ////////////////////////////////
+template
+IndicCalc1D::IndicCalc1D(IndicatorF1D& f, IndicatorF1D& g)
+ : _f(f), _g(g)
+{
+ this->_myMin[0] = std::min(f.getMin()[0], g.getMin()[0]);
+ this->_myMax[0] = std::max(f.getMax()[0], g.getMax()[0]);
+ std::swap(f._ptrCalcC, this->_ptrCalcC);
+}
+
+
+template
+IndicPlus1D::IndicPlus1D(IndicatorF1D& f, IndicatorF1D& g)
+ : IndicCalc1D(f, g)
+{}
+
+// returns 1 if( f==1 || g==1 ) UNION
+template
+bool IndicPlus1D::operator() (bool output[], const S input[])
+{
+ this->_f(output, input);
+ bool tmp;
+ this->_g(&tmp, input);
+ output[0] |= tmp;
+ return true;
+}
+
+
+template
+IndicMinus1D::IndicMinus1D(IndicatorF1D& f, IndicatorF1D& g)
+ : IndicCalc1D(f, g)
+{}
+
+// returns 1 if( f==1 && g==0 ) WITHOUT
+template
+bool IndicMinus1D::operator()(bool output[], const S input[])
+{
+ this->_f(output, input);
+ bool tmp;
+ this->_g(&tmp, input);
+ output[0] &= !tmp;
+ return true;
+}
+
+
+
+template
+IndicMultiplication1D::IndicMultiplication1D(IndicatorF1D& f, IndicatorF1D& g)
+ : IndicCalc1D(f, g)
+{}
+
+// returns 1 if( f==1 && g==1 ) INTERSECTION
+template
+bool IndicMultiplication1D::operator() (bool output[], const S input[])
+{
+ this->_f(output, input);
+ bool tmp;
+ this->_g(&tmp, input);
+ output[0] &= tmp;
+ return true;
+}
+
+
+
+template
+IndicatorF1D& IndicatorF1D::operator+(IndicatorF1D& rhs)
+{
+ auto tmp = std::make_shared< IndicPlus1D >(*this,rhs);
+ this->_ptrCalcC = tmp;
+ return *tmp;
+}
+
+template
+IndicatorF1D& IndicatorF1D::operator-(IndicatorF1D& rhs)
+{
+ auto tmp = std::make_shared< IndicMinus1D >(*this,rhs);
+ this->_ptrCalcC = tmp;
+ return *tmp;
+}
+
+template
+IndicatorF1D& IndicatorF1D::operator*(IndicatorF1D& rhs)
+{
+ auto tmp = std::make_shared< IndicMultiplication1D >(*this,rhs);
+ this->_ptrCalcC = tmp;
+ return *tmp;
+}
+
+
+
+
+//////////////////////////////// IndicCalc2D ////////////////////////////////
+template class F>
+IndicCalc2D::IndicCalc2D(std::shared_ptr> f, std::shared_ptr> g)
+ : _f(f), _g(g)
+{
+ for ( int i=0; i<2; i++) {
+ this->_myMin[i] = std::min(_f->getMin()[i], _g->getMin()[i]);
+ this->_myMax[i] = std::max(_f->getMax()[i], _g->getMax()[i]);
+ }
+}
+
+template class F>
+bool IndicCalc2D::operator()( bool output[], const S input[2])
+{
+ // componentwise operation on equidimensional functors
+ bool* outputF = output;
+ _f->operator()(outputF, input);
+
+ bool outputG[this->getTargetDim()];
+ _g->operator()(outputG, input);
+
+ for (int i = 0; i < this->getTargetDim(); i++) {
+ output[i] = F()(outputF[i], outputG[i]);
+ }
+ return output;
+}
+
+
+
+
+
+//// no association to a operator+ from a class is needed, thus we have these free functions
+template class F1, template class F2,
+ typename>
+std::shared_ptr> operator+(std::shared_ptr> lhs, std::shared_ptr> rhs)
+{
+ return std::make_shared>(lhs, rhs);
+}
+
+template class F1, template class F2,
+ typename>
+std::shared_ptr> operator-(std::shared_ptr> lhs, std::shared_ptr> rhs)
+{
+ return std::make_shared>(lhs, rhs);
+}
+
+template class F1, template class F2,
+ typename>
+std::shared_ptr> operator*(std::shared_ptr> lhs, std::shared_ptr> rhs)
+{
+ return std::make_shared>(lhs, rhs);
+}
+
+// template specialization for indicatorIdentity
+template class F1, template class F2,
+ typename>
+std::shared_ptr> operator+(F1 & lhs, std::shared_ptr> rhs)
+{
+ return lhs._f + rhs;
+}
+
+template class F1, template class F2,
+ typename>
+std::shared_ptr> operator-(F1 & lhs, std::shared_ptr> rhs)
+{
+ return lhs._f - rhs;
+}
+
+template class F1, template class F2,
+ typename>
+std::shared_ptr> operator*(F1 & lhs, std::shared_ptr> rhs)
+{
+ return lhs._f * rhs;
+}
+
+
+} // end namespace olb
+
+#endif
diff --git a/src/functors/analytical/indicator/indicCalc3D.cpp b/src/functors/analytical/indicator/indicCalc3D.cpp
new file mode 100644
index 0000000..8ae86cf
--- /dev/null
+++ b/src/functors/analytical/indicator/indicCalc3D.cpp
@@ -0,0 +1,50 @@
+/* This file is part of the OpenLB library
+ *
+ * Copyright (C) 2018 Albert Mink
+ * 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.
+*/
+
+#include "indicCalc3D.h"
+#include "indicCalc3D.hh"
+
+
+namespace olb {
+
+// arithmetic helper class for indicator 3d functors
+template class IndicCalc3D;
+template class IndicCalc3D;
+template class IndicCalc3D;
+
+template std::shared_ptr> operator+(std::shared_ptr> lhs,
+ std::shared_ptr> rhs);
+template std::shared_ptr> operator-(std::shared_ptr> lhs,
+ std::shared_ptr> rhs);
+template std::shared_ptr> operator*(std::shared_ptr> lhs,
+ std::shared_ptr> rhs);
+
+template std::shared_ptr> operator+(IndicatorIdentity3D & lhs,
+ std::shared_ptr>);
+template std::shared_ptr> operator-(IndicatorIdentity3D & lhs,
+ std::shared_ptr>);
+template std::shared_ptr> operator*(IndicatorIdentity3D & lhs,
+ std::shared_ptr>);
+
+}
+
diff --git a/src/functors/analytical/indicator/indicCalc3D.h b/src/functors/analytical/indicator/indicCalc3D.h
new file mode 100644
index 0000000..8d7f667
--- /dev/null
+++ b/src/functors/analytical/indicator/indicCalc3D.h
@@ -0,0 +1,92 @@
+/* This file is part of the OpenLB library
+ *
+ * Copyright (C) 2018 Albert Mink
+ * 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 INDIC_CALC_3D_H
+#define INDIC_CALC_3D_H
+
+#include "utilities/arithmetic.h"
+#include "indicatorBaseF3D.h"
+
+namespace olb {
+
+
+/*
+ * arithmetic helper classes for IndicatorF3D, smoothIndicator3D
+ * UNION +
+ * WITHOUT -
+ * INTERSECTION *
+*/
+
+//////////////////////////////// indicCalc3D ////////////////////////////////
+/// arithmetic helper class for Indicator 3d functors
+template class F>
+class IndicCalc3D : public IndicatorF3D {
+protected:
+ std::shared_ptr> _f;
+ std::shared_ptr> _g;
+public:
+ IndicCalc3D( std::shared_ptr> f, std::shared_ptr> g );
+
+ bool operator() (bool output[], const S input[3]) override;
+};
+
+/// Addition functor (W==bool: Union)
+template
+using IndicPlus3D = IndicCalc3D;
+template
+using IndicMinus3D = IndicCalc3D;
+template
+using IndicMultiplication3D = IndicCalc3D;
+
+/** Free function implements lhs+rhs, only for IndicaotrsF3D types through enable_if and is_base_of
+ *
+ * \tparam S usual type for source dimension of the functor
+ * \tparam F1 lhs has to be derived from IndicatorF3D, otherwise function is disabled
+ * \tparam F2 rhs
+ */
+template class F1, template class F2,
+ typename=typename std::enable_if, F1>::value>::type>
+std::shared_ptr> operator+(std::shared_ptr> lhs, std::shared_ptr> rhs);
+
+template class F1, template class F2,
+ typename=typename std::enable_if, F1>::value>::type>
+std::shared_ptr> operator-(std::shared_ptr> lhs, std::shared_ptr> rhs);
+
+template class F1, template class F2,
+ typename=typename std::enable_if, F1>::value>::type>
+std::shared_ptr> operator*(std::shared_ptr> lhs, std::shared_ptr> rhs);
+
+template class F1, template class F2,
+ typename=typename std::enable_if, F1>::value>::type>
+std::shared_ptr> operator+(F1 & lhs, std::shared_ptr> rhs);
+
+template class F1, template class F2,
+ typename=typename std::enable_if, F1>::value>::type>
+std::shared_ptr> operator-(F1 & lhs, std::shared_ptr> rhs);
+
+template class F1, template class F2,
+ typename=typename std::enable_if, F1>::value>::type>
+std::shared_ptr> operator*(F1 & lhs, std::shared_ptr> rhs);
+} // end namespace olb
+
+#endif
diff --git a/src/functors/analytical/indicator/indicCalc3D.hh b/src/functors/analytical/indicator/indicCalc3D.hh
new file mode 100644
index 0000000..d087ed9
--- /dev/null
+++ b/src/functors/analytical/indicator/indicCalc3D.hh
@@ -0,0 +1,110 @@
+/* This file is part of the OpenLB library
+ *
+ * Copyright (C) 2018 Albert Mink
+ * 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 INDIC_CALC_3D_HH
+#define INDIC_CALC_3D_HH
+
+#include "indicCalc3D.h"
+
+namespace olb {
+
+
+template class F>
+IndicCalc3D::IndicCalc3D(std::shared_ptr