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/lattice/superBaseF3D.h | 231 ++++++++++++++++++++++++++++++++++++
1 file changed, 231 insertions(+)
create mode 100644 src/functors/lattice/superBaseF3D.h
(limited to 'src/functors/lattice/superBaseF3D.h')
diff --git a/src/functors/lattice/superBaseF3D.h b/src/functors/lattice/superBaseF3D.h
new file mode 100644
index 0000000..16f79ed
--- /dev/null
+++ b/src/functors/lattice/superBaseF3D.h
@@ -0,0 +1,231 @@
+/* This file is part of the OpenLB library
+ *
+ * Copyright (C) 2012-2017 Lukas Baron, Tim Dornieden, Mathias J. Krause,
+ * Albert Mink, Benjamin Förster, 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 SUPER_BASE_F_3D_H
+#define SUPER_BASE_F_3D_H
+
+#include
+
+#include "functors/genericF.h"
+#include "blockBaseF3D.h"
+#include "indicator/superIndicatorBaseF3D.h"
+#include "communication/superStructure3D.h"
+#include "core/superData3D.h"
+#include "core/superLattice3D.h"
+
+/** Note: Throughout the whole source code directory functors, the
+ * template parameters for i/o dimensions are:
+ * F: S^m -> T^n (S=source, T=target)
+ */
+
+namespace olb {
+
+template class SuperData3D;
+template class SuperLattice3D;
+template class SuperStructure3D;
+template class BlockF3D;
+template class SuperIndicatorF3D;
+template class SuperIdentity3D;
+template class SuperLatticeIdentity3D;
+
+/// represents all functors that operate on a SuperStructure3D in general
+template
+class SuperF3D : public GenericF {
+protected:
+ SuperF3D(SuperStructure3D& superStructure, int targetDim);
+
+ SuperStructure3D& _superStructure;
+ /// Super functors may consist of several BlockF3D derived functors
+ /**
+ * By convention: If block level functors are used at all they should
+ * number exactly LoadBalancer::size per process.
+ **/
+ std::vector>> _blockF;
+public:
+ using identity_functor_type = SuperIdentity3D;
+
+ SuperF3D& operator-(SuperF3D& rhs);
+ SuperF3D& operator+(SuperF3D& rhs);
+ SuperF3D& operator*(SuperF3D& rhs);
+ SuperF3D& operator/(SuperF3D& rhs);
+
+ /// \return SuperF3D::_superStructure
+ SuperStructure3D& getSuperStructure();
+ /// \return Size of SuperF3D::_blockF vector
+ int getBlockFSize() const;
+ /// \return SuperF3D::_blockF[iCloc]
+ BlockF3D& getBlockF(int iCloc);
+};
+
+
+/// Functor from `SuperData3D`
+template
+class SuperDataF3D : public SuperF3D {
+protected:
+ /// `SuperData3D` object this functor was created from
+ SuperData3D& _superData;
+public:
+ /// Constructor from `SuperData3D` - stores `_superData` reference
+ SuperDataF3D(SuperData3D& superData);
+ /// Operator for this functor - copies data from `_superData` object into output
+ bool operator() (BaseType output[], const int input[]);
+ /// Getter for `_superData`
+ SuperData3D& getSuperData();
+};
+
+
+/// identity functor for memory management
+template
+class SuperIdentity3D : public SuperF3D {
+protected:
+ FunctorPtr> _f;
+public:
+ SuperIdentity3D(FunctorPtr>&& f);
+ bool operator() (W output[], const int input[]) override;
+};
+
+
+/// functor to extract one component
+template
+class SuperExtractComponentF3D : public SuperF3D {
+protected:
+ FunctorPtr> _f;
+ const int _extractDim;
+public:
+ SuperExtractComponentF3D(FunctorPtr>&& f, int extractDim);
+ int getExtractDim();
+ bool operator() (W output[], const int input[]);
+};
+
+
+/// functor to extract one component inside an indicator
+template
+class SuperExtractComponentIndicatorF3D : public SuperExtractComponentF3D {
+protected:
+ FunctorPtr> _indicatorF;
+public:
+ SuperExtractComponentIndicatorF3D(FunctorPtr>&& f, int extractDim,
+ FunctorPtr>&& indicatorF);
+ bool operator() (W output[], const int input[]) override;
+};
+
+
+/// functor to extract data inside an indicator
+template
+class SuperExtractIndicatorF3D : public SuperF3D {
+protected:
+ FunctorPtr> _f;
+ FunctorPtr> _indicatorF;
+public:
+ SuperExtractIndicatorF3D(FunctorPtr>&& f,
+ FunctorPtr>&& indicatorF);
+ bool operator() (W output[], const int input[]);
+};
+
+
+/// functor to extract one component
+template
+class SuperDotProductF3D : public SuperF3D {
+protected:
+ SuperF3D& _f;
+ T _vector[];
+public:
+ SuperDotProductF3D(SuperF3D& f, T vector[]);
+ bool operator() (W output[], const int input[]);
+};
+
+
+/// identity functor for memory management
+template
+class SuperIdentityOnSuperIndicatorF3D : public SuperF3D {
+protected:
+ SuperF3D& _f;
+ SuperIndicatorF3D& _indicatorF;
+ W _defaultValue;
+public:
+ SuperIdentityOnSuperIndicatorF3D(SuperF3D& f, SuperIndicatorF3D& indicatorF, W defaultValue=0.);
+ bool operator() (W output[], const int input[]);
+};
+
+/// represents all functors that operate on a SuperLattice in general, e.g. getVelocity(), getForce(), getPressure()
+template
+class SuperLatticeF3D : public SuperF3D {
+protected:
+ SuperLatticeF3D(SuperLattice3D& superLattice, int targetDim);
+
+ SuperLattice3D& _sLattice;
+public:
+ using identity_functor_type = SuperLatticeIdentity3D;
+
+ SuperLattice3D& getSuperLattice();
+};
+
+/// identity functor for memory management
+template
+class SuperLatticeIdentity3D : public SuperLatticeF3D {
+protected:
+ FunctorPtr> _f;
+public:
+ SuperLatticeIdentity3D(FunctorPtr>&& f);
+ bool operator() (T output[], const int input[]) override;
+};
+
+/// represents all functors that operate on a DESCRIPTOR with output in Phys, e.g. physVelocity(), physForce(), physPressure()
+template
+class SuperLatticePhysF3D : public SuperLatticeF3D {
+protected:
+ SuperLatticePhysF3D(SuperLattice3D& sLattice,
+ const UnitConverter& converter, int targetDim);
+ const UnitConverter& _converter;
+public:
+ UnitConverter const& getConverter() const;
+};
+
+/// represents all thermal functors that operate on a DESCRIPTOR with output in Phys, e.g. physTemperature(), physHeatFlux()
+template
+class SuperLatticeThermalPhysF3D : public SuperLatticeF3D {
+protected:
+ SuperLatticeThermalPhysF3D(SuperLattice3D& sLattice,
+ const ThermalUnitConverter& converter, int targetDim);
+ const ThermalUnitConverter& _converter;
+public:
+ ThermalUnitConverter const& getConverter() const;
+};
+
+template
+class ComposedSuperLatticeF3D : public SuperLatticeF3D {
+private:
+ SuperLatticeF3D& _f0;
+ SuperLatticeF3D& _f1;
+ SuperLatticeF3D& _f2;
+public:
+ ComposedSuperLatticeF3D(SuperLatticeF3D& f0,
+ SuperLatticeF3D& f1,
+ SuperLatticeF3D& f2);
+ bool operator() (T output[], const int x[]) override;
+};
+
+} // end namespace olb
+
+#endif
--
cgit v1.2.3