diff --git a/src/basics/CMakeLists.txt b/src/basics/CMakeLists.txt index 760d0f8260e1126b4cbe8933eda2780d43f36665..0d4559558e2ca027fb60c9c054b545595d18df4b 100644 --- a/src/basics/CMakeLists.txt +++ b/src/basics/CMakeLists.txt @@ -1,7 +1,7 @@ include(buildInfo.cmake) -vf_add_library(PUBLIC_LINK logger PRIVATE_LINK parallel EXCLUDE buildInfo.in.cpp) +vf_add_library(PUBLIC_LINK logger PRIVATE_LINK EXCLUDE buildInfo.in.cpp) vf_get_library_name (library_name) target_include_directories(${library_name} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/geometry3d) diff --git a/src/basics/Timer/Timer.cpp b/src/basics/Timer/Timer.cpp index c8856f72adffe0c407ff29ee74246638ce5c8280..9b10481a55726cdacb00fb6d1c41815865aafa80 100644 --- a/src/basics/Timer/Timer.cpp +++ b/src/basics/Timer/Timer.cpp @@ -26,18 +26,36 @@ // You should have received a copy of the GNU General Public License along // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // -//! \file Timer.cpp -//! \ingroup Timer -//! \author Stephan Lenz +//! \author Soeren Peters //======================================================================================= #include "Timer.h" -#include "TimerImp.h" -#include <memory> +namespace vf::basics +{ + +void Timer::start() +{ + this->startTime = std::chrono::high_resolution_clock::now(); +} + +void Timer::end() +{ + this->endTime = std::chrono::high_resolution_clock::now(); +} -SPtr<Timer> Timer::makeStart() +double timeInSeconds(Timer::timePoint end, Timer::timePoint start) { - SPtr<Timer> t = std::make_shared<TimerImp>(); - t->start(); - return t; + return std::chrono::duration_cast<std::chrono::microseconds>(end - start).count() / 1000000.0; } + +double Timer::getTimeInSeconds() const +{ + return timeInSeconds(endTime, startTime); +} + +double Timer::getCurrentRuntimeInSeconds() const +{ + return timeInSeconds(std::chrono::high_resolution_clock::now(), startTime); +} + +} // namespace vf::basics diff --git a/src/basics/Timer/Timer.h b/src/basics/Timer/Timer.h index 6de04b2f3d5573ac6266bd2c35cf18cd232384dd..74a28f2af540302356792d03b2fb0a854c35eeda 100644 --- a/src/basics/Timer/Timer.h +++ b/src/basics/Timer/Timer.h @@ -26,29 +26,32 @@ // You should have received a copy of the GNU General Public License along // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // -//! \file Timer.h -//! \ingroup Timer -//! \author Stephan Lenz +//! \author Soeren Peters //======================================================================================= -#ifndef TIMER_H -#define TIMER_H +#ifndef BASICS_TIMER_H +#define BASICS_TIMER_H -#include "basics_export.h" +#include <chrono> -#include "DataTypes.h" -#include "PointerDefinitions.h" +namespace vf::basics +{ -class BASICS_EXPORT Timer +class Timer { public: - virtual ~Timer() = default; - static SPtr<Timer> makeStart(); + using timePoint = std::chrono::high_resolution_clock::time_point; + + void start(); + void end(); - virtual void start() = 0; - virtual void end() = 0; + double getTimeInSeconds() const; + double getCurrentRuntimeInSeconds() const; - virtual real getTimeInSeconds() const = 0; - virtual real getCurrentRuntimeInSeconds() const = 0; +private: + timePoint startTime; + timePoint endTime; }; +} // namespace vf::basics + #endif diff --git a/src/basics/Timer/TimerImp.cpp b/src/basics/Timer/TimerImp.cpp deleted file mode 100644 index 76f9ac36793f2e2543abe9086f2780ee94b50eb7..0000000000000000000000000000000000000000 --- a/src/basics/Timer/TimerImp.cpp +++ /dev/null @@ -1,50 +0,0 @@ -//======================================================================================= -// ____ ____ __ ______ __________ __ __ __ __ -// \ \ | | | | | _ \ |___ ___| | | | | / \ | | -// \ \ | | | | | |_) | | | | | | | / \ | | -// \ \ | | | | | _ / | | | | | | / /\ \ | | -// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ -// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| -// \ \ | | ________________________________________________________________ -// \ \ | | | ______________________________________________________________| -// \ \| | | | __ __ __ __ ______ _______ -// \ | | |_____ | | | | | | | | | _ \ / _____) -// \ | | _____| | | | | | | | | | | \ \ \_______ -// \ | | | | |_____ | \_/ | | | | |_/ / _____ | -// \ _____| |__| |________| \_______/ |__| |______/ (_______/ -// -// This file is part of VirtualFluids. VirtualFluids 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 3 of -// the License, or (at your option) any later version. -// -// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. -// -//! \file TimerImp.cpp -//! \ingroup Timer -//! \author Stephan Lenz -//======================================================================================= -#include "TimerImp.h" - -void TimerImp::start() { this->startTime = std::chrono::high_resolution_clock::now(); } - -void TimerImp::end() { this->endTime = std::chrono::high_resolution_clock::now(); } - -real TimerImp::getTimeInSeconds() const -{ - return real(std::chrono::duration_cast<std::chrono::microseconds>(endTime - startTime).count() / 1000000.0); -} - -real TimerImp::getCurrentRuntimeInSeconds() const -{ - return real( - std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now() - startTime) - .count() / - 1000000.0); -} diff --git a/src/basics/Timer/TimerImp.h b/src/basics/Timer/TimerImp.h deleted file mode 100644 index e180ae084cb19b939f6e7a82cae7a0db3cc1ea15..0000000000000000000000000000000000000000 --- a/src/basics/Timer/TimerImp.h +++ /dev/null @@ -1,58 +0,0 @@ -//======================================================================================= -// ____ ____ __ ______ __________ __ __ __ __ -// \ \ | | | | | _ \ |___ ___| | | | | / \ | | -// \ \ | | | | | |_) | | | | | | | / \ | | -// \ \ | | | | | _ / | | | | | | / /\ \ | | -// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ -// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| -// \ \ | | ________________________________________________________________ -// \ \ | | | ______________________________________________________________| -// \ \| | | | __ __ __ __ ______ _______ -// \ | | |_____ | | | | | | | | | _ \ / _____) -// \ | | _____| | | | | | | | | | | \ \ \_______ -// \ | | | | |_____ | \_/ | | | | |_/ / _____ | -// \ _____| |__| |________| \_______/ |__| |______/ (_______/ -// -// This file is part of VirtualFluids. VirtualFluids 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 3 of -// the License, or (at your option) any later version. -// -// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. -// -//! \file TimerImp.h -//! \ingroup Timer -//! \author Stephan Lenz -//======================================================================================= -#ifndef TIMER_IMP_H -#define TIMER_IMP_H - -#include "Timer.h" - -#include <chrono> - -#include "DataTypes.h" - -class BASICS_EXPORT TimerImp : public Timer -{ -public: - using timePoint = std::chrono::high_resolution_clock::time_point; - - void start() override; - void end() override; - - real getTimeInSeconds() const override; - real getCurrentRuntimeInSeconds() const override; - -private: - timePoint startTime; - timePoint endTime; -}; - -#endif diff --git a/src/basics/geometry3d/GbTriFaceMesh3D.cpp b/src/basics/geometry3d/GbTriFaceMesh3D.cpp index 7da89fc9bf0565ec7862939ffa652b3ff1880a4f..b3c263ee7af29c538f4f3c2baa7113a82692c6ec 100644 --- a/src/basics/geometry3d/GbTriFaceMesh3D.cpp +++ b/src/basics/geometry3d/GbTriFaceMesh3D.cpp @@ -32,11 +32,12 @@ //======================================================================================= #include <geometry3d/GbTriFaceMesh3D.h> +#include <basics/Timer/Timer.h> #include <basics/utilities/UbFileInputASCII.h> #include <basics/utilities/UbLogger.h> #include <basics/utilities/UbRandom.h> -#include <basics/utilities/UbTiming.h> #include <basics/writer/WbWriter.h> + #include <geometry3d/CoordinateTransformation3D.h> #include <geometry3d/GbCuboid3D.h> #include <geometry3d/GbHalfSpace3D.h> @@ -651,7 +652,7 @@ void GbTriFaceMesh3D::addSurfaceTriangleSet(vector<UbTupleFloat3> &pts, vector<U // if( !kdTree) // { // UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree start"); -// UbTimer timer; timer.start(); +// vf::basics::Timer timer; timer.start(); // if(kdtreeSplitAlg == KDTREE_SAHPLIT ) // { // UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SAHSplit"); @@ -663,7 +664,7 @@ void GbTriFaceMesh3D::addSurfaceTriangleSet(vector<UbTupleFloat3> &pts, vector<U // this->kdTree = new Kd::Tree<double>( *this, Kd::SpatialMedianSplit<double>() ); // } // else throw UbException(UB_EXARGS, "unknown kdtree split option)" ); -// UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - built kdTree in "<<timer.stop()<<"seconds"); +// UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - built kdTree in "<<timer.getCurrentRuntimeInSeconds()<<"seconds"); // } // // //eigentlicher PIO-Test @@ -738,7 +739,7 @@ bool GbTriFaceMesh3D::isPointInGbObject3D(const double &x1, const double &x2, co // Baum erstellen, wen noch keiner vorhanden if (!kdTree) { UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree start"); - UbTimer timer; + vf::basics::Timer timer; timer.start(); if (kdtreeSplitAlg == KDTREE_SAHPLIT) { UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SAHSplit"); @@ -748,7 +749,7 @@ bool GbTriFaceMesh3D::isPointInGbObject3D(const double &x1, const double &x2, co this->kdTree = new Kd::Tree<double>(*this, Kd::SpatialMedianSplit<double>()); } else throw UbException(UB_EXARGS, "unknown kdtree split option)"); - UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - built kdTree in " << timer.stop() << "seconds"); + UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - built kdTree in " << timer.getCurrentRuntimeInSeconds() << "seconds"); } // eigentlicher PIO-Test @@ -820,7 +821,7 @@ bool GbTriFaceMesh3D::isPointInGbObject3D(const double &x1, const double &x2, co // Baum erstellen, wen noch keiner vorhanden if (!kdTree) { UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree start"); - UbTimer timer; + vf::basics::Timer timer; timer.start(); if (kdtreeSplitAlg == KDTREE_SAHPLIT) { UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SAHSplit"); @@ -831,7 +832,7 @@ bool GbTriFaceMesh3D::isPointInGbObject3D(const double &x1, const double &x2, co this->kdTree = new Kd::Tree<double>(*this, Kd::SpatialMedianSplit<double>()); } else throw UbException(UB_EXARGS, "unknown kdtree split option)"); - UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - built kdTree in " << timer.stop() << "seconds"); + UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - built kdTree in " << timer.getCurrentRuntimeInSeconds() << "seconds"); //cout << "GbTriFaceMesh3D::calculateValues - built kdTree in " << timer.stop() << "seconds" << std::endl; } @@ -905,7 +906,7 @@ bool GbTriFaceMesh3D::isPointInGbObject3D(const double &x1, const double &x2, co // Baum erstellen, wen noch keiner vorhanden if (!kdTree) { UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree start"); - UbTimer timer; + vf::basics::Timer timer; timer.start(); if (kdtreeSplitAlg == KDTREE_SAHPLIT) { UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SAHSplit"); @@ -915,7 +916,7 @@ bool GbTriFaceMesh3D::isPointInGbObject3D(const double &x1, const double &x2, co this->kdTree = new Kd::Tree<double>(*this, Kd::SpatialMedianSplit<double>()); } else throw UbException(UB_EXARGS, "unknown kdtree split option)"); - UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - built kdTree in " << timer.stop() << "seconds"); + UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - built kdTree in " << timer.getCurrentRuntimeInSeconds() << "seconds"); } // eigentlicher PIO-Test @@ -951,7 +952,7 @@ bool GbTriFaceMesh3D::intersectLine(const double &p1_x1, const double &p1_x2, co // Baum erstellen, wen noch keiner vorhanden if (!kdTree) { UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree start"); - UbTimer timer; + vf::basics::Timer timer; timer.start(); if (kdtreeSplitAlg == KDTREE_SAHPLIT) { UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - build KdTree with SAHSplit"); @@ -961,7 +962,7 @@ bool GbTriFaceMesh3D::intersectLine(const double &p1_x1, const double &p1_x2, co this->kdTree = new Kd::Tree<double>(*this, Kd::SpatialMedianSplit<double>()); } else throw UbException(UB_EXARGS, "unknown kdtree split option)"); - UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - built kdTree in " << timer.stop() << "seconds"); + UBLOG(logDEBUG3, "GbTriFaceMesh3D::calculateValues - built kdTree in " << timer.getCurrentRuntimeInSeconds() << "seconds"); } int iSec = kdTree->intersectLine(UbTupleDouble3(p1_x1, p1_x2, p1_x3), UbTupleDouble3(p2_x1, p2_x2, p2_x3), diff --git a/src/basics/utilities/UbNupsTimer.h b/src/basics/utilities/UbNupsTimer.h deleted file mode 100644 index 1545b5b694a57d112b485cf766ce26e22f30d939..0000000000000000000000000000000000000000 --- a/src/basics/utilities/UbNupsTimer.h +++ /dev/null @@ -1,125 +0,0 @@ -//======================================================================================= -// ____ ____ __ ______ __________ __ __ __ __ -// \ \ | | | | | _ \ |___ ___| | | | | / \ | | -// \ \ | | | | | |_) | | | | | | | / \ | | -// \ \ | | | | | _ / | | | | | | / /\ \ | | -// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ -// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| -// \ \ | | ________________________________________________________________ -// \ \ | | | ______________________________________________________________| -// \ \| | | | __ __ __ __ ______ _______ -// \ | | |_____ | | | | | | | | | _ \ / _____) -// \ | | _____| | | | | | | | | | | \ \ \_______ -// \ | | | | |_____ | \_/ | | | | |_/ / _____ | -// \ _____| |__| |________| \_______/ |__| |______/ (_______/ -// -// This file is part of VirtualFluids. VirtualFluids 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 3 of -// the License, or (at your option) any later version. -// -// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. -// -//! \file UbNupsTimer.h -//! \ingroup utilities -//! \author Soeren Freudiger, Sebastian Geller -//======================================================================================= -#ifndef UBNUPSTIMER_H -#define UBNUPSTIMER_H - -#include <basics/utilities/UbTiming.h> -#include <sstream> -#include <vector> - -/*=========================================================================*/ -/* UbNupsTimer */ -/* */ -/** -This Class provides the base for ... -<BR><BR> -@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -@version 1.0 - 01.11.04 -*/ -class UbNupsTimer : public UbTiming -{ -public: - UbNupsTimer() : UbTiming() - { - mTempNodes = 0.0; - mNofNodes.resize(0); - mDurations.resize(0); - } - /*==========================================================*/ - UbNupsTimer(std::string name) : UbTiming(name) - { - mNofNodes.resize(0); - mDurations.resize(0); - mTempNodes = 0.0; - } - /*==========================================================*/ - void initTiming() override - { - UbTiming::initTiming(); - mNofNodes.resize(0); - mDurations.resize(0); - mTempNodes = 0.0; - } - /*==========================================================*/ - void startNUPSTiming(double nofNodes) - { - mTempNodes = nofNodes; - UbTiming::startTiming(); - } - /*==========================================================*/ - void endTiming() override - { - UbTiming::endTiming(); - // save #node and time informations - mNofNodes.push_back(mTempNodes); - mDurations.push_back(UbTiming::getDuration()); - // reset internal timecounter - UbTiming::initTiming(); - } - /*==========================================================*/ - double getAverageNups() - { - double averageNups = 0.0; - for (int i = 0; i < (int)mNofNodes.size(); i++) - averageNups += mNofNodes.at(i) / mDurations.at(i); - - return averageNups / (double)mNofNodes.size(); - } - /*==========================================================*/ - double getSumOfDuration() - { - double duration = 0.0; - for (int i = 0; i < (int)mDurations.size(); i++) - duration += mDurations.at(i); - return duration; - } - /*==========================================================*/ - std::string getNupsString() - { - std::stringstream ss; - ss << "saved nups informations" << std::endl; - for (int i = 0; i < (int)mNofNodes.size(); i++) - ss << mNofNodes.at(i) << "nodes/" << mDurations.at(i) << "sec=" << mNofNodes.at(i) / mDurations.at(i) - << "nups\n"; - return ss.str(); - } - -protected: -private: - std::vector<double> mNofNodes; - std::vector<double> mDurations; - - double mTempNodes; -}; - -#endif diff --git a/src/basics/utilities/UbTiming.h b/src/basics/utilities/UbTiming.h deleted file mode 100644 index 9ea6ed16fc3b547bb20e34cc0e5c1e080e09cc6f..0000000000000000000000000000000000000000 --- a/src/basics/utilities/UbTiming.h +++ /dev/null @@ -1,375 +0,0 @@ -//======================================================================================= -// ____ ____ __ ______ __________ __ __ __ __ -// \ \ | | | | | _ \ |___ ___| | | | | / \ | | -// \ \ | | | | | |_) | | | | | | | / \ | | -// \ \ | | | | | _ / | | | | | | / /\ \ | | -// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ -// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| -// \ \ | | ________________________________________________________________ -// \ \ | | | ______________________________________________________________| -// \ \| | | | __ __ __ __ ______ _______ -// \ | | |_____ | | | | | | | | | _ \ / _____) -// \ | | _____| | | | | | | | | | | \ \ \_______ -// \ | | | | |_____ | \_/ | | | | |_/ / _____ | -// \ _____| |__| |________| \_______/ |__| |______/ (_______/ -// -// This file is part of VirtualFluids. VirtualFluids 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 3 of -// the License, or (at your option) any later version. -// -// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. -// -//! \file UbTiming.h -//! \ingroup utilities -//! \author Soeren Freudiger, Sebastian Geller -//======================================================================================= -#ifndef UBTIMING_H -#define UBTIMING_H - -#include <ctime> -#include <iostream> -#include <limits> -#include <sstream> -#include <string> -#include <vector> - -#if defined(VF_MPI) -#include <parallel/Communicator.h> -#endif - -class UbTiming -{ -public: - UbTiming() - { - this->duration = 0.0; - this->deltaT = 0.0; - this->startTime = 0; - this->name = "noname"; - } - /*==========================================================*/ - UbTiming(const std::string &name) - { - this->duration = 0.0; - this->deltaT = 0.0; - this->startTime = 0; - this->name = name; - } - /*==========================================================*/ - virtual ~UbTiming() = default; - /*==========================================================*/ - virtual void initTiming() { this->duration = 0.0; } - /*==========================================================*/ - virtual void startTiming() - { -#if defined(VF_MPI) - this->startTime = vf::parallel::Communicator::getInstance()->Wtime(); -#else - this->startTime = (double)clock(); -#endif // VF_MPI - } - /*==========================================================*/ - virtual void initAndStartTiming() - { - this->initTiming(); - this->startTiming(); - } - /*==========================================================*/ - virtual void endTiming() { this->stopTiming(); } - /*==========================================================*/ - virtual void stopTiming() - { -#if defined(VF_MPI) - this->deltaT = vf::parallel::Communicator::getInstance()->Wtime() - this->startTime; -#else - this->deltaT = ((double)clock() - this->startTime) / (double)CLOCKS_PER_SEC; -#endif // VF_MPI - - this->duration += this->deltaT; - } - /*==========================================================*/ - virtual double getDuration() const { return this->duration; } - /*==========================================================*/ - virtual void setName(const std::string &name) { this->name = name; } - /*==========================================================*/ - virtual std::string getName() const { return this->name; } - /*==========================================================*/ - void start() - { - this->duration = 0.0; - -#if defined(VF_MPI) - this->startTime = vf::parallel::Communicator::getInstance()->Wtime(); -#else - this->startTime = (double)clock(); -#endif // VF_MPI - } - /*==========================================================*/ - void pause() - { -#if defined(VF_MPI) - this->duration += vf::parallel::Communicator::getInstance()->Wtime() - this->startTime; -#else - this->duration += ((double)clock() - this->startTime) / (double)CLOCKS_PER_SEC; -#endif // VF_MPI - } - /*==========================================================*/ - void unpause() - { -#if defined(VF_MPI) - this->startTime = vf::parallel::Communicator::getInstance()->Wtime(); -#else - this->startTime = (double)clock(); -#endif // VF_MPI - } - /*==========================================================*/ - void stop() - { -#if defined(VF_MPI) - this->duration += vf::parallel::Communicator::getInstance()->Wtime() - this->startTime; -#else - this->duration += ((double)clock() - this->startTime) / (double)CLOCKS_PER_SEC; -#endif // VF_MPI - } - -protected: - std::string name; - - double startTime; - double duration; - double deltaT; -}; - -#include <basics/utilities/UbSystem.h> //for definitons of system/OS type - -#ifdef UBSYSTEM_APPLE // Apple hack -#include <cstdio> -#include <ctime> -#include <mach/mach_time.h> -inline void mach_absolute_difference(const uint64_t &end, const uint64_t &start, struct timespec *tp) -{ - uint64_t difference = end - start; - static mach_timebase_info_data_t info = { 0, 0 }; - - if (info.denom == 0) - mach_timebase_info(&info); - - uint64_t elapsednano = difference * (info.numer / info.denom); - - tp->tv_sec = elapsednano * 1e-9; - tp->tv_nsec = elapsednano - (tp->tv_sec * 1e9); -} -#elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_AIX) -#include <ctime> -#include <pthread.h> -#include <unistd.h> // for sysconf -#endif - -/*=========================================================================*/ -//! \brief Time Measuring -//! \details -//! example: -//! \code -//! t=0 start -//! t=1 -//! t=2 stop -> return 2; getLapTime=2; getTotalTime 2; getLapTimes: 2 -//! t=3 -//! t=4 -//! t=5 stop -> return 3; getLapTime=3; getTotalTime 5; getLapTimes: 2,3 -//! t=6 stop -> return 1; getLapTime=1; getTotalTime 6; getLapTimes: 2,3,1 -//! t=7 -//! t=8 start ->no consideration of time 7 and 8 -//! t=9 -//! t=10 stop -> return 2; getLapTime=2; getTotalTime 8; getLapTimes: 2,3,1,2 -//! t=11 resetAndStart -> Timer is reset and restarted -//! t=12 -//! t=13 -//! t=14 stop -> return 3; getLapTime=3; getTotalTime 3; getLapTimes: 3 -//! \endcode - -class UbTimer -{ -public: - UbTimer(const bool &storeLapTimes = false) : name("unamed"), storeLapTimes(storeLapTimes) {} - /*==========================================================*/ - UbTimer(const std::string &name, const bool &storeLapTimes = false) : name(name), storeLapTimes(storeLapTimes) {} - /*==========================================================*/ - virtual ~UbTimer() = default; - /*==========================================================*/ - double getLapTime() const { return this->lapTime; } - std::vector<double> getLapTimes() const { return this->lapTimes; } - void setName(const std::string &name) { this->name = name; } - std::string getName() const { return this->name; } - bool isRunning() const { return isMeasuring; } - bool isStoringLapTimes() const { return storeLapTimes; } - /*==========================================================*/ - void setStoreLapTimes(const bool &storeLapTimes) { this->storeLapTimes = storeLapTimes; } - /*==========================================================*/ - void start() - { - this->isMeasuring = true; - -#if defined(VF_MPI) - this->startTime = vf::parallel::Communicator::getInstance()->Wtime(); -#elif defined(UBSYSTEM_APPLE) - this->startTime = mach_absolute_time(); -#elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_AIX) - timespec tp; - clock_gettime(CLOCK_REALTIME, &tp); - this->startTime = (double)(tp.tv_sec) * 1.0e9 + (double)(tp.tv_nsec); -#else - this->startTime = (double)clock(); -#endif // VF_MPI - } - /*==========================================================*/ - void resetAndStart() - { - this->reset(); - this->start(); - } - /*==========================================================*/ - // stop: - stops the calculation and returns the time elapsed since last start/stop - // - timing continues - double stop() - { - // if start() was never activated before: - if (!isMeasuring) - return 0.0; - -#if defined(VF_MPI) - double actTime = vf::parallel::Communicator::getInstance()->Wtime(); - this->lapTime = actTime - this->startTime; -#elif defined(UBSYSTEM_APPLE) - double actTime = mach_absolute_time(); - timespec tp; - mach_absolute_difference(actTime, this->startTime, &tp); - this->lapTime = tp.tv_sec + tp.tv_nsec * 1e-9; -#elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_AIX) - timespec tp; - clock_gettime(CLOCK_REALTIME, &tp); - double actTime = (double)(tp.tv_sec) * 1.0e9 + (double)(tp.tv_nsec); - this->lapTime = (actTime - this->startTime) * 1.0e-9; -#else - double actTime = (double)clock(); - this->lapTime = (actTime - this->startTime) / (double)CLOCKS_PER_SEC; -#endif // VF_MPI - - this->startTime = actTime; - this->totalTime += this->lapTime; - if (storeLapTimes) - lapTimes.push_back(this->lapTime); - - return lapTime; - } - /*==========================================================*/ - void reset() - { - this->isMeasuring = false; - - this->startTime = 0.0; - this->totalTime = 0.0; - this->lapTime = 0.0; - - lapTimes.resize(0); - } - /*==========================================================*/ - double getCurrentLapTime() const - { - // if start() was never activated before: - if (!isMeasuring) - return 0.0; - -#if defined(VF_MPI) - return vf::parallel::Communicator::getInstance()->Wtime() - this->startTime; -#elif defined(UBSYSTEM_APPLE) - timespec tp; - mach_absolute_difference(mach_absolute_time(), this->startTime, &tp); - return tp.tv_sec + tp.tv_nsec * 1e-9; -#elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_AIX) - timespec tp; - clock_gettime(CLOCK_REALTIME, &tp); - return ((double)(tp.tv_sec) * 1.0e9 + (double)(tp.tv_nsec) - this->startTime) * 1.0e-9; -#else - return ((double)clock() - this->startTime) / (double)CLOCKS_PER_SEC; -#endif // VF_MPI - } - /*==========================================================*/ - double getTotalTime() const { return this->totalTime; } - /*==========================================================*/ - std::string toString() - { - std::stringstream text; - text << *this; - return text.str(); - } - - // ueberladene Operatoren - /*==========================================================*/ - friend inline std::ostream &operator<<(std::ostream &os, const UbTimer &timer) - { - os << "UbTimer[totalTime=" << timer.totalTime << "sec, lapTimes("; - for (std::size_t i = 0; i < timer.lapTimes.size(); i++) - os << timer.lapTimes[i] << ","; - os << ")]"; - return os; - } - -protected: - std::string name; - bool isMeasuring{ false }; - bool storeLapTimes; - - double startTime{ 0.0 }; - double totalTime{ 0.0 }; - double lapTime{ 0.0 }; - - std::vector<double> lapTimes; -}; - -/*=========================================================================*/ -//! \brief Time Measuring -//! -//! \details UbProressTimer measures the time from its instantiation to destruction and spend the elapsed time on "os" -//! in [s] example: \code -//! { -//! UbProgressTimer timer; -//! UbSystem::sleepS(10); -//! } //--> 10s -//! \endcode - -class UbProgressTimer : public UbTimer -{ -public: - UbProgressTimer(const UbProgressTimer &rhs) = delete; - - explicit UbProgressTimer(std::ostream &os = std::cout) : UbTimer(), os(os) { this->start(); } - /*==========================================================*/ - ~UbProgressTimer() override - { - // A) Throwing an exception from a destructor is a Bad Thing. - // B) The progress_timer destructor does output which may throw. - // C) A progress_timer is usually not critical to the application. - // Therefore, wrap the I/O in a try block, catch and ignore all exceptions. - try { - // use istream instead of ios_base to workaround GNU problem (Greg Chicares) - std::istream::fmtflags old_flags = os.setf(std::istream::fixed, std::istream::floatfield); - std::streamsize old_prec = os.precision(2); - os << stop() << " s" << std::endl; - os.flags(old_flags); - os.precision(old_prec); - } catch (...) { - } // eat any exceptions - } - -private: - std::ostream &os; -}; - -#endif // UBTIMING_H diff --git a/src/cpu/VirtualFluids.h b/src/cpu/VirtualFluids.h index bcbbdd20460afb3be0bdd8607a7e5e6bc2483821..ba0ed84971c53df40e3d7df14796d1b9ce0cf013 100644 --- a/src/cpu/VirtualFluids.h +++ b/src/cpu/VirtualFluids.h @@ -74,14 +74,12 @@ #include <basics/utilities/UbLimits.h> #include <basics/utilities/UbLogger.h> #include <basics/utilities/UbMath.h> -#include <basics/utilities/UbNupsTimer.h> #include <basics/utilities/UbObservable.h> #include <basics/utilities/UbObserver.h> #include <basics/utilities/UbRandom.h> #include <basics/utilities/UbScheduler.h> #include <basics/utilities/UbStringInputASCII.h> #include <basics/utilities/UbSystem.h> -#include <basics/utilities/UbTiming.h> #include <basics/utilities/UbTuple.h> #include <basics/writer/WbWriter.h> #include <basics/writer/WbWriterAvsASCII.h> @@ -152,13 +150,12 @@ #include <Connectors/TwoDistributionsFullVectorConnector.h> -#include <Data/D3Q27EsoTwist3DSplittedVector.h> -#include <Data/D3Q27EsoTwist3DSplittedVectorEx.h> +#include <Data/EsoSplit.h> + #include <Data/DataSet3D.h> #include <Data/DistributionArray3D.h> #include <Data/EsoTwist3D.h> -#include <Data/EsoTwistD3Q27System.h> -#include <Data/VoidData3D.h> + #include <Simulation/Block3D.h> #include <Simulation/Simulation.h> diff --git a/src/cpu/core/BoundaryConditions/BCSet.cpp b/src/cpu/core/BoundaryConditions/BCSet.cpp index ca8bcadd14040219ced9e519e04a947bd3b8efdc..c9939eea1adae1a806b0e82339cbaf7b7b3552f0 100644 --- a/src/cpu/core/BoundaryConditions/BCSet.cpp +++ b/src/cpu/core/BoundaryConditions/BCSet.cpp @@ -34,7 +34,7 @@ #include "BCSet.h" #include "BCStrategy.h" #include "BCArray3D.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "DataSet3D.h" #include "ILBMKernel.h" diff --git a/src/cpu/core/BoundaryConditions/ThinWallNoSlip.cpp b/src/cpu/core/BoundaryConditions/ThinWallNoSlip.cpp index 196ce715872fb2cebc181d19489b9055e7eb9a3d..e9702dcf2e33ce370a4a2a24299761c4e63affde 100644 --- a/src/cpu/core/BoundaryConditions/ThinWallNoSlip.cpp +++ b/src/cpu/core/BoundaryConditions/ThinWallNoSlip.cpp @@ -33,7 +33,7 @@ #include "ThinWallNoSlip.h" #include "BoundaryConditions.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" ThinWallNoSlip::ThinWallNoSlip() { diff --git a/src/cpu/core/Connectors/FullDirectConnector.cpp b/src/cpu/core/Connectors/FullDirectConnector.cpp index d40fc36cb9a15e1b7d1664be2ab2beeee74df394..14a8d3e4e795c270c8bebcb40907b578b00b60ae 100644 --- a/src/cpu/core/Connectors/FullDirectConnector.cpp +++ b/src/cpu/core/Connectors/FullDirectConnector.cpp @@ -32,7 +32,7 @@ //======================================================================================= #include "FullDirectConnector.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "DataSet3D.h" #include "LBMKernel.h" diff --git a/src/cpu/core/Connectors/FullVectorConnector.cpp b/src/cpu/core/Connectors/FullVectorConnector.cpp index ff501a8ecfc123ffba8eb1a0906126281b22ead8..91c4c11090936a107de3fe7722a5af7ff1acfe74 100644 --- a/src/cpu/core/Connectors/FullVectorConnector.cpp +++ b/src/cpu/core/Connectors/FullVectorConnector.cpp @@ -32,7 +32,7 @@ //======================================================================================= #include "FullVectorConnector.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "DataSet3D.h" #include "LBMKernel.h" ////////////////////////////////////////////////////////////////////////// diff --git a/src/cpu/core/Connectors/OneDistributionFullDirectConnector.h b/src/cpu/core/Connectors/OneDistributionFullDirectConnector.h index 44d3f9fc251d12c9c621193d326cbc751921d957..e83c19bde64eb4a6e1998d7fcb2dfba45677129a 100644 --- a/src/cpu/core/Connectors/OneDistributionFullDirectConnector.h +++ b/src/cpu/core/Connectors/OneDistributionFullDirectConnector.h @@ -37,7 +37,7 @@ #include "Block3D.h" #include "D3Q27System.h" #include "FullDirectConnector.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "basics/container/CbArray3D.h" #include "basics/container/CbArray4D.h" @@ -68,70 +68,72 @@ private: ////////////////////////////////////////////////////////////////////////// inline void OneDistributionFullDirectConnector::updatePointers() { - localDistributionsFrom = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getLocalDistributions(); - nonLocalDistributionsFrom = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getNonLocalDistributions(); - zeroDistributionsFrom = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getZeroDistributions(); + localDistributionsFrom = dynamicPointerCast<EsoSplit>(this->fFrom)->getLocalDistributions(); + nonLocalDistributionsFrom = dynamicPointerCast<EsoSplit>(this->fFrom)->getNonLocalDistributions(); + zeroDistributionsFrom = dynamicPointerCast<EsoSplit>(this->fFrom)->getZeroDistributions(); - localDistributionsTo = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getLocalDistributions(); - nonLocalDistributionsTo = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getNonLocalDistributions(); - zeroDistributionsTo = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getZeroDistributions(); + localDistributionsTo = dynamicPointerCast<EsoSplit>(this->fTo)->getLocalDistributions(); + nonLocalDistributionsTo = dynamicPointerCast<EsoSplit>(this->fTo)->getNonLocalDistributions(); + zeroDistributionsTo = dynamicPointerCast<EsoSplit>(this->fTo)->getZeroDistributions(); } ////////////////////////////////////////////////////////////////////////// inline void OneDistributionFullDirectConnector::exchangeData(int x1From, int x2From, int x3From, int x1To, int x2To, int x3To) { - (*this->localDistributionsTo)(D3Q27System::ET_E, x1To, x2To, x3To) = - (*this->localDistributionsFrom)(D3Q27System::ET_E, x1From, x2From, x3From); - (*this->localDistributionsTo)(D3Q27System::ET_N, x1To, x2To, x3To) = - (*this->localDistributionsFrom)(D3Q27System::ET_N, x1From, x2From, x3From); - (*this->localDistributionsTo)(D3Q27System::ET_T, x1To, x2To, x3To) = - (*this->localDistributionsFrom)(D3Q27System::ET_T, x1From, x2From, x3From); - (*this->localDistributionsTo)(D3Q27System::ET_NE, x1To, x2To, x3To) = - (*this->localDistributionsFrom)(D3Q27System::ET_NE, x1From, x2From, x3From); - (*this->localDistributionsTo)(D3Q27System::ET_NW, x1To + 1, x2To, x3To) = - (*this->localDistributionsFrom)(D3Q27System::ET_NW, x1From + 1, x2From, x3From); - (*this->localDistributionsTo)(D3Q27System::ET_TE, x1To, x2To, x3To) = - (*this->localDistributionsFrom)(D3Q27System::ET_TE, x1From, x2From, x3From); - (*this->localDistributionsTo)(D3Q27System::ET_TW, x1To + 1, x2To, x3To) = - (*this->localDistributionsFrom)(D3Q27System::ET_TW, x1From + 1, x2From, x3From); - (*this->localDistributionsTo)(D3Q27System::ET_TN, x1To, x2To, x3To) = - (*this->localDistributionsFrom)(D3Q27System::ET_TN, x1From, x2From, x3From); - (*this->localDistributionsTo)(D3Q27System::ET_TS, x1To, x2To + 1, x3To) = - (*this->localDistributionsFrom)(D3Q27System::ET_TS, x1From, x2From + 1, x3From); - (*this->localDistributionsTo)(D3Q27System::ET_TNE, x1To, x2To, x3To) = - (*this->localDistributionsFrom)(D3Q27System::ET_TNE, x1From, x2From, x3From); - (*this->localDistributionsTo)(D3Q27System::ET_TNW, x1To + 1, x2To, x3To) = - (*this->localDistributionsFrom)(D3Q27System::ET_TNW, x1From + 1, x2From, x3From); - (*this->localDistributionsTo)(D3Q27System::ET_TSE, x1To, x2To + 1, x3To) = - (*this->localDistributionsFrom)(D3Q27System::ET_TSE, x1From, x2From + 1, x3From); - (*this->localDistributionsTo)(D3Q27System::ET_TSW, x1To + 1, x2To + 1, x3To) = - (*this->localDistributionsFrom)(D3Q27System::ET_TSW, x1From + 1, x2From + 1, x3From); + using namespace vf::lbm::dir; - (*this->nonLocalDistributionsTo)(D3Q27System::ET_W, x1To + 1, x2To, x3To) = - (*this->nonLocalDistributionsFrom)(D3Q27System::ET_W, x1From + 1, x2From, x3From); - (*this->nonLocalDistributionsTo)(D3Q27System::ET_S, x1To, x2To + 1, x3To) = - (*this->nonLocalDistributionsFrom)(D3Q27System::ET_S, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsTo)(D3Q27System::ET_B, x1To, x2To, x3To + 1) = - (*this->nonLocalDistributionsFrom)(D3Q27System::ET_B, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsTo)(D3Q27System::ET_SW, x1To + 1, x2To + 1, x3To) = - (*this->nonLocalDistributionsFrom)(D3Q27System::ET_SW, x1From + 1, x2From + 1, x3From); - (*this->nonLocalDistributionsTo)(D3Q27System::ET_SE, x1To, x2To + 1, x3To) = - (*this->nonLocalDistributionsFrom)(D3Q27System::ET_SE, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsTo)(D3Q27System::ET_BW, x1To + 1, x2To, x3To + 1) = - (*this->nonLocalDistributionsFrom)(D3Q27System::ET_BW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsTo)(D3Q27System::ET_BE, x1To, x2To, x3To + 1) = - (*this->nonLocalDistributionsFrom)(D3Q27System::ET_BE, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsTo)(D3Q27System::ET_BS, x1To, x2To + 1, x3To + 1) = - (*this->nonLocalDistributionsFrom)(D3Q27System::ET_BS, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsTo)(D3Q27System::ET_BN, x1To, x2To, x3To + 1) = - (*this->nonLocalDistributionsFrom)(D3Q27System::ET_BN, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsTo)(D3Q27System::ET_BSW, x1To + 1, x2To + 1, x3To + 1) = - (*this->nonLocalDistributionsFrom)(D3Q27System::ET_BSW, x1From + 1, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsTo)(D3Q27System::ET_BSE, x1To, x2To + 1, x3To + 1) = - (*this->nonLocalDistributionsFrom)(D3Q27System::ET_BSE, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsTo)(D3Q27System::ET_BNW, x1To + 1, x2To, x3To + 1) = - (*this->nonLocalDistributionsFrom)(D3Q27System::ET_BNW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsTo)(D3Q27System::ET_BNE, x1To, x2To, x3To + 1) = - (*this->nonLocalDistributionsFrom)(D3Q27System::ET_BNE, x1From, x2From, x3From + 1); + (*this->localDistributionsTo)(eP00, x1To, x2To, x3To) = + (*this->localDistributionsFrom)(eP00, x1From, x2From, x3From); + (*this->localDistributionsTo)(e0P0, x1To, x2To, x3To) = + (*this->localDistributionsFrom)(e0P0, x1From, x2From, x3From); + (*this->localDistributionsTo)(e00P, x1To, x2To, x3To) = + (*this->localDistributionsFrom)(e00P, x1From, x2From, x3From); + (*this->localDistributionsTo)(ePP0, x1To, x2To, x3To) = + (*this->localDistributionsFrom)(ePP0, x1From, x2From, x3From); + (*this->localDistributionsTo)(eMP0, x1To + 1, x2To, x3To) = + (*this->localDistributionsFrom)(eMP0, x1From + 1, x2From, x3From); + (*this->localDistributionsTo)(eP0P, x1To, x2To, x3To) = + (*this->localDistributionsFrom)(eP0P, x1From, x2From, x3From); + (*this->localDistributionsTo)(eM0P, x1To + 1, x2To, x3To) = + (*this->localDistributionsFrom)(eM0P, x1From + 1, x2From, x3From); + (*this->localDistributionsTo)(e0PP, x1To, x2To, x3To) = + (*this->localDistributionsFrom)(e0PP, x1From, x2From, x3From); + (*this->localDistributionsTo)(e0MP, x1To, x2To + 1, x3To) = + (*this->localDistributionsFrom)(e0MP, x1From, x2From + 1, x3From); + (*this->localDistributionsTo)(ePPP, x1To, x2To, x3To) = + (*this->localDistributionsFrom)(ePPP, x1From, x2From, x3From); + (*this->localDistributionsTo)(eMPP, x1To + 1, x2To, x3To) = + (*this->localDistributionsFrom)(eMPP, x1From + 1, x2From, x3From); + (*this->localDistributionsTo)(ePMP, x1To, x2To + 1, x3To) = + (*this->localDistributionsFrom)(ePMP, x1From, x2From + 1, x3From); + (*this->localDistributionsTo)(eMMP, x1To + 1, x2To + 1, x3To) = + (*this->localDistributionsFrom)(eMMP, x1From + 1, x2From + 1, x3From); + + (*this->nonLocalDistributionsTo)(eM00, x1To + 1, x2To, x3To) = + (*this->nonLocalDistributionsFrom)(eM00, x1From + 1, x2From, x3From); + (*this->nonLocalDistributionsTo)(e0M0, x1To, x2To + 1, x3To) = + (*this->nonLocalDistributionsFrom)(e0M0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsTo)(e00M, x1To, x2To, x3To + 1) = + (*this->nonLocalDistributionsFrom)(e00M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsTo)(eMM0, x1To + 1, x2To + 1, x3To) = + (*this->nonLocalDistributionsFrom)(eMM0, x1From + 1, x2From + 1, x3From); + (*this->nonLocalDistributionsTo)(ePM0, x1To, x2To + 1, x3To) = + (*this->nonLocalDistributionsFrom)(ePM0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsTo)(eM0M, x1To + 1, x2To, x3To + 1) = + (*this->nonLocalDistributionsFrom)(eM0M, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsTo)(eP0M, x1To, x2To, x3To + 1) = + (*this->nonLocalDistributionsFrom)(eP0M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsTo)(e0MM, x1To, x2To + 1, x3To + 1) = + (*this->nonLocalDistributionsFrom)(e0MM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsTo)(e0PM, x1To, x2To, x3To + 1) = + (*this->nonLocalDistributionsFrom)(e0PM, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsTo)(eMMM, x1To + 1, x2To + 1, x3To + 1) = + (*this->nonLocalDistributionsFrom)(eMMM, x1From + 1, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsTo)(ePMM, x1To, x2To + 1, x3To + 1) = + (*this->nonLocalDistributionsFrom)(ePMM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsTo)(eMPM, x1To + 1, x2To, x3To + 1) = + (*this->nonLocalDistributionsFrom)(eMPM, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsTo)(ePPM, x1To, x2To, x3To + 1) = + (*this->nonLocalDistributionsFrom)(ePPM, x1From, x2From, x3From + 1); (*this->zeroDistributionsTo)(x1To, x2To, x3To) = (*this->zeroDistributionsFrom)(x1From, x2From, x3From); } diff --git a/src/cpu/core/Connectors/OneDistributionFullVectorConnector.h b/src/cpu/core/Connectors/OneDistributionFullVectorConnector.h index a9a53455c934fa68663ac6f3ff0722cdb45f689b..fa0b95f7a90d6da23ee36bae4c7f27b12951cdba 100644 --- a/src/cpu/core/Connectors/OneDistributionFullVectorConnector.h +++ b/src/cpu/core/Connectors/OneDistributionFullVectorConnector.h @@ -9,7 +9,7 @@ //#include "EsoTwistD3Q27System.h" #include "LBMKernel.h" #include "FullVectorConnector.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "basics/container/CbArray3D.h" #include "basics/container/CbArray4D.h" @@ -40,73 +40,77 @@ private: ////////////////////////////////////////////////////////////////////////// inline void OneDistributionFullVectorConnector::updatePointers() { - localDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getLocalDistributions(); - nonLocalDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getNonLocalDistributions(); - zeroDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getZeroDistributions(); + localDistributions = dynamicPointerCast<EsoSplit>(this->fDis)->getLocalDistributions(); + nonLocalDistributions = dynamicPointerCast<EsoSplit>(this->fDis)->getNonLocalDistributions(); + zeroDistributions = dynamicPointerCast<EsoSplit>(this->fDis)->getZeroDistributions(); } ////////////////////////////////////////////////////////////////////////// inline void OneDistributionFullVectorConnector::fillData(vector_type &sdata, int &index, int x1, int x2, int x3) { - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); + using namespace vf::lbm::dir; - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); + sdata[index++] = (*this->localDistributions)(eP00, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(e0P0, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(e00P, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(ePP0, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(eMP0, x1 + 1, x2, x3); + sdata[index++] = (*this->localDistributions)(eP0P, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(eM0P, x1 + 1, x2, x3); + sdata[index++] = (*this->localDistributions)(e0PP, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(e0MP, x1, x2 + 1, x3); + sdata[index++] = (*this->localDistributions)(ePPP, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(eMPP, x1 + 1, x2, x3); + sdata[index++] = (*this->localDistributions)(ePMP, x1, x2 + 1, x3); + sdata[index++] = (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3); + + sdata[index++] = (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3); + sdata[index++] = (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1); sdata[index++] = (*this->zeroDistributions)(x1, x2, x3); } ////////////////////////////////////////////////////////////////////////// inline void OneDistributionFullVectorConnector::distributeData(vector_type &rdata, int &index, int x1, int x2, int x3) { - (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = rdata[index++]; + using namespace vf::lbm::dir; + + (*this->localDistributions)(eP00, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e0P0, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e00P, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(ePP0, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eMP0, x1 + 1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eP0P, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eM0P, x1 + 1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e0PP, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e0MP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localDistributions)(ePPP, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eMPP, x1 + 1, x2, x3) = rdata[index++]; + (*this->localDistributions)(ePMP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3) = rdata[index++]; + (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1) = rdata[index++]; (*this->zeroDistributions)(x1, x2, x3) = rdata[index++]; } diff --git a/src/cpu/core/Connectors/RemoteBlock3DConnector.h b/src/cpu/core/Connectors/RemoteBlock3DConnector.h index 2c27eea33a01b7b680c645c4e143639f779bf4d6..acaac4c8cdd122c72ec8eb407bbe8cebf4712d5e 100644 --- a/src/cpu/core/Connectors/RemoteBlock3DConnector.h +++ b/src/cpu/core/Connectors/RemoteBlock3DConnector.h @@ -38,7 +38,6 @@ #include "Block3D.h" #include "Block3DConnector.h" #include "D3Q27System.h" -#include "EsoTwistD3Q27System.h" #include "LBMKernel.h" #include "TransmitterType.h" diff --git a/src/cpu/core/Connectors/ThreeDistributionsDoubleGhostLayerFullDirectConnector.h b/src/cpu/core/Connectors/ThreeDistributionsDoubleGhostLayerFullDirectConnector.h index 0efc6d2d981e2846a9f6718f2730b0077de43095..9ffbe9182bcae74c6e2c45bc06e8a3ec3b05a1a2 100644 --- a/src/cpu/core/Connectors/ThreeDistributionsDoubleGhostLayerFullDirectConnector.h +++ b/src/cpu/core/Connectors/ThreeDistributionsDoubleGhostLayerFullDirectConnector.h @@ -37,7 +37,7 @@ #include "FullDirectConnector.h" #include "Block3D.h" #include "D3Q27System.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "basics/container/CbArray3D.h" #include "basics/container/CbArray4D.h" #include "DataSet3D.h" @@ -90,147 +90,149 @@ private: ////////////////////////////////////////////////////////////////////////// inline void ThreeDistributionsDoubleGhostLayerFullDirectConnector::updatePointers() { - localDistributionsFromf = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getLocalDistributions(); - nonLocalDistributionsFromf = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getNonLocalDistributions(); - zeroDistributionsFromf = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getZeroDistributions(); + localDistributionsFromf = dynamicPointerCast<EsoSplit>(this->fFrom)->getLocalDistributions(); + nonLocalDistributionsFromf = dynamicPointerCast<EsoSplit>(this->fFrom)->getNonLocalDistributions(); + zeroDistributionsFromf = dynamicPointerCast<EsoSplit>(this->fFrom)->getZeroDistributions(); - localDistributionsTof = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getLocalDistributions(); - nonLocalDistributionsTof = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getNonLocalDistributions(); - zeroDistributionsTof = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getZeroDistributions(); + localDistributionsTof = dynamicPointerCast<EsoSplit>(this->fTo)->getLocalDistributions(); + nonLocalDistributionsTof = dynamicPointerCast<EsoSplit>(this->fTo)->getNonLocalDistributions(); + zeroDistributionsTof = dynamicPointerCast<EsoSplit>(this->fTo)->getZeroDistributions(); - localDistributionsFromh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hFrom)->getLocalDistributions(); - nonLocalDistributionsFromh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hFrom)->getNonLocalDistributions(); - zeroDistributionsFromh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hFrom)->getZeroDistributions(); + localDistributionsFromh = dynamicPointerCast<EsoSplit>(this->hFrom)->getLocalDistributions(); + nonLocalDistributionsFromh = dynamicPointerCast<EsoSplit>(this->hFrom)->getNonLocalDistributions(); + zeroDistributionsFromh = dynamicPointerCast<EsoSplit>(this->hFrom)->getZeroDistributions(); - localDistributionsToh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo)->getLocalDistributions(); - nonLocalDistributionsToh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo)->getNonLocalDistributions(); - zeroDistributionsToh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo)->getZeroDistributions(); + localDistributionsToh = dynamicPointerCast<EsoSplit>(this->hTo)->getLocalDistributions(); + nonLocalDistributionsToh = dynamicPointerCast<EsoSplit>(this->hTo)->getNonLocalDistributions(); + zeroDistributionsToh = dynamicPointerCast<EsoSplit>(this->hTo)->getZeroDistributions(); - localDistributionsFromh2 = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hFrom2)->getLocalDistributions(); - nonLocalDistributionsFromh2 = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hFrom2)->getNonLocalDistributions(); - zeroDistributionsFromh2 = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hFrom2)->getZeroDistributions(); + localDistributionsFromh2 = dynamicPointerCast<EsoSplit>(this->hFrom2)->getLocalDistributions(); + nonLocalDistributionsFromh2 = dynamicPointerCast<EsoSplit>(this->hFrom2)->getNonLocalDistributions(); + zeroDistributionsFromh2 = dynamicPointerCast<EsoSplit>(this->hFrom2)->getZeroDistributions(); - localDistributionsToh2 = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo2)->getLocalDistributions(); - nonLocalDistributionsToh2 = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo2)->getNonLocalDistributions(); - zeroDistributionsToh2 = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo2)->getZeroDistributions(); + localDistributionsToh2 = dynamicPointerCast<EsoSplit>(this->hTo2)->getLocalDistributions(); + nonLocalDistributionsToh2 = dynamicPointerCast<EsoSplit>(this->hTo2)->getNonLocalDistributions(); + zeroDistributionsToh2 = dynamicPointerCast<EsoSplit>(this->hTo2)->getZeroDistributions(); } ////////////////////////////////////////////////////////////////////////// inline void ThreeDistributionsDoubleGhostLayerFullDirectConnector::exchangeData(int x1From, int x2From, int x3From, int x1To, int x2To, int x3To) { - (*this->localDistributionsTof)(D3Q27System::ET_E, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_E, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_N, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_N, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_T, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_T, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_NE, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_NE, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_NW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_NW, x1From + 1, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TE, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TE, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TW, x1From + 1, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TN, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TN, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TS, x1To, x2To + 1, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TS, x1From, x2From + 1, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TNE, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TNE, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TNW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TNW, x1From + 1, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TSE, x1To, x2To + 1, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TSE, x1From, x2From + 1, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TSW, x1To + 1, x2To + 1, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TSW, x1From + 1, x2From + 1, x3From); - - (*this->nonLocalDistributionsTof)(D3Q27System::ET_W, x1To + 1, x2To, x3To) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_W, x1From + 1, x2From, x3From); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_S, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_S, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_B, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_B, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_SW, x1To + 1, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_SW, x1From + 1, x2From + 1, x3From); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_SE, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_SE, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BW, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BE, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BE, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BS, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BS, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BN, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BN, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BSW, x1To + 1, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BSW, x1From + 1, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BSE, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BSE, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BNW, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BNW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BNE, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BNE, x1From, x2From, x3From + 1); + using namespace vf::lbm::dir; + + (*this->localDistributionsTof)(eP00, x1To, x2To, x3To) = (*this->localDistributionsFromf)(eP00, x1From, x2From, x3From); + (*this->localDistributionsTof)(e0P0, x1To, x2To, x3To) = (*this->localDistributionsFromf)(e0P0, x1From, x2From, x3From); + (*this->localDistributionsTof)(e00P, x1To, x2To, x3To) = (*this->localDistributionsFromf)(e00P, x1From, x2From, x3From); + (*this->localDistributionsTof)(ePP0, x1To, x2To, x3To) = (*this->localDistributionsFromf)(ePP0, x1From, x2From, x3From); + (*this->localDistributionsTof)(eMP0, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(eMP0, x1From + 1, x2From, x3From); + (*this->localDistributionsTof)(eP0P, x1To, x2To, x3To) = (*this->localDistributionsFromf)(eP0P, x1From, x2From, x3From); + (*this->localDistributionsTof)(eM0P, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(eM0P, x1From + 1, x2From, x3From); + (*this->localDistributionsTof)(e0PP, x1To, x2To, x3To) = (*this->localDistributionsFromf)(e0PP, x1From, x2From, x3From); + (*this->localDistributionsTof)(e0MP, x1To, x2To + 1, x3To) = (*this->localDistributionsFromf)(e0MP, x1From, x2From + 1, x3From); + (*this->localDistributionsTof)(ePPP, x1To, x2To, x3To) = (*this->localDistributionsFromf)(ePPP, x1From, x2From, x3From); + (*this->localDistributionsTof)(eMPP, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(eMPP, x1From + 1, x2From, x3From); + (*this->localDistributionsTof)(ePMP, x1To, x2To + 1, x3To) = (*this->localDistributionsFromf)(ePMP, x1From, x2From + 1, x3From); + (*this->localDistributionsTof)(eMMP, x1To + 1, x2To + 1, x3To) = (*this->localDistributionsFromf)(eMMP, x1From + 1, x2From + 1, x3From); + + (*this->nonLocalDistributionsTof)(eM00, x1To + 1, x2To, x3To) = (*this->nonLocalDistributionsFromf)(eM00, x1From + 1, x2From, x3From); + (*this->nonLocalDistributionsTof)(e0M0, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(e0M0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsTof)(e00M, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(e00M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(eMM0, x1To + 1, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(eMM0, x1From + 1, x2From + 1, x3From); + (*this->nonLocalDistributionsTof)(ePM0, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(ePM0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsTof)(eM0M, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(eM0M, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(eP0M, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(eP0M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(e0MM, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(e0MM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsTof)(e0PM, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(e0PM, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(eMMM, x1To + 1, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(eMMM, x1From + 1, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsTof)(ePMM, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(ePMM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsTof)(eMPM, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(eMPM, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(ePPM, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(ePPM, x1From, x2From, x3From + 1); (*this->zeroDistributionsTof)(x1To, x2To, x3To) = (*this->zeroDistributionsFromf)(x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_E, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_E, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_N, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_N, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_T, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_T, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_NE, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_NE, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_NW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_NW, x1From + 1, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TE, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TE, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TW, x1From + 1, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TN, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TN, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TS, x1To, x2To + 1, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TS, x1From, x2From + 1, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TNE, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TNE, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TNW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TNW, x1From + 1, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TSE, x1To, x2To + 1, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TSE, x1From, x2From + 1, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TSW, x1To + 1, x2To + 1, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TSW, x1From + 1, x2From + 1, x3From); - - (*this->nonLocalDistributionsToh)(D3Q27System::ET_W, x1To + 1, x2To, x3To) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_W, x1From + 1, x2From, x3From); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_S, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_S, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_B, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_B, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_SW, x1To + 1, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_SW, x1From + 1, x2From + 1, x3From); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_SE, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_SE, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BW, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BE, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BE, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BS, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BS, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BN, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BN, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BSW, x1To + 1, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BSW, x1From + 1, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BSE, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BSE, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BNW, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BNW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BNE, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BNE, x1From, x2From, x3From + 1); + (*this->localDistributionsToh)(eP00, x1To, x2To, x3To) = (*this->localDistributionsFromh)(eP00, x1From, x2From, x3From); + (*this->localDistributionsToh)(e0P0, x1To, x2To, x3To) = (*this->localDistributionsFromh)(e0P0, x1From, x2From, x3From); + (*this->localDistributionsToh)(e00P, x1To, x2To, x3To) = (*this->localDistributionsFromh)(e00P, x1From, x2From, x3From); + (*this->localDistributionsToh)(ePP0, x1To, x2To, x3To) = (*this->localDistributionsFromh)(ePP0, x1From, x2From, x3From); + (*this->localDistributionsToh)(eMP0, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(eMP0, x1From + 1, x2From, x3From); + (*this->localDistributionsToh)(eP0P, x1To, x2To, x3To) = (*this->localDistributionsFromh)(eP0P, x1From, x2From, x3From); + (*this->localDistributionsToh)(eM0P, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(eM0P, x1From + 1, x2From, x3From); + (*this->localDistributionsToh)(e0PP, x1To, x2To, x3To) = (*this->localDistributionsFromh)(e0PP, x1From, x2From, x3From); + (*this->localDistributionsToh)(e0MP, x1To, x2To + 1, x3To) = (*this->localDistributionsFromh)(e0MP, x1From, x2From + 1, x3From); + (*this->localDistributionsToh)(ePPP, x1To, x2To, x3To) = (*this->localDistributionsFromh)(ePPP, x1From, x2From, x3From); + (*this->localDistributionsToh)(eMPP, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(eMPP, x1From + 1, x2From, x3From); + (*this->localDistributionsToh)(ePMP, x1To, x2To + 1, x3To) = (*this->localDistributionsFromh)(ePMP, x1From, x2From + 1, x3From); + (*this->localDistributionsToh)(eMMP, x1To + 1, x2To + 1, x3To) = (*this->localDistributionsFromh)(eMMP, x1From + 1, x2From + 1, x3From); + + (*this->nonLocalDistributionsToh)(eM00, x1To + 1, x2To, x3To) = (*this->nonLocalDistributionsFromh)(eM00, x1From + 1, x2From, x3From); + (*this->nonLocalDistributionsToh)(e0M0, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(e0M0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsToh)(e00M, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(e00M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(eMM0, x1To + 1, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(eMM0, x1From + 1, x2From + 1, x3From); + (*this->nonLocalDistributionsToh)(ePM0, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(ePM0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsToh)(eM0M, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(eM0M, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(eP0M, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(eP0M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(e0MM, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(e0MM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsToh)(e0PM, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(e0PM, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(eMMM, x1To + 1, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(eMMM, x1From + 1, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsToh)(ePMM, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(ePMM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsToh)(eMPM, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(eMPM, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(ePPM, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(ePPM, x1From, x2From, x3From + 1); (*this->zeroDistributionsToh)(x1To, x2To, x3To) = (*this->zeroDistributionsFromh)(x1From, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_E, x1To, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_E, x1From, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_N, x1To, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_N, x1From, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_T, x1To, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_T, x1From, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_NE, x1To, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_NE, x1From, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_NW, x1To + 1, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_NW, x1From + 1, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_TE, x1To, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_TE, x1From, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_TW, x1To + 1, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_TW, x1From + 1, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_TN, x1To, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_TN, x1From, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_TS, x1To, x2To + 1, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_TS, x1From, x2From + 1, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_TNE, x1To, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_TNE, x1From, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_TNW, x1To + 1, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_TNW, x1From + 1, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_TSE, x1To, x2To + 1, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_TSE, x1From, x2From + 1, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_TSW, x1To + 1, x2To + 1, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_TSW, x1From + 1, x2From + 1, x3From); - - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_W, x1To + 1, x2To, x3To) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_W, x1From + 1, x2From, x3From); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_S, x1To, x2To + 1, x3To) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_S, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_B, x1To, x2To, x3To + 1) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_B, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_SW, x1To + 1, x2To + 1, x3To) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_SW, x1From + 1, x2From + 1, x3From); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_SE, x1To, x2To + 1, x3To) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_SE, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_BW, x1To + 1, x2To, x3To + 1) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_BW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_BE, x1To, x2To, x3To + 1) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_BE, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_BS, x1To, x2To + 1, x3To + 1) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_BS, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_BN, x1To, x2To, x3To + 1) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_BN, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_BSW, x1To + 1, x2To + 1, x3To + 1) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_BSW, x1From + 1, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_BSE, x1To, x2To + 1, x3To + 1) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_BSE, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_BNW, x1To + 1, x2To, x3To + 1) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_BNW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_BNE, x1To, x2To, x3To + 1) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_BNE, x1From, x2From, x3From + 1); + (*this->localDistributionsToh2)(eP00, x1To, x2To, x3To) = + (*this->localDistributionsFromh2)(eP00, x1From, x2From, x3From); + (*this->localDistributionsToh2)(e0P0, x1To, x2To, x3To) = + (*this->localDistributionsFromh2)(e0P0, x1From, x2From, x3From); + (*this->localDistributionsToh2)(e00P, x1To, x2To, x3To) = + (*this->localDistributionsFromh2)(e00P, x1From, x2From, x3From); + (*this->localDistributionsToh2)(ePP0, x1To, x2To, x3To) = + (*this->localDistributionsFromh2)(ePP0, x1From, x2From, x3From); + (*this->localDistributionsToh2)(eMP0, x1To + 1, x2To, x3To) = + (*this->localDistributionsFromh2)(eMP0, x1From + 1, x2From, x3From); + (*this->localDistributionsToh2)(eP0P, x1To, x2To, x3To) = + (*this->localDistributionsFromh2)(eP0P, x1From, x2From, x3From); + (*this->localDistributionsToh2)(eM0P, x1To + 1, x2To, x3To) = + (*this->localDistributionsFromh2)(eM0P, x1From + 1, x2From, x3From); + (*this->localDistributionsToh2)(e0PP, x1To, x2To, x3To) = + (*this->localDistributionsFromh2)(e0PP, x1From, x2From, x3From); + (*this->localDistributionsToh2)(e0MP, x1To, x2To + 1, x3To) = + (*this->localDistributionsFromh2)(e0MP, x1From, x2From + 1, x3From); + (*this->localDistributionsToh2)(ePPP, x1To, x2To, x3To) = + (*this->localDistributionsFromh2)(ePPP, x1From, x2From, x3From); + (*this->localDistributionsToh2)(eMPP, x1To + 1, x2To, x3To) = + (*this->localDistributionsFromh2)(eMPP, x1From + 1, x2From, x3From); + (*this->localDistributionsToh2)(ePMP, x1To, x2To + 1, x3To) = + (*this->localDistributionsFromh2)(ePMP, x1From, x2From + 1, x3From); + (*this->localDistributionsToh2)(eMMP, x1To + 1, x2To + 1, x3To) = + (*this->localDistributionsFromh2)(eMMP, x1From + 1, x2From + 1, x3From); + + (*this->nonLocalDistributionsToh2)(eM00, x1To + 1, x2To, x3To) = + (*this->nonLocalDistributionsFromh2)(eM00, x1From + 1, x2From, x3From); + (*this->nonLocalDistributionsToh2)(e0M0, x1To, x2To + 1, x3To) = + (*this->nonLocalDistributionsFromh2)(e0M0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsToh2)(e00M, x1To, x2To, x3To + 1) = + (*this->nonLocalDistributionsFromh2)(e00M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsToh2)(eMM0, x1To + 1, x2To + 1, x3To) = + (*this->nonLocalDistributionsFromh2)(eMM0, x1From + 1, x2From + 1, x3From); + (*this->nonLocalDistributionsToh2)(ePM0, x1To, x2To + 1, x3To) = + (*this->nonLocalDistributionsFromh2)(ePM0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsToh2)(eM0M, x1To + 1, x2To, x3To + 1) = + (*this->nonLocalDistributionsFromh2)(eM0M, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsToh2)(eP0M, x1To, x2To, x3To + 1) = + (*this->nonLocalDistributionsFromh2)(eP0M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsToh2)(e0MM, x1To, x2To + 1, x3To + 1) = + (*this->nonLocalDistributionsFromh2)(e0MM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsToh2)(e0PM, x1To, x2To, x3To + 1) = + (*this->nonLocalDistributionsFromh2)(e0PM, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsToh2)(eMMM, x1To + 1, x2To + 1, x3To + 1) = + (*this->nonLocalDistributionsFromh2)(eMMM, x1From + 1, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsToh2)(ePMM, x1To, x2To + 1, x3To + 1) = + (*this->nonLocalDistributionsFromh2)(ePMM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsToh2)(eMPM, x1To + 1, x2To, x3To + 1) = + (*this->nonLocalDistributionsFromh2)(eMPM, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsToh2)(ePPM, x1To, x2To, x3To + 1) = + (*this->nonLocalDistributionsFromh2)(ePPM, x1From, x2From, x3From + 1); (*this->zeroDistributionsToh2)(x1To, x2To, x3To) = (*this->zeroDistributionsFromh2)(x1From, x2From, x3From); diff --git a/src/cpu/core/Connectors/ThreeDistributionsDoubleGhostLayerFullVectorConnector.h b/src/cpu/core/Connectors/ThreeDistributionsDoubleGhostLayerFullVectorConnector.h index c91103481e71979d93830573fe3a27a80c77a337..891536fe66624e85915be768527cd9e4454b3147 100644 --- a/src/cpu/core/Connectors/ThreeDistributionsDoubleGhostLayerFullVectorConnector.h +++ b/src/cpu/core/Connectors/ThreeDistributionsDoubleGhostLayerFullVectorConnector.h @@ -38,7 +38,7 @@ #include "FullVectorConnector.h" #include "D3Q27System.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "basics/container/CbArray3D.h" #include "basics/container/CbArray4D.h" #include "DataSet3D.h" @@ -92,109 +92,111 @@ private: ////////////////////////////////////////////////////////////////////////// inline void ThreeDistributionsDoubleGhostLayerFullVectorConnector::updatePointers() { - localDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getLocalDistributions(); - nonLocalDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getNonLocalDistributions(); - zeroDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getZeroDistributions(); + localDistributions = dynamicPointerCast<EsoSplit>(this->fDis)->getLocalDistributions(); + nonLocalDistributions = dynamicPointerCast<EsoSplit>(this->fDis)->getNonLocalDistributions(); + zeroDistributions = dynamicPointerCast<EsoSplit>(this->fDis)->getZeroDistributions(); - localHdistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hDis)->getLocalDistributions(); - nonLocalHdistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hDis)->getNonLocalDistributions(); - zeroHdistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hDis)->getZeroDistributions(); + localHdistributions = dynamicPointerCast<EsoSplit>(this->hDis)->getLocalDistributions(); + nonLocalHdistributions = dynamicPointerCast<EsoSplit>(this->hDis)->getNonLocalDistributions(); + zeroHdistributions = dynamicPointerCast<EsoSplit>(this->hDis)->getZeroDistributions(); - localH2distributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->h2Dis)->getLocalDistributions(); - nonLocalH2distributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->h2Dis)->getNonLocalDistributions(); - zeroH2distributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->h2Dis)->getZeroDistributions(); + localH2distributions = dynamicPointerCast<EsoSplit>(this->h2Dis)->getLocalDistributions(); + nonLocalH2distributions = dynamicPointerCast<EsoSplit>(this->h2Dis)->getNonLocalDistributions(); + zeroH2distributions = dynamicPointerCast<EsoSplit>(this->h2Dis)->getZeroDistributions(); } ////////////////////////////////////////////////////////////////////////// inline void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData(vector_type& sdata, int& index, int x1, int x2, int x3) { - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); - - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); + using namespace vf::lbm::dir; + + sdata[index++] = (*this->localDistributions)(eP00, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(e0P0, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(e00P, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(ePP0, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(eMP0, x1 + 1, x2, x3); + sdata[index++] = (*this->localDistributions)(eP0P, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(eM0P, x1 + 1, x2, x3); + sdata[index++] = (*this->localDistributions)(e0PP, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(e0MP, x1, x2 + 1, x3); + sdata[index++] = (*this->localDistributions)(ePPP, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(eMPP, x1 + 1, x2, x3); + sdata[index++] = (*this->localDistributions)(ePMP, x1, x2 + 1, x3); + sdata[index++] = (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3); + + sdata[index++] = (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3); + sdata[index++] = (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1); sdata[index++] = (*this->zeroDistributions)(x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_E, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_N, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_T, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_NE, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TE, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TN, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TNE, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); - - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_W, x1 + 1, x2, x3); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_S, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_B, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); + sdata[index++] = (*this->localHdistributions)(eP00, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(e0P0, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(e00P, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(ePP0, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(eMP0, x1 + 1, x2, x3); + sdata[index++] = (*this->localHdistributions)(eP0P, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(eM0P, x1 + 1, x2, x3); + sdata[index++] = (*this->localHdistributions)(e0PP, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(e0MP, x1, x2 + 1, x3); + sdata[index++] = (*this->localHdistributions)(ePPP, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(eMPP, x1 + 1, x2, x3); + sdata[index++] = (*this->localHdistributions)(ePMP, x1, x2 + 1, x3); + sdata[index++] = (*this->localHdistributions)(eMMP, x1 + 1, x2 + 1, x3); + + sdata[index++] = (*this->nonLocalHdistributions)(eM00, x1 + 1, x2, x3); + sdata[index++] = (*this->nonLocalHdistributions)(e0M0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalHdistributions)(e00M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(eMM0, x1 + 1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalHdistributions)(ePM0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalHdistributions)(eM0M, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(eP0M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(e0MM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(e0PM, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(ePMM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(eMPM, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(ePPM, x1, x2, x3 + 1); sdata[index++] = (*this->zeroHdistributions)(x1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_E, x1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_N, x1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_T, x1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_NE, x1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_TE, x1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_TN, x1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_TNE, x1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); - - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_W, x1 + 1, x2, x3); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_S, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_B, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); + sdata[index++] = (*this->localH2distributions)(eP00, x1, x2, x3); + sdata[index++] = (*this->localH2distributions)(e0P0, x1, x2, x3); + sdata[index++] = (*this->localH2distributions)(e00P, x1, x2, x3); + sdata[index++] = (*this->localH2distributions)(ePP0, x1, x2, x3); + sdata[index++] = (*this->localH2distributions)(eMP0, x1 + 1, x2, x3); + sdata[index++] = (*this->localH2distributions)(eP0P, x1, x2, x3); + sdata[index++] = (*this->localH2distributions)(eM0P, x1 + 1, x2, x3); + sdata[index++] = (*this->localH2distributions)(e0PP, x1, x2, x3); + sdata[index++] = (*this->localH2distributions)(e0MP, x1, x2 + 1, x3); + sdata[index++] = (*this->localH2distributions)(ePPP, x1, x2, x3); + sdata[index++] = (*this->localH2distributions)(eMPP, x1 + 1, x2, x3); + sdata[index++] = (*this->localH2distributions)(ePMP, x1, x2 + 1, x3); + sdata[index++] = (*this->localH2distributions)(eMMP, x1 + 1, x2 + 1, x3); + + sdata[index++] = (*this->nonLocalH2distributions)(eM00, x1 + 1, x2, x3); + sdata[index++] = (*this->nonLocalH2distributions)(e0M0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalH2distributions)(e00M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalH2distributions)(eMM0, x1 + 1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalH2distributions)(ePM0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalH2distributions)(eM0M, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalH2distributions)(eP0M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalH2distributions)(e0MM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalH2distributions)(e0PM, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalH2distributions)(eMMM, x1 + 1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalH2distributions)(ePMM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalH2distributions)(eMPM, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalH2distributions)(ePPM, x1, x2, x3 + 1); sdata[index++] = (*this->zeroH2distributions)(x1, x2, x3); @@ -204,94 +206,96 @@ inline void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData(vect ////////////////////////////////////////////////////////////////////////// inline void ThreeDistributionsDoubleGhostLayerFullVectorConnector::distributeData(vector_type& rdata, int& index, int x1, int x2, int x3) { - (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = rdata[index++]; - - (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = rdata[index++]; + using namespace vf::lbm::dir; + + (*this->localDistributions)(eP00, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e0P0, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e00P, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(ePP0, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eMP0, x1 + 1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eP0P, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eM0P, x1 + 1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e0PP, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e0MP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localDistributions)(ePPP, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eMPP, x1 + 1, x2, x3) = rdata[index++]; + (*this->localDistributions)(ePMP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3) = rdata[index++]; + + (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3) = rdata[index++]; + (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1) = rdata[index++]; (*this->zeroDistributions)(x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_E, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_N, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_T, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_NE, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TE, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TN, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TNE, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = rdata[index++]; - - (*this->nonLocalHdistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = rdata[index++]; + (*this->localHdistributions)(eP00, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(e0P0, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(e00P, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(ePP0, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(eMP0, x1 + 1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(eP0P, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(eM0P, x1 + 1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(e0PP, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(e0MP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localHdistributions)(ePPP, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(eMPP, x1 + 1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(ePMP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localHdistributions)(eMMP, x1 + 1, x2 + 1, x3) = rdata[index++]; + + (*this->nonLocalHdistributions)(eM00, x1 + 1, x2, x3) = rdata[index++]; + (*this->nonLocalHdistributions)(e0M0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalHdistributions)(e00M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(eMM0, x1 + 1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalHdistributions)(ePM0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalHdistributions)(eM0M, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(eP0M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(e0MM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(e0PM, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(ePMM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(eMPM, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(ePPM, x1, x2, x3 + 1) = rdata[index++]; (*this->zeroHdistributions)(x1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_E, x1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_N, x1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_T, x1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_NE, x1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_TE, x1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_TN, x1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_TNE, x1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = rdata[index++]; - - (*this->nonLocalH2distributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = rdata[index++]; + (*this->localH2distributions)(eP00, x1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(e0P0, x1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(e00P, x1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(ePP0, x1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(eMP0, x1 + 1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(eP0P, x1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(eM0P, x1 + 1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(e0PP, x1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(e0MP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localH2distributions)(ePPP, x1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(eMPP, x1 + 1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(ePMP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localH2distributions)(eMMP, x1 + 1, x2 + 1, x3) = rdata[index++]; + + (*this->nonLocalH2distributions)(eM00, x1 + 1, x2, x3) = rdata[index++]; + (*this->nonLocalH2distributions)(e0M0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalH2distributions)(e00M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalH2distributions)(eMM0, x1 + 1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalH2distributions)(ePM0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalH2distributions)(eM0M, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalH2distributions)(eP0M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalH2distributions)(e0MM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalH2distributions)(e0PM, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalH2distributions)(eMMM, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalH2distributions)(ePMM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalH2distributions)(eMPM, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalH2distributions)(ePPM, x1, x2, x3 + 1) = rdata[index++]; (*this->zeroH2distributions)(x1, x2, x3) = rdata[index++]; diff --git a/src/cpu/core/Connectors/ThreeDistributionsFullDirectConnector.h b/src/cpu/core/Connectors/ThreeDistributionsFullDirectConnector.h index d31b775f51347b5471512b0da763dc9f9ca90596..32caaf40263515514ef1912effdf389a42d6930e 100644 --- a/src/cpu/core/Connectors/ThreeDistributionsFullDirectConnector.h +++ b/src/cpu/core/Connectors/ThreeDistributionsFullDirectConnector.h @@ -37,7 +37,7 @@ #include "FullDirectConnector.h" #include "Block3D.h" #include "D3Q27System.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "basics/container/CbArray3D.h" #include "basics/container/CbArray4D.h" @@ -85,147 +85,149 @@ private: ////////////////////////////////////////////////////////////////////////// inline void ThreeDistributionsFullDirectConnector::updatePointers() { - localDistributionsFromf = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getLocalDistributions(); - nonLocalDistributionsFromf = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getNonLocalDistributions(); - zeroDistributionsFromf = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getZeroDistributions(); + localDistributionsFromf = dynamicPointerCast<EsoSplit>(this->fFrom)->getLocalDistributions(); + nonLocalDistributionsFromf = dynamicPointerCast<EsoSplit>(this->fFrom)->getNonLocalDistributions(); + zeroDistributionsFromf = dynamicPointerCast<EsoSplit>(this->fFrom)->getZeroDistributions(); - localDistributionsTof = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getLocalDistributions(); - nonLocalDistributionsTof = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getNonLocalDistributions(); - zeroDistributionsTof = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getZeroDistributions(); + localDistributionsTof = dynamicPointerCast<EsoSplit>(this->fTo)->getLocalDistributions(); + nonLocalDistributionsTof = dynamicPointerCast<EsoSplit>(this->fTo)->getNonLocalDistributions(); + zeroDistributionsTof = dynamicPointerCast<EsoSplit>(this->fTo)->getZeroDistributions(); - localDistributionsFromh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hFrom)->getLocalDistributions(); - nonLocalDistributionsFromh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hFrom)->getNonLocalDistributions(); - zeroDistributionsFromh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hFrom)->getZeroDistributions(); + localDistributionsFromh = dynamicPointerCast<EsoSplit>(this->hFrom)->getLocalDistributions(); + nonLocalDistributionsFromh = dynamicPointerCast<EsoSplit>(this->hFrom)->getNonLocalDistributions(); + zeroDistributionsFromh = dynamicPointerCast<EsoSplit>(this->hFrom)->getZeroDistributions(); - localDistributionsToh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo)->getLocalDistributions(); - nonLocalDistributionsToh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo)->getNonLocalDistributions(); - zeroDistributionsToh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo)->getZeroDistributions(); + localDistributionsToh = dynamicPointerCast<EsoSplit>(this->hTo)->getLocalDistributions(); + nonLocalDistributionsToh = dynamicPointerCast<EsoSplit>(this->hTo)->getNonLocalDistributions(); + zeroDistributionsToh = dynamicPointerCast<EsoSplit>(this->hTo)->getZeroDistributions(); - localDistributionsFromh2 = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hFrom2)->getLocalDistributions(); - nonLocalDistributionsFromh2 = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hFrom2)->getNonLocalDistributions(); - zeroDistributionsFromh2 = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hFrom2)->getZeroDistributions(); + localDistributionsFromh2 = dynamicPointerCast<EsoSplit>(this->hFrom2)->getLocalDistributions(); + nonLocalDistributionsFromh2 = dynamicPointerCast<EsoSplit>(this->hFrom2)->getNonLocalDistributions(); + zeroDistributionsFromh2 = dynamicPointerCast<EsoSplit>(this->hFrom2)->getZeroDistributions(); - localDistributionsToh2 = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo2)->getLocalDistributions(); - nonLocalDistributionsToh2 = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo2)->getNonLocalDistributions(); - zeroDistributionsToh2 = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo2)->getZeroDistributions(); + localDistributionsToh2 = dynamicPointerCast<EsoSplit>(this->hTo2)->getLocalDistributions(); + nonLocalDistributionsToh2 = dynamicPointerCast<EsoSplit>(this->hTo2)->getNonLocalDistributions(); + zeroDistributionsToh2 = dynamicPointerCast<EsoSplit>(this->hTo2)->getZeroDistributions(); } ////////////////////////////////////////////////////////////////////////// inline void ThreeDistributionsFullDirectConnector::exchangeData(int x1From, int x2From, int x3From, int x1To, int x2To, int x3To) { - (*this->localDistributionsTof)(D3Q27System::ET_E, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_E, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_N, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_N, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_T, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_T, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_NE, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_NE, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_NW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_NW, x1From + 1, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TE, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TE, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TW, x1From + 1, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TN, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TN, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TS, x1To, x2To + 1, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TS, x1From, x2From + 1, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TNE, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TNE, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TNW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TNW, x1From + 1, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TSE, x1To, x2To + 1, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TSE, x1From, x2From + 1, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TSW, x1To + 1, x2To + 1, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TSW, x1From + 1, x2From + 1, x3From); - - (*this->nonLocalDistributionsTof)(D3Q27System::ET_W, x1To + 1, x2To, x3To) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_W, x1From + 1, x2From, x3From); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_S, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_S, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_B, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_B, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_SW, x1To + 1, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_SW, x1From + 1, x2From + 1, x3From); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_SE, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_SE, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BW, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BE, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BE, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BS, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BS, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BN, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BN, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BSW, x1To + 1, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BSW, x1From + 1, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BSE, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BSE, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BNW, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BNW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BNE, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BNE, x1From, x2From, x3From + 1); + using namespace vf::lbm::dir; + + (*this->localDistributionsTof)(eP00, x1To, x2To, x3To) = (*this->localDistributionsFromf)(eP00, x1From, x2From, x3From); + (*this->localDistributionsTof)(e0P0, x1To, x2To, x3To) = (*this->localDistributionsFromf)(e0P0, x1From, x2From, x3From); + (*this->localDistributionsTof)(e00P, x1To, x2To, x3To) = (*this->localDistributionsFromf)(e00P, x1From, x2From, x3From); + (*this->localDistributionsTof)(ePP0, x1To, x2To, x3To) = (*this->localDistributionsFromf)(ePP0, x1From, x2From, x3From); + (*this->localDistributionsTof)(eMP0, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(eMP0, x1From + 1, x2From, x3From); + (*this->localDistributionsTof)(eP0P, x1To, x2To, x3To) = (*this->localDistributionsFromf)(eP0P, x1From, x2From, x3From); + (*this->localDistributionsTof)(eM0P, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(eM0P, x1From + 1, x2From, x3From); + (*this->localDistributionsTof)(e0PP, x1To, x2To, x3To) = (*this->localDistributionsFromf)(e0PP, x1From, x2From, x3From); + (*this->localDistributionsTof)(e0MP, x1To, x2To + 1, x3To) = (*this->localDistributionsFromf)(e0MP, x1From, x2From + 1, x3From); + (*this->localDistributionsTof)(ePPP, x1To, x2To, x3To) = (*this->localDistributionsFromf)(ePPP, x1From, x2From, x3From); + (*this->localDistributionsTof)(eMPP, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(eMPP, x1From + 1, x2From, x3From); + (*this->localDistributionsTof)(ePMP, x1To, x2To + 1, x3To) = (*this->localDistributionsFromf)(ePMP, x1From, x2From + 1, x3From); + (*this->localDistributionsTof)(eMMP, x1To + 1, x2To + 1, x3To) = (*this->localDistributionsFromf)(eMMP, x1From + 1, x2From + 1, x3From); + + (*this->nonLocalDistributionsTof)(eM00, x1To + 1, x2To, x3To) = (*this->nonLocalDistributionsFromf)(eM00, x1From + 1, x2From, x3From); + (*this->nonLocalDistributionsTof)(e0M0, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(e0M0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsTof)(e00M, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(e00M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(eMM0, x1To + 1, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(eMM0, x1From + 1, x2From + 1, x3From); + (*this->nonLocalDistributionsTof)(ePM0, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(ePM0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsTof)(eM0M, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(eM0M, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(eP0M, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(eP0M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(e0MM, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(e0MM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsTof)(e0PM, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(e0PM, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(eMMM, x1To + 1, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(eMMM, x1From + 1, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsTof)(ePMM, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(ePMM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsTof)(eMPM, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(eMPM, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(ePPM, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(ePPM, x1From, x2From, x3From + 1); (*this->zeroDistributionsTof)(x1To, x2To, x3To) = (*this->zeroDistributionsFromf)(x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_E, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_E, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_N, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_N, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_T, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_T, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_NE, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_NE, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_NW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_NW, x1From + 1, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TE, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TE, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TW, x1From + 1, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TN, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TN, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TS, x1To, x2To + 1, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TS, x1From, x2From + 1, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TNE, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TNE, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TNW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TNW, x1From + 1, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TSE, x1To, x2To + 1, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TSE, x1From, x2From + 1, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TSW, x1To + 1, x2To + 1, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TSW, x1From + 1, x2From + 1, x3From); - - (*this->nonLocalDistributionsToh)(D3Q27System::ET_W, x1To + 1, x2To, x3To) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_W, x1From + 1, x2From, x3From); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_S, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_S, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_B, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_B, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_SW, x1To + 1, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_SW, x1From + 1, x2From + 1, x3From); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_SE, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_SE, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BW, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BE, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BE, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BS, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BS, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BN, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BN, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BSW, x1To + 1, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BSW, x1From + 1, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BSE, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BSE, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BNW, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BNW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BNE, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BNE, x1From, x2From, x3From + 1); + (*this->localDistributionsToh)(eP00, x1To, x2To, x3To) = (*this->localDistributionsFromh)(eP00, x1From, x2From, x3From); + (*this->localDistributionsToh)(e0P0, x1To, x2To, x3To) = (*this->localDistributionsFromh)(e0P0, x1From, x2From, x3From); + (*this->localDistributionsToh)(e00P, x1To, x2To, x3To) = (*this->localDistributionsFromh)(e00P, x1From, x2From, x3From); + (*this->localDistributionsToh)(ePP0, x1To, x2To, x3To) = (*this->localDistributionsFromh)(ePP0, x1From, x2From, x3From); + (*this->localDistributionsToh)(eMP0, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(eMP0, x1From + 1, x2From, x3From); + (*this->localDistributionsToh)(eP0P, x1To, x2To, x3To) = (*this->localDistributionsFromh)(eP0P, x1From, x2From, x3From); + (*this->localDistributionsToh)(eM0P, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(eM0P, x1From + 1, x2From, x3From); + (*this->localDistributionsToh)(e0PP, x1To, x2To, x3To) = (*this->localDistributionsFromh)(e0PP, x1From, x2From, x3From); + (*this->localDistributionsToh)(e0MP, x1To, x2To + 1, x3To) = (*this->localDistributionsFromh)(e0MP, x1From, x2From + 1, x3From); + (*this->localDistributionsToh)(ePPP, x1To, x2To, x3To) = (*this->localDistributionsFromh)(ePPP, x1From, x2From, x3From); + (*this->localDistributionsToh)(eMPP, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(eMPP, x1From + 1, x2From, x3From); + (*this->localDistributionsToh)(ePMP, x1To, x2To + 1, x3To) = (*this->localDistributionsFromh)(ePMP, x1From, x2From + 1, x3From); + (*this->localDistributionsToh)(eMMP, x1To + 1, x2To + 1, x3To) = (*this->localDistributionsFromh)(eMMP, x1From + 1, x2From + 1, x3From); + + (*this->nonLocalDistributionsToh)(eM00, x1To + 1, x2To, x3To) = (*this->nonLocalDistributionsFromh)(eM00, x1From + 1, x2From, x3From); + (*this->nonLocalDistributionsToh)(e0M0, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(e0M0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsToh)(e00M, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(e00M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(eMM0, x1To + 1, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(eMM0, x1From + 1, x2From + 1, x3From); + (*this->nonLocalDistributionsToh)(ePM0, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(ePM0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsToh)(eM0M, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(eM0M, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(eP0M, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(eP0M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(e0MM, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(e0MM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsToh)(e0PM, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(e0PM, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(eMMM, x1To + 1, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(eMMM, x1From + 1, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsToh)(ePMM, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(ePMM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsToh)(eMPM, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(eMPM, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(ePPM, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(ePPM, x1From, x2From, x3From + 1); (*this->zeroDistributionsToh)(x1To, x2To, x3To) = (*this->zeroDistributionsFromh)(x1From, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_E, x1To, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_E, x1From, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_N, x1To, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_N, x1From, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_T, x1To, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_T, x1From, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_NE, x1To, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_NE, x1From, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_NW, x1To + 1, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_NW, x1From + 1, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_TE, x1To, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_TE, x1From, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_TW, x1To + 1, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_TW, x1From + 1, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_TN, x1To, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_TN, x1From, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_TS, x1To, x2To + 1, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_TS, x1From, x2From + 1, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_TNE, x1To, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_TNE, x1From, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_TNW, x1To + 1, x2To, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_TNW, x1From + 1, x2From, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_TSE, x1To, x2To + 1, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_TSE, x1From, x2From + 1, x3From); - (*this->localDistributionsToh2)(D3Q27System::ET_TSW, x1To + 1, x2To + 1, x3To) = - (*this->localDistributionsFromh2)(D3Q27System::ET_TSW, x1From + 1, x2From + 1, x3From); - - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_W, x1To + 1, x2To, x3To) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_W, x1From + 1, x2From, x3From); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_S, x1To, x2To + 1, x3To) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_S, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_B, x1To, x2To, x3To + 1) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_B, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_SW, x1To + 1, x2To + 1, x3To) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_SW, x1From + 1, x2From + 1, x3From); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_SE, x1To, x2To + 1, x3To) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_SE, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_BW, x1To + 1, x2To, x3To + 1) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_BW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_BE, x1To, x2To, x3To + 1) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_BE, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_BS, x1To, x2To + 1, x3To + 1) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_BS, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_BN, x1To, x2To, x3To + 1) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_BN, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_BSW, x1To + 1, x2To + 1, x3To + 1) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_BSW, x1From + 1, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_BSE, x1To, x2To + 1, x3To + 1) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_BSE, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_BNW, x1To + 1, x2To, x3To + 1) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_BNW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsToh2)(D3Q27System::ET_BNE, x1To, x2To, x3To + 1) = - (*this->nonLocalDistributionsFromh2)(D3Q27System::ET_BNE, x1From, x2From, x3From + 1); + (*this->localDistributionsToh2)(eP00, x1To, x2To, x3To) = + (*this->localDistributionsFromh2)(eP00, x1From, x2From, x3From); + (*this->localDistributionsToh2)(e0P0, x1To, x2To, x3To) = + (*this->localDistributionsFromh2)(e0P0, x1From, x2From, x3From); + (*this->localDistributionsToh2)(e00P, x1To, x2To, x3To) = + (*this->localDistributionsFromh2)(e00P, x1From, x2From, x3From); + (*this->localDistributionsToh2)(ePP0, x1To, x2To, x3To) = + (*this->localDistributionsFromh2)(ePP0, x1From, x2From, x3From); + (*this->localDistributionsToh2)(eMP0, x1To + 1, x2To, x3To) = + (*this->localDistributionsFromh2)(eMP0, x1From + 1, x2From, x3From); + (*this->localDistributionsToh2)(eP0P, x1To, x2To, x3To) = + (*this->localDistributionsFromh2)(eP0P, x1From, x2From, x3From); + (*this->localDistributionsToh2)(eM0P, x1To + 1, x2To, x3To) = + (*this->localDistributionsFromh2)(eM0P, x1From + 1, x2From, x3From); + (*this->localDistributionsToh2)(e0PP, x1To, x2To, x3To) = + (*this->localDistributionsFromh2)(e0PP, x1From, x2From, x3From); + (*this->localDistributionsToh2)(e0MP, x1To, x2To + 1, x3To) = + (*this->localDistributionsFromh2)(e0MP, x1From, x2From + 1, x3From); + (*this->localDistributionsToh2)(ePPP, x1To, x2To, x3To) = + (*this->localDistributionsFromh2)(ePPP, x1From, x2From, x3From); + (*this->localDistributionsToh2)(eMPP, x1To + 1, x2To, x3To) = + (*this->localDistributionsFromh2)(eMPP, x1From + 1, x2From, x3From); + (*this->localDistributionsToh2)(ePMP, x1To, x2To + 1, x3To) = + (*this->localDistributionsFromh2)(ePMP, x1From, x2From + 1, x3From); + (*this->localDistributionsToh2)(eMMP, x1To + 1, x2To + 1, x3To) = + (*this->localDistributionsFromh2)(eMMP, x1From + 1, x2From + 1, x3From); + + (*this->nonLocalDistributionsToh2)(eM00, x1To + 1, x2To, x3To) = + (*this->nonLocalDistributionsFromh2)(eM00, x1From + 1, x2From, x3From); + (*this->nonLocalDistributionsToh2)(e0M0, x1To, x2To + 1, x3To) = + (*this->nonLocalDistributionsFromh2)(e0M0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsToh2)(e00M, x1To, x2To, x3To + 1) = + (*this->nonLocalDistributionsFromh2)(e00M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsToh2)(eMM0, x1To + 1, x2To + 1, x3To) = + (*this->nonLocalDistributionsFromh2)(eMM0, x1From + 1, x2From + 1, x3From); + (*this->nonLocalDistributionsToh2)(ePM0, x1To, x2To + 1, x3To) = + (*this->nonLocalDistributionsFromh2)(ePM0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsToh2)(eM0M, x1To + 1, x2To, x3To + 1) = + (*this->nonLocalDistributionsFromh2)(eM0M, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsToh2)(eP0M, x1To, x2To, x3To + 1) = + (*this->nonLocalDistributionsFromh2)(eP0M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsToh2)(e0MM, x1To, x2To + 1, x3To + 1) = + (*this->nonLocalDistributionsFromh2)(e0MM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsToh2)(e0PM, x1To, x2To, x3To + 1) = + (*this->nonLocalDistributionsFromh2)(e0PM, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsToh2)(eMMM, x1To + 1, x2To + 1, x3To + 1) = + (*this->nonLocalDistributionsFromh2)(eMMM, x1From + 1, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsToh2)(ePMM, x1To, x2To + 1, x3To + 1) = + (*this->nonLocalDistributionsFromh2)(ePMM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsToh2)(eMPM, x1To + 1, x2To, x3To + 1) = + (*this->nonLocalDistributionsFromh2)(eMPM, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsToh2)(ePPM, x1To, x2To, x3To + 1) = + (*this->nonLocalDistributionsFromh2)(ePPM, x1From, x2From, x3From + 1); (*this->zeroDistributionsToh2)(x1To, x2To, x3To) = (*this->zeroDistributionsFromh2)(x1From, x2From, x3From); } diff --git a/src/cpu/core/Connectors/ThreeDistributionsFullVectorConnector.h b/src/cpu/core/Connectors/ThreeDistributionsFullVectorConnector.h index 794ba2d01d8015b347e8a1712da943b82d80b83c..36a698d60aed924bda94fcb772a444e2081b080e 100644 --- a/src/cpu/core/Connectors/ThreeDistributionsFullVectorConnector.h +++ b/src/cpu/core/Connectors/ThreeDistributionsFullVectorConnector.h @@ -38,7 +38,7 @@ #include "FullVectorConnector.h" #include "D3Q27System.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "basics/container/CbArray3D.h" #include "basics/container/CbArray4D.h" @@ -84,203 +84,207 @@ private: ////////////////////////////////////////////////////////////////////////// inline void ThreeDistributionsFullVectorConnector::updatePointers() { - localDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getLocalDistributions(); - nonLocalDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getNonLocalDistributions(); - zeroDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getZeroDistributions(); + localDistributions = dynamicPointerCast<EsoSplit>(this->fDis)->getLocalDistributions(); + nonLocalDistributions = dynamicPointerCast<EsoSplit>(this->fDis)->getNonLocalDistributions(); + zeroDistributions = dynamicPointerCast<EsoSplit>(this->fDis)->getZeroDistributions(); - localHdistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hDis)->getLocalDistributions(); - nonLocalHdistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hDis)->getNonLocalDistributions(); - zeroHdistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hDis)->getZeroDistributions(); + localHdistributions = dynamicPointerCast<EsoSplit>(this->hDis)->getLocalDistributions(); + nonLocalHdistributions = dynamicPointerCast<EsoSplit>(this->hDis)->getNonLocalDistributions(); + zeroHdistributions = dynamicPointerCast<EsoSplit>(this->hDis)->getZeroDistributions(); - localH2distributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->h2Dis)->getLocalDistributions(); - nonLocalH2distributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->h2Dis)->getNonLocalDistributions(); - zeroH2distributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->h2Dis)->getZeroDistributions(); + localH2distributions = dynamicPointerCast<EsoSplit>(this->h2Dis)->getLocalDistributions(); + nonLocalH2distributions = dynamicPointerCast<EsoSplit>(this->h2Dis)->getNonLocalDistributions(); + zeroH2distributions = dynamicPointerCast<EsoSplit>(this->h2Dis)->getZeroDistributions(); } ////////////////////////////////////////////////////////////////////////// inline void ThreeDistributionsFullVectorConnector::fillData(vector_type& sdata, int& index, int x1, int x2, int x3) { - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); - - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); + using namespace vf::lbm::dir; + + sdata[index++] = (*this->localDistributions)(eP00, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(e0P0, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(e00P, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(ePP0, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(eMP0, x1 + 1, x2, x3); + sdata[index++] = (*this->localDistributions)(eP0P, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(eM0P, x1 + 1, x2, x3); + sdata[index++] = (*this->localDistributions)(e0PP, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(e0MP, x1, x2 + 1, x3); + sdata[index++] = (*this->localDistributions)(ePPP, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(eMPP, x1 + 1, x2, x3); + sdata[index++] = (*this->localDistributions)(ePMP, x1, x2 + 1, x3); + sdata[index++] = (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3); + + sdata[index++] = (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3); + sdata[index++] = (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1); sdata[index++] = (*this->zeroDistributions)(x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_E, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_N, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_T, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_NE, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TE, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TN, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TNE, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); - - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_W, x1 + 1, x2, x3); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_S, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_B, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); + sdata[index++] = (*this->localHdistributions)(eP00, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(e0P0, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(e00P, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(ePP0, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(eMP0, x1 + 1, x2, x3); + sdata[index++] = (*this->localHdistributions)(eP0P, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(eM0P, x1 + 1, x2, x3); + sdata[index++] = (*this->localHdistributions)(e0PP, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(e0MP, x1, x2 + 1, x3); + sdata[index++] = (*this->localHdistributions)(ePPP, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(eMPP, x1 + 1, x2, x3); + sdata[index++] = (*this->localHdistributions)(ePMP, x1, x2 + 1, x3); + sdata[index++] = (*this->localHdistributions)(eMMP, x1 + 1, x2 + 1, x3); + + sdata[index++] = (*this->nonLocalHdistributions)(eM00, x1 + 1, x2, x3); + sdata[index++] = (*this->nonLocalHdistributions)(e0M0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalHdistributions)(e00M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(eMM0, x1 + 1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalHdistributions)(ePM0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalHdistributions)(eM0M, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(eP0M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(e0MM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(e0PM, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(ePMM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(eMPM, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(ePPM, x1, x2, x3 + 1); sdata[index++] = (*this->zeroHdistributions)(x1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_E, x1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_N, x1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_T, x1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_NE, x1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_TE, x1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_TN, x1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_TNE, x1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); - sdata[index++] = (*this->localH2distributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); - - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_W, x1 + 1, x2, x3); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_S, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_B, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalH2distributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); + sdata[index++] = (*this->localH2distributions)(eP00, x1, x2, x3); + sdata[index++] = (*this->localH2distributions)(e0P0, x1, x2, x3); + sdata[index++] = (*this->localH2distributions)(e00P, x1, x2, x3); + sdata[index++] = (*this->localH2distributions)(ePP0, x1, x2, x3); + sdata[index++] = (*this->localH2distributions)(eMP0, x1 + 1, x2, x3); + sdata[index++] = (*this->localH2distributions)(eP0P, x1, x2, x3); + sdata[index++] = (*this->localH2distributions)(eM0P, x1 + 1, x2, x3); + sdata[index++] = (*this->localH2distributions)(e0PP, x1, x2, x3); + sdata[index++] = (*this->localH2distributions)(e0MP, x1, x2 + 1, x3); + sdata[index++] = (*this->localH2distributions)(ePPP, x1, x2, x3); + sdata[index++] = (*this->localH2distributions)(eMPP, x1 + 1, x2, x3); + sdata[index++] = (*this->localH2distributions)(ePMP, x1, x2 + 1, x3); + sdata[index++] = (*this->localH2distributions)(eMMP, x1 + 1, x2 + 1, x3); + + sdata[index++] = (*this->nonLocalH2distributions)(eM00, x1 + 1, x2, x3); + sdata[index++] = (*this->nonLocalH2distributions)(e0M0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalH2distributions)(e00M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalH2distributions)(eMM0, x1 + 1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalH2distributions)(ePM0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalH2distributions)(eM0M, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalH2distributions)(eP0M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalH2distributions)(e0MM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalH2distributions)(e0PM, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalH2distributions)(eMMM, x1 + 1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalH2distributions)(ePMM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalH2distributions)(eMPM, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalH2distributions)(ePPM, x1, x2, x3 + 1); sdata[index++] = (*this->zeroH2distributions)(x1, x2, x3); } ////////////////////////////////////////////////////////////////////////// inline void ThreeDistributionsFullVectorConnector::distributeData(vector_type& rdata, int& index, int x1, int x2, int x3) { - (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = rdata[index++]; - - (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = rdata[index++]; + using namespace vf::lbm::dir; + + (*this->localDistributions)(eP00, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e0P0, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e00P, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(ePP0, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eMP0, x1 + 1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eP0P, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eM0P, x1 + 1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e0PP, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e0MP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localDistributions)(ePPP, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eMPP, x1 + 1, x2, x3) = rdata[index++]; + (*this->localDistributions)(ePMP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3) = rdata[index++]; + + (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3) = rdata[index++]; + (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1) = rdata[index++]; (*this->zeroDistributions)(x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_E, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_N, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_T, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_NE, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TE, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TN, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TNE, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = rdata[index++]; - - (*this->nonLocalHdistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = rdata[index++]; + (*this->localHdistributions)(eP00, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(e0P0, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(e00P, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(ePP0, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(eMP0, x1 + 1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(eP0P, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(eM0P, x1 + 1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(e0PP, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(e0MP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localHdistributions)(ePPP, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(eMPP, x1 + 1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(ePMP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localHdistributions)(eMMP, x1 + 1, x2 + 1, x3) = rdata[index++]; + + (*this->nonLocalHdistributions)(eM00, x1 + 1, x2, x3) = rdata[index++]; + (*this->nonLocalHdistributions)(e0M0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalHdistributions)(e00M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(eMM0, x1 + 1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalHdistributions)(ePM0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalHdistributions)(eM0M, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(eP0M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(e0MM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(e0PM, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(ePMM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(eMPM, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(ePPM, x1, x2, x3 + 1) = rdata[index++]; (*this->zeroHdistributions)(x1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_E, x1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_N, x1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_T, x1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_NE, x1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_TE, x1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_TN, x1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_TNE, x1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = rdata[index++]; - (*this->localH2distributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = rdata[index++]; - - (*this->nonLocalH2distributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalH2distributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = rdata[index++]; + (*this->localH2distributions)(eP00, x1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(e0P0, x1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(e00P, x1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(ePP0, x1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(eMP0, x1 + 1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(eP0P, x1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(eM0P, x1 + 1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(e0PP, x1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(e0MP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localH2distributions)(ePPP, x1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(eMPP, x1 + 1, x2, x3) = rdata[index++]; + (*this->localH2distributions)(ePMP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localH2distributions)(eMMP, x1 + 1, x2 + 1, x3) = rdata[index++]; + + (*this->nonLocalH2distributions)(eM00, x1 + 1, x2, x3) = rdata[index++]; + (*this->nonLocalH2distributions)(e0M0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalH2distributions)(e00M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalH2distributions)(eMM0, x1 + 1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalH2distributions)(ePM0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalH2distributions)(eM0M, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalH2distributions)(eP0M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalH2distributions)(e0MM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalH2distributions)(e0PM, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalH2distributions)(eMMM, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalH2distributions)(ePMM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalH2distributions)(eMPM, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalH2distributions)(ePPM, x1, x2, x3 + 1) = rdata[index++]; (*this->zeroH2distributions)(x1, x2, x3) = rdata[index++]; } diff --git a/src/cpu/core/Connectors/TwoDistributionsDoubleGhostLayerFullDirectConnector.h b/src/cpu/core/Connectors/TwoDistributionsDoubleGhostLayerFullDirectConnector.h index 25769481d79ea2c5fc3185531542ede8c3256701..53c429e196b5230530e51f2c2aa6ac67ad0d2283 100644 --- a/src/cpu/core/Connectors/TwoDistributionsDoubleGhostLayerFullDirectConnector.h +++ b/src/cpu/core/Connectors/TwoDistributionsDoubleGhostLayerFullDirectConnector.h @@ -37,7 +37,7 @@ #include "FullDirectConnector.h" #include "Block3D.h" #include "D3Q27System.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "basics/container/CbArray3D.h" #include "basics/container/CbArray4D.h" #include "DataSet3D.h" @@ -82,83 +82,85 @@ private: ////////////////////////////////////////////////////////////////////////// inline void TwoDistributionsDoubleGhostLayerFullDirectConnector::updatePointers() { - localDistributionsFromf = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getLocalDistributions(); - nonLocalDistributionsFromf = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getNonLocalDistributions(); - zeroDistributionsFromf = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getZeroDistributions(); + localDistributionsFromf = dynamicPointerCast<EsoSplit>(this->fFrom)->getLocalDistributions(); + nonLocalDistributionsFromf = dynamicPointerCast<EsoSplit>(this->fFrom)->getNonLocalDistributions(); + zeroDistributionsFromf = dynamicPointerCast<EsoSplit>(this->fFrom)->getZeroDistributions(); - localDistributionsTof = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getLocalDistributions(); - nonLocalDistributionsTof = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getNonLocalDistributions(); - zeroDistributionsTof = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getZeroDistributions(); + localDistributionsTof = dynamicPointerCast<EsoSplit>(this->fTo)->getLocalDistributions(); + nonLocalDistributionsTof = dynamicPointerCast<EsoSplit>(this->fTo)->getNonLocalDistributions(); + zeroDistributionsTof = dynamicPointerCast<EsoSplit>(this->fTo)->getZeroDistributions(); - localDistributionsFromh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hFrom)->getLocalDistributions(); - nonLocalDistributionsFromh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hFrom)->getNonLocalDistributions(); - zeroDistributionsFromh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hFrom)->getZeroDistributions(); + localDistributionsFromh = dynamicPointerCast<EsoSplit>(this->hFrom)->getLocalDistributions(); + nonLocalDistributionsFromh = dynamicPointerCast<EsoSplit>(this->hFrom)->getNonLocalDistributions(); + zeroDistributionsFromh = dynamicPointerCast<EsoSplit>(this->hFrom)->getZeroDistributions(); - localDistributionsToh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo)->getLocalDistributions(); - nonLocalDistributionsToh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo)->getNonLocalDistributions(); - zeroDistributionsToh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo)->getZeroDistributions(); + localDistributionsToh = dynamicPointerCast<EsoSplit>(this->hTo)->getLocalDistributions(); + nonLocalDistributionsToh = dynamicPointerCast<EsoSplit>(this->hTo)->getNonLocalDistributions(); + zeroDistributionsToh = dynamicPointerCast<EsoSplit>(this->hTo)->getZeroDistributions(); } ////////////////////////////////////////////////////////////////////////// inline void TwoDistributionsDoubleGhostLayerFullDirectConnector::exchangeData(int x1From, int x2From, int x3From, int x1To, int x2To, int x3To) { - (*this->localDistributionsTof)(D3Q27System::ET_E, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_E, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_N, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_N, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_T, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_T, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_NE, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_NE, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_NW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_NW, x1From + 1, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TE, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TE, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TW, x1From + 1, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TN, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TN, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TS, x1To, x2To + 1, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TS, x1From, x2From + 1, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TNE, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TNE, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TNW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TNW, x1From + 1, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TSE, x1To, x2To + 1, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TSE, x1From, x2From + 1, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TSW, x1To + 1, x2To + 1, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TSW, x1From + 1, x2From + 1, x3From); - - (*this->nonLocalDistributionsTof)(D3Q27System::ET_W, x1To + 1, x2To, x3To) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_W, x1From + 1, x2From, x3From); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_S, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_S, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_B, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_B, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_SW, x1To + 1, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_SW, x1From + 1, x2From + 1, x3From); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_SE, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_SE, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BW, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BE, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BE, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BS, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BS, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BN, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BN, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BSW, x1To + 1, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BSW, x1From + 1, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BSE, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BSE, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BNW, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BNW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BNE, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BNE, x1From, x2From, x3From + 1); + using namespace vf::lbm::dir; + + (*this->localDistributionsTof)(eP00, x1To, x2To, x3To) = (*this->localDistributionsFromf)(eP00, x1From, x2From, x3From); + (*this->localDistributionsTof)(e0P0, x1To, x2To, x3To) = (*this->localDistributionsFromf)(e0P0, x1From, x2From, x3From); + (*this->localDistributionsTof)(e00P, x1To, x2To, x3To) = (*this->localDistributionsFromf)(e00P, x1From, x2From, x3From); + (*this->localDistributionsTof)(ePP0, x1To, x2To, x3To) = (*this->localDistributionsFromf)(ePP0, x1From, x2From, x3From); + (*this->localDistributionsTof)(eMP0, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(eMP0, x1From + 1, x2From, x3From); + (*this->localDistributionsTof)(eP0P, x1To, x2To, x3To) = (*this->localDistributionsFromf)(eP0P, x1From, x2From, x3From); + (*this->localDistributionsTof)(eM0P, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(eM0P, x1From + 1, x2From, x3From); + (*this->localDistributionsTof)(e0PP, x1To, x2To, x3To) = (*this->localDistributionsFromf)(e0PP, x1From, x2From, x3From); + (*this->localDistributionsTof)(e0MP, x1To, x2To + 1, x3To) = (*this->localDistributionsFromf)(e0MP, x1From, x2From + 1, x3From); + (*this->localDistributionsTof)(ePPP, x1To, x2To, x3To) = (*this->localDistributionsFromf)(ePPP, x1From, x2From, x3From); + (*this->localDistributionsTof)(eMPP, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(eMPP, x1From + 1, x2From, x3From); + (*this->localDistributionsTof)(ePMP, x1To, x2To + 1, x3To) = (*this->localDistributionsFromf)(ePMP, x1From, x2From + 1, x3From); + (*this->localDistributionsTof)(eMMP, x1To + 1, x2To + 1, x3To) = (*this->localDistributionsFromf)(eMMP, x1From + 1, x2From + 1, x3From); + + (*this->nonLocalDistributionsTof)(eM00, x1To + 1, x2To, x3To) = (*this->nonLocalDistributionsFromf)(eM00, x1From + 1, x2From, x3From); + (*this->nonLocalDistributionsTof)(e0M0, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(e0M0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsTof)(e00M, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(e00M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(eMM0, x1To + 1, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(eMM0, x1From + 1, x2From + 1, x3From); + (*this->nonLocalDistributionsTof)(ePM0, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(ePM0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsTof)(eM0M, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(eM0M, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(eP0M, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(eP0M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(e0MM, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(e0MM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsTof)(e0PM, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(e0PM, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(eMMM, x1To + 1, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(eMMM, x1From + 1, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsTof)(ePMM, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(ePMM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsTof)(eMPM, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(eMPM, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(ePPM, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(ePPM, x1From, x2From, x3From + 1); (*this->zeroDistributionsTof)(x1To, x2To, x3To) = (*this->zeroDistributionsFromf)(x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_E, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_E, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_N, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_N, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_T, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_T, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_NE, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_NE, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_NW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_NW, x1From + 1, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TE, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TE, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TW, x1From + 1, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TN, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TN, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TS, x1To, x2To + 1, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TS, x1From, x2From + 1, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TNE, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TNE, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TNW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TNW, x1From + 1, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TSE, x1To, x2To + 1, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TSE, x1From, x2From + 1, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TSW, x1To + 1, x2To + 1, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TSW, x1From + 1, x2From + 1, x3From); - - (*this->nonLocalDistributionsToh)(D3Q27System::ET_W, x1To + 1, x2To, x3To) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_W, x1From + 1, x2From, x3From); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_S, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_S, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_B, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_B, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_SW, x1To + 1, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_SW, x1From + 1, x2From + 1, x3From); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_SE, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_SE, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BW, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BE, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BE, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BS, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BS, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BN, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BN, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BSW, x1To + 1, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BSW, x1From + 1, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BSE, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BSE, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BNW, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BNW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BNE, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BNE, x1From, x2From, x3From + 1); + (*this->localDistributionsToh)(eP00, x1To, x2To, x3To) = (*this->localDistributionsFromh)(eP00, x1From, x2From, x3From); + (*this->localDistributionsToh)(e0P0, x1To, x2To, x3To) = (*this->localDistributionsFromh)(e0P0, x1From, x2From, x3From); + (*this->localDistributionsToh)(e00P, x1To, x2To, x3To) = (*this->localDistributionsFromh)(e00P, x1From, x2From, x3From); + (*this->localDistributionsToh)(ePP0, x1To, x2To, x3To) = (*this->localDistributionsFromh)(ePP0, x1From, x2From, x3From); + (*this->localDistributionsToh)(eMP0, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(eMP0, x1From + 1, x2From, x3From); + (*this->localDistributionsToh)(eP0P, x1To, x2To, x3To) = (*this->localDistributionsFromh)(eP0P, x1From, x2From, x3From); + (*this->localDistributionsToh)(eM0P, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(eM0P, x1From + 1, x2From, x3From); + (*this->localDistributionsToh)(e0PP, x1To, x2To, x3To) = (*this->localDistributionsFromh)(e0PP, x1From, x2From, x3From); + (*this->localDistributionsToh)(e0MP, x1To, x2To + 1, x3To) = (*this->localDistributionsFromh)(e0MP, x1From, x2From + 1, x3From); + (*this->localDistributionsToh)(ePPP, x1To, x2To, x3To) = (*this->localDistributionsFromh)(ePPP, x1From, x2From, x3From); + (*this->localDistributionsToh)(eMPP, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(eMPP, x1From + 1, x2From, x3From); + (*this->localDistributionsToh)(ePMP, x1To, x2To + 1, x3To) = (*this->localDistributionsFromh)(ePMP, x1From, x2From + 1, x3From); + (*this->localDistributionsToh)(eMMP, x1To + 1, x2To + 1, x3To) = (*this->localDistributionsFromh)(eMMP, x1From + 1, x2From + 1, x3From); + + (*this->nonLocalDistributionsToh)(eM00, x1To + 1, x2To, x3To) = (*this->nonLocalDistributionsFromh)(eM00, x1From + 1, x2From, x3From); + (*this->nonLocalDistributionsToh)(e0M0, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(e0M0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsToh)(e00M, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(e00M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(eMM0, x1To + 1, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(eMM0, x1From + 1, x2From + 1, x3From); + (*this->nonLocalDistributionsToh)(ePM0, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(ePM0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsToh)(eM0M, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(eM0M, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(eP0M, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(eP0M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(e0MM, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(e0MM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsToh)(e0PM, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(e0PM, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(eMMM, x1To + 1, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(eMMM, x1From + 1, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsToh)(ePMM, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(ePMM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsToh)(eMPM, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(eMPM, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(ePPM, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(ePPM, x1From, x2From, x3From + 1); (*this->zeroDistributionsToh)(x1To, x2To, x3To) = (*this->zeroDistributionsFromh)(x1From, x2From, x3From); diff --git a/src/cpu/core/Connectors/TwoDistributionsDoubleGhostLayerFullVectorConnector.h b/src/cpu/core/Connectors/TwoDistributionsDoubleGhostLayerFullVectorConnector.h index 67f896af34c8b7e7d7fa9c918236b5a435156c62..3944f09d6ca9379d1ff3cec9da4945e1579dfb09 100644 --- a/src/cpu/core/Connectors/TwoDistributionsDoubleGhostLayerFullVectorConnector.h +++ b/src/cpu/core/Connectors/TwoDistributionsDoubleGhostLayerFullVectorConnector.h @@ -38,7 +38,7 @@ #include "FullVectorConnector.h" #include "D3Q27System.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "basics/container/CbArray3D.h" #include "basics/container/CbArray4D.h" #include "DataSet3D.h" @@ -86,75 +86,77 @@ private: ////////////////////////////////////////////////////////////////////////// inline void TwoDistributionsDoubleGhostLayerFullVectorConnector::updatePointers() { - localDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getLocalDistributions(); - nonLocalDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getNonLocalDistributions(); - zeroDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getZeroDistributions(); + localDistributions = dynamicPointerCast<EsoSplit>(this->fDis)->getLocalDistributions(); + nonLocalDistributions = dynamicPointerCast<EsoSplit>(this->fDis)->getNonLocalDistributions(); + zeroDistributions = dynamicPointerCast<EsoSplit>(this->fDis)->getZeroDistributions(); - localHdistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hDis)->getLocalDistributions(); - nonLocalHdistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hDis)->getNonLocalDistributions(); - zeroHdistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hDis)->getZeroDistributions(); + localHdistributions = dynamicPointerCast<EsoSplit>(this->hDis)->getLocalDistributions(); + nonLocalHdistributions = dynamicPointerCast<EsoSplit>(this->hDis)->getNonLocalDistributions(); + zeroHdistributions = dynamicPointerCast<EsoSplit>(this->hDis)->getZeroDistributions(); } ////////////////////////////////////////////////////////////////////////// inline void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData(vector_type& sdata, int& index, int x1, int x2, int x3) { - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); - - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); + using namespace vf::lbm::dir; + + sdata[index++] = (*this->localDistributions)(eP00, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(e0P0, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(e00P, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(ePP0, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(eMP0, x1 + 1, x2, x3); + sdata[index++] = (*this->localDistributions)(eP0P, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(eM0P, x1 + 1, x2, x3); + sdata[index++] = (*this->localDistributions)(e0PP, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(e0MP, x1, x2 + 1, x3); + sdata[index++] = (*this->localDistributions)(ePPP, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(eMPP, x1 + 1, x2, x3); + sdata[index++] = (*this->localDistributions)(ePMP, x1, x2 + 1, x3); + sdata[index++] = (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3); + + sdata[index++] = (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3); + sdata[index++] = (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1); sdata[index++] = (*this->zeroDistributions)(x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_E, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_N, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_T, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_NE, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TE, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TN, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TNE, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); - - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_W, x1 + 1, x2, x3); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_S, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_B, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); + sdata[index++] = (*this->localHdistributions)(eP00, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(e0P0, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(e00P, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(ePP0, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(eMP0, x1 + 1, x2, x3); + sdata[index++] = (*this->localHdistributions)(eP0P, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(eM0P, x1 + 1, x2, x3); + sdata[index++] = (*this->localHdistributions)(e0PP, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(e0MP, x1, x2 + 1, x3); + sdata[index++] = (*this->localHdistributions)(ePPP, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(eMPP, x1 + 1, x2, x3); + sdata[index++] = (*this->localHdistributions)(ePMP, x1, x2 + 1, x3); + sdata[index++] = (*this->localHdistributions)(eMMP, x1 + 1, x2 + 1, x3); + + sdata[index++] = (*this->nonLocalHdistributions)(eM00, x1 + 1, x2, x3); + sdata[index++] = (*this->nonLocalHdistributions)(e0M0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalHdistributions)(e00M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(eMM0, x1 + 1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalHdistributions)(ePM0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalHdistributions)(eM0M, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(eP0M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(e0MM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(e0PM, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(ePMM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(eMPM, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(ePPM, x1, x2, x3 + 1); sdata[index++] = (*this->zeroHdistributions)(x1, x2, x3); @@ -164,64 +166,66 @@ inline void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData(vector ////////////////////////////////////////////////////////////////////////// inline void TwoDistributionsDoubleGhostLayerFullVectorConnector::distributeData(vector_type& rdata, int& index, int x1, int x2, int x3) { - (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = rdata[index++]; - - (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = rdata[index++]; + using namespace vf::lbm::dir; + + (*this->localDistributions)(eP00, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e0P0, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e00P, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(ePP0, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eMP0, x1 + 1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eP0P, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eM0P, x1 + 1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e0PP, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e0MP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localDistributions)(ePPP, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eMPP, x1 + 1, x2, x3) = rdata[index++]; + (*this->localDistributions)(ePMP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3) = rdata[index++]; + + (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3) = rdata[index++]; + (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1) = rdata[index++]; (*this->zeroDistributions)(x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_E, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_N, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_T, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_NE, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TE, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TN, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TNE, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = rdata[index++]; - - (*this->nonLocalHdistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = rdata[index++]; + (*this->localHdistributions)(eP00, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(e0P0, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(e00P, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(ePP0, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(eMP0, x1 + 1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(eP0P, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(eM0P, x1 + 1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(e0PP, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(e0MP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localHdistributions)(ePPP, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(eMPP, x1 + 1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(ePMP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localHdistributions)(eMMP, x1 + 1, x2 + 1, x3) = rdata[index++]; + + (*this->nonLocalHdistributions)(eM00, x1 + 1, x2, x3) = rdata[index++]; + (*this->nonLocalHdistributions)(e0M0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalHdistributions)(e00M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(eMM0, x1 + 1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalHdistributions)(ePM0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalHdistributions)(eM0M, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(eP0M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(e0MM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(e0PM, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(ePMM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(eMPM, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(ePPM, x1, x2, x3 + 1) = rdata[index++]; (*this->zeroHdistributions)(x1, x2, x3) = rdata[index++]; diff --git a/src/cpu/core/Connectors/TwoDistributionsFullDirectConnector.h b/src/cpu/core/Connectors/TwoDistributionsFullDirectConnector.h index 7c92fc7fc66302daa5e7f3ea455d21c227d73d3f..e7e5e406660f9f2c7668f3d221a56d06753f6d19 100644 --- a/src/cpu/core/Connectors/TwoDistributionsFullDirectConnector.h +++ b/src/cpu/core/Connectors/TwoDistributionsFullDirectConnector.h @@ -37,7 +37,7 @@ #include "FullDirectConnector.h" #include "Block3D.h" #include "D3Q27System.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "basics/container/CbArray3D.h" #include "basics/container/CbArray4D.h" @@ -77,83 +77,85 @@ private: ////////////////////////////////////////////////////////////////////////// inline void TwoDistributionsFullDirectConnector::updatePointers() { - localDistributionsFromf = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getLocalDistributions(); - nonLocalDistributionsFromf = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getNonLocalDistributions(); - zeroDistributionsFromf = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getZeroDistributions(); + localDistributionsFromf = dynamicPointerCast<EsoSplit>(this->fFrom)->getLocalDistributions(); + nonLocalDistributionsFromf = dynamicPointerCast<EsoSplit>(this->fFrom)->getNonLocalDistributions(); + zeroDistributionsFromf = dynamicPointerCast<EsoSplit>(this->fFrom)->getZeroDistributions(); - localDistributionsTof = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getLocalDistributions(); - nonLocalDistributionsTof = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getNonLocalDistributions(); - zeroDistributionsTof = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getZeroDistributions(); + localDistributionsTof = dynamicPointerCast<EsoSplit>(this->fTo)->getLocalDistributions(); + nonLocalDistributionsTof = dynamicPointerCast<EsoSplit>(this->fTo)->getNonLocalDistributions(); + zeroDistributionsTof = dynamicPointerCast<EsoSplit>(this->fTo)->getZeroDistributions(); - localDistributionsFromh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hFrom)->getLocalDistributions(); - nonLocalDistributionsFromh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hFrom)->getNonLocalDistributions(); - zeroDistributionsFromh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hFrom)->getZeroDistributions(); + localDistributionsFromh = dynamicPointerCast<EsoSplit>(this->hFrom)->getLocalDistributions(); + nonLocalDistributionsFromh = dynamicPointerCast<EsoSplit>(this->hFrom)->getNonLocalDistributions(); + zeroDistributionsFromh = dynamicPointerCast<EsoSplit>(this->hFrom)->getZeroDistributions(); - localDistributionsToh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo)->getLocalDistributions(); - nonLocalDistributionsToh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo)->getNonLocalDistributions(); - zeroDistributionsToh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo)->getZeroDistributions(); + localDistributionsToh = dynamicPointerCast<EsoSplit>(this->hTo)->getLocalDistributions(); + nonLocalDistributionsToh = dynamicPointerCast<EsoSplit>(this->hTo)->getNonLocalDistributions(); + zeroDistributionsToh = dynamicPointerCast<EsoSplit>(this->hTo)->getZeroDistributions(); } ////////////////////////////////////////////////////////////////////////// inline void TwoDistributionsFullDirectConnector::exchangeData(int x1From, int x2From, int x3From, int x1To, int x2To, int x3To) { - (*this->localDistributionsTof)(D3Q27System::ET_E, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_E, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_N, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_N, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_T, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_T, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_NE, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_NE, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_NW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_NW, x1From + 1, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TE, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TE, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TW, x1From + 1, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TN, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TN, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TS, x1To, x2To + 1, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TS, x1From, x2From + 1, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TNE, x1To, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TNE, x1From, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TNW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TNW, x1From + 1, x2From, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TSE, x1To, x2To + 1, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TSE, x1From, x2From + 1, x3From); - (*this->localDistributionsTof)(D3Q27System::ET_TSW, x1To + 1, x2To + 1, x3To) = (*this->localDistributionsFromf)(D3Q27System::ET_TSW, x1From + 1, x2From + 1, x3From); - - (*this->nonLocalDistributionsTof)(D3Q27System::ET_W, x1To + 1, x2To, x3To) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_W, x1From + 1, x2From, x3From); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_S, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_S, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_B, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_B, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_SW, x1To + 1, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_SW, x1From + 1, x2From + 1, x3From); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_SE, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_SE, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BW, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BE, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BE, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BS, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BS, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BN, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BN, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BSW, x1To + 1, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BSW, x1From + 1, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BSE, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BSE, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BNW, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BNW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsTof)(D3Q27System::ET_BNE, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(D3Q27System::ET_BNE, x1From, x2From, x3From + 1); + using namespace vf::lbm::dir; + + (*this->localDistributionsTof)(eP00, x1To, x2To, x3To) = (*this->localDistributionsFromf)(eP00, x1From, x2From, x3From); + (*this->localDistributionsTof)(e0P0, x1To, x2To, x3To) = (*this->localDistributionsFromf)(e0P0, x1From, x2From, x3From); + (*this->localDistributionsTof)(e00P, x1To, x2To, x3To) = (*this->localDistributionsFromf)(e00P, x1From, x2From, x3From); + (*this->localDistributionsTof)(ePP0, x1To, x2To, x3To) = (*this->localDistributionsFromf)(ePP0, x1From, x2From, x3From); + (*this->localDistributionsTof)(eMP0, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(eMP0, x1From + 1, x2From, x3From); + (*this->localDistributionsTof)(eP0P, x1To, x2To, x3To) = (*this->localDistributionsFromf)(eP0P, x1From, x2From, x3From); + (*this->localDistributionsTof)(eM0P, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(eM0P, x1From + 1, x2From, x3From); + (*this->localDistributionsTof)(e0PP, x1To, x2To, x3To) = (*this->localDistributionsFromf)(e0PP, x1From, x2From, x3From); + (*this->localDistributionsTof)(e0MP, x1To, x2To + 1, x3To) = (*this->localDistributionsFromf)(e0MP, x1From, x2From + 1, x3From); + (*this->localDistributionsTof)(ePPP, x1To, x2To, x3To) = (*this->localDistributionsFromf)(ePPP, x1From, x2From, x3From); + (*this->localDistributionsTof)(eMPP, x1To + 1, x2To, x3To) = (*this->localDistributionsFromf)(eMPP, x1From + 1, x2From, x3From); + (*this->localDistributionsTof)(ePMP, x1To, x2To + 1, x3To) = (*this->localDistributionsFromf)(ePMP, x1From, x2From + 1, x3From); + (*this->localDistributionsTof)(eMMP, x1To + 1, x2To + 1, x3To) = (*this->localDistributionsFromf)(eMMP, x1From + 1, x2From + 1, x3From); + + (*this->nonLocalDistributionsTof)(eM00, x1To + 1, x2To, x3To) = (*this->nonLocalDistributionsFromf)(eM00, x1From + 1, x2From, x3From); + (*this->nonLocalDistributionsTof)(e0M0, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(e0M0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsTof)(e00M, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(e00M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(eMM0, x1To + 1, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(eMM0, x1From + 1, x2From + 1, x3From); + (*this->nonLocalDistributionsTof)(ePM0, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromf)(ePM0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsTof)(eM0M, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(eM0M, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(eP0M, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(eP0M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(e0MM, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(e0MM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsTof)(e0PM, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(e0PM, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(eMMM, x1To + 1, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(eMMM, x1From + 1, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsTof)(ePMM, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromf)(ePMM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsTof)(eMPM, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(eMPM, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsTof)(ePPM, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromf)(ePPM, x1From, x2From, x3From + 1); (*this->zeroDistributionsTof)(x1To, x2To, x3To) = (*this->zeroDistributionsFromf)(x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_E, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_E, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_N, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_N, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_T, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_T, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_NE, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_NE, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_NW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_NW, x1From + 1, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TE, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TE, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TW, x1From + 1, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TN, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TN, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TS, x1To, x2To + 1, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TS, x1From, x2From + 1, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TNE, x1To, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TNE, x1From, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TNW, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TNW, x1From + 1, x2From, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TSE, x1To, x2To + 1, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TSE, x1From, x2From + 1, x3From); - (*this->localDistributionsToh)(D3Q27System::ET_TSW, x1To + 1, x2To + 1, x3To) = (*this->localDistributionsFromh)(D3Q27System::ET_TSW, x1From + 1, x2From + 1, x3From); - - (*this->nonLocalDistributionsToh)(D3Q27System::ET_W, x1To + 1, x2To, x3To) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_W, x1From + 1, x2From, x3From); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_S, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_S, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_B, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_B, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_SW, x1To + 1, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_SW, x1From + 1, x2From + 1, x3From); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_SE, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_SE, x1From, x2From + 1, x3From); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BW, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BE, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BE, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BS, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BS, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BN, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BN, x1From, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BSW, x1To + 1, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BSW, x1From + 1, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BSE, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BSE, x1From, x2From + 1, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BNW, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BNW, x1From + 1, x2From, x3From + 1); - (*this->nonLocalDistributionsToh)(D3Q27System::ET_BNE, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(D3Q27System::ET_BNE, x1From, x2From, x3From + 1); + (*this->localDistributionsToh)(eP00, x1To, x2To, x3To) = (*this->localDistributionsFromh)(eP00, x1From, x2From, x3From); + (*this->localDistributionsToh)(e0P0, x1To, x2To, x3To) = (*this->localDistributionsFromh)(e0P0, x1From, x2From, x3From); + (*this->localDistributionsToh)(e00P, x1To, x2To, x3To) = (*this->localDistributionsFromh)(e00P, x1From, x2From, x3From); + (*this->localDistributionsToh)(ePP0, x1To, x2To, x3To) = (*this->localDistributionsFromh)(ePP0, x1From, x2From, x3From); + (*this->localDistributionsToh)(eMP0, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(eMP0, x1From + 1, x2From, x3From); + (*this->localDistributionsToh)(eP0P, x1To, x2To, x3To) = (*this->localDistributionsFromh)(eP0P, x1From, x2From, x3From); + (*this->localDistributionsToh)(eM0P, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(eM0P, x1From + 1, x2From, x3From); + (*this->localDistributionsToh)(e0PP, x1To, x2To, x3To) = (*this->localDistributionsFromh)(e0PP, x1From, x2From, x3From); + (*this->localDistributionsToh)(e0MP, x1To, x2To + 1, x3To) = (*this->localDistributionsFromh)(e0MP, x1From, x2From + 1, x3From); + (*this->localDistributionsToh)(ePPP, x1To, x2To, x3To) = (*this->localDistributionsFromh)(ePPP, x1From, x2From, x3From); + (*this->localDistributionsToh)(eMPP, x1To + 1, x2To, x3To) = (*this->localDistributionsFromh)(eMPP, x1From + 1, x2From, x3From); + (*this->localDistributionsToh)(ePMP, x1To, x2To + 1, x3To) = (*this->localDistributionsFromh)(ePMP, x1From, x2From + 1, x3From); + (*this->localDistributionsToh)(eMMP, x1To + 1, x2To + 1, x3To) = (*this->localDistributionsFromh)(eMMP, x1From + 1, x2From + 1, x3From); + + (*this->nonLocalDistributionsToh)(eM00, x1To + 1, x2To, x3To) = (*this->nonLocalDistributionsFromh)(eM00, x1From + 1, x2From, x3From); + (*this->nonLocalDistributionsToh)(e0M0, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(e0M0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsToh)(e00M, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(e00M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(eMM0, x1To + 1, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(eMM0, x1From + 1, x2From + 1, x3From); + (*this->nonLocalDistributionsToh)(ePM0, x1To, x2To + 1, x3To) = (*this->nonLocalDistributionsFromh)(ePM0, x1From, x2From + 1, x3From); + (*this->nonLocalDistributionsToh)(eM0M, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(eM0M, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(eP0M, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(eP0M, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(e0MM, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(e0MM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsToh)(e0PM, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(e0PM, x1From, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(eMMM, x1To + 1, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(eMMM, x1From + 1, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsToh)(ePMM, x1To, x2To + 1, x3To + 1) = (*this->nonLocalDistributionsFromh)(ePMM, x1From, x2From + 1, x3From + 1); + (*this->nonLocalDistributionsToh)(eMPM, x1To + 1, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(eMPM, x1From + 1, x2From, x3From + 1); + (*this->nonLocalDistributionsToh)(ePPM, x1To, x2To, x3To + 1) = (*this->nonLocalDistributionsFromh)(ePPM, x1From, x2From, x3From + 1); (*this->zeroDistributionsToh)(x1To, x2To, x3To) = (*this->zeroDistributionsFromh)(x1From, x2From, x3From); } diff --git a/src/cpu/core/Connectors/TwoDistributionsFullVectorConnector.h b/src/cpu/core/Connectors/TwoDistributionsFullVectorConnector.h index b2cb384d652273aee82c992c50d4df9b1e46a4e9..81c3e9950cac0e4f20525c8f8756a55888181362 100644 --- a/src/cpu/core/Connectors/TwoDistributionsFullVectorConnector.h +++ b/src/cpu/core/Connectors/TwoDistributionsFullVectorConnector.h @@ -38,7 +38,7 @@ #include "FullVectorConnector.h" #include "D3Q27System.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "basics/container/CbArray3D.h" #include "basics/container/CbArray4D.h" @@ -79,75 +79,77 @@ private: ////////////////////////////////////////////////////////////////////////// inline void TwoDistributionsFullVectorConnector::updatePointers() { - localDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getLocalDistributions(); - nonLocalDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getNonLocalDistributions(); - zeroDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getZeroDistributions(); + localDistributions = dynamicPointerCast<EsoSplit>(this->fDis)->getLocalDistributions(); + nonLocalDistributions = dynamicPointerCast<EsoSplit>(this->fDis)->getNonLocalDistributions(); + zeroDistributions = dynamicPointerCast<EsoSplit>(this->fDis)->getZeroDistributions(); - localHdistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hDis)->getLocalDistributions(); - nonLocalHdistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hDis)->getNonLocalDistributions(); - zeroHdistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hDis)->getZeroDistributions(); + localHdistributions = dynamicPointerCast<EsoSplit>(this->hDis)->getLocalDistributions(); + nonLocalHdistributions = dynamicPointerCast<EsoSplit>(this->hDis)->getNonLocalDistributions(); + zeroHdistributions = dynamicPointerCast<EsoSplit>(this->hDis)->getZeroDistributions(); } ////////////////////////////////////////////////////////////////////////// inline void TwoDistributionsFullVectorConnector::fillData(vector_type& sdata, int& index, int x1, int x2, int x3) { - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); - sdata[index++] = (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); - - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); + using namespace vf::lbm::dir; + + sdata[index++] = (*this->localDistributions)(eP00, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(e0P0, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(e00P, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(ePP0, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(eMP0, x1 + 1, x2, x3); + sdata[index++] = (*this->localDistributions)(eP0P, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(eM0P, x1 + 1, x2, x3); + sdata[index++] = (*this->localDistributions)(e0PP, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(e0MP, x1, x2 + 1, x3); + sdata[index++] = (*this->localDistributions)(ePPP, x1, x2, x3); + sdata[index++] = (*this->localDistributions)(eMPP, x1 + 1, x2, x3); + sdata[index++] = (*this->localDistributions)(ePMP, x1, x2 + 1, x3); + sdata[index++] = (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3); + + sdata[index++] = (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3); + sdata[index++] = (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1); sdata[index++] = (*this->zeroDistributions)(x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_E, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_N, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_T, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_NE, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TE, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TN, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TNE, x1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); - sdata[index++] = (*this->localHdistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); - - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_W, x1 + 1, x2, x3); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_S, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_B, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); - sdata[index++] = (*this->nonLocalHdistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); + sdata[index++] = (*this->localHdistributions)(eP00, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(e0P0, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(e00P, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(ePP0, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(eMP0, x1 + 1, x2, x3); + sdata[index++] = (*this->localHdistributions)(eP0P, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(eM0P, x1 + 1, x2, x3); + sdata[index++] = (*this->localHdistributions)(e0PP, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(e0MP, x1, x2 + 1, x3); + sdata[index++] = (*this->localHdistributions)(ePPP, x1, x2, x3); + sdata[index++] = (*this->localHdistributions)(eMPP, x1 + 1, x2, x3); + sdata[index++] = (*this->localHdistributions)(ePMP, x1, x2 + 1, x3); + sdata[index++] = (*this->localHdistributions)(eMMP, x1 + 1, x2 + 1, x3); + + sdata[index++] = (*this->nonLocalHdistributions)(eM00, x1 + 1, x2, x3); + sdata[index++] = (*this->nonLocalHdistributions)(e0M0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalHdistributions)(e00M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(eMM0, x1 + 1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalHdistributions)(ePM0, x1, x2 + 1, x3); + sdata[index++] = (*this->nonLocalHdistributions)(eM0M, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(eP0M, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(e0MM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(e0PM, x1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(ePMM, x1, x2 + 1, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(eMPM, x1 + 1, x2, x3 + 1); + sdata[index++] = (*this->nonLocalHdistributions)(ePPM, x1, x2, x3 + 1); sdata[index++] = (*this->zeroHdistributions)(x1, x2, x3); @@ -155,64 +157,66 @@ inline void TwoDistributionsFullVectorConnector::fillData(vector_type& sdata, in ////////////////////////////////////////////////////////////////////////// inline void TwoDistributionsFullVectorConnector::distributeData(vector_type& rdata, int& index, int x1, int x2, int x3) { - (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = rdata[index++]; - (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = rdata[index++]; - - (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = rdata[index++]; + using namespace vf::lbm::dir; + + (*this->localDistributions)(eP00, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e0P0, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e00P, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(ePP0, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eMP0, x1 + 1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eP0P, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eM0P, x1 + 1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e0PP, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(e0MP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localDistributions)(ePPP, x1, x2, x3) = rdata[index++]; + (*this->localDistributions)(eMPP, x1 + 1, x2, x3) = rdata[index++]; + (*this->localDistributions)(ePMP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3) = rdata[index++]; + + (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3) = rdata[index++]; + (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1) = rdata[index++]; (*this->zeroDistributions)(x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_E, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_N, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_T, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_NE, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TE, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TN, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TNE, x1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = rdata[index++]; - (*this->localHdistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = rdata[index++]; - - (*this->nonLocalHdistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = rdata[index++]; - (*this->nonLocalHdistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = rdata[index++]; + (*this->localHdistributions)(eP00, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(e0P0, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(e00P, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(ePP0, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(eMP0, x1 + 1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(eP0P, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(eM0P, x1 + 1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(e0PP, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(e0MP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localHdistributions)(ePPP, x1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(eMPP, x1 + 1, x2, x3) = rdata[index++]; + (*this->localHdistributions)(ePMP, x1, x2 + 1, x3) = rdata[index++]; + (*this->localHdistributions)(eMMP, x1 + 1, x2 + 1, x3) = rdata[index++]; + + (*this->nonLocalHdistributions)(eM00, x1 + 1, x2, x3) = rdata[index++]; + (*this->nonLocalHdistributions)(e0M0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalHdistributions)(e00M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(eMM0, x1 + 1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalHdistributions)(ePM0, x1, x2 + 1, x3) = rdata[index++]; + (*this->nonLocalHdistributions)(eM0M, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(eP0M, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(e0MM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(e0PM, x1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(ePMM, x1, x2 + 1, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(eMPM, x1 + 1, x2, x3 + 1) = rdata[index++]; + (*this->nonLocalHdistributions)(ePPM, x1, x2, x3 + 1) = rdata[index++]; (*this->zeroHdistributions)(x1, x2, x3) = rdata[index++]; } diff --git a/src/cpu/core/Data/D3Q27EsoTwist3DSoA.cpp b/src/cpu/core/Data/D3Q27EsoTwist3DSoA.cpp deleted file mode 100644 index e36f7ddea80e40eb7fcb60a154cea0c4930fa973..0000000000000000000000000000000000000000 --- a/src/cpu/core/Data/D3Q27EsoTwist3DSoA.cpp +++ /dev/null @@ -1,616 +0,0 @@ -#include "D3Q27EsoTwist3DSoA.h" -#include "EsoTwistD3Q27System.h" -#include <D3Q27System.h> - -D3Q27EsoTwist3DSoA::D3Q27EsoTwist3DSoA() = default; -////////////////////////////////////////////////////////////////////////// -D3Q27EsoTwist3DSoA::D3Q27EsoTwist3DSoA(const size_t &nx1, const size_t &nx2, const size_t &nx3, real value) -{ - this->NX1 = nx1; - this->NX2 = nx2; - this->NX3 = nx3; - - d.E = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.W = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.N = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.S = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.T = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.B = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.NE = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.SW = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.SE = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.NW = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.TE = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.BW = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.BE = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.TW = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.TN = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.BS = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.BN = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.TS = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.TNE = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.TNW = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.TSE = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.TSW = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.BNE = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.BNW = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.BSE = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.BSW = CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr( - new CbArray3D<real, IndexerX3X2X1>(nx1 + 1, nx2 + 1, nx3 + 1, value)); - d.REST = - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>(nx1, nx2, nx3, value)); -} -////////////////////////////////////////////////////////////////////////// -D3Q27EsoTwist3DSoA::~D3Q27EsoTwist3DSoA() = default; -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSoA::swap() -{ - std::swap(d.E, d.W); - std::swap(d.N, d.S); - std::swap(d.T, d.B); - std::swap(d.NE, d.SW); - std::swap(d.NW, d.SE); - std::swap(d.TE, d.BW); - std::swap(d.TW, d.BE); - std::swap(d.TN, d.BS); - std::swap(d.TS, d.BN); - std::swap(d.TNE, d.BSW); - std::swap(d.TNW, d.BSE); - std::swap(d.TSE, d.BNW); - std::swap(d.TSW, d.BNE); -} -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSoA::getPreCollisionDistribution(real *const f, size_t x1, size_t x2, size_t x3) -{ - using namespace vf::lbm::dir; - - size_t x1p = x1 + 1; - size_t x2p = x2 + 1; - size_t x3p = x3 + 1; - - f[dP00] = (*d.E)(x1, x2, x3); - f[d0P0] = (*d.N)(x1, x2, x3); - f[d00P] = (*d.T)(x1, x2, x3); - f[dPP0] = (*d.NE)(x1, x2, x3); - f[dMP0] = (*d.NW)(x1p, x2, x3); - f[dP0P] = (*d.TE)(x1, x2, x3); - f[dM0P] = (*d.TW)(x1p, x2, x3); - f[d0PP] = (*d.TN)(x1, x2, x3); - f[d0MP] = (*d.TS)(x1, x2p, x3); - f[dPPP] = (*d.TNE)(x1, x2, x3); - f[dMPP] = (*d.TNW)(x1p, x2, x3); - f[dPMP] = (*d.TSE)(x1, x2p, x3); - f[dMMP] = (*d.TSW)(x1p, x2p, x3); - - f[dM00] = (*d.W)(x1p, x2, x3); - f[d0M0] = (*d.S)(x1, x2p, x3); - f[d00M] = (*d.B)(x1, x2, x3p); - f[dMM0] = (*d.SW)(x1p, x2p, x3); - f[dPM0] = (*d.SE)(x1, x2p, x3); - f[dM0M] = (*d.BW)(x1p, x2, x3p); - f[dP0M] = (*d.BE)(x1, x2, x3p); - f[d0MM] = (*d.BS)(x1, x2p, x3p); - f[d0PM] = (*d.BN)(x1, x2, x3p); - f[dMMM] = (*d.BSW)(x1p, x2p, x3p); - f[dPMM] = (*d.BSE)(x1, x2p, x3p); - f[dMPM] = (*d.BNW)(x1p, x2, x3p); - f[dPPM] = (*d.BNE)(x1, x2, x3p); - - f[d000] = (*d.REST)(x1, x2, x3); -} -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSoA::setPostCollisionDistribution(const real *const f, size_t x1, size_t x2, size_t x3) -{ - using namespace vf::lbm::dir; - - size_t x1p = x1 + 1; - size_t x2p = x2 + 1; - size_t x3p = x3 + 1; - - (*d.E)(x1, x2, x3) = f[iP00]; - (*d.N)(x1, x2, x3) = f[i0P0]; - (*d.T)(x1, x2, x3) = f[i00P]; - (*d.NE)(x1, x2, x3) = f[iPP0]; - (*d.NW)(x1p, x2, x3) = f[iMP0]; - (*d.TE)(x1, x2, x3) = f[iP0P]; - (*d.TW)(x1p, x2, x3) = f[iM0P]; - (*d.TN)(x1, x2, x3) = f[i0PP]; - (*d.TS)(x1, x2p, x3) = f[i0MP]; - (*d.TNE)(x1, x2, x3) = f[iPPP]; - (*d.TNW)(x1p, x2, x3) = f[iMPP]; - (*d.TSE)(x1, x2p, x3) = f[iPMP]; - (*d.TSW)(x1p, x2p, x3) = f[iMMP]; - - (*d.W)(x1p, x2, x3) = f[iM00]; - (*d.S)(x1, x2p, x3) = f[i0M0]; - (*d.B)(x1, x2, x3p) = f[i00M]; - (*d.SW)(x1p, x2p, x3) = f[iMM0]; - (*d.SE)(x1, x2p, x3) = f[iPM0]; - (*d.BW)(x1p, x2, x3p) = f[iM0M]; - (*d.BE)(x1, x2, x3p) = f[iP0M]; - (*d.BS)(x1, x2p, x3p) = f[i0MM]; - (*d.BN)(x1, x2, x3p) = f[i0PM]; - (*d.BSW)(x1p, x2p, x3p) = f[iMMM]; - (*d.BSE)(x1, x2p, x3p) = f[iPMM]; - (*d.BNW)(x1p, x2, x3p) = f[iMPM]; - (*d.BNE)(x1, x2, x3p) = f[iPPM]; - - (*d.REST)(x1, x2, x3) = f[d000]; -} -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSoA::getPostCollisionDistribution(real *const f, size_t x1, size_t x2, size_t x3) -{ - using namespace vf::lbm::dir; - - f[iP00] = (*d.E)(x1, x2, x3); - f[i0P0] = (*d.N)(x1, x2, x3); - f[i00P] = (*d.T)(x1, x2, x3); - f[iPP0] = (*d.NE)(x1, x2, x3); - f[iMP0] = (*d.NW)(x1 + 1, x2, x3); - f[iP0P] = (*d.TE)(x1, x2, x3); - f[iM0P] = (*d.TW)(x1 + 1, x2, x3); - f[i0PP] = (*d.TN)(x1, x2, x3); - f[i0MP] = (*d.TS)(x1, x2 + 1, x3); - f[iPPP] = (*d.TNE)(x1, x2, x3); - f[iMPP] = (*d.TNW)(x1 + 1, x2, x3); - f[iPMP] = (*d.TSE)(x1, x2 + 1, x3); - f[iMMP] = (*d.TSW)(x1 + 1, x2 + 1, x3); - - f[iM00] = (*d.W)(x1 + 1, x2, x3); - f[i0M0] = (*d.S)(x1, x2 + 1, x3); - f[i00M] = (*d.B)(x1, x2, x3 + 1); - f[iMM0] = (*d.SW)(x1 + 1, x2 + 1, x3); - f[iPM0] = (*d.SE)(x1, x2 + 1, x3); - f[iM0M] = (*d.BW)(x1 + 1, x2, x3 + 1); - f[iP0M] = (*d.BE)(x1, x2, x3 + 1); - f[i0MM] = (*d.BS)(x1, x2 + 1, x3 + 1); - f[i0PM] = (*d.BN)(x1, x2, x3 + 1); - f[iMMM] = (*d.BSW)(x1 + 1, x2 + 1, x3 + 1); - f[iPMM] = (*d.BSE)(x1, x2 + 1, x3 + 1); - f[iMPM] = (*d.BNW)(x1 + 1, x2, x3 + 1); - f[iPPM] = (*d.BNE)(x1, x2, x3 + 1); - - f[d000] = (*d.REST)(x1, x2, x3); -} -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSoA::setPreCollisionDistribution(const real *const f, size_t x1, size_t x2, size_t x3) -{ - //(*this->localDistributions)(D3Q27System::ET_E,x1, x2, x3) = f[D3Q27System::dP00]; - //(*this->localDistributions)(D3Q27System::ET_N,x1, x2, x3) = f[D3Q27System::d0P0]; - //(*this->localDistributions)(D3Q27System::ET_T,x1, x2, x3) = f[D3Q27System::d00P]; - //(*this->localDistributions)(D3Q27System::ET_NE,x1, x2, x3) = f[D3Q27System::dPP0]; - //(*this->localDistributions)(D3Q27System::ET_NW,x1+1,x2, x3) = f[D3Q27System::dMP0]; - //(*this->localDistributions)(D3Q27System::ET_TE,x1, x2, x3) = f[D3Q27System::dP0P]; - //(*this->localDistributions)(D3Q27System::ET_TW,x1+1,x2, x3) = f[D3Q27System::dM0P]; - //(*this->localDistributions)(D3Q27System::ET_TN,x1, x2, x3) = f[D3Q27System::d0PP]; - //(*this->localDistributions)(D3Q27System::ET_TS,x1, x2+1,x3) = f[D3Q27System::d0MP]; - //(*this->localDistributions)(D3Q27System::ET_TNE,x1, x2, x3) = f[D3Q27System::dPPP]; - //(*this->localDistributions)(D3Q27System::ET_TNW,x1+1,x2, x3) = f[D3Q27System::dMPP]; - //(*this->localDistributions)(D3Q27System::ET_TSE,x1, x2+1,x3) = f[D3Q27System::dPMP]; - //(*this->localDistributions)(D3Q27System::ET_TSW,x1+1,x2+1,x3) = f[D3Q27System::dMMP]; - - //(*this->nonLocalDistributions)(D3Q27System::ET_W,x1+1,x2, x3 ) = f[D3Q27System::dM00 ]; - //(*this->nonLocalDistributions)(D3Q27System::ET_S,x1, x2+1,x3 ) = f[D3Q27System::d0M0 ]; - //(*this->nonLocalDistributions)(D3Q27System::ET_B,x1, x2, x3+1 ) = f[D3Q27System::d00M ]; - //(*this->nonLocalDistributions)(D3Q27System::ET_SW,x1+1,x2+1,x3 ) = f[D3Q27System::dMM0]; - //(*this->nonLocalDistributions)(D3Q27System::ET_SE,x1, x2+1,x3 ) = f[D3Q27System::dPM0]; - //(*this->nonLocalDistributions)(D3Q27System::ET_BW,x1+1,x2, x3+1 ) = f[D3Q27System::dM0M]; - //(*this->nonLocalDistributions)(D3Q27System::ET_BE,x1, x2, x3+1 ) = f[D3Q27System::dP0M]; - //(*this->nonLocalDistributions)(D3Q27System::ET_BS,x1, x2+1,x3+1 ) = f[D3Q27System::d0MM]; - //(*this->nonLocalDistributions)(D3Q27System::ET_BN,x1, x2, x3+1 ) = f[D3Q27System::d0PM]; - //(*this->nonLocalDistributions)(D3Q27System::ET_BSW,x1+1,x2+1,x3+1) = f[D3Q27System::BSW]; - //(*this->nonLocalDistributions)(D3Q27System::ET_BSE,x1, x2+1,x3+1) = f[D3Q27System::BSE]; - //(*this->nonLocalDistributions)(D3Q27System::ET_BNW,x1+1,x2, x3+1) = f[D3Q27System::BNW]; - //(*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1, x2, x3+1) = f[D3Q27System::DIR_DIR_PPM]; - - //(*this->zeroDistributions)(x1,x2,x3) = f[D3Q27System::REST]; -} -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSoA::setPostCollisionDistributionForDirection(const real *const f, size_t x1, size_t x2, size_t x3, - unsigned long int direction) -{ - // bool directionFlag = false; - // if ((direction & EsoTwistD3Q27System::etE) == EsoTwistD3Q27System::etE) - // (*this->nonLocalDistributions)(D3Q27System::ET_W,x1+1,x2, x3 ) = f[D3Q27System::dP00]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etW) == EsoTwistD3Q27System::etW) - // (*this->localDistributions)(D3Q27System::ET_E,x1, x2, x3) = f[D3Q27System::dM00]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etS) == EsoTwistD3Q27System::etS) - // (*this->localDistributions)(D3Q27System::ET_N,x1, x2, x3) = f[D3Q27System::d0M0]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etN) == EsoTwistD3Q27System::etN) - // (*this->nonLocalDistributions)(D3Q27System::ET_S,x1, x2+1,x3 ) = f[D3Q27System::d0P0]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etB) == EsoTwistD3Q27System::etB) - // (*this->localDistributions)(D3Q27System::ET_T,x1, x2, x3) = f[D3Q27System::d00M]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etT) == EsoTwistD3Q27System::etT) - // (*this->nonLocalDistributions)(D3Q27System::ET_B,x1, x2, x3+1 ) = f[D3Q27System::d00P]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etSW) == EsoTwistD3Q27System::etSW) - // (*this->localDistributions)(D3Q27System::ET_NE,x1, x2, x3) = f[D3Q27System::dMM0]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etNE) == EsoTwistD3Q27System::etNE) - // (*this->nonLocalDistributions)(D3Q27System::ET_SW,x1+1,x2+1,x3 ) = f[D3Q27System::dPP0]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etNW) == EsoTwistD3Q27System::etNW) - // (*this->nonLocalDistributions)(D3Q27System::ET_SE,x1, x2+1,x3 ) = f[D3Q27System::dMP0]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etSE) == EsoTwistD3Q27System::etSE) - // (*this->localDistributions)(D3Q27System::ET_NW,x1+1,x2, x3) = f[D3Q27System::dPM0]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etBW) == EsoTwistD3Q27System::etBW) - // (*this->localDistributions)(D3Q27System::ET_TE,x1, x2, x3) = f[D3Q27System::dM0M]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etTE) == EsoTwistD3Q27System::etTE) - // (*this->nonLocalDistributions)(D3Q27System::ET_BW,x1+1,x2, x3+1 ) = f[D3Q27System::dP0P]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etTW) == EsoTwistD3Q27System::etTW) - // (*this->nonLocalDistributions)(D3Q27System::ET_BE,x1, x2, x3+1 ) = f[D3Q27System::dM0P]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etBE) == EsoTwistD3Q27System::etBE) - // (*this->localDistributions)(D3Q27System::ET_TW,x1+1,x2, x3) = f[D3Q27System::dP0M]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etBS) == EsoTwistD3Q27System::etBS) - // (*this->localDistributions)(D3Q27System::ET_TN,x1, x2, x3) = f[D3Q27System::d0MM]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etTN) == EsoTwistD3Q27System::etTN) - // (*this->nonLocalDistributions)(D3Q27System::ET_BS,x1, x2+1,x3+1 ) = f[D3Q27System::d0PP]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etTS) == EsoTwistD3Q27System::etTS) - // (*this->nonLocalDistributions)(D3Q27System::ET_BN,x1, x2, x3+1 ) = f[D3Q27System::d0MP]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etBN) == EsoTwistD3Q27System::etBN) - // (*this->localDistributions)(D3Q27System::ET_TS,x1, x2+1,x3) = f[D3Q27System::d0PM]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etBSW) == EsoTwistD3Q27System::etBSW) - // (*this->localDistributions)(D3Q27System::ET_TNE,x1, x2, x3) = f[D3Q27System::BSW]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etTNE) == EsoTwistD3Q27System::etTNE) - // (*this->nonLocalDistributions)(D3Q27System::ET_BSW,x1+1,x2+1,x3+1) = f[D3Q27System::dPPP]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etBSE) == EsoTwistD3Q27System::etBSE) - // (*this->localDistributions)(D3Q27System::ET_TNW,x1+1,x2, x3) = f[D3Q27System::BSE]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etTNW) == EsoTwistD3Q27System::etTNW) - // (*this->nonLocalDistributions)(D3Q27System::ET_BSE,x1, x2+1,x3+1) = f[D3Q27System::dMPP]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etBNW) == EsoTwistD3Q27System::etBNW) - // (*this->localDistributions)(D3Q27System::ET_TSE,x1, x2+1,x3) = f[D3Q27System::BNW]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etTSE) == EsoTwistD3Q27System::etTSE) - // (*this->nonLocalDistributions)(D3Q27System::ET_BNW,x1+1,x2, x3+1) = f[D3Q27System::dPMP]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etBNE) == EsoTwistD3Q27System::etBNE) - // (*this->localDistributions)(D3Q27System::ET_TSW,x1+1,x2+1,x3) = f[D3Q27System::DIR_DIR_PPM]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etTSW) == EsoTwistD3Q27System::etTSW) - // (*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1, x2, x3+1) = f[D3Q27System::dMMP]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::REST) == EsoTwistD3Q27System::REST) - // (*this->zeroDistributions)(x1,x2,x3) = f[D3Q27System::REST]; directionFlag=true; - //#ifdef _DEBUG - // if(!directionFlag)UB_THROW( UbException(UB_EXARGS, "Direction didn't find") ); - //#endif //DEBUG -} -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSoA::setPostCollisionDistributionForDirection(real f, size_t x1, size_t x2, size_t x3, int direction) -{ - // switch (direction) - //{ - // case D3Q27System::dP00 : - // (*this->nonLocalDistributions)(D3Q27System::ET_W,x1+1,x2, x3 ) = f; - // break; - // case D3Q27System::dM00 : - // (*this->localDistributions)(D3Q27System::ET_E,x1, x2, x3) = f; - // break; - // case D3Q27System::d0M0 : - // (*this->localDistributions)(D3Q27System::ET_N,x1, x2, x3) = f; - // break; - // case D3Q27System::d0P0 : - // (*this->nonLocalDistributions)(D3Q27System::ET_S,x1, x2+1,x3 ) = f; - // break; - // case D3Q27System::d00M : - // (*this->localDistributions)(D3Q27System::ET_T,x1, x2, x3) = f; - // break; - // case D3Q27System::d00P : - // (*this->nonLocalDistributions)(D3Q27System::ET_B,x1, x2, x3+1 ) = f; - // break; - // case D3Q27System::dMM0 : - // (*this->localDistributions)(D3Q27System::ET_NE,x1, x2, x3) = f; - // break; - // case D3Q27System::dPP0 : - // (*this->nonLocalDistributions)(D3Q27System::ET_SW,x1+1,x2+1,x3 ) = f; - // break; - // case D3Q27System::dMP0 : - // (*this->nonLocalDistributions)(D3Q27System::ET_SE,x1, x2+1,x3 ) = f; - // break; - // case D3Q27System::dPM0 : - // (*this->localDistributions)(D3Q27System::ET_NW,x1+1,x2, x3) = f; - // break; - // case D3Q27System::dM0M : - // (*this->localDistributions)(D3Q27System::ET_TE,x1, x2, x3) = f; - // break; - // case D3Q27System::dP0P : - // (*this->nonLocalDistributions)(D3Q27System::ET_BW,x1+1,x2, x3+1 ) = f; - // break; - // case D3Q27System::dM0P : - // (*this->nonLocalDistributions)(D3Q27System::ET_BE,x1, x2, x3+1 ) = f; - // break; - // case D3Q27System::dP0M : - // (*this->localDistributions)(D3Q27System::ET_TW,x1+1,x2, x3) = f; - // break; - // case D3Q27System::d0MM : - // (*this->localDistributions)(D3Q27System::ET_TN,x1, x2, x3) = f; - // break; - // case D3Q27System::d0PP : - // (*this->nonLocalDistributions)(D3Q27System::ET_BS,x1, x2+1,x3+1 ) = f; - // break; - // case D3Q27System::d0MP : - // (*this->nonLocalDistributions)(D3Q27System::ET_BN,x1, x2, x3+1 ) = f; - // break; - // case D3Q27System::d0PM : - // (*this->localDistributions)(D3Q27System::ET_TS,x1, x2+1,x3) = f; - // break; - // case D3Q27System::BSW : - // (*this->localDistributions)(D3Q27System::ET_TNE,x1, x2, x3) = f; - // break; - // case D3Q27System::dPPP : - // (*this->nonLocalDistributions)(D3Q27System::ET_BSW,x1+1,x2+1,x3+1) = f; - // break; - // case D3Q27System::BSE : - // (*this->localDistributions)(D3Q27System::ET_TNW,x1+1,x2, x3) = f; - // break; - // case D3Q27System::dMPP : - // (*this->nonLocalDistributions)(D3Q27System::ET_BSE,x1, x2+1,x3+1) = f; - // break; - // case D3Q27System::BNW : - // (*this->localDistributions)(D3Q27System::ET_TSE,x1, x2+1,x3) = f; - // break; - // case D3Q27System::dPMP : - // (*this->nonLocalDistributions)(D3Q27System::ET_BNW,x1+1,x2, x3+1) = f; - // break; - // case D3Q27System::DIR_DIR_PPM : - // (*this->localDistributions)(D3Q27System::ET_TSW,x1+1,x2+1,x3) = f; - // break; - // case D3Q27System::dMMP : - // (*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1, x2, x3+1) = f; - // break; - // case D3Q27System::REST : - // (*this->zeroDistributions)(x1,x2,x3) = f; - // break; - // default: - // UB_THROW( UbException(UB_EXARGS, "Direction didn't find") ); - //} -} -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSoA::setPreCollisionDistributionForDirection(const real *const f, size_t x1, size_t x2, size_t x3, - unsigned long int direction) -{ - // bool directionFlag = false; - // if ((direction & EsoTwistD3Q27System::etE) == EsoTwistD3Q27System::etE) - // (*this->localDistributions)(D3Q27System::ET_E,x1, x2, x3) = f[D3Q27System::dP00]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etW) == EsoTwistD3Q27System::etW) - // (*this->nonLocalDistributions)(D3Q27System::ET_W,x1+1,x2, x3 ) = f[D3Q27System::dM00]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etS) == EsoTwistD3Q27System::etS) - // (*this->nonLocalDistributions)(D3Q27System::ET_S,x1, x2+1,x3 ) = f[D3Q27System::d0M0]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etN) == EsoTwistD3Q27System::etN) - // (*this->localDistributions)(D3Q27System::ET_N,x1, x2, x3) = f[D3Q27System::d0P0]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etB) == EsoTwistD3Q27System::etB) - // (*this->nonLocalDistributions)(D3Q27System::ET_B,x1, x2, x3+1 ) = f[D3Q27System::d00M]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etT) == EsoTwistD3Q27System::etT) - // (*this->localDistributions)(D3Q27System::ET_T,x1, x2, x3) = f[D3Q27System::d00P]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etSW) == EsoTwistD3Q27System::etSW) - // (*this->nonLocalDistributions)(D3Q27System::ET_SW,x1+1,x2+1,x3 ) = f[D3Q27System::dMM0]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etNE) == EsoTwistD3Q27System::etNE) - // (*this->localDistributions)(D3Q27System::ET_NE,x1, x2, x3) = f[D3Q27System::dPP0]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etNW) == EsoTwistD3Q27System::etNW) - // (*this->localDistributions)(D3Q27System::ET_NW,x1+1,x2, x3) = f[D3Q27System::dMP0]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etSE) == EsoTwistD3Q27System::etSE) - // (*this->nonLocalDistributions)(D3Q27System::ET_SE,x1, x2+1,x3 ) = f[D3Q27System::dPM0]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etBW) == EsoTwistD3Q27System::etBW) - // (*this->nonLocalDistributions)(D3Q27System::ET_BW,x1+1,x2, x3+1 ) = f[D3Q27System::dM0M]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etTE) == EsoTwistD3Q27System::etTE) - // (*this->localDistributions)(D3Q27System::ET_TE,x1, x2, x3) = f[D3Q27System::dP0P]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etTW) == EsoTwistD3Q27System::etTW) - // (*this->localDistributions)(D3Q27System::ET_TW,x1+1,x2, x3) = f[D3Q27System::dM0P]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etBE) == EsoTwistD3Q27System::etBE) - // (*this->nonLocalDistributions)(D3Q27System::ET_BE,x1, x2, x3+1 ) = f[D3Q27System::dP0M]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etBS) == EsoTwistD3Q27System::etBS) - // (*this->nonLocalDistributions)(D3Q27System::ET_BS,x1, x2+1,x3+1 ) = f[D3Q27System::d0MM]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etTN) == EsoTwistD3Q27System::etTN) - // (*this->localDistributions)(D3Q27System::ET_TN,x1, x2, x3) = f[D3Q27System::d0PP]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etTS) == EsoTwistD3Q27System::etTS) - // (*this->localDistributions)(D3Q27System::ET_TS,x1, x2+1,x3) = f[D3Q27System::d0MP]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etBN) == EsoTwistD3Q27System::etBN) - // (*this->nonLocalDistributions)(D3Q27System::ET_BN,x1, x2, x3+1 ) = f[D3Q27System::d0PM]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etBSW) == EsoTwistD3Q27System::etBSW) - // (*this->nonLocalDistributions)(D3Q27System::ET_BSW,x1+1,x2+1,x3+1) = f[D3Q27System::BSW]; - // directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etTNE) == EsoTwistD3Q27System::etTNE) - // (*this->localDistributions)(D3Q27System::ET_TNE,x1, x2, x3) = f[D3Q27System::dPPP]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etBSE) == EsoTwistD3Q27System::etBSE) - // (*this->nonLocalDistributions)(D3Q27System::ET_BSE,x1, x2+1,x3+1) = f[D3Q27System::BSE]; - // directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etTNW) == EsoTwistD3Q27System::etTNW) - // (*this->localDistributions)(D3Q27System::ET_TNW,x1+1,x2, x3) = f[D3Q27System::dMPP]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etBNW) == EsoTwistD3Q27System::etBNW) - // (*this->nonLocalDistributions)(D3Q27System::ET_BNW,x1+1,x2, x3+1) = f[D3Q27System::BNW]; - // directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etTSE) == EsoTwistD3Q27System::etTSE) - // (*this->localDistributions)(D3Q27System::ET_TSE,x1, x2+1,x3) = f[D3Q27System::dPMP]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etBNE) == EsoTwistD3Q27System::etBNE) - // (*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1, x2, x3+1)= f[D3Q27System::DIR_DIR_PPM]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::etTSW) == EsoTwistD3Q27System::etTSW) - // (*this->localDistributions)(D3Q27System::ET_TSW,x1+1,x2+1,x3) = f[D3Q27System::dMMP]; directionFlag=true; - // if ((direction & EsoTwistD3Q27System::REST) == EsoTwistD3Q27System::REST) - // (*this->zeroDistributions)(x1,x2,x3) = f[D3Q27System::REST]; directionFlag=true; - //#ifdef _DEBUG - // if(!directionFlag)UB_THROW( UbException(UB_EXARGS, "Direction didn't find") ); - //#endif //DEBUG -} -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSoA::setPreCollisionDistributionForDirection(real f, size_t x1, size_t x2, size_t x3, - unsigned long int direction) -{ - // switch (direction) - //{ - // case D3Q27System::dP00 : - // (*this->localDistributions)(D3Q27System::ET_E,x1, x2, x3) = f; - // break; - // case D3Q27System::dM00 : - // (*this->nonLocalDistributions)(D3Q27System::ET_W,x1+1,x2, x3 ) = f; - // break; - // case D3Q27System::d0M0 : - // (*this->nonLocalDistributions)(D3Q27System::ET_S,x1, x2+1,x3 ) = f; - // break; - // case D3Q27System::d0P0 : - // (*this->localDistributions)(D3Q27System::ET_N,x1, x2, x3) = f; - // break; - // case D3Q27System::d00M : - // (*this->nonLocalDistributions)(D3Q27System::ET_B,x1, x2, x3+1 ) = f; - // break; - // case D3Q27System::d00P : - // (*this->localDistributions)(D3Q27System::ET_T,x1, x2, x3) = f; - // break; - // case D3Q27System::dMM0 : - // (*this->nonLocalDistributions)(D3Q27System::ET_SW,x1+1,x2+1,x3 ) = f; - // break; - // case D3Q27System::dPP0 : - // (*this->localDistributions)(D3Q27System::ET_NE,x1, x2, x3) = f; - // break; - // case D3Q27System::dMP0 : - // (*this->localDistributions)(D3Q27System::ET_NW,x1+1,x2, x3) = f; - // break; - // case D3Q27System::dPM0 : - // (*this->nonLocalDistributions)(D3Q27System::ET_SE,x1, x2+1,x3 ) = f; - // break; - // case D3Q27System::dM0M : - // (*this->nonLocalDistributions)(D3Q27System::ET_BW,x1+1,x2, x3+1 ) = f; - // break; - // case D3Q27System::dP0P : - // (*this->localDistributions)(D3Q27System::ET_TE,x1, x2, x3) = f; - // break; - // case D3Q27System::dM0P : - // (*this->localDistributions)(D3Q27System::ET_TW,x1+1,x2, x3) = f; - // break; - // case D3Q27System::dP0M : - // (*this->nonLocalDistributions)(D3Q27System::ET_BE,x1, x2, x3+1 ) = f; - // break; - // case D3Q27System::d0MM : - // (*this->nonLocalDistributions)(D3Q27System::ET_BS,x1, x2+1,x3+1 ) = f; - // break; - // case D3Q27System::d0PP : - // (*this->localDistributions)(D3Q27System::ET_TN,x1, x2, x3) = f; - // break; - // case D3Q27System::d0MP : - // (*this->localDistributions)(D3Q27System::ET_TS,x1, x2+1,x3) = f; - // break; - // case D3Q27System::d0PM : - // (*this->nonLocalDistributions)(D3Q27System::ET_BN,x1, x2, x3+1 ) = f; - // break; - // case D3Q27System::BSW : - // (*this->nonLocalDistributions)(D3Q27System::ET_BSW,x1+1,x2+1,x3+1) = f; - // break; - // case D3Q27System::dPPP : - // (*this->localDistributions)(D3Q27System::ET_TNE,x1, x2, x3) = f; - // break; - // case D3Q27System::BSE : - // (*this->nonLocalDistributions)(D3Q27System::ET_BSE,x1, x2+1,x3+1) = f; - // break; - // case D3Q27System::dMPP : - // (*this->localDistributions)(D3Q27System::ET_TNW,x1+1,x2, x3) = f; - // break; - // case D3Q27System::BNW : - // (*this->nonLocalDistributions)(D3Q27System::ET_BNW,x1+1,x2, x3+1) = f; - // break; - // case D3Q27System::dPMP : - // (*this->localDistributions)(D3Q27System::ET_TSE,x1, x2+1,x3) = f; - // break; - // case D3Q27System::DIR_DIR_PPM : - // (*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1, x2, x3+1) = f; - // break; - // case D3Q27System::dMMP : - // (*this->localDistributions)(D3Q27System::ET_TSW,x1+1,x2+1,x3) = f; - // break; - // case D3Q27System::REST : - // (*this->zeroDistributions)(x1,x2,x3) = f; - // break; - // default: - // UB_THROW( UbException(UB_EXARGS, "Direction didn't find") ); - //} -} -////////////////////////////////////////////////////////////////////////// -real D3Q27EsoTwist3DSoA::getPostCollisionDistributionForDirection(size_t /*x1*/, size_t /*x2*/, size_t /*x3*/, - int /*direction*/) -{ - // switch (direction) - //{ - // case D3Q27System::dP00 : - // return (*this->nonLocalDistributions)(D3Q27System::ET_W,x1+1,x2, x3 ); - // case D3Q27System::dM00 : - // return (*this->localDistributions)(D3Q27System::ET_E,x1, x2, x3); - // case D3Q27System::d0M0 : - // return (*this->localDistributions)(D3Q27System::ET_N,x1, x2, x3); - // case D3Q27System::d0P0 : - // return (*this->nonLocalDistributions)(D3Q27System::ET_S,x1, x2+1,x3 ); - // case D3Q27System::d00M : - // return (*this->localDistributions)(D3Q27System::ET_T,x1, x2, x3); - // case D3Q27System::d00P : - // return (*this->nonLocalDistributions)(D3Q27System::ET_B,x1, x2, x3+1 ); - // case D3Q27System::dMM0 : - // return (*this->localDistributions)(D3Q27System::ET_NE,x1, x2, x3); - // case D3Q27System::dPP0 : - // return (*this->nonLocalDistributions)(D3Q27System::ET_SW,x1+1,x2+1,x3 ); - // case D3Q27System::dMP0 : - // return (*this->nonLocalDistributions)(D3Q27System::ET_SE,x1, x2+1,x3 ); - // case D3Q27System::dPM0 : - // return (*this->localDistributions)(D3Q27System::ET_NW,x1+1,x2, x3); - // case D3Q27System::dM0M : - // return (*this->localDistributions)(D3Q27System::ET_TE,x1, x2, x3); - // case D3Q27System::dP0P : - // return (*this->nonLocalDistributions)(D3Q27System::ET_BW,x1+1,x2, x3+1 ); - // case D3Q27System::dM0P : - // return (*this->nonLocalDistributions)(D3Q27System::ET_BE,x1, x2, x3+1 ); - // case D3Q27System::dP0M : - // return (*this->localDistributions)(D3Q27System::ET_TW,x1+1,x2, x3); - // case D3Q27System::d0MM : - // return (*this->localDistributions)(D3Q27System::ET_TN,x1, x2, x3); - // case D3Q27System::d0PP : - // return (*this->nonLocalDistributions)(D3Q27System::ET_BS,x1, x2+1,x3+1 ); - // case D3Q27System::d0MP : - // return (*this->nonLocalDistributions)(D3Q27System::ET_BN,x1, x2, x3+1 ); - // case D3Q27System::d0PM : - // return (*this->localDistributions)(D3Q27System::ET_TS,x1, x2+1,x3); - // case D3Q27System::BSW : - // return (*this->localDistributions)(D3Q27System::ET_TNE,x1, x2, x3); - // case D3Q27System::dPPP : - // return (*this->nonLocalDistributions)(D3Q27System::ET_BSW,x1+1,x2+1,x3+1); - // case D3Q27System::BSE : - // return (*this->localDistributions)(D3Q27System::ET_TNW,x1+1,x2, x3); - // case D3Q27System::dMPP : - // return (*this->nonLocalDistributions)(D3Q27System::ET_BSE,x1, x2+1,x3+1); - // case D3Q27System::BNW : - // return (*this->localDistributions)(D3Q27System::ET_TSE,x1, x2+1,x3); - // case D3Q27System::dPMP : - // return (*this->nonLocalDistributions)(D3Q27System::ET_BNW,x1+1,x2, x3+1); - // case D3Q27System::DIR_DIR_PPM : - // return (*this->localDistributions)(D3Q27System::ET_TSW,x1+1,x2+1,x3); - // case D3Q27System::dMMP : - // return (*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1, x2, x3+1); - // case D3Q27System::REST : - // return (*this->zeroDistributions)(x1,x2,x3); - // default: - // UB_THROW( UbException(UB_EXARGS, "Direction didn't find") ); - //} - return 0; -} -////////////////////////////////////////////////////////////////////////// -size_t D3Q27EsoTwist3DSoA::getNX1() const { return NX1; } -////////////////////////////////////////////////////////////////////////// -size_t D3Q27EsoTwist3DSoA::getNX2() const { return NX2; } -////////////////////////////////////////////////////////////////////////// -size_t D3Q27EsoTwist3DSoA::getNX3() const { return NX3; } -////////////////////////////////////////////////////////////////////////// -Distributions D3Q27EsoTwist3DSoA::getDistributions() { return d; } -////////////////////////////////////////////////////////////////////////// diff --git a/src/cpu/core/Data/D3Q27EsoTwist3DSoA.h b/src/cpu/core/Data/D3Q27EsoTwist3DSoA.h deleted file mode 100644 index 3fb5f96b004dff71527744b0ef74f4d36a27d5af..0000000000000000000000000000000000000000 --- a/src/cpu/core/Data/D3Q27EsoTwist3DSoA.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef D3Q27EsoTwist3DSoA_h -#define D3Q27EsoTwist3DSoA_h - -#include "EsoTwist3D.h" -//#include "D3Q27System.h" -//#include "basics/container/CbArray4D.h" -#include <basics/container/CbArray3D.h> -//#include <boost/serialization/serialization.hpp> -//#include <boost/serialization/base_object.hpp> - -struct Distributions { - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr E; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr W; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr N; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr S; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr T; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr B; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr NE; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr SW; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr SE; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr NW; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr TE; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr BW; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr BE; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr TW; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr TN; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr BS; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr BN; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr TS; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr TNE; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr TNW; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr TSE; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr TSW; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr BNE; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr BNW; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr BSE; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr BSW; - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr REST; -}; - -class D3Q27EsoTwist3DSoA : public EsoTwist3D -{ -public: - D3Q27EsoTwist3DSoA(); - D3Q27EsoTwist3DSoA(const size_t &nx1, const size_t &nx2, const size_t &nx3, real value); - ////////////////////////////////////////////////////////////////////////// - ~D3Q27EsoTwist3DSoA() override; - ////////////////////////////////////////////////////////////////////////// - void swap() override; - ////////////////////////////////////////////////////////////////////////// - void getPreCollisionDistribution(real *const f, size_t x1, size_t x2, size_t x3) override; - ////////////////////////////////////////////////////////////////////////// - void setPostCollisionDistribution(const real *const f, size_t x1, size_t x2, size_t x3) override; - //////////////////////////////////////////////////////////////////////// - void getPostCollisionDistribution(real *const f, size_t x1, size_t x2, size_t x3) override; - ////////////////////////////////////////////////////////////////////////// - void setPreCollisionDistribution(const real *const f, size_t x1, size_t x2, size_t x3) override; - ////////////////////////////////////////////////////////////////////////// - void setPostCollisionDistributionForDirection(const real *const f, size_t x1, size_t x2, size_t x3, - unsigned long int direction) override; - ////////////////////////////////////////////////////////////////////////// - void setPostCollisionDistributionForDirection(real f, size_t x1, size_t x2, size_t x3, int direction) override; - ////////////////////////////////////////////////////////////////////////// - real getPostCollisionDistributionForDirection(size_t x1, size_t x2, size_t x3, int direction) override; - ////////////////////////////////////////////////////////////////////////// - void setPreCollisionDistributionForDirection(const real *const f, size_t x1, size_t x2, size_t x3, - unsigned long int direction) override; - ////////////////////////////////////////////////////////////////////////// - void setPreCollisionDistributionForDirection(real f, size_t x1, size_t x2, size_t x3, - unsigned long int direction) override; - ////////////////////////////////////////////////////////////////////////// - real getPreCollisionDistributionForDirection(size_t x1, size_t x2, size_t x3, int direction) override; - ////////////////////////////////////////////////////////////////////////// - size_t getNX1() const override; - ////////////////////////////////////////////////////////////////////////// - size_t getNX2() const override; - ////////////////////////////////////////////////////////////////////////// - size_t getNX3() const override; - ////////////////////////////////////////////////////////////////////////// - Distributions getDistributions(); - ////////////////////////////////////////////////////////////////////////// - void getDistributionAfterLastStep(real *const f, size_t x1, size_t x2, size_t x3); - -protected: - Distributions d; - size_t NX1, NX2, NX3; -}; - -#endif diff --git a/src/cpu/core/Data/D3Q27EsoTwist3DSplittedVector.cpp b/src/cpu/core/Data/D3Q27EsoTwist3DSplittedVector.cpp deleted file mode 100644 index 70cb9e0131dcf4e3e98d65f5ac129e3ac08ea559..0000000000000000000000000000000000000000 --- a/src/cpu/core/Data/D3Q27EsoTwist3DSplittedVector.cpp +++ /dev/null @@ -1,675 +0,0 @@ -//======================================================================================= -// ____ ____ __ ______ __________ __ __ __ __ -// \ \ | | | | | _ \ |___ ___| | | | | / \ | | -// \ \ | | | | | |_) | | | | | | | / \ | | -// \ \ | | | | | _ / | | | | | | / /\ \ | | -// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ -// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| -// \ \ | | ________________________________________________________________ -// \ \ | | | ______________________________________________________________| -// \ \| | | | __ __ __ __ ______ _______ -// \ | | |_____ | | | | | | | | | _ \ / _____) -// \ | | _____| | | | | | | | | | | \ \ \_______ -// \ | | | | |_____ | \_/ | | | | |_/ / _____ | -// \ _____| |__| |________| \_______/ |__| |______/ (_______/ -// -// This file is part of VirtualFluids. VirtualFluids 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 3 of -// the License, or (at your option) any later version. -// -// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. -// -//! \file D3Q27EsoTwist3DSplittedVector.cpp -//! \ingroup Data -//! \author Konstantin Kutscher -//======================================================================================= - -#include "D3Q27EsoTwist3DSplittedVector.h" -#include "EsoTwistD3Q27System.h" - -D3Q27EsoTwist3DSplittedVector::D3Q27EsoTwist3DSplittedVector() = default; -////////////////////////////////////////////////////////////////////////// -D3Q27EsoTwist3DSplittedVector::D3Q27EsoTwist3DSplittedVector(size_t nx1, size_t nx2, size_t nx3, real value) -{ - this->NX1 = nx1; - this->NX2 = nx2; - this->NX3 = nx3; - - this->localDistributions = - std::make_shared<CbArray4D<real, IndexerX4X3X2X1>>(13, nx1 + 1, nx2 + 1, nx3 + 1, value); - this->nonLocalDistributions = - std::make_shared<CbArray4D<real, IndexerX4X3X2X1>>(13, nx1 + 1, nx2 + 1, nx3 + 1, value); - - this->zeroDistributions = std::make_shared<CbArray3D<real, IndexerX3X2X1>>(nx1, nx2, nx3, value); -} -////////////////////////////////////////////////////////////////////////// -D3Q27EsoTwist3DSplittedVector::~D3Q27EsoTwist3DSplittedVector() = default; -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSplittedVector::swap() { std::swap(this->localDistributions, this->nonLocalDistributions); } -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSplittedVector::getPreCollisionDistribution(real *const f, size_t x1, size_t x2, size_t x3) -{ - const size_t x1p = x1 + 1; - const size_t x2p = x2 + 1; - const size_t x3p = x3 + 1; - - f[vf::lbm::dir::dP00] = (*this->localDistributions)(D3Q27System::ET_P00, x1, x2, x3); - f[vf::lbm::dir::d0P0] = (*this->localDistributions)(D3Q27System::ET_0P0, x1, x2, x3); - f[vf::lbm::dir::d00P] = (*this->localDistributions)(D3Q27System::ET_00P, x1, x2, x3); - f[vf::lbm::dir::dPP0] = (*this->localDistributions)(D3Q27System::ET_PP0, x1, x2, x3); - f[vf::lbm::dir::dMP0] = (*this->localDistributions)(D3Q27System::ET_MP0, x1p, x2, x3); - f[vf::lbm::dir::dP0P] = (*this->localDistributions)(D3Q27System::ET_P0P, x1, x2, x3); - f[vf::lbm::dir::dM0P] = (*this->localDistributions)(D3Q27System::ET_M0P, x1p, x2, x3); - f[vf::lbm::dir::d0PP] = (*this->localDistributions)(D3Q27System::ET_0PP, x1, x2, x3); - f[vf::lbm::dir::d0MP] = (*this->localDistributions)(D3Q27System::ET_0MP, x1, x2p, x3); - f[vf::lbm::dir::dPPP] = (*this->localDistributions)(D3Q27System::ET_PPP, x1, x2, x3); - f[vf::lbm::dir::dMPP] = (*this->localDistributions)(D3Q27System::ET_MPP, x1p, x2, x3); - f[vf::lbm::dir::dPMP] = (*this->localDistributions)(D3Q27System::ET_PMP, x1, x2p, x3); - f[vf::lbm::dir::dMMP] = (*this->localDistributions)(D3Q27System::ET_MMP, x1p, x2p, x3); - - f[vf::lbm::dir::dM00] = (*this->nonLocalDistributions)(D3Q27System::ET_M00, x1p, x2, x3); - f[vf::lbm::dir::d0M0] = (*this->nonLocalDistributions)(D3Q27System::ET_0M0, x1, x2p, x3); - f[vf::lbm::dir::d00M] = (*this->nonLocalDistributions)(D3Q27System::ET_00M, x1, x2, x3p); - f[vf::lbm::dir::dMM0] = (*this->nonLocalDistributions)(D3Q27System::ET_MM0, x1p, x2p, x3); - f[vf::lbm::dir::dPM0] = (*this->nonLocalDistributions)(D3Q27System::ET_PM0, x1, x2p, x3); - f[vf::lbm::dir::dM0M] = (*this->nonLocalDistributions)(D3Q27System::ET_M0M, x1p, x2, x3p); - f[vf::lbm::dir::dP0M] = (*this->nonLocalDistributions)(D3Q27System::ET_P0M, x1, x2, x3p); - f[vf::lbm::dir::d0MM] = (*this->nonLocalDistributions)(D3Q27System::ET_0MM, x1, x2p, x3p); - f[vf::lbm::dir::d0PM] = (*this->nonLocalDistributions)(D3Q27System::ET_0PM, x1, x2, x3p); - f[vf::lbm::dir::dMMM] = (*this->nonLocalDistributions)(D3Q27System::ET_MMM, x1p, x2p, x3p); - f[vf::lbm::dir::dPMM] = (*this->nonLocalDistributions)(D3Q27System::ET_PMM, x1, x2p, x3p); - f[vf::lbm::dir::dMPM] = (*this->nonLocalDistributions)(D3Q27System::ET_MPM, x1p, x2, x3p); - f[vf::lbm::dir::dPPM] = (*this->nonLocalDistributions)(D3Q27System::ET_PPM, x1, x2, x3p); - - f[vf::lbm::dir::d000] = (*this->zeroDistributions)(x1, x2, x3); -} -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSplittedVector::setPostCollisionDistribution(const real *const f, size_t x1, size_t x2, size_t x3) -{ - using namespace vf::lbm::dir; - - (*this->localDistributions)(D3Q27System::ET_P00, x1, x2, x3) = f[iP00]; - (*this->localDistributions)(D3Q27System::ET_0P0, x1, x2, x3) = f[i0P0]; - (*this->localDistributions)(D3Q27System::ET_00P, x1, x2, x3) = f[i00P]; - (*this->localDistributions)(D3Q27System::ET_PP0, x1, x2, x3) = f[iPP0]; - (*this->localDistributions)(D3Q27System::ET_MP0, x1 + 1, x2, x3) = f[iMP0]; - (*this->localDistributions)(D3Q27System::ET_P0P, x1, x2, x3) = f[iP0P]; - (*this->localDistributions)(D3Q27System::ET_M0P, x1 + 1, x2, x3) = f[iM0P]; - (*this->localDistributions)(D3Q27System::ET_0PP, x1, x2, x3) = f[i0PP]; - (*this->localDistributions)(D3Q27System::ET_0MP, x1, x2 + 1, x3) = f[i0MP]; - (*this->localDistributions)(D3Q27System::ET_PPP, x1, x2, x3) = f[iPPP]; - (*this->localDistributions)(D3Q27System::ET_MPP, x1 + 1, x2, x3) = f[iMPP]; - (*this->localDistributions)(D3Q27System::ET_PMP, x1, x2 + 1, x3) = f[iPMP]; - (*this->localDistributions)(D3Q27System::ET_MMP, x1 + 1, x2 + 1, x3) = f[iMMP]; - - (*this->nonLocalDistributions)(D3Q27System::ET_M00, x1 + 1, x2, x3) = f[iM00]; - (*this->nonLocalDistributions)(D3Q27System::ET_0M0, x1, x2 + 1, x3) = f[i0M0]; - (*this->nonLocalDistributions)(D3Q27System::ET_00M, x1, x2, x3 + 1) = f[i00M]; - (*this->nonLocalDistributions)(D3Q27System::ET_MM0, x1 + 1, x2 + 1, x3) = f[iMM0]; - (*this->nonLocalDistributions)(D3Q27System::ET_PM0, x1, x2 + 1, x3) = f[iPM0]; - (*this->nonLocalDistributions)(D3Q27System::ET_M0M, x1 + 1, x2, x3 + 1) = f[iM0M]; - (*this->nonLocalDistributions)(D3Q27System::ET_P0M, x1, x2, x3 + 1) = f[iP0M]; - (*this->nonLocalDistributions)(D3Q27System::ET_0MM, x1, x2 + 1, x3 + 1) = f[i0MM]; - (*this->nonLocalDistributions)(D3Q27System::ET_0PM, x1, x2, x3 + 1) = f[i0PM]; - (*this->nonLocalDistributions)(D3Q27System::ET_MMM, x1 + 1, x2 + 1, x3 + 1) = f[iMMM]; - (*this->nonLocalDistributions)(D3Q27System::ET_PMM, x1, x2 + 1, x3 + 1) = f[iPMM]; - (*this->nonLocalDistributions)(D3Q27System::ET_MPM, x1 + 1, x2, x3 + 1) = f[iMPM]; - (*this->nonLocalDistributions)(D3Q27System::ET_PPM, x1, x2, x3 + 1) = f[iPPM]; - - (*this->zeroDistributions)(x1, x2, x3) = f[d000]; -} -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSplittedVector::getPostCollisionDistribution(real *const f, size_t x1, size_t x2, size_t x3) -{ - using namespace vf::lbm::dir; - - f[iP00] = (*this->localDistributions)(D3Q27System::ET_P00, x1, x2, x3); - f[i0P0] = (*this->localDistributions)(D3Q27System::ET_0P0, x1, x2, x3); - f[i00P] = (*this->localDistributions)(D3Q27System::ET_00P, x1, x2, x3); - f[iPP0] = (*this->localDistributions)(D3Q27System::ET_PP0, x1, x2, x3); - f[iMP0] = (*this->localDistributions)(D3Q27System::ET_MP0, x1 + 1, x2, x3); - f[iP0P] = (*this->localDistributions)(D3Q27System::ET_P0P, x1, x2, x3); - f[iM0P] = (*this->localDistributions)(D3Q27System::ET_M0P, x1 + 1, x2, x3); - f[i0PP] = (*this->localDistributions)(D3Q27System::ET_0PP, x1, x2, x3); - f[i0MP] = (*this->localDistributions)(D3Q27System::ET_0MP, x1, x2 + 1, x3); - f[iPPP] = (*this->localDistributions)(D3Q27System::ET_PPP, x1, x2, x3); - f[iMPP] = (*this->localDistributions)(D3Q27System::ET_MPP, x1 + 1, x2, x3); - f[iPMP] = (*this->localDistributions)(D3Q27System::ET_PMP, x1, x2 + 1, x3); - f[iMMP] = (*this->localDistributions)(D3Q27System::ET_MMP, x1 + 1, x2 + 1, x3); - - f[iM00] = (*this->nonLocalDistributions)(D3Q27System::ET_M00, x1 + 1, x2, x3); - f[i0M0] = (*this->nonLocalDistributions)(D3Q27System::ET_0M0, x1, x2 + 1, x3); - f[i00M] = (*this->nonLocalDistributions)(D3Q27System::ET_00M, x1, x2, x3 + 1); - f[iMM0] = (*this->nonLocalDistributions)(D3Q27System::ET_MM0, x1 + 1, x2 + 1, x3); - f[iPM0] = (*this->nonLocalDistributions)(D3Q27System::ET_PM0, x1, x2 + 1, x3); - f[iM0M] = (*this->nonLocalDistributions)(D3Q27System::ET_M0M, x1 + 1, x2, x3 + 1); - f[iP0M] = (*this->nonLocalDistributions)(D3Q27System::ET_P0M, x1, x2, x3 + 1); - f[i0MM] = (*this->nonLocalDistributions)(D3Q27System::ET_0MM, x1, x2 + 1, x3 + 1); - f[i0PM] = (*this->nonLocalDistributions)(D3Q27System::ET_0PM, x1, x2, x3 + 1); - f[iMMM] = (*this->nonLocalDistributions)(D3Q27System::ET_MMM, x1 + 1, x2 + 1, x3 + 1); - f[iPMM] = (*this->nonLocalDistributions)(D3Q27System::ET_PMM, x1, x2 + 1, x3 + 1); - f[iMPM] = (*this->nonLocalDistributions)(D3Q27System::ET_MPM, x1 + 1, x2, x3 + 1); - f[iPPM] = (*this->nonLocalDistributions)(D3Q27System::ET_PPM, x1, x2, x3 + 1); - - f[d000] = (*this->zeroDistributions)(x1, x2, x3); -} -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSplittedVector::setPreCollisionDistribution(const real *const f, size_t x1, size_t x2, size_t x3) -{ - using namespace vf::lbm::dir; - - (*this->localDistributions)(D3Q27System::ET_P00, x1, x2, x3) = f[dP00]; - (*this->localDistributions)(D3Q27System::ET_0P0, x1, x2, x3) = f[d0P0]; - (*this->localDistributions)(D3Q27System::ET_00P, x1, x2, x3) = f[d00P]; - (*this->localDistributions)(D3Q27System::ET_PP0, x1, x2, x3) = f[dPP0]; - (*this->localDistributions)(D3Q27System::ET_MP0, x1 + 1, x2, x3) = f[dMP0]; - (*this->localDistributions)(D3Q27System::ET_P0P, x1, x2, x3) = f[dP0P]; - (*this->localDistributions)(D3Q27System::ET_M0P, x1 + 1, x2, x3) = f[dM0P]; - (*this->localDistributions)(D3Q27System::ET_0PP, x1, x2, x3) = f[d0PP]; - (*this->localDistributions)(D3Q27System::ET_0MP, x1, x2 + 1, x3) = f[d0MP]; - (*this->localDistributions)(D3Q27System::ET_PPP, x1, x2, x3) = f[dPPP]; - (*this->localDistributions)(D3Q27System::ET_MPP, x1 + 1, x2, x3) = f[dMPP]; - (*this->localDistributions)(D3Q27System::ET_PMP, x1, x2 + 1, x3) = f[dPMP]; - (*this->localDistributions)(D3Q27System::ET_MMP, x1 + 1, x2 + 1, x3) = f[dMMP]; - - (*this->nonLocalDistributions)(D3Q27System::ET_M00, x1 + 1, x2, x3) = f[dM00]; - (*this->nonLocalDistributions)(D3Q27System::ET_0M0, x1, x2 + 1, x3) = f[d0M0]; - (*this->nonLocalDistributions)(D3Q27System::ET_00M, x1, x2, x3 + 1) = f[d00M]; - (*this->nonLocalDistributions)(D3Q27System::ET_MM0, x1 + 1, x2 + 1, x3) = f[dMM0]; - (*this->nonLocalDistributions)(D3Q27System::ET_PM0, x1, x2 + 1, x3) = f[dPM0]; - (*this->nonLocalDistributions)(D3Q27System::ET_M0M, x1 + 1, x2, x3 + 1) = f[dM0M]; - (*this->nonLocalDistributions)(D3Q27System::ET_P0M, x1, x2, x3 + 1) = f[dP0M]; - (*this->nonLocalDistributions)(D3Q27System::ET_0MM, x1, x2 + 1, x3 + 1) = f[d0MM]; - (*this->nonLocalDistributions)(D3Q27System::ET_0PM, x1, x2, x3 + 1) = f[d0PM]; - (*this->nonLocalDistributions)(D3Q27System::ET_MMM, x1 + 1, x2 + 1, x3 + 1) = f[dMMM]; - (*this->nonLocalDistributions)(D3Q27System::ET_PMM, x1, x2 + 1, x3 + 1) = f[dPMM]; - (*this->nonLocalDistributions)(D3Q27System::ET_MPM, x1 + 1, x2, x3 + 1) = f[dMPM]; - (*this->nonLocalDistributions)(D3Q27System::ET_PPM, x1, x2, x3 + 1) = f[dPPM]; - - (*this->zeroDistributions)(x1, x2, x3) = f[d000]; -} -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSplittedVector::setPostCollisionDistributionForDirection(const real *const f, size_t x1, size_t x2, size_t x3, - unsigned long int direction) -{ - using namespace vf::lbm::dir; - - if ((direction & EsoTwistD3Q27System::etE) == EsoTwistD3Q27System::etE) - (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = f[dP00]; - if ((direction & EsoTwistD3Q27System::etW) == EsoTwistD3Q27System::etW) - (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f[dM00]; - if ((direction & EsoTwistD3Q27System::etS) == EsoTwistD3Q27System::etS) - (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f[d0M0]; - if ((direction & EsoTwistD3Q27System::etN) == EsoTwistD3Q27System::etN) - (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = f[d0P0]; - if ((direction & EsoTwistD3Q27System::etB) == EsoTwistD3Q27System::etB) - (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f[d00M]; - if ((direction & EsoTwistD3Q27System::etT) == EsoTwistD3Q27System::etT) - (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = f[d00P]; - if ((direction & EsoTwistD3Q27System::etSW) == EsoTwistD3Q27System::etSW) - (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f[dMM0]; - if ((direction & EsoTwistD3Q27System::etNE) == EsoTwistD3Q27System::etNE) - (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = f[dPP0]; - if ((direction & EsoTwistD3Q27System::etNW) == EsoTwistD3Q27System::etNW) - (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = f[dMP0]; - if ((direction & EsoTwistD3Q27System::etSE) == EsoTwistD3Q27System::etSE) - (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = f[dPM0]; - if ((direction & EsoTwistD3Q27System::etBW) == EsoTwistD3Q27System::etBW) - (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f[dM0M]; - if ((direction & EsoTwistD3Q27System::etTE) == EsoTwistD3Q27System::etTE) - (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = f[dP0P]; - if ((direction & EsoTwistD3Q27System::etTW) == EsoTwistD3Q27System::etTW) - (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = f[dM0P]; - if ((direction & EsoTwistD3Q27System::etBE) == EsoTwistD3Q27System::etBE) - (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = f[dP0M]; - if ((direction & EsoTwistD3Q27System::etBS) == EsoTwistD3Q27System::etBS) - (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f[d0MM]; - if ((direction & EsoTwistD3Q27System::etTN) == EsoTwistD3Q27System::etTN) - (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = f[d0PP]; - if ((direction & EsoTwistD3Q27System::etTS) == EsoTwistD3Q27System::etTS) - (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = f[d0MP]; - if ((direction & EsoTwistD3Q27System::etBN) == EsoTwistD3Q27System::etBN) - (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = f[d0PM]; - if ((direction & EsoTwistD3Q27System::etBSW) == EsoTwistD3Q27System::etBSW) - (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f[dMMM]; - if ((direction & EsoTwistD3Q27System::etTNE) == EsoTwistD3Q27System::etTNE) - (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = f[dPPP]; - if ((direction & EsoTwistD3Q27System::etBSE) == EsoTwistD3Q27System::etBSE) - (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = f[dPMM]; - if ((direction & EsoTwistD3Q27System::etTNW) == EsoTwistD3Q27System::etTNW) - (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = f[dMPP]; - if ((direction & EsoTwistD3Q27System::etBNW) == EsoTwistD3Q27System::etBNW) - (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = f[dMPM]; - if ((direction & EsoTwistD3Q27System::etTSE) == EsoTwistD3Q27System::etTSE) - (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = f[dPMP]; - if ((direction & EsoTwistD3Q27System::etBNE) == EsoTwistD3Q27System::etBNE) - (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = f[dPPM]; - if ((direction & EsoTwistD3Q27System::etTSW) == EsoTwistD3Q27System::etTSW) - (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = f[dMMP]; - if ((direction & EsoTwistD3Q27System::REST) == EsoTwistD3Q27System::REST) - (*this->zeroDistributions)(x1, x2, x3) = f[d000]; -} -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSplittedVector::setPostCollisionDistributionForDirection(real f, size_t x1, size_t x2, size_t x3, - int direction) -{ - using namespace vf::lbm::dir; - - switch (direction) { - case dP00: - (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = f; - break; - case dM00: - (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f; - break; - case d0M0: - (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f; - break; - case d0P0: - (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = f; - break; - case d00M: - (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f; - break; - case d00P: - (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = f; - break; - case dMM0: - (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f; - break; - case dPP0: - (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = f; - break; - case dMP0: - (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = f; - break; - case dPM0: - (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = f; - break; - case dM0M: - (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f; - break; - case dP0P: - (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = f; - break; - case dM0P: - (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = f; - break; - case dP0M: - (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = f; - break; - case d0MM: - (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f; - break; - case d0PP: - (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = f; - break; - case d0MP: - (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = f; - break; - case d0PM: - (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = f; - break; - case dMMM: - (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f; - break; - case dPPP: - (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = f; - break; - case dPMM: - (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = f; - break; - case dMPP: - (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = f; - break; - case dMPM: - (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = f; - break; - case dPMP: - (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = f; - break; - case dPPM: - (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = f; - break; - case dMMP: - (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = f; - break; - case d000: - (*this->zeroDistributions)(x1, x2, x3) = f; - break; - default: - UB_THROW(UbException(UB_EXARGS, "Direction didn't find")); - } -} -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSplittedVector::setPreCollisionDistributionForDirection(const real *const f, size_t x1, size_t x2, - size_t x3, unsigned long int direction) -{ - using namespace vf::lbm::dir; - - if ((direction & EsoTwistD3Q27System::etE) == EsoTwistD3Q27System::etE) - (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f[dP00]; - if ((direction & EsoTwistD3Q27System::etW) == EsoTwistD3Q27System::etW) - (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = f[dM00]; - if ((direction & EsoTwistD3Q27System::etS) == EsoTwistD3Q27System::etS) - (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = f[d0M0]; - if ((direction & EsoTwistD3Q27System::etN) == EsoTwistD3Q27System::etN) - (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f[d0P0]; - if ((direction & EsoTwistD3Q27System::etB) == EsoTwistD3Q27System::etB) - (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = f[d00M]; - if ((direction & EsoTwistD3Q27System::etT) == EsoTwistD3Q27System::etT) - (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f[d00P]; - if ((direction & EsoTwistD3Q27System::etSW) == EsoTwistD3Q27System::etSW) - (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = f[dMM0]; - if ((direction & EsoTwistD3Q27System::etNE) == EsoTwistD3Q27System::etNE) - (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f[dPP0]; - if ((direction & EsoTwistD3Q27System::etNW) == EsoTwistD3Q27System::etNW) - (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = f[dMP0]; - if ((direction & EsoTwistD3Q27System::etSE) == EsoTwistD3Q27System::etSE) - (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = f[dPM0]; - if ((direction & EsoTwistD3Q27System::etBW) == EsoTwistD3Q27System::etBW) - (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = f[dM0M]; - if ((direction & EsoTwistD3Q27System::etTE) == EsoTwistD3Q27System::etTE) - (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f[dP0P]; - if ((direction & EsoTwistD3Q27System::etTW) == EsoTwistD3Q27System::etTW) - (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = f[dM0P]; - if ((direction & EsoTwistD3Q27System::etBE) == EsoTwistD3Q27System::etBE) - (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = f[dP0M]; - if ((direction & EsoTwistD3Q27System::etBS) == EsoTwistD3Q27System::etBS) - (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = f[d0MM]; - if ((direction & EsoTwistD3Q27System::etTN) == EsoTwistD3Q27System::etTN) - (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f[d0PP]; - if ((direction & EsoTwistD3Q27System::etTS) == EsoTwistD3Q27System::etTS) - (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = f[d0MP]; - if ((direction & EsoTwistD3Q27System::etBN) == EsoTwistD3Q27System::etBN) - (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = f[d0PM]; - if ((direction & EsoTwistD3Q27System::etBSW) == EsoTwistD3Q27System::etBSW) - (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = f[dMMM]; - if ((direction & EsoTwistD3Q27System::etTNE) == EsoTwistD3Q27System::etTNE) - (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f[dPPP]; - if ((direction & EsoTwistD3Q27System::etBSE) == EsoTwistD3Q27System::etBSE) - (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = f[dPMM]; - if ((direction & EsoTwistD3Q27System::etTNW) == EsoTwistD3Q27System::etTNW) - (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = f[dMPP]; - if ((direction & EsoTwistD3Q27System::etBNW) == EsoTwistD3Q27System::etBNW) - (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = f[dMPM]; - if ((direction & EsoTwistD3Q27System::etTSE) == EsoTwistD3Q27System::etTSE) - (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = f[dPMP]; - if ((direction & EsoTwistD3Q27System::etBNE) == EsoTwistD3Q27System::etBNE) - (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = f[dPPM]; - if ((direction & EsoTwistD3Q27System::etTSW) == EsoTwistD3Q27System::etTSW) - (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = f[dMMP]; - if ((direction & EsoTwistD3Q27System::REST) == EsoTwistD3Q27System::REST) - (*this->zeroDistributions)(x1, x2, x3) = f[d000]; -} -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSplittedVector::setPreCollisionDistributionForDirection(real f, size_t x1, size_t x2, size_t x3, - unsigned long int direction) -{ - using namespace vf::lbm::dir; - - switch (direction) { - case dP00: - (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f; - break; - case dM00: - (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = f; - break; - case d0M0: - (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = f; - break; - case d0P0: - (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f; - break; - case d00M: - (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = f; - break; - case d00P: - (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f; - break; - case dMM0: - (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = f; - break; - case dPP0: - (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f; - break; - case dMP0: - (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = f; - break; - case dPM0: - (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = f; - break; - case dM0M: - (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = f; - break; - case dP0P: - (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f; - break; - case dM0P: - (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = f; - break; - case dP0M: - (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = f; - break; - case d0MM: - (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = f; - break; - case d0PP: - (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f; - break; - case d0MP: - (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = f; - break; - case d0PM: - (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = f; - break; - case dMMM: - (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = f; - break; - case dPPP: - (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f; - break; - case dPMM: - (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = f; - break; - case dMPP: - (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = f; - break; - case dMPM: - (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = f; - break; - case dPMP: - (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = f; - break; - case dPPM: - (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = f; - break; - case dMMP: - (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = f; - break; - case d000: - (*this->zeroDistributions)(x1, x2, x3) = f; - break; - default: - UB_THROW(UbException(UB_EXARGS, "Direction didn't find")); - } -} -////////////////////////////////////////////////////////////////////////// -real D3Q27EsoTwist3DSplittedVector::getPreCollisionDistributionForDirection(size_t x1, size_t x2, size_t x3, int direction) -{ - using namespace vf::lbm::dir; - - switch (direction) { - case dM00: - return (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3); - case dP00: - return (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); - case d0P0: - return (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); - case d0M0: - return (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3); - case d00P: - return (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); - case d00M: - return (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1); - case dPP0: - return (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); - case dMM0: - return (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); - case dPM0: - return (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); - case dMP0: - return (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); - case dP0P: - return (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); - case dM0M: - return (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); - case dP0M: - return (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); - case dM0P: - return (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); - case d0PP: - return (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); - case d0MM: - return (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); - case d0PM: - return (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); - case d0MP: - return (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); - case dPPP: - return (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); - case dMMM: - return (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); - case dMPP: - return (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); - case dPMM: - return (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); - case dPMP: - return (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); - case dMPM: - return (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); - case dMMP: - return (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); - case dPPM: - return (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); - case d000: - return (*this->zeroDistributions)(x1, x2, x3); - default: - UB_THROW(UbException(UB_EXARGS, "Direction didn't find")); - } -} -////////////////////////////////////////////////////////////////////////// -real D3Q27EsoTwist3DSplittedVector::getPostCollisionDistributionForDirection(size_t x1, size_t x2, size_t x3, int direction) -{ - using namespace vf::lbm::dir; - - switch (direction) { - case dP00: - return (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3); - case dM00: - return (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); - case d0M0: - return (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); - case d0P0: - return (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3); - case d00M: - return (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); - case d00P: - return (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1); - case dMM0: - return (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); - case dPP0: - return (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); - case dMP0: - return (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); - case dPM0: - return (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); - case dM0M: - return (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); - case dP0P: - return (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); - case dM0P: - return (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); - case dP0M: - return (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); - case d0MM: - return (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); - case d0PP: - return (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); - case d0MP: - return (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); - case d0PM: - return (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); - case dMMM: - return (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); - case dPPP: - return (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); - case dPMM: - return (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); - case dMPP: - return (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); - case dMPM: - return (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); - case dPMP: - return (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); - case dPPM: - return (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); - case dMMP: - return (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); - case d000: - return (*this->zeroDistributions)(x1, x2, x3); - default: - UB_THROW(UbException(UB_EXARGS, "Direction didn't find")); - } -} -////////////////////////////////////////////////////////////////////////// -size_t D3Q27EsoTwist3DSplittedVector::getNX1() const { return NX1; } -////////////////////////////////////////////////////////////////////////// -size_t D3Q27EsoTwist3DSplittedVector::getNX2() const { return NX2; } -////////////////////////////////////////////////////////////////////////// -size_t D3Q27EsoTwist3DSplittedVector::getNX3() const { return NX3; } -////////////////////////////////////////////////////////////////////////// -CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr D3Q27EsoTwist3DSplittedVector::getLocalDistributions() -{ - return this->localDistributions; -} -////////////////////////////////////////////////////////////////////////// -CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr D3Q27EsoTwist3DSplittedVector::getNonLocalDistributions() -{ - return this->nonLocalDistributions; -} -////////////////////////////////////////////////////////////////////////// -CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr D3Q27EsoTwist3DSplittedVector::getZeroDistributions() -{ - return this->zeroDistributions; -} -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSplittedVector::setNX1(size_t newNX1) { NX1 = newNX1; } -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSplittedVector::setNX2(size_t newNX2) { NX2 = newNX2; } -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSplittedVector::setNX3(size_t newNX3) { NX3 = newNX3; } -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSplittedVector::setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr array) -{ - localDistributions = array; -} -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSplittedVector::setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr array) -{ - nonLocalDistributions = array; -} -////////////////////////////////////////////////////////////////////////// -void D3Q27EsoTwist3DSplittedVector::setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr array) -{ - zeroDistributions = array; -} - -////////////////////////////////////////////////////////////////////////// diff --git a/src/cpu/core/Data/D3Q27EsoTwist3DSplittedVectorEx.cpp b/src/cpu/core/Data/D3Q27EsoTwist3DSplittedVectorEx.cpp deleted file mode 100644 index 07b0abb6aafd34510eedb2df7829d39239ecb13f..0000000000000000000000000000000000000000 --- a/src/cpu/core/Data/D3Q27EsoTwist3DSplittedVectorEx.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "D3Q27EsoTwist3DSplittedVectorEx.h" - -D3Q27EsoTwist3DSplittedVectorEx::D3Q27EsoTwist3DSplittedVectorEx(int nx1, int nx2, int nx3, real value) -{ - this->NX1 = nx1; - this->NX2 = nx2; - this->NX3 = nx3; - - this->localDistributions = CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( - new CbArray4D<real, IndexerX4X3X2X1>(13, nx1, nx2, nx3, value)); - this->nonLocalDistributions = CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( - new CbArray4D<real, IndexerX4X3X2X1>(13, nx1, nx2, nx3, value)); - - this->zeroDistributions = - CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>(nx1, nx2, nx3, value)); -} diff --git a/src/cpu/core/Data/D3Q27EsoTwist3DSplittedVectorEx.h b/src/cpu/core/Data/D3Q27EsoTwist3DSplittedVectorEx.h deleted file mode 100644 index e5481f4c86c80c4c9d3f6d64c404b8c279268f9b..0000000000000000000000000000000000000000 --- a/src/cpu/core/Data/D3Q27EsoTwist3DSplittedVectorEx.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef D3Q27EsoTwist3DSplittedVectorEx_h -#define D3Q27EsoTwist3DSplittedVectorEx_h - -#include "D3Q27EsoTwist3DSplittedVector.h" - -class D3Q27EsoTwist3DSplittedVectorEx : public D3Q27EsoTwist3DSplittedVector -{ -public: - D3Q27EsoTwist3DSplittedVectorEx(int nx1, int nx2, int nx3, real value); - -protected: -private: -}; - -#endif diff --git a/src/cpu/core/Data/EsoSplit.cpp b/src/cpu/core/Data/EsoSplit.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5c24a6728255b886fc39346c0ebf50496aab2846 --- /dev/null +++ b/src/cpu/core/Data/EsoSplit.cpp @@ -0,0 +1,676 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids 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 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file EsoSplit.cpp +//! \ingroup Data +//! \author Konstantin Kutscher +//======================================================================================= + +#include "EsoSplit.h" + +EsoSplit::EsoSplit() = default; +////////////////////////////////////////////////////////////////////////// +EsoSplit::EsoSplit(size_t nx1, size_t nx2, size_t nx3, real value) +{ + this->NX1 = nx1; + this->NX2 = nx2; + this->NX3 = nx3; + + this->localDistributions = + std::make_shared<CbArray4D<real, IndexerX4X3X2X1>>(13, nx1 + 1, nx2 + 1, nx3 + 1, value); + this->nonLocalDistributions = + std::make_shared<CbArray4D<real, IndexerX4X3X2X1>>(13, nx1 + 1, nx2 + 1, nx3 + 1, value); + + this->zeroDistributions = std::make_shared<CbArray3D<real, IndexerX3X2X1>>(nx1, nx2, nx3, value); +} +////////////////////////////////////////////////////////////////////////// +EsoSplit::~EsoSplit() = default; +////////////////////////////////////////////////////////////////////////// +void EsoSplit::swap() { std::swap(this->localDistributions, this->nonLocalDistributions); } +////////////////////////////////////////////////////////////////////////// +void EsoSplit::getPreCollisionDistribution(real *const f, size_t x1, size_t x2, size_t x3) +{ + using namespace vf::lbm::dir; + + const size_t x1p = x1 + 1; + const size_t x2p = x2 + 1; + const size_t x3p = x3 + 1; + + f[dP00] = (*this->localDistributions)(eP00, x1, x2, x3); + f[d0P0] = (*this->localDistributions)(e0P0, x1, x2, x3); + f[d00P] = (*this->localDistributions)(e00P, x1, x2, x3); + f[dPP0] = (*this->localDistributions)(ePP0, x1, x2, x3); + f[dMP0] = (*this->localDistributions)(eMP0, x1p, x2, x3); + f[dP0P] = (*this->localDistributions)(eP0P, x1, x2, x3); + f[dM0P] = (*this->localDistributions)(eM0P, x1p, x2, x3); + f[d0PP] = (*this->localDistributions)(e0PP, x1, x2, x3); + f[d0MP] = (*this->localDistributions)(e0MP, x1, x2p, x3); + f[dPPP] = (*this->localDistributions)(ePPP, x1, x2, x3); + f[dMPP] = (*this->localDistributions)(eMPP, x1p, x2, x3); + f[dPMP] = (*this->localDistributions)(ePMP, x1, x2p, x3); + f[dMMP] = (*this->localDistributions)(eMMP, x1p, x2p, x3); + + f[dM00] = (*this->nonLocalDistributions)(eM00, x1p, x2, x3); + f[d0M0] = (*this->nonLocalDistributions)(e0M0, x1, x2p, x3); + f[d00M] = (*this->nonLocalDistributions)(e00M, x1, x2, x3p); + f[dMM0] = (*this->nonLocalDistributions)(eMM0, x1p, x2p, x3); + f[dPM0] = (*this->nonLocalDistributions)(ePM0, x1, x2p, x3); + f[dM0M] = (*this->nonLocalDistributions)(eM0M, x1p, x2, x3p); + f[dP0M] = (*this->nonLocalDistributions)(eP0M, x1, x2, x3p); + f[d0MM] = (*this->nonLocalDistributions)(e0MM, x1, x2p, x3p); + f[d0PM] = (*this->nonLocalDistributions)(e0PM, x1, x2, x3p); + f[dMMM] = (*this->nonLocalDistributions)(eMMM, x1p, x2p, x3p); + f[dPMM] = (*this->nonLocalDistributions)(ePMM, x1, x2p, x3p); + f[dMPM] = (*this->nonLocalDistributions)(eMPM, x1p, x2, x3p); + f[dPPM] = (*this->nonLocalDistributions)(ePPM, x1, x2, x3p); + + f[d000] = (*this->zeroDistributions)(x1, x2, x3); +} +////////////////////////////////////////////////////////////////////////// +void EsoSplit::setPostCollisionDistribution(const real *const f, size_t x1, size_t x2, size_t x3) +{ + using namespace vf::lbm::dir; + + (*this->localDistributions)(eP00, x1, x2, x3) = f[iP00]; + (*this->localDistributions)(e0P0, x1, x2, x3) = f[i0P0]; + (*this->localDistributions)(e00P, x1, x2, x3) = f[i00P]; + (*this->localDistributions)(ePP0, x1, x2, x3) = f[iPP0]; + (*this->localDistributions)(eMP0, x1 + 1, x2, x3) = f[iMP0]; + (*this->localDistributions)(eP0P, x1, x2, x3) = f[iP0P]; + (*this->localDistributions)(eM0P, x1 + 1, x2, x3) = f[iM0P]; + (*this->localDistributions)(e0PP, x1, x2, x3) = f[i0PP]; + (*this->localDistributions)(e0MP, x1, x2 + 1, x3) = f[i0MP]; + (*this->localDistributions)(ePPP, x1, x2, x3) = f[iPPP]; + (*this->localDistributions)(eMPP, x1 + 1, x2, x3) = f[iMPP]; + (*this->localDistributions)(ePMP, x1, x2 + 1, x3) = f[iPMP]; + (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3) = f[iMMP]; + + (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3) = f[iM00]; + (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3) = f[i0M0]; + (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1) = f[i00M]; + (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3) = f[iMM0]; + (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3) = f[iPM0]; + (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1) = f[iM0M]; + (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1) = f[iP0M]; + (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1) = f[i0MM]; + (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1) = f[i0PM]; + (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1) = f[iMMM]; + (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1) = f[iPMM]; + (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1) = f[iMPM]; + (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1) = f[iPPM]; + + (*this->zeroDistributions)(x1, x2, x3) = f[d000]; +} +////////////////////////////////////////////////////////////////////////// +void EsoSplit::getPostCollisionDistribution(real *const f, size_t x1, size_t x2, size_t x3) +{ + using namespace vf::lbm::dir; + + f[iP00] = (*this->localDistributions)(eP00, x1, x2, x3); + f[i0P0] = (*this->localDistributions)(e0P0, x1, x2, x3); + f[i00P] = (*this->localDistributions)(e00P, x1, x2, x3); + f[iPP0] = (*this->localDistributions)(ePP0, x1, x2, x3); + f[iMP0] = (*this->localDistributions)(eMP0, x1 + 1, x2, x3); + f[iP0P] = (*this->localDistributions)(eP0P, x1, x2, x3); + f[iM0P] = (*this->localDistributions)(eM0P, x1 + 1, x2, x3); + f[i0PP] = (*this->localDistributions)(e0PP, x1, x2, x3); + f[i0MP] = (*this->localDistributions)(e0MP, x1, x2 + 1, x3); + f[iPPP] = (*this->localDistributions)(ePPP, x1, x2, x3); + f[iMPP] = (*this->localDistributions)(eMPP, x1 + 1, x2, x3); + f[iPMP] = (*this->localDistributions)(ePMP, x1, x2 + 1, x3); + f[iMMP] = (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3); + + f[iM00] = (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3); + f[i0M0] = (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3); + f[i00M] = (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1); + f[iMM0] = (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3); + f[iPM0] = (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3); + f[iM0M] = (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1); + f[iP0M] = (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1); + f[i0MM] = (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1); + f[i0PM] = (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1); + f[iMMM] = (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1); + f[iPMM] = (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1); + f[iMPM] = (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1); + f[iPPM] = (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1); + + f[d000] = (*this->zeroDistributions)(x1, x2, x3); +} +////////////////////////////////////////////////////////////////////////// +void EsoSplit::setPreCollisionDistribution(const real *const f, size_t x1, size_t x2, size_t x3) +{ + using namespace vf::lbm::dir; + + (*this->localDistributions)(eP00, x1, x2, x3) = f[dP00]; + (*this->localDistributions)(e0P0, x1, x2, x3) = f[d0P0]; + (*this->localDistributions)(e00P, x1, x2, x3) = f[d00P]; + (*this->localDistributions)(ePP0, x1, x2, x3) = f[dPP0]; + (*this->localDistributions)(eMP0, x1 + 1, x2, x3) = f[dMP0]; + (*this->localDistributions)(eP0P, x1, x2, x3) = f[dP0P]; + (*this->localDistributions)(eM0P, x1 + 1, x2, x3) = f[dM0P]; + (*this->localDistributions)(e0PP, x1, x2, x3) = f[d0PP]; + (*this->localDistributions)(e0MP, x1, x2 + 1, x3) = f[d0MP]; + (*this->localDistributions)(ePPP, x1, x2, x3) = f[dPPP]; + (*this->localDistributions)(eMPP, x1 + 1, x2, x3) = f[dMPP]; + (*this->localDistributions)(ePMP, x1, x2 + 1, x3) = f[dPMP]; + (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3) = f[dMMP]; + + (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3) = f[dM00]; + (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3) = f[d0M0]; + (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1) = f[d00M]; + (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3) = f[dMM0]; + (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3) = f[dPM0]; + (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1) = f[dM0M]; + (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1) = f[dP0M]; + (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1) = f[d0MM]; + (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1) = f[d0PM]; + (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1) = f[dMMM]; + (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1) = f[dPMM]; + (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1) = f[dMPM]; + (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1) = f[dPPM]; + + (*this->zeroDistributions)(x1, x2, x3) = f[d000]; +} +////////////////////////////////////////////////////////////////////////// +void EsoSplit::setPostCollisionDistributionForDirection(const real *const f, size_t x1, size_t x2, size_t x3, + unsigned long int direction) +{ + using namespace vf::lbm::dir; + + if ((direction & etP00) == etP00) + (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3) = f[dP00]; + if ((direction & etM00) == etM00) + (*this->localDistributions)(eP00, x1, x2, x3) = f[dM00]; + if ((direction & et0M0) == et0M0) + (*this->localDistributions)(e0P0, x1, x2, x3) = f[d0M0]; + if ((direction & et0P0) == et0P0) + (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3) = f[d0P0]; + if ((direction & et00M) == et00M) + (*this->localDistributions)(e00P, x1, x2, x3) = f[d00M]; + if ((direction & et00P) == et00P) + (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1) = f[d00P]; + if ((direction & etMM0) == etMM0) + (*this->localDistributions)(ePP0, x1, x2, x3) = f[dMM0]; + if ((direction & etPP0) == etPP0) + (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3) = f[dPP0]; + if ((direction & etMP0) == etMP0) + (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3) = f[dMP0]; + if ((direction & etPM0) == etPM0) + (*this->localDistributions)(eMP0, x1 + 1, x2, x3) = f[dPM0]; + if ((direction & etM0M) == etM0M) + (*this->localDistributions)(eP0P, x1, x2, x3) = f[dM0M]; + if ((direction & etP0P) == etP0P) + (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1) = f[dP0P]; + if ((direction & etM0P) == etM0P) + (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1) = f[dM0P]; + if ((direction & etP0M) == etP0M) + (*this->localDistributions)(eM0P, x1 + 1, x2, x3) = f[dP0M]; + if ((direction & et0MM) == et0MM) + (*this->localDistributions)(e0PP, x1, x2, x3) = f[d0MM]; + if ((direction & et0PP) == et0PP) + (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1) = f[d0PP]; + if ((direction & et0MP) == et0MP) + (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1) = f[d0MP]; + if ((direction & et0PM) == et0PM) + (*this->localDistributions)(e0MP, x1, x2 + 1, x3) = f[d0PM]; + if ((direction & etMMM) == etMMM) + (*this->localDistributions)(ePPP, x1, x2, x3) = f[dMMM]; + if ((direction & etPPP) == etPPP) + (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1) = f[dPPP]; + if ((direction & etPMM) == etPMM) + (*this->localDistributions)(eMPP, x1 + 1, x2, x3) = f[dPMM]; + if ((direction & etMPP) == etMPP) + (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1) = f[dMPP]; + if ((direction & etMPM) == etMPM) + (*this->localDistributions)(ePMP, x1, x2 + 1, x3) = f[dMPM]; + if ((direction & etPMP) == etPMP) + (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1) = f[dPMP]; + if ((direction & etPPM) == etPPM) + (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3) = f[dPPM]; + if ((direction & etMMP) == etMMP) + (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1) = f[dMMP]; + if ((direction & et000) == et000) + (*this->zeroDistributions)(x1, x2, x3) = f[d000]; +} +////////////////////////////////////////////////////////////////////////// +void EsoSplit::setPostCollisionDistributionForDirection(real f, size_t x1, size_t x2, size_t x3, + int direction) +{ + using namespace vf::lbm::dir; + + switch (direction) { + case dP00: + (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3) = f; + break; + case dM00: + (*this->localDistributions)(eP00, x1, x2, x3) = f; + break; + case d0M0: + (*this->localDistributions)(e0P0, x1, x2, x3) = f; + break; + case d0P0: + (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3) = f; + break; + case d00M: + (*this->localDistributions)(e00P, x1, x2, x3) = f; + break; + case d00P: + (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1) = f; + break; + case dMM0: + (*this->localDistributions)(ePP0, x1, x2, x3) = f; + break; + case dPP0: + (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3) = f; + break; + case dMP0: + (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3) = f; + break; + case dPM0: + (*this->localDistributions)(eMP0, x1 + 1, x2, x3) = f; + break; + case dM0M: + (*this->localDistributions)(eP0P, x1, x2, x3) = f; + break; + case dP0P: + (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1) = f; + break; + case dM0P: + (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1) = f; + break; + case dP0M: + (*this->localDistributions)(eM0P, x1 + 1, x2, x3) = f; + break; + case d0MM: + (*this->localDistributions)(e0PP, x1, x2, x3) = f; + break; + case d0PP: + (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1) = f; + break; + case d0MP: + (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1) = f; + break; + case d0PM: + (*this->localDistributions)(e0MP, x1, x2 + 1, x3) = f; + break; + case dMMM: + (*this->localDistributions)(ePPP, x1, x2, x3) = f; + break; + case dPPP: + (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1) = f; + break; + case dPMM: + (*this->localDistributions)(eMPP, x1 + 1, x2, x3) = f; + break; + case dMPP: + (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1) = f; + break; + case dMPM: + (*this->localDistributions)(ePMP, x1, x2 + 1, x3) = f; + break; + case dPMP: + (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1) = f; + break; + case dPPM: + (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3) = f; + break; + case dMMP: + (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1) = f; + break; + case d000: + (*this->zeroDistributions)(x1, x2, x3) = f; + break; + default: + UB_THROW(UbException(UB_EXARGS, "Direction didn't find")); + } +} +////////////////////////////////////////////////////////////////////////// +void EsoSplit::setPreCollisionDistributionForDirection(const real *const f, size_t x1, size_t x2, + size_t x3, unsigned long int direction) +{ + using namespace vf::lbm::dir; + + if ((direction & etP00) == etP00) + (*this->localDistributions)(eP00, x1, x2, x3) = f[dP00]; + if ((direction & etM00) == etM00) + (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3) = f[dM00]; + if ((direction & et0M0) == et0M0) + (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3) = f[d0M0]; + if ((direction & et0P0) == et0P0) + (*this->localDistributions)(e0P0, x1, x2, x3) = f[d0P0]; + if ((direction & et00M) == et00M) + (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1) = f[d00M]; + if ((direction & et00P) == et00P) + (*this->localDistributions)(e00P, x1, x2, x3) = f[d00P]; + if ((direction & etMM0) == etMM0) + (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3) = f[dMM0]; + if ((direction & etPP0) == etPP0) + (*this->localDistributions)(ePP0, x1, x2, x3) = f[dPP0]; + if ((direction & etMP0) == etMP0) + (*this->localDistributions)(eMP0, x1 + 1, x2, x3) = f[dMP0]; + if ((direction & etPM0) == etPM0) + (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3) = f[dPM0]; + if ((direction & etM0M) == etM0M) + (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1) = f[dM0M]; + if ((direction & etP0P) == etP0P) + (*this->localDistributions)(eP0P, x1, x2, x3) = f[dP0P]; + if ((direction & etM0P) == etM0P) + (*this->localDistributions)(eM0P, x1 + 1, x2, x3) = f[dM0P]; + if ((direction & etP0M) == etP0M) + (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1) = f[dP0M]; + if ((direction & et0MM) == et0MM) + (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1) = f[d0MM]; + if ((direction & et0PP) == et0PP) + (*this->localDistributions)(e0PP, x1, x2, x3) = f[d0PP]; + if ((direction & et0MP) == et0MP) + (*this->localDistributions)(e0MP, x1, x2 + 1, x3) = f[d0MP]; + if ((direction & et0PM) == et0PM) + (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1) = f[d0PM]; + if ((direction & etMMM) == etMMM) + (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1) = f[dMMM]; + if ((direction & etPPP) == etPPP) + (*this->localDistributions)(ePPP, x1, x2, x3) = f[dPPP]; + if ((direction & etPMM) == etPMM) + (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1) = f[dPMM]; + if ((direction & etMPP) == etMPP) + (*this->localDistributions)(eMPP, x1 + 1, x2, x3) = f[dMPP]; + if ((direction & etMPM) == etMPM) + (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1) = f[dMPM]; + if ((direction & etPMP) == etPMP) + (*this->localDistributions)(ePMP, x1, x2 + 1, x3) = f[dPMP]; + if ((direction & etPPM) == etPPM) + (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1) = f[dPPM]; + if ((direction & etMMP) == etMMP) + (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3) = f[dMMP]; + if ((direction & et000) == et000) + (*this->zeroDistributions)(x1, x2, x3) = f[d000]; +} +////////////////////////////////////////////////////////////////////////// +void EsoSplit::setPreCollisionDistributionForDirection(real f, size_t x1, size_t x2, size_t x3, + unsigned long int direction) +{ + using namespace vf::lbm::dir; + + switch (direction) { + case dP00: + (*this->localDistributions)(eP00, x1, x2, x3) = f; + break; + case dM00: + (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3) = f; + break; + case d0M0: + (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3) = f; + break; + case d0P0: + (*this->localDistributions)(e0P0, x1, x2, x3) = f; + break; + case d00M: + (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1) = f; + break; + case d00P: + (*this->localDistributions)(e00P, x1, x2, x3) = f; + break; + case dMM0: + (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3) = f; + break; + case dPP0: + (*this->localDistributions)(ePP0, x1, x2, x3) = f; + break; + case dMP0: + (*this->localDistributions)(eMP0, x1 + 1, x2, x3) = f; + break; + case dPM0: + (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3) = f; + break; + case dM0M: + (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1) = f; + break; + case dP0P: + (*this->localDistributions)(eP0P, x1, x2, x3) = f; + break; + case dM0P: + (*this->localDistributions)(eM0P, x1 + 1, x2, x3) = f; + break; + case dP0M: + (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1) = f; + break; + case d0MM: + (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1) = f; + break; + case d0PP: + (*this->localDistributions)(e0PP, x1, x2, x3) = f; + break; + case d0MP: + (*this->localDistributions)(e0MP, x1, x2 + 1, x3) = f; + break; + case d0PM: + (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1) = f; + break; + case dMMM: + (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1) = f; + break; + case dPPP: + (*this->localDistributions)(ePPP, x1, x2, x3) = f; + break; + case dPMM: + (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1) = f; + break; + case dMPP: + (*this->localDistributions)(eMPP, x1 + 1, x2, x3) = f; + break; + case dMPM: + (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1) = f; + break; + case dPMP: + (*this->localDistributions)(ePMP, x1, x2 + 1, x3) = f; + break; + case dPPM: + (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1) = f; + break; + case dMMP: + (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3) = f; + break; + case d000: + (*this->zeroDistributions)(x1, x2, x3) = f; + break; + default: + UB_THROW(UbException(UB_EXARGS, "Direction didn't find")); + } +} +////////////////////////////////////////////////////////////////////////// +real EsoSplit::getPreCollisionDistributionForDirection(size_t x1, size_t x2, size_t x3, int direction) +{ + using namespace vf::lbm::dir; + + switch (direction) { + case dM00: + return (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3); + case dP00: + return (*this->localDistributions)(eP00, x1, x2, x3); + case d0P0: + return (*this->localDistributions)(e0P0, x1, x2, x3); + case d0M0: + return (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3); + case d00P: + return (*this->localDistributions)(e00P, x1, x2, x3); + case d00M: + return (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1); + case dPP0: + return (*this->localDistributions)(ePP0, x1, x2, x3); + case dMM0: + return (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3); + case dPM0: + return (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3); + case dMP0: + return (*this->localDistributions)(eMP0, x1 + 1, x2, x3); + case dP0P: + return (*this->localDistributions)(eP0P, x1, x2, x3); + case dM0M: + return (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1); + case dP0M: + return (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1); + case dM0P: + return (*this->localDistributions)(eM0P, x1 + 1, x2, x3); + case d0PP: + return (*this->localDistributions)(e0PP, x1, x2, x3); + case d0MM: + return (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1); + case d0PM: + return (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1); + case d0MP: + return (*this->localDistributions)(e0MP, x1, x2 + 1, x3); + case dPPP: + return (*this->localDistributions)(ePPP, x1, x2, x3); + case dMMM: + return (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1); + case dMPP: + return (*this->localDistributions)(eMPP, x1 + 1, x2, x3); + case dPMM: + return (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1); + case dPMP: + return (*this->localDistributions)(ePMP, x1, x2 + 1, x3); + case dMPM: + return (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1); + case dMMP: + return (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3); + case dPPM: + return (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1); + case d000: + return (*this->zeroDistributions)(x1, x2, x3); + default: + UB_THROW(UbException(UB_EXARGS, "Direction didn't find")); + } +} +////////////////////////////////////////////////////////////////////////// +real EsoSplit::getPostCollisionDistributionForDirection(size_t x1, size_t x2, size_t x3, int direction) +{ + using namespace vf::lbm::dir; + + switch (direction) { + case dP00: + return (*this->nonLocalDistributions)(eM00, x1 + 1, x2, x3); + case dM00: + return (*this->localDistributions)(eP00, x1, x2, x3); + case d0M0: + return (*this->localDistributions)(e0P0, x1, x2, x3); + case d0P0: + return (*this->nonLocalDistributions)(e0M0, x1, x2 + 1, x3); + case d00M: + return (*this->localDistributions)(e00P, x1, x2, x3); + case d00P: + return (*this->nonLocalDistributions)(e00M, x1, x2, x3 + 1); + case dMM0: + return (*this->localDistributions)(ePP0, x1, x2, x3); + case dPP0: + return (*this->nonLocalDistributions)(eMM0, x1 + 1, x2 + 1, x3); + case dMP0: + return (*this->nonLocalDistributions)(ePM0, x1, x2 + 1, x3); + case dPM0: + return (*this->localDistributions)(eMP0, x1 + 1, x2, x3); + case dM0M: + return (*this->localDistributions)(eP0P, x1, x2, x3); + case dP0P: + return (*this->nonLocalDistributions)(eM0M, x1 + 1, x2, x3 + 1); + case dM0P: + return (*this->nonLocalDistributions)(eP0M, x1, x2, x3 + 1); + case dP0M: + return (*this->localDistributions)(eM0P, x1 + 1, x2, x3); + case d0MM: + return (*this->localDistributions)(e0PP, x1, x2, x3); + case d0PP: + return (*this->nonLocalDistributions)(e0MM, x1, x2 + 1, x3 + 1); + case d0MP: + return (*this->nonLocalDistributions)(e0PM, x1, x2, x3 + 1); + case d0PM: + return (*this->localDistributions)(e0MP, x1, x2 + 1, x3); + case dMMM: + return (*this->localDistributions)(ePPP, x1, x2, x3); + case dPPP: + return (*this->nonLocalDistributions)(eMMM, x1 + 1, x2 + 1, x3 + 1); + case dPMM: + return (*this->localDistributions)(eMPP, x1 + 1, x2, x3); + case dMPP: + return (*this->nonLocalDistributions)(ePMM, x1, x2 + 1, x3 + 1); + case dMPM: + return (*this->localDistributions)(ePMP, x1, x2 + 1, x3); + case dPMP: + return (*this->nonLocalDistributions)(eMPM, x1 + 1, x2, x3 + 1); + case dPPM: + return (*this->localDistributions)(eMMP, x1 + 1, x2 + 1, x3); + case dMMP: + return (*this->nonLocalDistributions)(ePPM, x1, x2, x3 + 1); + case d000: + return (*this->zeroDistributions)(x1, x2, x3); + default: + UB_THROW(UbException(UB_EXARGS, "Direction didn't find")); + } +} +////////////////////////////////////////////////////////////////////////// +size_t EsoSplit::getNX1() const { return NX1; } +////////////////////////////////////////////////////////////////////////// +size_t EsoSplit::getNX2() const { return NX2; } +////////////////////////////////////////////////////////////////////////// +size_t EsoSplit::getNX3() const { return NX3; } +////////////////////////////////////////////////////////////////////////// +CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr EsoSplit::getLocalDistributions() +{ + return this->localDistributions; +} +////////////////////////////////////////////////////////////////////////// +CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr EsoSplit::getNonLocalDistributions() +{ + return this->nonLocalDistributions; +} +////////////////////////////////////////////////////////////////////////// +CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr EsoSplit::getZeroDistributions() +{ + return this->zeroDistributions; +} +////////////////////////////////////////////////////////////////////////// +void EsoSplit::setNX1(size_t newNX1) { NX1 = newNX1; } +////////////////////////////////////////////////////////////////////////// +void EsoSplit::setNX2(size_t newNX2) { NX2 = newNX2; } +////////////////////////////////////////////////////////////////////////// +void EsoSplit::setNX3(size_t newNX3) { NX3 = newNX3; } +////////////////////////////////////////////////////////////////////////// +void EsoSplit::setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr array) +{ + localDistributions = array; +} +////////////////////////////////////////////////////////////////////////// +void EsoSplit::setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr array) +{ + nonLocalDistributions = array; +} +////////////////////////////////////////////////////////////////////////// +void EsoSplit::setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr array) +{ + zeroDistributions = array; +} + +////////////////////////////////////////////////////////////////////////// diff --git a/src/cpu/core/Data/D3Q27EsoTwist3DSplittedVector.h b/src/cpu/core/Data/EsoSplit.h similarity index 93% rename from src/cpu/core/Data/D3Q27EsoTwist3DSplittedVector.h rename to src/cpu/core/Data/EsoSplit.h index c05b8c01d4a85cfaccac2531badda017d5e607d2..a87f629652a4b9cf8afba7e56dd70eef538c7c60 100644 --- a/src/cpu/core/Data/D3Q27EsoTwist3DSplittedVector.h +++ b/src/cpu/core/Data/EsoSplit.h @@ -26,13 +26,13 @@ // You should have received a copy of the GNU General Public License along // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // -//! \file D3Q27EsoTwist3DSplittedVector.h +//! \file EsoSplit.h //! \ingroup Data //! \author Konstantin Kutscher //======================================================================================= -#ifndef D3Q27EsoTwist3DSplittedVector_h -#define D3Q27EsoTwist3DSplittedVector_h +#ifndef EsoSplit_h +#define EsoSplit_h #include "D3Q27System.h" #include "EsoTwist3D.h" @@ -40,18 +40,18 @@ #include "basics/container/CbArray4D.h" //! \brief Class implements EsoTwist3D -//! \details D3Q27EsoTwist3DSplittedVector uses three vectors to implement Esoteric Twist method -class D3Q27EsoTwist3DSplittedVector : public EsoTwist3D +//! \details EsoSplit uses three vectors to implement Esoteric Twist method +class EsoSplit : public EsoTwist3D { public: - D3Q27EsoTwist3DSplittedVector(); + EsoSplit(); //! \param nx1 number of nodes in x1 direction //! \param nx2 number of nodes in x2 direction //! \param nx3 number of nodes in x3 direction //! \param value initialisation value - D3Q27EsoTwist3DSplittedVector(size_t nx1, size_t nx2, size_t nx3, real value); + EsoSplit(size_t nx1, size_t nx2, size_t nx3, real value); ////////////////////////////////////////////////////////////////////////// - ~D3Q27EsoTwist3DSplittedVector() override; + ~EsoSplit() override; ////////////////////////////////////////////////////////////////////////// void swap() override; ////////////////////////////////////////////////////////////////////////// diff --git a/src/cpu/core/Data/EsoTwistD3Q27System.cpp b/src/cpu/core/Data/EsoTwistD3Q27System.cpp deleted file mode 100644 index 8f249ceeca6e0270a4396e6100fc1a7d0af0c3c6..0000000000000000000000000000000000000000 --- a/src/cpu/core/Data/EsoTwistD3Q27System.cpp +++ /dev/null @@ -1,87 +0,0 @@ -//======================================================================================= -// ____ ____ __ ______ __________ __ __ __ __ -// \ \ | | | | | _ \ |___ ___| | | | | / \ | | -// \ \ | | | | | |_) | | | | | | | / \ | | -// \ \ | | | | | _ / | | | | | | / /\ \ | | -// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ -// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| -// \ \ | | ________________________________________________________________ -// \ \ | | | ______________________________________________________________| -// \ \| | | | __ __ __ __ ______ _______ -// \ | | |_____ | | | | | | | | | _ \ / _____) -// \ | | _____| | | | | | | | | | | \ \ \_______ -// \ | | | | |_____ | \_/ | | | | |_/ / _____ | -// \ _____| |__| |________| \_______/ |__| |______/ (_______/ -// -// This file is part of VirtualFluids. VirtualFluids 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 3 of -// the License, or (at your option) any later version. -// -// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. -// -//! \file EsoTwistD3Q27System.cpp -//! \ingroup Data -//! \author Konstantin Kutscher -//======================================================================================= - -#include "EsoTwistD3Q27System.h" - -// index 0 1 2 3 4 5 6 7 8 9 10 11 12 -// 13 14 15 16 17 18 19 20 21 22 23 24 25 26 f: E, W, N, S, T, B, NE, SW, SE, NW, TE, BW, BE, TW, TN, -// BS, BN, TS, TNE TNW TSE TSW BNE BNW BSE BSW REST -const int EsoTwistD3Q27System::ETX1[EsoTwistD3Q27System::ENDF + 1] = { 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, - 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0 }; -const int EsoTwistD3Q27System::ETX2[EsoTwistD3Q27System::ENDF + 1] = { 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, - 0, 1, -1, 0, 0, -1, 0, 1, 0, -1, 0, 1, 0 }; -const int EsoTwistD3Q27System::ETX3[EsoTwistD3Q27System::ENDF + 1] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, -1, - 0, 1, 1, 0, 0, -1, 0, -1, 0, 1, 0, 1, 0 }; - -const int EsoTwistD3Q27System::etINVDIR[EsoTwistD3Q27System::ENDF + 1] = { - - vf::lbm::dir::iP00, vf::lbm::dir::iM00, vf::lbm::dir::i0P0, vf::lbm::dir::i0M0, vf::lbm::dir::i00P, - vf::lbm::dir::i00M, vf::lbm::dir::iPP0, vf::lbm::dir::iMM0, vf::lbm::dir::iPM0, vf::lbm::dir::iMP0, - vf::lbm::dir::iP0P, vf::lbm::dir::iM0M, vf::lbm::dir::iP0M, vf::lbm::dir::iM0P, vf::lbm::dir::i0PP, - vf::lbm::dir::i0MM, vf::lbm::dir::i0PM, vf::lbm::dir::i0MP, vf::lbm::dir::iPPP, vf::lbm::dir::iMPP, - vf::lbm::dir::iPMP, vf::lbm::dir::iMMP, vf::lbm::dir::iPPM, vf::lbm::dir::iMPM, vf::lbm::dir::iPMM, - vf::lbm::dir::iMMM, vf::lbm::dir::d000 -}; - -const unsigned long int EsoTwistD3Q27System::etDIR[EsoTwistD3Q27System::ENDF + 1] = { - etE, etW, etN, etS, etT, etB, etNE, etSW, etSE, etNW, etTE, etBW, etBE, etTW, - etTN, etBS, etBN, etTS, etTNE, etTNW, etTSE, etTSW, etBNE, etBNW, etBSE, etBSW, etZERO -}; - -const unsigned long int EsoTwistD3Q27System::etZERO = 1; /*f0 */ -const unsigned long int EsoTwistD3Q27System::etE = 2; /*f1 */ -const unsigned long int EsoTwistD3Q27System::etW = 4; /*f2 */ -const unsigned long int EsoTwistD3Q27System::etN = 8; /*f3 */ -const unsigned long int EsoTwistD3Q27System::etS = 16; /*f4 */ -const unsigned long int EsoTwistD3Q27System::etT = 32; /*f5 */ -const unsigned long int EsoTwistD3Q27System::etB = 64; /*f6 */ -const unsigned long int EsoTwistD3Q27System::etNE = 128; /*f7 */ -const unsigned long int EsoTwistD3Q27System::etSW = 256; /*f8 */ -const unsigned long int EsoTwistD3Q27System::etSE = 512; /*f9 */ -const unsigned long int EsoTwistD3Q27System::etNW = 1024; /*f10*/ -const unsigned long int EsoTwistD3Q27System::etTE = 2048; /*f11*/ -const unsigned long int EsoTwistD3Q27System::etBW = 4096; /*f12*/ -const unsigned long int EsoTwistD3Q27System::etBE = 8192; /*f13*/ -const unsigned long int EsoTwistD3Q27System::etTW = 16384; /*f14*/ -const unsigned long int EsoTwistD3Q27System::etTN = 32768; /*f15*/ -const unsigned long int EsoTwistD3Q27System::etBS = 65536; /*f16*/ -const unsigned long int EsoTwistD3Q27System::etBN = 131072; /*f17*/ -const unsigned long int EsoTwistD3Q27System::etTS = 262144; /*f18*/ -const unsigned long int EsoTwistD3Q27System::etTNE = 524288; -const unsigned long int EsoTwistD3Q27System::etTNW = 1048576; -const unsigned long int EsoTwistD3Q27System::etTSE = 2097152; -const unsigned long int EsoTwistD3Q27System::etTSW = 4194304; -const unsigned long int EsoTwistD3Q27System::etBNE = 8388608; -const unsigned long int EsoTwistD3Q27System::etBNW = 16777216; -const unsigned long int EsoTwistD3Q27System::etBSE = 33554432; -const unsigned long int EsoTwistD3Q27System::etBSW = 67108864; diff --git a/src/cpu/core/Data/EsoTwistD3Q27System.h b/src/cpu/core/Data/EsoTwistD3Q27System.h deleted file mode 100644 index 77db3dd1dc2d8406e0f0777ced845c8df54fca1a..0000000000000000000000000000000000000000 --- a/src/cpu/core/Data/EsoTwistD3Q27System.h +++ /dev/null @@ -1,140 +0,0 @@ -//======================================================================================= -// ____ ____ __ ______ __________ __ __ __ __ -// \ \ | | | | | _ \ |___ ___| | | | | / \ | | -// \ \ | | | | | |_) | | | | | | | / \ | | -// \ \ | | | | | _ / | | | | | | / /\ \ | | -// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ -// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| -// \ \ | | ________________________________________________________________ -// \ \ | | | ______________________________________________________________| -// \ \| | | | __ __ __ __ ______ _______ -// \ | | |_____ | | | | | | | | | _ \ / _____) -// \ | | _____| | | | | | | | | | | \ \ \_______ -// \ | | | | |_____ | \_/ | | | | |_/ / _____ | -// \ _____| |__| |________| \_______/ |__| |______/ (_______/ -// -// This file is part of VirtualFluids. VirtualFluids 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 3 of -// the License, or (at your option) any later version. -// -// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. -// -//! \file EsoTwistD3Q27System.h -//! \ingroup Data -//! \author Konstantin Kutscher -//======================================================================================= - -#ifndef ESOTWISTD3Q27SYSTEM_H -#define ESOTWISTD3Q27SYSTEM_H - -#include "D3Q27System.h" - -//! -struct EsoTwistD3Q27System { - const static int FSTARTDIR = D3Q27System::FSTARTDIR; - const static int FENDDIR = D3Q27System::FENDDIR; // gellerstyle: meint alle frichtungen OHNE f0 - - const static int STARTF = D3Q27System::STARTF; - const static int ENDF = D3Q27System::ENDF; - - // const static int STARTDIR = D3Q27System::STARTDIR; - const static int ENDDIR = D3Q27System::ENDDIR; - - static const int REST = vf::lbm::dir::d000; /*f0 */ - static const int E = vf::lbm::dir::dP00; /*f1 */ - static const int W = vf::lbm::dir::dM00; /*f2 */ - static const int N = vf::lbm::dir::d0P0; /*f3 */ - static const int S = vf::lbm::dir::d0M0; /*f4 */ - static const int T = vf::lbm::dir::d00P; /*f5 */ - static const int B = vf::lbm::dir::d00M; /*f6 */ - static const int NE = vf::lbm::dir::dPP0; /*f7 */ - static const int SW = vf::lbm::dir::dMM0; /*f8 */ - static const int SE = vf::lbm::dir::dPM0; /*f9 */ - static const int NW = vf::lbm::dir::dMP0; /*f10*/ - static const int TE = vf::lbm::dir::dP0P; /*f11*/ - static const int BW = vf::lbm::dir::dM0M; /*f12*/ - static const int BE = vf::lbm::dir::dP0M; /*f13*/ - static const int TW = vf::lbm::dir::dM0P; /*f14*/ - static const int TN = vf::lbm::dir::d0PP; /*f15*/ - static const int BS = vf::lbm::dir::d0MM; /*f16*/ - static const int BN = vf::lbm::dir::d0PM; /*f17*/ - static const int TS = vf::lbm::dir::d0MP; /*f18*/ - static const int TNE = vf::lbm::dir::dPPP; - static const int TNW = vf::lbm::dir::dMPP; - static const int TSE = vf::lbm::dir::dPMP; - static const int TSW = vf::lbm::dir::dMMP; - static const int BNE = vf::lbm::dir::dPPM; - static const int BNW = vf::lbm::dir::dMPM; - static const int BSE = vf::lbm::dir::dPMM; - static const int BSW = vf::lbm::dir::dMMM; - - static const int INV_E = vf::lbm::dir::dM00; - static const int INV_W = vf::lbm::dir::dP00; - static const int INV_N = vf::lbm::dir::d0M0; - static const int INV_S = vf::lbm::dir::d0P0; - static const int INV_T = vf::lbm::dir::d00M; - static const int INV_B = vf::lbm::dir::d00P; - static const int INV_NE = vf::lbm::dir::dMM0; - static const int INV_SW = vf::lbm::dir::dPP0; - static const int INV_SE = vf::lbm::dir::dMP0; - static const int INV_NW = vf::lbm::dir::dPM0; - static const int INV_TE = vf::lbm::dir::dM0M; - static const int INV_BW = vf::lbm::dir::dP0P; - static const int INV_BE = vf::lbm::dir::dM0P; - static const int INV_TW = vf::lbm::dir::dP0M; - static const int INV_TN = vf::lbm::dir::d0MM; - static const int INV_BS = vf::lbm::dir::d0PP; - static const int INV_BN = vf::lbm::dir::d0MP; - static const int INV_TS = vf::lbm::dir::d0PM; - static const int INV_TNE = vf::lbm::dir::dMMM; - static const int INV_TNW = vf::lbm::dir::dPMM; - static const int INV_TSE = vf::lbm::dir::dMPM; - static const int INV_TSW = vf::lbm::dir::dPPM; - static const int INV_BNE = vf::lbm::dir::dMMP; - static const int INV_BNW = vf::lbm::dir::dPMP; - static const int INV_BSE = vf::lbm::dir::dMPP; - static const int INV_BSW = vf::lbm::dir::dPPP; - - static const unsigned long int etZERO; // 1;/*f0 */ - static const unsigned long int etE; // 2; /*f1 */ - static const unsigned long int etW; // 4; /*f2 */ - static const unsigned long int etN; // 8; /*f3 */ - static const unsigned long int etS; // 16; /*f4 */ - static const unsigned long int etT; // 32; /*f5 */ - static const unsigned long int etB; // 64; /*f6 */ - static const unsigned long int etNE; // 128; /*f7 */ - static const unsigned long int etSW; // 256; /*f8 */ - static const unsigned long int etSE; // 512; /*f9 */ - static const unsigned long int etNW; // 1024; /*f10*/ - static const unsigned long int etTE; // 2048; /*f11*/ - static const unsigned long int etBW; // 4096; /*f12*/ - static const unsigned long int etBE; // 8192; /*f13*/ - static const unsigned long int etTW; // 16384; /*f14*/ - static const unsigned long int etTN; // 32768; /*f15*/ - static const unsigned long int etBS; // 65536; /*f16*/ - static const unsigned long int etBN; // 131072; /*f17*/ - static const unsigned long int etTS; // 262144; /*f18*/ - static const unsigned long int etTNE; // 524288; - static const unsigned long int etTNW; // 1048576; - static const unsigned long int etTSE; // 2097152; - static const unsigned long int etTSW; // 4194304; - static const unsigned long int etBNE; // 8388608; - static const unsigned long int etBNW; // 16777216; - static const unsigned long int etBSE; // 33554432; - static const unsigned long int etBSW; // = 67108864; - - const static int ETX1[ENDF + 1]; - const static int ETX2[ENDF + 1]; - const static int ETX3[ENDF + 1]; - const static int etINVDIR[ENDF + 1]; - const static unsigned long int etDIR[ENDF + 1]; -}; - -#endif diff --git a/src/cpu/core/Data/VoidData3D.h b/src/cpu/core/Data/VoidData3D.h deleted file mode 100644 index 797056dd152c921698f1e58746282add163c8b0c..0000000000000000000000000000000000000000 --- a/src/cpu/core/Data/VoidData3D.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef VoidData3D_H -#define VoidData3D_H - -#include "EsoTwist3D.h" - -class VoidData3D : public EsoTwist3D -{ -public: - VoidData3D() = default; - - VoidData3D(size_t nx1, size_t nx2, size_t nx3, real /*value*/) - { - this->NX1 = nx1; - this->NX2 = nx2; - this->NX3 = nx3; - } - ~VoidData3D() override = default; - - size_t getNX1() const override { return NX1; } - size_t getNX2() const override { return NX2; } - size_t getNX3() const override { return NX3; } - void getPreCollisionDistribution(real *const f, size_t x1, size_t x2, size_t x3) override {} - void setPostCollisionDistribution(const real *const f, size_t x1, size_t x2, size_t x3) override {} - void getPostCollisionDistribution(real *const f, size_t x1, size_t x2, size_t x3) override {} - void setPreCollisionDistribution(const real *const f, size_t x1, size_t x2, size_t x3) override {} - void setPostCollisionDistributionForDirection(const real *const f, size_t x1, size_t x2, size_t x3, - unsigned long int direction) override - { - } - void setPostCollisionDistributionForDirection(real f, size_t x1, size_t x2, size_t x3, int direction) override {} - real getPostCollisionDistributionForDirection(size_t /*x1*/, size_t /*x2*/, size_t /*x3*/, int /*direction*/) override - { - return 0.0; - } - void setPreCollisionDistributionForDirection(const real *const f, size_t x1, size_t x2, size_t x3, - unsigned long int direction) override - { - } - void setPreCollisionDistributionForDirection(real f, size_t x1, size_t x2, size_t x3, - unsigned long int direction) override - { - } - real getPreCollisionDistributionForDirection(size_t /*x1*/, size_t /*x2*/, size_t /*x3*/, int /*direction*/) override - { - return 0.0; - } - void swap() override {} - -protected: -private: - size_t NX1, NX2, NX3; -}; - -#endif diff --git a/src/cpu/core/Interactors/D3Q27TriFaceMeshInteractor.cpp b/src/cpu/core/Interactors/D3Q27TriFaceMeshInteractor.cpp index d4dc0b3499f5dd936ead549c463e980cab88f4cc..a503b573cc55480c1d67597692bc2e8e78c0b989 100644 --- a/src/cpu/core/Interactors/D3Q27TriFaceMeshInteractor.cpp +++ b/src/cpu/core/Interactors/D3Q27TriFaceMeshInteractor.cpp @@ -2,11 +2,13 @@ #include <basics/utilities/UbLogger.h> #include <basics/utilities/UbMath.h> -#include "basics/writer/WbWriterVtkXmlASCII.h" +#include <basics/writer/WbWriterVtkXmlASCII.h> #include <basics/writer/WbWriterVtkASCII.h> #include <basics/writer/WbWriterVtkBinary.h> #include <basics/writer/WbWriterVtkXmlBinary.h> +#include <basics/Timer/Timer.h> + #include "BCArray3D.h" #include "BCSet.h" #include "Block3D.h" @@ -14,7 +16,6 @@ #include "Grid3D.h" #include "LBMKernel.h" #include "VelocityBC.h" -#include "basics/utilities/UbTiming.h" #include <geometry3d/GbCuboid3D.h> #include <geometry3d/GbHalfSpace3D.h> #include <geometry3d/GbMeshTools3D.h> @@ -241,7 +242,7 @@ void D3Q27TriFaceMeshInteractor::setQs(const real &timeStep) int onePercent = UbMath::integerRounding(triangles.size() * c1o100); if (onePercent == 0) onePercent = 1; - UbTimer setQTimer; + vf::basics::Timer setQTimer; setQTimer.start(); UBLOG(logDEBUG3, " - setQs for " << (int)triangles.size() << " triangles"); @@ -746,7 +747,7 @@ void D3Q27TriFaceMeshInteractor::initInteractor2(const real &timeStep) int onePercent = UbMath::integerRounding(triangles.size() * c1o100); if (onePercent == 0) onePercent = 1; - UbTimer setQTimer; + vf::basics::Timer setQTimer; setQTimer.start(); UBLOG(logDEBUG3, " - setQs for " << (int)triangles.size() << " triangles"); @@ -1106,10 +1107,10 @@ void D3Q27TriFaceMeshInteractor::initInteractor2(const real &timeStep) boundingCubeTriangle.finalize(); } } - setQTimer.stop(); + setQTimer.end(); UBLOG(logDEBUG1, " - setQs for " /*<< this->getName()*/ << " - " << (int)triangles.size() - << " triangles: 100% done in " << setQTimer.getTotalTime() + << " triangles: 100% done in " << setQTimer.getTimeInSeconds() << "sec"); UBLOG(logDEBUG1, " * rejected blocks with tribox overlap test : " << counterTriBoxOverlap); UBLOG(logDEBUG1, " * rejected nodes with AABB test : " << counterAABBTriFace); @@ -1135,8 +1136,8 @@ void D3Q27TriFaceMeshInteractor::initInteractor2(const real &timeStep) UBLOG(logDEBUG1, " - setSolids for " << blocksForSolidCheck.size() << " blocks"); - UbTimer scanLineTimer; - UbTimer solidTimer; + vf::basics::Timer scanLineTimer; + vf::basics::Timer solidTimer; solidTimer.start(); for (BlockSolidCheckMethodIterator pos = blocksForSolidCheck.begin(); pos != blocksForSolidCheck.end(); ++pos) { @@ -1244,24 +1245,24 @@ void D3Q27TriFaceMeshInteractor::initInteractor2(const real &timeStep) // block hat in initInteractor mind eine BC erhalten -> transBlock this->bcBlocks.push_back(block); - scanLineTimer.stop(); + scanLineTimer.end(); // bvd->getTimer().stop(); } else throw UbException(UB_EXARGS, "unknown option for in object test"); } - solidTimer.stop(); + solidTimer.end(); UBLOG(logDEBUG1, " - setSolids for " << blocksForSolidCheck.size() << " blocks: 100% done in " - << solidTimer.getTotalTime() << "s"); + << solidTimer.getTimeInSeconds() << "s"); UBLOG(logDEBUG1, " * pointInObject for " << pointInObjectCounter << " blocks in " - << solidTimer.getTotalTime() - scanLineTimer.getTotalTime() + << solidTimer.getTimeInSeconds() - scanLineTimer.getTimeInSeconds() << "s"); UBLOG(logDEBUG1, " * flood fill for " << scanlineCounter << " blocks in " - << scanLineTimer.getTotalTime() << " secs"); + << scanLineTimer.getTimeInSeconds() << " secs"); UBLOG(logDEBUG1, "LBMTriFaceMeshInteractor::initInteractor for \"" - << mesh->getName() << "\" done in " << setQTimer.getTotalTime() + solidTimer.getTotalTime() + << mesh->getName() << "\" done in " << setQTimer.getTimeInSeconds() + solidTimer.getTimeInSeconds() << "s"); } diff --git a/src/cpu/core/LBM/B92IncompressibleNavierStokes.cpp b/src/cpu/core/LBM/B92IncompressibleNavierStokes.cpp index 755d97ca1373380bab9a1c206850df87fcf673b8..a06a9a15d7e580d16d9be4763d09fad594bd56b3 100644 --- a/src/cpu/core/LBM/B92IncompressibleNavierStokes.cpp +++ b/src/cpu/core/LBM/B92IncompressibleNavierStokes.cpp @@ -1,8 +1,7 @@ #include "B92IncompressibleNavierStokes.h" #include "BCArray3D.h" #include "BCSet.h" -#include "D3Q27EsoTwist3DSoA.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "D3Q27System.h" #include "DataSet3D.h" #include "Block3D.h" @@ -17,7 +16,7 @@ B92IncompressibleNavierStokes::~B92IncompressibleNavierStokes(void) = default; ////////////////////////////////////////////////////////////////////////// void B92IncompressibleNavierStokes::initDataSet() { - SPtr<DistributionArray3D> d(new D3Q27EsoTwist3DSplittedVector(nx[0] + 2, nx[1] + 2, nx[2] + 2, -999.9)); + SPtr<DistributionArray3D> d(new EsoSplit(nx[0] + 2, nx[1] + 2, nx[2] + 2, -999.9)); dataSet->setFdistributions(d); } ////////////////////////////////////////////////////////////////////////// @@ -63,11 +62,11 @@ void B92IncompressibleNavierStokes::calculate(int step) ///////////////////////////////////// localDistributions = - std::dynamic_pointer_cast<D3Q27EsoTwist3DSplittedVector>(dataSet->getFdistributions())->getLocalDistributions(); - nonLocalDistributions = std::dynamic_pointer_cast<D3Q27EsoTwist3DSplittedVector>(dataSet->getFdistributions()) + std::dynamic_pointer_cast<EsoSplit>(dataSet->getFdistributions())->getLocalDistributions(); + nonLocalDistributions = std::dynamic_pointer_cast<EsoSplit>(dataSet->getFdistributions()) ->getNonLocalDistributions(); zeroDistributions = - std::dynamic_pointer_cast<D3Q27EsoTwist3DSplittedVector>(dataSet->getFdistributions())->getZeroDistributions(); + std::dynamic_pointer_cast<EsoSplit>(dataSet->getFdistributions())->getZeroDistributions(); SPtr<BCArray3D> bcArray = this->getBCSet()->getBCArray(); real f[D3Q27System::ENDF + 1]; @@ -96,33 +95,33 @@ void B92IncompressibleNavierStokes::calculate(int step) //////////////////////////////////////////////////////////////////////////// f[d000] = (*this->zeroDistributions)(x1, x2, x3); - f[dP00] = (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); - f[d0P0] = (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); - f[d00P] = (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); - f[dPP0] = (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); - f[dMP0] = (*this->localDistributions)(D3Q27System::ET_NW, x1p, x2, x3); - f[dP0P] = (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); - f[dM0P] = (*this->localDistributions)(D3Q27System::ET_TW, x1p, x2, x3); - f[d0PP] = (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); - f[d0MP] = (*this->localDistributions)(D3Q27System::ET_TS, x1, x2p, x3); - f[dPPP] = (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); - f[dMPP] = (*this->localDistributions)(D3Q27System::ET_TNW, x1p, x2, x3); - f[dPMP] = (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2p, x3); - f[dMMP] = (*this->localDistributions)(D3Q27System::ET_TSW, x1p, x2p, x3); + f[dP00] = (*this->localDistributions)(eP00, x1, x2, x3); + f[d0P0] = (*this->localDistributions)(e0P0, x1, x2, x3); + f[d00P] = (*this->localDistributions)(e00P, x1, x2, x3); + f[dPP0] = (*this->localDistributions)(ePP0, x1, x2, x3); + f[dMP0] = (*this->localDistributions)(eMP0, x1p, x2, x3); + f[dP0P] = (*this->localDistributions)(eP0P, x1, x2, x3); + f[dM0P] = (*this->localDistributions)(eM0P, x1p, x2, x3); + f[d0PP] = (*this->localDistributions)(e0PP, x1, x2, x3); + f[d0MP] = (*this->localDistributions)(e0MP, x1, x2p, x3); + f[dPPP] = (*this->localDistributions)(ePPP, x1, x2, x3); + f[dMPP] = (*this->localDistributions)(eMPP, x1p, x2, x3); + f[dPMP] = (*this->localDistributions)(ePMP, x1, x2p, x3); + f[dMMP] = (*this->localDistributions)(eMMP, x1p, x2p, x3); - f[dM00] = (*this->nonLocalDistributions)(D3Q27System::ET_W, x1p, x2, x3); - f[d0M0] = (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2p, x3); - f[d00M] = (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3p); - f[dMM0] = (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1p, x2p, x3); - f[dPM0] = (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2p, x3); - f[dM0M] = (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1p, x2, x3p); - f[dP0M] = (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3p); - f[d0MM] = (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2p, x3p); - f[d0PM] = (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3p); - f[dMMM] = (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1p, x2p, x3p); - f[dPMM] = (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2p, x3p); - f[dMPM] = (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1p, x2, x3p); - f[dPPM] = (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3p); + f[dM00] = (*this->nonLocalDistributions)(eM00, x1p, x2, x3); + f[d0M0] = (*this->nonLocalDistributions)(e0M0, x1, x2p, x3); + f[d00M] = (*this->nonLocalDistributions)(e00M, x1, x2, x3p); + f[dMM0] = (*this->nonLocalDistributions)(eMM0, x1p, x2p, x3); + f[dPM0] = (*this->nonLocalDistributions)(ePM0, x1, x2p, x3); + f[dM0M] = (*this->nonLocalDistributions)(eM0M, x1p, x2, x3p); + f[dP0M] = (*this->nonLocalDistributions)(eP0M, x1, x2, x3p); + f[d0MM] = (*this->nonLocalDistributions)(e0MM, x1, x2p, x3p); + f[d0PM] = (*this->nonLocalDistributions)(e0PM, x1, x2, x3p); + f[dMMM] = (*this->nonLocalDistributions)(eMMM, x1p, x2p, x3p); + f[dPMM] = (*this->nonLocalDistributions)(ePMM, x1, x2p, x3p); + f[dMPM] = (*this->nonLocalDistributions)(eMPM, x1p, x2, x3p); + f[dPPM] = (*this->nonLocalDistributions)(ePPM, x1, x2, x3p); ////////////////////////////////////////////////////////////////////////// drho = f[d000] + f[dP00] + f[dM00] + f[d0P0] + f[d0M0] + f[d00P] + f[d00M] + f[dPP0] + f[dMM0] + f[dPM0] + f[dMP0] + f[dP0P] + @@ -266,33 +265,33 @@ void B92IncompressibleNavierStokes::calculate(int step) ////////////////////////////////////////////////////////////////////////// // write distribution ////////////////////////////////////////////////////////////////////////// - (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f[iP00]; - (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f[i0P0]; - (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f[i00P]; - (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f[iPP0]; - (*this->localDistributions)(D3Q27System::ET_NW, x1p, x2, x3) = f[iMP0]; - (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f[iP0P]; - (*this->localDistributions)(D3Q27System::ET_TW, x1p, x2, x3) = f[iM0P]; - (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f[i0PP]; - (*this->localDistributions)(D3Q27System::ET_TS, x1, x2p, x3) = f[i0MP]; - (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f[iPPP]; - (*this->localDistributions)(D3Q27System::ET_TNW, x1p, x2, x3) = f[iMPP]; - (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2p, x3) = f[iPMP]; - (*this->localDistributions)(D3Q27System::ET_TSW, x1p, x2p, x3) = f[iMMP]; + (*this->localDistributions)(eP00, x1, x2, x3) = f[iP00]; + (*this->localDistributions)(e0P0, x1, x2, x3) = f[i0P0]; + (*this->localDistributions)(e00P, x1, x2, x3) = f[i00P]; + (*this->localDistributions)(ePP0, x1, x2, x3) = f[iPP0]; + (*this->localDistributions)(eMP0, x1p, x2, x3) = f[iMP0]; + (*this->localDistributions)(eP0P, x1, x2, x3) = f[iP0P]; + (*this->localDistributions)(eM0P, x1p, x2, x3) = f[iM0P]; + (*this->localDistributions)(e0PP, x1, x2, x3) = f[i0PP]; + (*this->localDistributions)(e0MP, x1, x2p, x3) = f[i0MP]; + (*this->localDistributions)(ePPP, x1, x2, x3) = f[iPPP]; + (*this->localDistributions)(eMPP, x1p, x2, x3) = f[iMPP]; + (*this->localDistributions)(ePMP, x1, x2p, x3) = f[iPMP]; + (*this->localDistributions)(eMMP, x1p, x2p, x3) = f[iMMP]; - (*this->nonLocalDistributions)(D3Q27System::ET_W, x1p, x2, x3) = f[iM00]; - (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2p, x3) = f[i0M0]; - (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3p) = f[i00M]; - (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1p, x2p, x3) = f[iMM0]; - (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2p, x3) = f[iPM0]; - (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1p, x2, x3p) = f[iM0M]; - (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3p) = f[iP0M]; - (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2p, x3p) = f[i0MM]; - (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3p) = f[i0PM]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1p, x2p, x3p) = f[iMMM]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2p, x3p) = f[iPMM]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1p, x2, x3p) = f[iMPM]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3p) = f[iPPM]; + (*this->nonLocalDistributions)(eM00, x1p, x2, x3) = f[iM00]; + (*this->nonLocalDistributions)(e0M0, x1, x2p, x3) = f[i0M0]; + (*this->nonLocalDistributions)(e00M, x1, x2, x3p) = f[i00M]; + (*this->nonLocalDistributions)(eMM0, x1p, x2p, x3) = f[iMM0]; + (*this->nonLocalDistributions)(ePM0, x1, x2p, x3) = f[iPM0]; + (*this->nonLocalDistributions)(eM0M, x1p, x2, x3p) = f[iM0M]; + (*this->nonLocalDistributions)(eP0M, x1, x2, x3p) = f[iP0M]; + (*this->nonLocalDistributions)(e0MM, x1, x2p, x3p) = f[i0MM]; + (*this->nonLocalDistributions)(e0PM, x1, x2, x3p) = f[i0PM]; + (*this->nonLocalDistributions)(eMMM, x1p, x2p, x3p) = f[iMMM]; + (*this->nonLocalDistributions)(ePMM, x1, x2p, x3p) = f[iPMM]; + (*this->nonLocalDistributions)(eMPM, x1p, x2, x3p) = f[iMPM]; + (*this->nonLocalDistributions)(ePPM, x1, x2, x3p) = f[iPPM]; (*this->zeroDistributions)(x1, x2, x3) = f[d000]; ////////////////////////////////////////////////////////////////////////// diff --git a/src/cpu/core/LBM/D3Q27System.h b/src/cpu/core/LBM/D3Q27System.h index 0f284a2cbe30e8c181c6de8ea7ed589c3c35bf75..bfd6c72d7e7b06a333d0e0e75c8cd446446af43f 100644 --- a/src/cpu/core/LBM/D3Q27System.h +++ b/src/cpu/core/LBM/D3Q27System.h @@ -75,172 +75,11 @@ extern const int EX1[ENDDIR + 1]; extern const int EX2[ENDDIR + 1]; extern const int EX3[ENDDIR + 1]; -//static const int E = 0; -//static const int W = 1; -//static const int N = 2; -//static const int S = 3; -//static const int T = 4; -//static const int B = 5; -//static const int NE = 6; -//static const int SW = 7; -//static const int SE = 8; -//static const int NW = 9; -//static const int TE = 10; -//static const int BW = 11; -//static const int BE = 12; -//static const int TW = 13; -//static const int TN = 14; -//static const int BS = 15; -//static const int BN = 16; -//static const int TS = 17; -//static const int TNE = 18; -//static const int TNW = 19; -//static const int TSE = 20; -//static const int TSW = 21; -//static const int BNE = 22; -//static const int BNW = 23; -//static const int BSE = 24; -//static const int BSW = 25; -//static const int REST = 26; - -//static constexpr int REST = 0; -//static constexpr int E = 1; -//static constexpr int W = 2; -//static constexpr int N = 3; -//static constexpr int S = 4; -//static constexpr int T = 5; -//static constexpr int B = 6; -//static constexpr int NE = 7; -//static constexpr int SW = 8; -//static constexpr int SE = 9; -//static constexpr int NW = 10; -//static constexpr int TE = 11; -//static constexpr int BW = 12; -//static constexpr int BE = 13; -//static constexpr int TW = 14; -//static constexpr int TN = 15; -//static constexpr int BS = 16; -//static constexpr int BN = 17; -//static constexpr int TS = 18; -//static constexpr int TNE = 19; -//static constexpr int TNW = 20; -//static constexpr int TSE = 21; -//static constexpr int TSW = 22; -//static constexpr int BNE = 23; -//static constexpr int BNW = 24; -//static constexpr int BSE = 25; -//static constexpr int BSW = 26; - -//static constexpr int d000 = 0; -//static constexpr int dP00 = 1; -//static constexpr int dM00 = 2; -//static constexpr int d0P0 = 3; -//static constexpr int d0M0 = 4; -//static constexpr int d00P = 5; -//static constexpr int d00M = 6; -//static constexpr int dPP0 = 7; -//static constexpr int dMM0 = 8; -//static constexpr int dPM0 = 9; -//static constexpr int dMP0 = 10; -//static constexpr int dP0P = 11; -//static constexpr int dM0M = 12; -//static constexpr int dP0M = 13; -//static constexpr int dM0P = 14; -//static constexpr int d0PP = 15; -//static constexpr int d0MM = 16; -//static constexpr int d0PM = 17; -//static constexpr int d0MP = 18; -//static constexpr int dPPP = 19; -//static constexpr int dMPP = 20; -//static constexpr int dPMP = 21; -//static constexpr int dMMP = 22; -//static constexpr int dPPM = 23; -//static constexpr int dMPM = 24; -//static constexpr int dPMM = 25; -//static constexpr int dMMM = 26; - -//static constexpr int iP00 = dM00; -//static constexpr int iM00 = dP00; -//static constexpr int i0P0 = d0M0; -//static constexpr int i0M0 = d0P0; -//static constexpr int i00P = d00M; -//static constexpr int i00M = d00P; -//static constexpr int iPP0 = dMM0; -//static constexpr int iMM0 = dPP0; -//static constexpr int iPM0 = dMP0; -//static constexpr int iMP0 = dPM0; -//static constexpr int iP0P = dM0M; -//static constexpr int iM0M = dP0P; -//static constexpr int iP0M = dM0P; -//static constexpr int iM0P = dP0M; -//static constexpr int i0PP = d0MM; -//static constexpr int i0MM = d0PP; -//static constexpr int i0PM = d0MP; -//static constexpr int i0MP = d0PM; -//static constexpr int iPPP = dMMM; -//static constexpr int iMPP = dPMM; -//static constexpr int iPMP = dMPM; -//static constexpr int iMMP = dPPM; -//static constexpr int iPPM = dMMP; -//static constexpr int iMPM = dPMP; -//static constexpr int iPMM = dMPP; -//static constexpr int iMMM = dPPP; + extern const int INVDIR[ENDDIR + 1]; -static const int ET_E = 0; -static const int ET_W = 0; -static const int ET_N = 1; -static const int ET_S = 1; -static const int ET_T = 2; -static const int ET_B = 2; -static const int ET_NE = 3; -static const int ET_SW = 3; -static const int ET_SE = 4; -static const int ET_NW = 4; -static const int ET_TE = 5; -static const int ET_BW = 5; -static const int ET_BE = 6; -static const int ET_TW = 6; -static const int ET_TN = 7; -static const int ET_BS = 7; -static const int ET_BN = 8; -static const int ET_TS = 8; -static const int ET_TNE = 9; -static const int ET_BSW = 9; -static const int ET_TNW = 10; -static const int ET_BSE = 10; -static const int ET_TSE = 11; -static const int ET_BNW = 11; -static const int ET_TSW = 12; -static const int ET_BNE = 12; - -static const int ET_P00 = 0; -static const int ET_M00 = 0; -static const int ET_0P0 = 1; -static const int ET_0M0 = 1; -static const int ET_00P = 2; -static const int ET_00M = 2; -static const int ET_PP0 = 3; -static const int ET_MM0 = 3; -static const int ET_PM0 = 4; -static const int ET_MP0 = 4; -static const int ET_P0P = 5; -static const int ET_M0M = 5; -static const int ET_P0M = 6; -static const int ET_M0P = 6; -static const int ET_0PP = 7; -static const int ET_0MM = 7; -static const int ET_0PM = 8; -static const int ET_0MP = 8; -static const int ET_PPP = 9; -static const int ET_MMM = 9; -static const int ET_MPP = 10; -static const int ET_PMM = 10; -static const int ET_PMP = 11; -static const int ET_MPM = 11; -static const int ET_MMP = 12; -static const int ET_PPM = 12; + ////////////////////////////////////////////////////////////////////////// inline std::string getDirectionString(int direction) diff --git a/src/cpu/core/LBM/K15CompressibleNavierStokes.cpp b/src/cpu/core/LBM/K15CompressibleNavierStokes.cpp index 4b8e2259eb54c050535d6346cf9544765cc5d802..3ddb0b2ce02fbd964bd72da28f6871f9fdd2ad3c 100644 --- a/src/cpu/core/LBM/K15CompressibleNavierStokes.cpp +++ b/src/cpu/core/LBM/K15CompressibleNavierStokes.cpp @@ -1,7 +1,7 @@ #include "K15CompressibleNavierStokes.h" #include "D3Q27System.h" #include "Interpolator.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "DataSet3D.h" #include "Block3D.h" @@ -25,7 +25,7 @@ K15CompressibleNavierStokes::~K15CompressibleNavierStokes(void) ////////////////////////////////////////////////////////////////////////// void K15CompressibleNavierStokes::initDataSet() { - SPtr<DistributionArray3D> d(new D3Q27EsoTwist3DSplittedVector(nx[0]+2, nx[1]+2, nx[2]+2, -999.9)); + SPtr<DistributionArray3D> d(new EsoSplit(nx[0]+2, nx[1]+2, nx[2]+2, -999.9)); dataSet->setFdistributions(d); } ////////////////////////////////////////////////////////////////////////// @@ -69,8 +69,9 @@ void K15CompressibleNavierStokes::calculate(int step) { using namespace D3Q27System; using namespace std; + using namespace vf::lbm::dir; - //timer.resetAndStart(); + //timer.start(); //initializing of forcing stuff if (withForcing) @@ -97,9 +98,9 @@ void K15CompressibleNavierStokes::calculate(int step) } ///////////////////////////////////// - localDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(dataSet->getFdistributions())->getLocalDistributions(); - nonLocalDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(dataSet->getFdistributions())->getNonLocalDistributions(); - zeroDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(dataSet->getFdistributions())->getZeroDistributions(); + localDistributions = dynamicPointerCast<EsoSplit>(dataSet->getFdistributions())->getLocalDistributions(); + nonLocalDistributions = dynamicPointerCast<EsoSplit>(dataSet->getFdistributions())->getNonLocalDistributions(); + zeroDistributions = dynamicPointerCast<EsoSplit>(dataSet->getFdistributions())->getZeroDistributions(); SPtr<BCArray3D> bcArray = this->getBCSet()->getBCArray(); @@ -148,33 +149,33 @@ void K15CompressibleNavierStokes::calculate(int step) // a b c //-1 0 1 - real mfcbb = (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); - real mfbcb = (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); - real mfbbc = (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); - real mfccb = (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); - real mfacb = (*this->localDistributions)(D3Q27System::ET_NW, x1p, x2, x3); - real mfcbc = (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); - real mfabc = (*this->localDistributions)(D3Q27System::ET_TW, x1p, x2, x3); - real mfbcc = (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); - real mfbac = (*this->localDistributions)(D3Q27System::ET_TS, x1, x2p, x3); - real mfccc = (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); - real mfacc = (*this->localDistributions)(D3Q27System::ET_TNW, x1p, x2, x3); - real mfcac = (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2p, x3); - real mfaac = (*this->localDistributions)(D3Q27System::ET_TSW, x1p, x2p, x3); - - real mfabb = (*this->nonLocalDistributions)(D3Q27System::ET_W, x1p, x2, x3); - real mfbab = (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2p, x3); - real mfbba = (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3p); - real mfaab = (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1p, x2p, x3); - real mfcab = (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2p, x3); - real mfaba = (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1p, x2, x3p); - real mfcba = (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3p); - real mfbaa = (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2p, x3p); - real mfbca = (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3p); - real mfaaa = (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1p, x2p, x3p); - real mfcaa = (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2p, x3p); - real mfaca = (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1p, x2, x3p); - real mfcca = (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3p); + real mfcbb = (*this->localDistributions)(eP00, x1, x2, x3); + real mfbcb = (*this->localDistributions)(e0P0, x1, x2, x3); + real mfbbc = (*this->localDistributions)(e00P, x1, x2, x3); + real mfccb = (*this->localDistributions)(ePP0, x1, x2, x3); + real mfacb = (*this->localDistributions)(eMP0, x1p, x2, x3); + real mfcbc = (*this->localDistributions)(eP0P, x1, x2, x3); + real mfabc = (*this->localDistributions)(eM0P, x1p, x2, x3); + real mfbcc = (*this->localDistributions)(e0PP, x1, x2, x3); + real mfbac = (*this->localDistributions)(e0MP, x1, x2p, x3); + real mfccc = (*this->localDistributions)(ePPP, x1, x2, x3); + real mfacc = (*this->localDistributions)(eMPP, x1p, x2, x3); + real mfcac = (*this->localDistributions)(ePMP, x1, x2p, x3); + real mfaac = (*this->localDistributions)(eMMP, x1p, x2p, x3); + + real mfabb = (*this->nonLocalDistributions)(eM00, x1p, x2, x3); + real mfbab = (*this->nonLocalDistributions)(e0M0, x1, x2p, x3); + real mfbba = (*this->nonLocalDistributions)(e00M, x1, x2, x3p); + real mfaab = (*this->nonLocalDistributions)(eMM0, x1p, x2p, x3); + real mfcab = (*this->nonLocalDistributions)(ePM0, x1, x2p, x3); + real mfaba = (*this->nonLocalDistributions)(eM0M, x1p, x2, x3p); + real mfcba = (*this->nonLocalDistributions)(eP0M, x1, x2, x3p); + real mfbaa = (*this->nonLocalDistributions)(e0MM, x1, x2p, x3p); + real mfbca = (*this->nonLocalDistributions)(e0PM, x1, x2, x3p); + real mfaaa = (*this->nonLocalDistributions)(eMMM, x1p, x2p, x3p); + real mfcaa = (*this->nonLocalDistributions)(ePMM, x1, x2p, x3p); + real mfaca = (*this->nonLocalDistributions)(eMPM, x1p, x2, x3p); + real mfcca = (*this->nonLocalDistributions)(ePPM, x1, x2, x3p); real mfbbb = (*this->zeroDistributions)(x1, x2, x3); @@ -870,33 +871,33 @@ void K15CompressibleNavierStokes::calculate(int step) ////////////////////////////////////////////////////////////////////////// //write distribution ////////////////////////////////////////////////////////////////////////// - (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = mfabb; - (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = mfbab; - (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = mfbba; - (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = mfaab; - (*this->localDistributions)(D3Q27System::ET_NW, x1p, x2, x3) = mfcab; - (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = mfaba; - (*this->localDistributions)(D3Q27System::ET_TW, x1p, x2, x3) = mfcba; - (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = mfbaa; - (*this->localDistributions)(D3Q27System::ET_TS, x1, x2p, x3) = mfbca; - (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = mfaaa; - (*this->localDistributions)(D3Q27System::ET_TNW, x1p, x2, x3) = mfcaa; - (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2p, x3) = mfaca; - (*this->localDistributions)(D3Q27System::ET_TSW, x1p, x2p, x3) = mfcca; - - (*this->nonLocalDistributions)(D3Q27System::ET_W, x1p, x2, x3) = mfcbb; - (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2p, x3) = mfbcb; - (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3p) = mfbbc; - (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1p, x2p, x3) = mfccb; - (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2p, x3) = mfacb; - (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1p, x2, x3p) = mfcbc; - (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3p) = mfabc; - (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2p, x3p) = mfbcc; - (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3p) = mfbac; - (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1p, x2p, x3p) = mfccc; - (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2p, x3p) = mfacc; - (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1p, x2, x3p) = mfcac; - (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3p) = mfaac; + (*this->localDistributions)(eP00, x1, x2, x3) = mfabb; + (*this->localDistributions)(e0P0, x1, x2, x3) = mfbab; + (*this->localDistributions)(e00P, x1, x2, x3) = mfbba; + (*this->localDistributions)(ePP0, x1, x2, x3) = mfaab; + (*this->localDistributions)(eMP0, x1p, x2, x3) = mfcab; + (*this->localDistributions)(eP0P, x1, x2, x3) = mfaba; + (*this->localDistributions)(eM0P, x1p, x2, x3) = mfcba; + (*this->localDistributions)(e0PP, x1, x2, x3) = mfbaa; + (*this->localDistributions)(e0MP, x1, x2p, x3) = mfbca; + (*this->localDistributions)(ePPP, x1, x2, x3) = mfaaa; + (*this->localDistributions)(eMPP, x1p, x2, x3) = mfcaa; + (*this->localDistributions)(ePMP, x1, x2p, x3) = mfaca; + (*this->localDistributions)(eMMP, x1p, x2p, x3) = mfcca; + + (*this->nonLocalDistributions)(eM00, x1p, x2, x3) = mfcbb; + (*this->nonLocalDistributions)(e0M0, x1, x2p, x3) = mfbcb; + (*this->nonLocalDistributions)(e00M, x1, x2, x3p) = mfbbc; + (*this->nonLocalDistributions)(eMM0, x1p, x2p, x3) = mfccb; + (*this->nonLocalDistributions)(ePM0, x1, x2p, x3) = mfacb; + (*this->nonLocalDistributions)(eM0M, x1p, x2, x3p) = mfcbc; + (*this->nonLocalDistributions)(eP0M, x1, x2, x3p) = mfabc; + (*this->nonLocalDistributions)(e0MM, x1, x2p, x3p) = mfbcc; + (*this->nonLocalDistributions)(e0PM, x1, x2, x3p) = mfbac; + (*this->nonLocalDistributions)(eMMM, x1p, x2p, x3p) = mfccc; + (*this->nonLocalDistributions)(ePMM, x1, x2p, x3p) = mfacc; + (*this->nonLocalDistributions)(eMPM, x1p, x2, x3p) = mfcac; + (*this->nonLocalDistributions)(ePPM, x1, x2, x3p) = mfaac; (*this->zeroDistributions)(x1, x2, x3) = mfbbb; ////////////////////////////////////////////////////////////////////////// @@ -908,13 +909,12 @@ void K15CompressibleNavierStokes::calculate(int step) - //timer.stop(); + //timer.end(); } ////////////////////////////////////////////////////////////////////////// real K15CompressibleNavierStokes::getCalculationTime() { - //return timer.getDuration(); - return timer.getTotalTime(); + return timer.getTimeInSeconds(); } ////////////////////////////////////////////////////////////////////////// void K15CompressibleNavierStokes::setBulkOmegaToOmega(bool value) diff --git a/src/cpu/core/LBM/K15CompressibleNavierStokes.h b/src/cpu/core/LBM/K15CompressibleNavierStokes.h index 1135e5c324c8e6fc23e2d0101151ef33ce16b6e7..fd0b4e9e6005a844108778a7b9fdfa7dd7dded28 100644 --- a/src/cpu/core/LBM/K15CompressibleNavierStokes.h +++ b/src/cpu/core/LBM/K15CompressibleNavierStokes.h @@ -1,10 +1,11 @@ #ifndef K15CompressibleNavierStokes_h__ #define K15CompressibleNavierStokes_h__ +#include <basics/Timer/Timer.h> + #include "LBMKernel.h" #include "BCSet.h" #include "D3Q27System.h" -#include "basics/utilities/UbTiming.h" #include "basics/container/CbArray4D.h" #include "basics/container/CbArray3D.h" @@ -28,7 +29,7 @@ protected: virtual void initDataSet(); real f[D3Q27System::ENDF+1]; - UbTimer timer; + vf::basics::Timer timer; real OxyyMxzz; Parameter parameter; diff --git a/src/cpu/core/LBM/K16IncompressibleNavierStokes.cpp b/src/cpu/core/LBM/K16IncompressibleNavierStokes.cpp index ca08ce35b3c6592dacf14f483d9fbbde115abb89..9c3c00dea19bc1b27f8415350f2339dc16ddfb5b 100644 --- a/src/cpu/core/LBM/K16IncompressibleNavierStokes.cpp +++ b/src/cpu/core/LBM/K16IncompressibleNavierStokes.cpp @@ -1,7 +1,7 @@ #include "K16IncompressibleNavierStokes.h" #include "D3Q27System.h" #include "Interpolator.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "DataSet3D.h" #include <cmath> #include "Block3D.h" @@ -24,7 +24,7 @@ K16IncompressibleNavierStokes::~K16IncompressibleNavierStokes(void) ////////////////////////////////////////////////////////////////////////// void K16IncompressibleNavierStokes::initDataSet() { - SPtr<DistributionArray3D> d(new D3Q27EsoTwist3DSplittedVector(nx[0]+2, nx[1]+2, nx[2]+2, -999.9)); + SPtr<DistributionArray3D> d(new EsoSplit(nx[0]+2, nx[1]+2, nx[2]+2, -999.9)); dataSet->setFdistributions(d); } ////////////////////////////////////////////////////////////////////////// @@ -59,8 +59,9 @@ void K16IncompressibleNavierStokes::calculate(int step) { using namespace D3Q27System; using namespace std; + using namespace vf::lbm::dir; - //timer.resetAndStart(); + //timer.start(); //initializing of forcing stuff if (withForcing) @@ -87,9 +88,9 @@ void K16IncompressibleNavierStokes::calculate(int step) } ///////////////////////////////////// - localDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(dataSet->getFdistributions())->getLocalDistributions(); - nonLocalDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(dataSet->getFdistributions())->getNonLocalDistributions(); - zeroDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(dataSet->getFdistributions())->getZeroDistributions(); + localDistributions = dynamicPointerCast<EsoSplit>(dataSet->getFdistributions())->getLocalDistributions(); + nonLocalDistributions = dynamicPointerCast<EsoSplit>(dataSet->getFdistributions())->getNonLocalDistributions(); + zeroDistributions = dynamicPointerCast<EsoSplit>(dataSet->getFdistributions())->getZeroDistributions(); SPtr<BCArray3D> bcArray = this->getBCSet()->getBCArray(); @@ -136,33 +137,33 @@ void K16IncompressibleNavierStokes::calculate(int step) // a b c //-1 0 1 - real mfcbb = (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); - real mfbcb = (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); - real mfbbc = (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); - real mfccb = (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); - real mfacb = (*this->localDistributions)(D3Q27System::ET_NW, x1p, x2, x3); - real mfcbc = (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); - real mfabc = (*this->localDistributions)(D3Q27System::ET_TW, x1p, x2, x3); - real mfbcc = (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); - real mfbac = (*this->localDistributions)(D3Q27System::ET_TS, x1, x2p, x3); - real mfccc = (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); - real mfacc = (*this->localDistributions)(D3Q27System::ET_TNW, x1p, x2, x3); - real mfcac = (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2p, x3); - real mfaac = (*this->localDistributions)(D3Q27System::ET_TSW, x1p, x2p, x3); - - real mfabb = (*this->nonLocalDistributions)(D3Q27System::ET_W, x1p, x2, x3); - real mfbab = (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2p, x3); - real mfbba = (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3p); - real mfaab = (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1p, x2p, x3); - real mfcab = (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2p, x3); - real mfaba = (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1p, x2, x3p); - real mfcba = (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3p); - real mfbaa = (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2p, x3p); - real mfbca = (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3p); - real mfaaa = (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1p, x2p, x3p); - real mfcaa = (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2p, x3p); - real mfaca = (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1p, x2, x3p); - real mfcca = (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3p); + real mfcbb = (*this->localDistributions)(eP00, x1, x2, x3); + real mfbcb = (*this->localDistributions)(e0P0, x1, x2, x3); + real mfbbc = (*this->localDistributions)(e00P, x1, x2, x3); + real mfccb = (*this->localDistributions)(ePP0, x1, x2, x3); + real mfacb = (*this->localDistributions)(eMP0, x1p, x2, x3); + real mfcbc = (*this->localDistributions)(eP0P, x1, x2, x3); + real mfabc = (*this->localDistributions)(eM0P, x1p, x2, x3); + real mfbcc = (*this->localDistributions)(e0PP, x1, x2, x3); + real mfbac = (*this->localDistributions)(e0MP, x1, x2p, x3); + real mfccc = (*this->localDistributions)(ePPP, x1, x2, x3); + real mfacc = (*this->localDistributions)(eMPP, x1p, x2, x3); + real mfcac = (*this->localDistributions)(ePMP, x1, x2p, x3); + real mfaac = (*this->localDistributions)(eMMP, x1p, x2p, x3); + + real mfabb = (*this->nonLocalDistributions)(eM00, x1p, x2, x3); + real mfbab = (*this->nonLocalDistributions)(e0M0, x1, x2p, x3); + real mfbba = (*this->nonLocalDistributions)(e00M, x1, x2, x3p); + real mfaab = (*this->nonLocalDistributions)(eMM0, x1p, x2p, x3); + real mfcab = (*this->nonLocalDistributions)(ePM0, x1, x2p, x3); + real mfaba = (*this->nonLocalDistributions)(eM0M, x1p, x2, x3p); + real mfcba = (*this->nonLocalDistributions)(eP0M, x1, x2, x3p); + real mfbaa = (*this->nonLocalDistributions)(e0MM, x1, x2p, x3p); + real mfbca = (*this->nonLocalDistributions)(e0PM, x1, x2, x3p); + real mfaaa = (*this->nonLocalDistributions)(eMMM, x1p, x2p, x3p); + real mfcaa = (*this->nonLocalDistributions)(ePMM, x1, x2p, x3p); + real mfaca = (*this->nonLocalDistributions)(eMPM, x1p, x2, x3p); + real mfcca = (*this->nonLocalDistributions)(ePPM, x1, x2, x3p); real mfbbb = (*this->zeroDistributions)(x1, x2, x3); @@ -852,33 +853,33 @@ void K16IncompressibleNavierStokes::calculate(int step) ////////////////////////////////////////////////////////////////////////// //write distribution ////////////////////////////////////////////////////////////////////////// - (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = mfabb; - (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = mfbab; - (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = mfbba; - (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = mfaab; - (*this->localDistributions)(D3Q27System::ET_NW, x1p, x2, x3) = mfcab; - (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = mfaba; - (*this->localDistributions)(D3Q27System::ET_TW, x1p, x2, x3) = mfcba; - (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = mfbaa; - (*this->localDistributions)(D3Q27System::ET_TS, x1, x2p, x3) = mfbca; - (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = mfaaa; - (*this->localDistributions)(D3Q27System::ET_TNW, x1p, x2, x3) = mfcaa; - (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2p, x3) = mfaca; - (*this->localDistributions)(D3Q27System::ET_TSW, x1p, x2p, x3) = mfcca; - - (*this->nonLocalDistributions)(D3Q27System::ET_W, x1p, x2, x3) = mfcbb; - (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2p, x3) = mfbcb; - (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3p) = mfbbc; - (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1p, x2p, x3) = mfccb; - (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2p, x3) = mfacb; - (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1p, x2, x3p) = mfcbc; - (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3p) = mfabc; - (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2p, x3p) = mfbcc; - (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3p) = mfbac; - (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1p, x2p, x3p) = mfccc; - (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2p, x3p) = mfacc; - (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1p, x2, x3p) = mfcac; - (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3p) = mfaac; + (*this->localDistributions)(eP00, x1, x2, x3) = mfabb; + (*this->localDistributions)(e0P0, x1, x2, x3) = mfbab; + (*this->localDistributions)(e00P, x1, x2, x3) = mfbba; + (*this->localDistributions)(ePP0, x1, x2, x3) = mfaab; + (*this->localDistributions)(eMP0, x1p, x2, x3) = mfcab; + (*this->localDistributions)(eP0P, x1, x2, x3) = mfaba; + (*this->localDistributions)(eM0P, x1p, x2, x3) = mfcba; + (*this->localDistributions)(e0PP, x1, x2, x3) = mfbaa; + (*this->localDistributions)(e0MP, x1, x2p, x3) = mfbca; + (*this->localDistributions)(ePPP, x1, x2, x3) = mfaaa; + (*this->localDistributions)(eMPP, x1p, x2, x3) = mfcaa; + (*this->localDistributions)(ePMP, x1, x2p, x3) = mfaca; + (*this->localDistributions)(eMMP, x1p, x2p, x3) = mfcca; + + (*this->nonLocalDistributions)(eM00, x1p, x2, x3) = mfcbb; + (*this->nonLocalDistributions)(e0M0, x1, x2p, x3) = mfbcb; + (*this->nonLocalDistributions)(e00M, x1, x2, x3p) = mfbbc; + (*this->nonLocalDistributions)(eMM0, x1p, x2p, x3) = mfccb; + (*this->nonLocalDistributions)(ePM0, x1, x2p, x3) = mfacb; + (*this->nonLocalDistributions)(eM0M, x1p, x2, x3p) = mfcbc; + (*this->nonLocalDistributions)(eP0M, x1, x2, x3p) = mfabc; + (*this->nonLocalDistributions)(e0MM, x1, x2p, x3p) = mfbcc; + (*this->nonLocalDistributions)(e0PM, x1, x2, x3p) = mfbac; + (*this->nonLocalDistributions)(eMMM, x1p, x2p, x3p) = mfccc; + (*this->nonLocalDistributions)(ePMM, x1, x2p, x3p) = mfacc; + (*this->nonLocalDistributions)(eMPM, x1p, x2, x3p) = mfcac; + (*this->nonLocalDistributions)(ePPM, x1, x2, x3p) = mfaac; (*this->zeroDistributions)(x1, x2, x3) = mfbbb; ////////////////////////////////////////////////////////////////////////// @@ -892,8 +893,7 @@ void K16IncompressibleNavierStokes::calculate(int step) ////////////////////////////////////////////////////////////////////////// real K16IncompressibleNavierStokes::getCalculationTime() { - //return timer.getDuration(); - return timer.getTotalTime(); + return timer.getTimeInSeconds(); } ////////////////////////////////////////////////////////////////////////// void K16IncompressibleNavierStokes::setRelaxationParameter(Parameter p) diff --git a/src/cpu/core/LBM/K16IncompressibleNavierStokes.h b/src/cpu/core/LBM/K16IncompressibleNavierStokes.h index a67b0617801fb315b3fdcb58258099bf0839ba85..f7c8a1dc0329150f1847c12c2c2c52c636e46b21 100644 --- a/src/cpu/core/LBM/K16IncompressibleNavierStokes.h +++ b/src/cpu/core/LBM/K16IncompressibleNavierStokes.h @@ -3,17 +3,18 @@ #ifndef K16IncompressibleNavierStokes_H #define K16IncompressibleNavierStokes_H +#include <basics/Timer/Timer.h> + #include "LBMKernel.h" #include "BCSet.h" #include "D3Q27System.h" -#include "basics/utilities/UbTiming.h" #include "basics/container/CbArray4D.h" #include "basics/container/CbArray3D.h" //! \brief Cascaded Cumulant LBM kernel. //! \details CFD solver that use Cascaded Cumulant Lattice Boltzmann method for D3Q27 model //! \author K. Kutscher, M. Geier -class K16IncompressibleNavierStokes : public LBMKernel +class K16IncompressibleNavierStokes : public LBMKernel { public: //! This option set relaxation parameter: NORMAL @@ -29,7 +30,7 @@ protected: virtual void initDataSet(); real f[D3Q27System::ENDF+1]; - UbTimer timer; + vf::basics::Timer timer; real OxyyMxzz; Parameter parameter; diff --git a/src/cpu/core/LBM/K17CompressibleNavierStokes.cpp b/src/cpu/core/LBM/K17CompressibleNavierStokes.cpp index 4287254015ad9ee8c6d1250636c15989cd81242b..6d8cfb7ec48721b20c371427221388bbac959a3b 100644 --- a/src/cpu/core/LBM/K17CompressibleNavierStokes.cpp +++ b/src/cpu/core/LBM/K17CompressibleNavierStokes.cpp @@ -39,7 +39,7 @@ #include "BCArray3D.h" #include "BCSet.h" #include "Block3D.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "D3Q27System.h" #include "DataSet3D.h" #include "LBMKernel.h" @@ -51,7 +51,7 @@ K17CompressibleNavierStokes::K17CompressibleNavierStokes() void K17CompressibleNavierStokes::initDataSet() { - SPtr<DistributionArray3D> d(new D3Q27EsoTwist3DSplittedVector(nx[0] + 2, nx[1] + 2, nx[2] + 2, -999.9)); + SPtr<DistributionArray3D> d(new EsoSplit(nx[0] + 2, nx[1] + 2, nx[2] + 2, -999.9)); dataSet->setFdistributions(d); } @@ -99,9 +99,9 @@ void K17CompressibleNavierStokes::calculate(int step) muForcingX3.DefineVar("nu", &muNu); } - auto localDistributions = std::dynamic_pointer_cast<D3Q27EsoTwist3DSplittedVector>(dataSet->getFdistributions())->getLocalDistributions(); - auto nonLocalDistributions = std::dynamic_pointer_cast<D3Q27EsoTwist3DSplittedVector>(dataSet->getFdistributions())->getNonLocalDistributions(); - auto restDistributions = std::dynamic_pointer_cast<D3Q27EsoTwist3DSplittedVector>(dataSet->getFdistributions())->getZeroDistributions(); + auto localDistributions = std::dynamic_pointer_cast<EsoSplit>(dataSet->getFdistributions())->getLocalDistributions(); + auto nonLocalDistributions = std::dynamic_pointer_cast<EsoSplit>(dataSet->getFdistributions())->getNonLocalDistributions(); + auto restDistributions = std::dynamic_pointer_cast<EsoSplit>(dataSet->getFdistributions())->getZeroDistributions(); SPtr<BCArray3D> bcArray = this->getBCSet()->getBCArray(); diff --git a/src/cpu/core/LBM/VoidLBMKernel.cpp b/src/cpu/core/LBM/VoidLBMKernel.cpp deleted file mode 100644 index 7ab956494af3121eedfb56a22cb638a04c08efba..0000000000000000000000000000000000000000 --- a/src/cpu/core/LBM/VoidLBMKernel.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "VoidLBMKernel.h" -#include "BCSet.h" -#include "DataSet3D.h" -#include "VoidData3D.h" -#include "D3Q27System.h" - -VoidLBMKernel::VoidLBMKernel() = default; -////////////////////////////////////////////////////////////////////////// -VoidLBMKernel::~VoidLBMKernel() = default; -////////////////////////////////////////////////////////////////////////// -void VoidLBMKernel::initDataSet() -{ - SPtr<DistributionArray3D> d(new VoidData3D(nx[0] + 2, nx[1] + 2, nx[2] + 2, -999.9)); - dataSet->setFdistributions(d); -} -////////////////////////////////////////////////////////////////////////// -SPtr<LBMKernel> VoidLBMKernel::clone() -{ - SPtr<LBMKernel> kernel(new VoidLBMKernel()); - kernel->setNX(nx); - dynamicPointerCast<VoidLBMKernel>(kernel)->initDataSet(); - kernel->setCollisionFactor(this->collFactor); - kernel->setBCSet(bcSet->clone(kernel)); - kernel->setWithForcing(withForcing); - kernel->setForcingX1(muForcingX1); - kernel->setForcingX2(muForcingX2); - kernel->setForcingX3(muForcingX3); - kernel->setIndex(ix1, ix2, ix3); - kernel->setDeltaT(deltaT); - return kernel; -} -////////////////////////////////////////////////////////////////////////// -void VoidLBMKernel::calculate(int step) {} -////////////////////////////////////////////////////////////////////////// -real VoidLBMKernel::getCalculationTime() { return vf::basics::constant::c0o1; } diff --git a/src/cpu/core/LBM/VoidLBMKernel.h b/src/cpu/core/LBM/VoidLBMKernel.h deleted file mode 100644 index 0984cab144021c3895bf8cb85f50efbc94476e6b..0000000000000000000000000000000000000000 --- a/src/cpu/core/LBM/VoidLBMKernel.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef VoidLBMKernel_h__ -#define VoidLBMKernel_h__ - -#include "LBMKernel.h" - -class VoidLBMKernel : public LBMKernel -{ -public: - VoidLBMKernel(); - ~VoidLBMKernel() override; - SPtr<LBMKernel> clone() override; - void calculate(int step) override; - real getCalculationTime() override; - void initDataSet(); - -protected: -}; -#endif // VoidLBMKernel_h__ diff --git a/src/cpu/core/Simulation/Simulation.cpp b/src/cpu/core/Simulation/Simulation.cpp index e3b0169847d43efd62bdf7dabf80fdc009027d46..c4766c8cfd0865880fa2df2a76e9a28036915dea 100644 --- a/src/cpu/core/Simulation/Simulation.cpp +++ b/src/cpu/core/Simulation/Simulation.cpp @@ -49,7 +49,10 @@ #define OMP_SCHEDULE guided // #define TIMING -// #include "UbTiming.h" +#ifdef TIMING +#include <basics/Timer/Timer.h> +using namespace vf::basics; +#endif #include <basics/utilities/UbException.h> @@ -254,7 +257,7 @@ void Simulation::run() int threshold; #ifdef TIMING - UbTimer timer; + Timer timer; real time[6]; #endif @@ -272,8 +275,8 @@ void Simulation::run() for (straightStartLevel = maxInitLevel, threshold = 1; (staggeredStep & threshold) != threshold; straightStartLevel--, threshold <<= 1) ; } -#ifdef TIMING - timer.resetAndStart(); +#ifdef TIMING + timer.start(); #endif ////////////////////////////////////////////////////////////////////////// applyPreCollisionBC(straightStartLevel, maxInitLevel); @@ -282,8 +285,9 @@ void Simulation::run() calculateBlocks(straightStartLevel, maxInitLevel, calcStep); ////////////////////////////////////////////////////////////////////////// #ifdef TIMING - time[0] = timer.stop(); + time[0] = timer.getCurrentRuntimeInSeconds(); UBLOG(logINFO, "calculateBlocks time = " << time[0]); + timer.start(); #endif ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -291,31 +295,35 @@ void Simulation::run() exchangeBlockData(straightStartLevel, maxInitLevel); ////////////////////////////////////////////////////////////////////////// #ifdef TIMING - time[1] = timer.stop(); + time[1] = timer.getCurrentRuntimeInSeconds(); UBLOG(logINFO, "exchangeBlockData time = " << time[1]); + timer.start(); #endif ////////////////////////////////////////////////////////////////////////// applyPostCollisionBC(straightStartLevel, maxInitLevel); ////////////////////////////////////////////////////////////////////////// #ifdef TIMING - time[2] = timer.stop(); + time[2] = timer.getCurrentRuntimeInSeconds(); UBLOG(logINFO, "applyBCs time = " << time[2]); + timer.start(); #endif ////////////////////////////////////////////////////////////////////////// // swap distributions in kernel swapDistributions(straightStartLevel, maxInitLevel); ////////////////////////////////////////////////////////////////////////// #ifdef TIMING - time[3] = timer.stop(); + time[3] = timer.getCurrentRuntimeInSeconds(); UBLOG(logINFO, "swapDistributions time = " << time[3]); + timer.start(); #endif ////////////////////////////////////////////////////////////////////////// if (refinement) { if (straightStartLevel < maxInitLevel) exchangeBlockData(straightStartLevel, maxInitLevel); ////////////////////////////////////////////////////////////////////////// #ifdef TIMING - time[4] = timer.stop(); + time[4] = timer.getCurrentRuntimeInSeconds(); UBLOG(logINFO, "refinement exchangeBlockData time = " << time[4]); + timer.start(); #endif ////////////////////////////////////////////////////////////////////////// // now ghost nodes have actual values @@ -323,8 +331,9 @@ void Simulation::run() interpolation(straightStartLevel, maxInitLevel); ////////////////////////////////////////////////////////////////////////// #ifdef TIMING - time[5] = timer.stop(); + time[5] = timer.getCurrentRuntimeInSeconds(); UBLOG(logINFO, "refinement interpolation time = " << time[5]); + timer.start(); #endif ////////////////////////////////////////////////////////////////////////// } @@ -362,7 +371,10 @@ void Simulation::calculateBlocks(int startLevel, int maxInitLevel, int calcStep) SPtr<Block3D> blockTemp; // startLevel bis maxInitLevel for (int level = startLevel; level <= maxInitLevel; level++) { - // timer.resetAndStart(); +#ifdef TIMING + Timer timer; + timer.start(); +#endif // call LBM kernel int size = (int)blocks[level].size(); #ifdef _OPENMP @@ -378,9 +390,11 @@ void Simulation::calculateBlocks(int startLevel, int maxInitLevel, int calcStep) std::exit(EXIT_FAILURE); } } - // timer.stop(); - // UBLOG(logINFO, "level = " << level << " blocks = " << blocks[level].size() << " collision time = " << - // timer.getTotalTime()); +#ifdef TIMING + timer.end(); + UBLOG(logINFO, "level = " << level << " blocks = " << blocks[level].size() + << " collision time = " << timer.getTimeInSeconds()); +#endif } } } diff --git a/src/cpu/core/SimulationObservers/MPIIOMigrationBESimulationObserver.cpp b/src/cpu/core/SimulationObservers/MPIIOMigrationBESimulationObserver.cpp index c1dd846c43fb25037586033930ece502865c93ae..6fa22199a61e01fb5266418343d4f978c83bab22 100644 --- a/src/cpu/core/SimulationObservers/MPIIOMigrationBESimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/MPIIOMigrationBESimulationObserver.cpp @@ -5,7 +5,7 @@ #include "BoundaryConditions.h" #include <parallel/Communicator.h> #include "CoordinateTransformation3D.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "D3Q27System.h" #include "DataSet3D.h" #include "Grid3D.h" @@ -130,7 +130,7 @@ void MPIIOMigrationBESimulationObserver::writeDataSet(int step) DSArraysPresence arrPresence; bool firstBlock = true; int doubleCountInBlock = 0; - SPtr<D3Q27EsoTwist3DSplittedVector> D3Q27EsoTwist3DSplittedVectorPtrF = 0, D3Q27EsoTwist3DSplittedVectorPtrH1 = 0, D3Q27EsoTwist3DSplittedVectorPtrH2 = 0; + SPtr<EsoSplit> D3Q27EsoTwist3DSplittedVectorPtrF = 0, D3Q27EsoTwist3DSplittedVectorPtrH1 = 0, D3Q27EsoTwist3DSplittedVectorPtrH2 = 0; CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr localDistributionsF = 0, localDistributionsH1 = 0, localDistributionsH2 = 0; CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributionsF = 0, nonLocalDistributionsH1 = 0, nonLocalDistributionsH2 = 0; CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr zeroDistributionsF = 0, zeroDistributionsH1 = 0, zeroDistributionsH2 = 0; @@ -139,12 +139,12 @@ void MPIIOMigrationBESimulationObserver::writeDataSet(int step) { for (SPtr<Block3D> block : blocksVector[level]) // blocks of the current level { - D3Q27EsoTwist3DSplittedVectorPtrF = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(block->getKernel()->getDataSet()->getFdistributions()); + D3Q27EsoTwist3DSplittedVectorPtrF = dynamicPointerCast<EsoSplit>(block->getKernel()->getDataSet()->getFdistributions()); localDistributionsF = D3Q27EsoTwist3DSplittedVectorPtrF->getLocalDistributions(); nonLocalDistributionsF = D3Q27EsoTwist3DSplittedVectorPtrF->getNonLocalDistributions(); zeroDistributionsF = D3Q27EsoTwist3DSplittedVectorPtrF->getZeroDistributions(); - D3Q27EsoTwist3DSplittedVectorPtrH1 = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(block->getKernel()->getDataSet()->getHdistributions()); + D3Q27EsoTwist3DSplittedVectorPtrH1 = dynamicPointerCast<EsoSplit>(block->getKernel()->getDataSet()->getHdistributions()); if (D3Q27EsoTwist3DSplittedVectorPtrH1 != 0) { multiPhase1 = true; @@ -153,7 +153,7 @@ void MPIIOMigrationBESimulationObserver::writeDataSet(int step) zeroDistributionsH1 = D3Q27EsoTwist3DSplittedVectorPtrH1->getZeroDistributions(); } - D3Q27EsoTwist3DSplittedVectorPtrH2 = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(block->getKernel()->getDataSet()->getH2distributions()); + D3Q27EsoTwist3DSplittedVectorPtrH2 = dynamicPointerCast<EsoSplit>(block->getKernel()->getDataSet()->getH2distributions()); if (D3Q27EsoTwist3DSplittedVectorPtrH2 != 0) { multiPhase2 = true; @@ -1171,46 +1171,46 @@ void MPIIOMigrationBESimulationObserver::readDataSet(int step) vectorsOfValuesH23.assign(rawDataReceiveH2[r].data() + index, rawDataReceiveH2[r].data() + index + vectorSize3); index += vectorSize3; - SPtr<DistributionArray3D> mFdistributions(new D3Q27EsoTwist3DSplittedVector()); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mFdistributions)->setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( + SPtr<DistributionArray3D> mFdistributions(new EsoSplit()); + dynamicPointerCast<EsoSplit>(mFdistributions)->setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( new CbArray4D<real, IndexerX4X3X2X1>(vectorsOfValuesF1, dataSetParamStr1.nx[0], dataSetParamStr1.nx[1], dataSetParamStr1.nx[2], dataSetParamStr1.nx[3]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mFdistributions)->setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( + dynamicPointerCast<EsoSplit>(mFdistributions)->setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( new CbArray4D<real, IndexerX4X3X2X1>(vectorsOfValuesF2, dataSetParamStr2.nx[0], dataSetParamStr2.nx[1], dataSetParamStr2.nx[2], dataSetParamStr2.nx[3]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mFdistributions)->setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>( + dynamicPointerCast<EsoSplit>(mFdistributions)->setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>( vectorsOfValuesF3, dataSetParamStr3.nx[0], dataSetParamStr3.nx[1], dataSetParamStr3.nx[2]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mFdistributions)->setNX1(dataSetParamStr1.nx1); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mFdistributions)->setNX2(dataSetParamStr1.nx2); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mFdistributions)->setNX3(dataSetParamStr1.nx3); + dynamicPointerCast<EsoSplit>(mFdistributions)->setNX1(dataSetParamStr1.nx1); + dynamicPointerCast<EsoSplit>(mFdistributions)->setNX2(dataSetParamStr1.nx2); + dynamicPointerCast<EsoSplit>(mFdistributions)->setNX3(dataSetParamStr1.nx3); - SPtr<DistributionArray3D> mH1distributions(new D3Q27EsoTwist3DSplittedVector()); + SPtr<DistributionArray3D> mH1distributions(new EsoSplit()); if (multiPhase1) { - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH1distributions)->setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( + dynamicPointerCast<EsoSplit>(mH1distributions)->setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( new CbArray4D<real, IndexerX4X3X2X1>(vectorsOfValuesH11, dataSetParamStr1.nx[0], dataSetParamStr1.nx[1], dataSetParamStr1.nx[2], dataSetParamStr1.nx[3]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH1distributions)->setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( + dynamicPointerCast<EsoSplit>(mH1distributions)->setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( new CbArray4D<real, IndexerX4X3X2X1>(vectorsOfValuesH12, dataSetParamStr2.nx[0], dataSetParamStr2.nx[1], dataSetParamStr2.nx[2], dataSetParamStr2.nx[3]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH1distributions)->setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>( + dynamicPointerCast<EsoSplit>(mH1distributions)->setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>( vectorsOfValuesH13, dataSetParamStr3.nx[0], dataSetParamStr3.nx[1], dataSetParamStr3.nx[2]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH1distributions)->setNX1(dataSetParamStr1.nx1); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH1distributions)->setNX2(dataSetParamStr1.nx2); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH1distributions)->setNX3(dataSetParamStr1.nx3); + dynamicPointerCast<EsoSplit>(mH1distributions)->setNX1(dataSetParamStr1.nx1); + dynamicPointerCast<EsoSplit>(mH1distributions)->setNX2(dataSetParamStr1.nx2); + dynamicPointerCast<EsoSplit>(mH1distributions)->setNX3(dataSetParamStr1.nx3); } - SPtr<DistributionArray3D> mH2distributions(new D3Q27EsoTwist3DSplittedVector()); + SPtr<DistributionArray3D> mH2distributions(new EsoSplit()); if (multiPhase2) { - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH2distributions)->setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( + dynamicPointerCast<EsoSplit>(mH2distributions)->setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( new CbArray4D<real, IndexerX4X3X2X1>(vectorsOfValuesH21, dataSetParamStr1.nx[0], dataSetParamStr1.nx[1], dataSetParamStr1.nx[2], dataSetParamStr1.nx[3]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH2distributions)->setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( + dynamicPointerCast<EsoSplit>(mH2distributions)->setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( new CbArray4D<real, IndexerX4X3X2X1>(vectorsOfValuesH22, dataSetParamStr2.nx[0], dataSetParamStr2.nx[1], dataSetParamStr2.nx[2], dataSetParamStr2.nx[3]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH2distributions)->setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>( + dynamicPointerCast<EsoSplit>(mH2distributions)->setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>( vectorsOfValuesH23, dataSetParamStr3.nx[0], dataSetParamStr3.nx[1], dataSetParamStr3.nx[2]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH2distributions)->setNX1(dataSetParamStr1.nx1); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH2distributions)->setNX2(dataSetParamStr1.nx2); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH2distributions)->setNX3(dataSetParamStr1.nx3); + dynamicPointerCast<EsoSplit>(mH2distributions)->setNX1(dataSetParamStr1.nx1); + dynamicPointerCast<EsoSplit>(mH2distributions)->setNX2(dataSetParamStr1.nx2); + dynamicPointerCast<EsoSplit>(mH2distributions)->setNX3(dataSetParamStr1.nx3); } // find the nesessary block and fill it diff --git a/src/cpu/core/SimulationObservers/MPIIOMigrationSimulationObserver.cpp b/src/cpu/core/SimulationObservers/MPIIOMigrationSimulationObserver.cpp index 7552ee428c16c065e7c3e506c0facfeca2476268..6c031011d400870abfa0ed95fd3312f973a98626 100644 --- a/src/cpu/core/SimulationObservers/MPIIOMigrationSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/MPIIOMigrationSimulationObserver.cpp @@ -5,7 +5,7 @@ #include "BoundaryConditions.h" #include <parallel/Communicator.h> #include "CoordinateTransformation3D.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "D3Q27System.h" #include "DataSet3D.h" #include "Grid3D.h" @@ -150,7 +150,7 @@ void MPIIOMigrationSimulationObserver::writeDataSet(int step) bool firstBlock = true; size_t doubleCountInBlock = 0; int ic = 0; - SPtr<D3Q27EsoTwist3DSplittedVector> D3Q27EsoTwist3DSplittedVectorPtrF = 0, D3Q27EsoTwist3DSplittedVectorPtrH1 = 0, D3Q27EsoTwist3DSplittedVectorPtrH2 = 0; + SPtr<EsoSplit> D3Q27EsoTwist3DSplittedVectorPtrF = 0, D3Q27EsoTwist3DSplittedVectorPtrH1 = 0, D3Q27EsoTwist3DSplittedVectorPtrH2 = 0; CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr localDistributionsF = 0, localDistributionsH1 = 0, localDistributionsH2 = 0; CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributionsF = 0, nonLocalDistributionsH1 = 0, nonLocalDistributionsH2 = 0; CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr zeroDistributionsF = 0, zeroDistributionsH1 = 0, zeroDistributionsH2 = 0; @@ -173,12 +173,12 @@ void MPIIOMigrationSimulationObserver::writeDataSet(int step) dataSetArray[ic].collFactorG = kernel->getCollisionFactorG(); dataSetArray[ic].densityRatio = kernel->getDensityRatio(); - D3Q27EsoTwist3DSplittedVectorPtrF = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(block->getKernel()->getDataSet()->getFdistributions()); + D3Q27EsoTwist3DSplittedVectorPtrF = dynamicPointerCast<EsoSplit>(block->getKernel()->getDataSet()->getFdistributions()); localDistributionsF = D3Q27EsoTwist3DSplittedVectorPtrF->getLocalDistributions(); nonLocalDistributionsF = D3Q27EsoTwist3DSplittedVectorPtrF->getNonLocalDistributions(); zeroDistributionsF = D3Q27EsoTwist3DSplittedVectorPtrF->getZeroDistributions(); - D3Q27EsoTwist3DSplittedVectorPtrH1 = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(block->getKernel()->getDataSet()->getHdistributions()); + D3Q27EsoTwist3DSplittedVectorPtrH1 = dynamicPointerCast<EsoSplit>(block->getKernel()->getDataSet()->getHdistributions()); if (D3Q27EsoTwist3DSplittedVectorPtrH1 != 0) { multiPhase1 = true; @@ -187,7 +187,7 @@ void MPIIOMigrationSimulationObserver::writeDataSet(int step) zeroDistributionsH1 = D3Q27EsoTwist3DSplittedVectorPtrH1->getZeroDistributions(); } - D3Q27EsoTwist3DSplittedVectorPtrH2 = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(block->getKernel()->getDataSet()->getH2distributions()); + D3Q27EsoTwist3DSplittedVectorPtrH2 = dynamicPointerCast<EsoSplit>(block->getKernel()->getDataSet()->getH2distributions()); if (D3Q27EsoTwist3DSplittedVectorPtrH2 != 0) { multiPhase2 = true; @@ -1096,48 +1096,48 @@ void MPIIOMigrationSimulationObserver::readDataSet(int step) vectorsOfValuesH23.assign(doubleValuesArrayH2.data() + index, doubleValuesArrayH2.data() + index + vectorSize3); index += vectorSize3; - SPtr<DistributionArray3D> mFdistributions(new D3Q27EsoTwist3DSplittedVector()); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mFdistributions)->setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( + SPtr<DistributionArray3D> mFdistributions(new EsoSplit()); + dynamicPointerCast<EsoSplit>(mFdistributions)->setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( new CbArray4D<real, IndexerX4X3X2X1>(vectorsOfValuesF1, dataSetParamStr1.nx[0], dataSetParamStr1.nx[1], dataSetParamStr1.nx[2], dataSetParamStr1.nx[3]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mFdistributions)->setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( + dynamicPointerCast<EsoSplit>(mFdistributions)->setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( new CbArray4D<real, IndexerX4X3X2X1>(vectorsOfValuesF2, dataSetParamStr2.nx[0], dataSetParamStr2.nx[1], dataSetParamStr2.nx[2], dataSetParamStr2.nx[3]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mFdistributions)->setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>( + dynamicPointerCast<EsoSplit>(mFdistributions)->setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>( vectorsOfValuesF3, dataSetParamStr3.nx[0], dataSetParamStr3.nx[1], dataSetParamStr3.nx[2]))); //----------------------------------------- H1 ---------------------------------------------------- - SPtr<DistributionArray3D> mH1distributions(new D3Q27EsoTwist3DSplittedVector()); + SPtr<DistributionArray3D> mH1distributions(new EsoSplit()); if (multiPhase1) { - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH1distributions)->setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( + dynamicPointerCast<EsoSplit>(mH1distributions)->setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( new CbArray4D<real, IndexerX4X3X2X1>(vectorsOfValuesH11, dataSetParamStr1.nx[0], dataSetParamStr1.nx[1], dataSetParamStr1.nx[2], dataSetParamStr1.nx[3]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH1distributions)->setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( + dynamicPointerCast<EsoSplit>(mH1distributions)->setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( new CbArray4D<real, IndexerX4X3X2X1>(vectorsOfValuesH12, dataSetParamStr2.nx[0], dataSetParamStr2.nx[1], dataSetParamStr2.nx[2], dataSetParamStr2.nx[3]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH1distributions)->setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>( + dynamicPointerCast<EsoSplit>(mH1distributions)->setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>( vectorsOfValuesH13, dataSetParamStr3.nx[0], dataSetParamStr3.nx[1], dataSetParamStr3.nx[2]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH1distributions)->setNX1(dataSetParamStr1.nx1); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH1distributions)->setNX2(dataSetParamStr1.nx2); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH1distributions)->setNX3(dataSetParamStr1.nx3); + dynamicPointerCast<EsoSplit>(mH1distributions)->setNX1(dataSetParamStr1.nx1); + dynamicPointerCast<EsoSplit>(mH1distributions)->setNX2(dataSetParamStr1.nx2); + dynamicPointerCast<EsoSplit>(mH1distributions)->setNX3(dataSetParamStr1.nx3); } - SPtr<DistributionArray3D> mH2distributions(new D3Q27EsoTwist3DSplittedVector()); + SPtr<DistributionArray3D> mH2distributions(new EsoSplit()); if (multiPhase2) { - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH2distributions)->setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( + dynamicPointerCast<EsoSplit>(mH2distributions)->setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( new CbArray4D<real, IndexerX4X3X2X1>(vectorsOfValuesH21, dataSetParamStr1.nx[0], dataSetParamStr1.nx[1], dataSetParamStr1.nx[2], dataSetParamStr1.nx[3]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH2distributions)->setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( + dynamicPointerCast<EsoSplit>(mH2distributions)->setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( new CbArray4D<real, IndexerX4X3X2X1>(vectorsOfValuesH22, dataSetParamStr2.nx[0], dataSetParamStr2.nx[1], dataSetParamStr2.nx[2], dataSetParamStr2.nx[3]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH2distributions)->setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>( + dynamicPointerCast<EsoSplit>(mH2distributions)->setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>( vectorsOfValuesH23, dataSetParamStr3.nx[0], dataSetParamStr3.nx[1], dataSetParamStr3.nx[2]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH2distributions)->setNX1(dataSetParamStr1.nx1); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH2distributions)->setNX2(dataSetParamStr1.nx2); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH2distributions)->setNX3(dataSetParamStr1.nx3); + dynamicPointerCast<EsoSplit>(mH2distributions)->setNX1(dataSetParamStr1.nx1); + dynamicPointerCast<EsoSplit>(mH2distributions)->setNX2(dataSetParamStr1.nx2); + dynamicPointerCast<EsoSplit>(mH2distributions)->setNX3(dataSetParamStr1.nx3); } - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mFdistributions)->setNX1(dataSetParamStr1.nx1); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mFdistributions)->setNX2(dataSetParamStr1.nx2); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mFdistributions)->setNX3(dataSetParamStr1.nx3); + dynamicPointerCast<EsoSplit>(mFdistributions)->setNX1(dataSetParamStr1.nx1); + dynamicPointerCast<EsoSplit>(mFdistributions)->setNX2(dataSetParamStr1.nx2); + dynamicPointerCast<EsoSplit>(mFdistributions)->setNX3(dataSetParamStr1.nx3); // find the nesessary block and fill it SPtr<Block3D> block = grid->getBlock(dataSetArray[n].globalID); diff --git a/src/cpu/core/SimulationObservers/MPIIORestartSimulationObserver.cpp b/src/cpu/core/SimulationObservers/MPIIORestartSimulationObserver.cpp index 71133fc81aa247e87b92898c6bd8a006fa27b62c..af43f64a68167372f98e4046cf14f6ca915b3ea3 100644 --- a/src/cpu/core/SimulationObservers/MPIIORestartSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/MPIIORestartSimulationObserver.cpp @@ -5,7 +5,7 @@ #include "BoundaryConditions.h" #include <parallel/Communicator.h> #include "CoordinateTransformation3D.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "D3Q27System.h" #include "DataSet3D.h" #include "Grid3D.h" @@ -155,7 +155,7 @@ void MPIIORestartSimulationObserver::writeDataSet(int step) int doubleCountInBlock = 0; int ic = 0; - SPtr<D3Q27EsoTwist3DSplittedVector> D3Q27EsoTwist3DSplittedVectorPtrF, D3Q27EsoTwist3DSplittedVectorPtrH1, D3Q27EsoTwist3DSplittedVectorPtrH2; + SPtr<EsoSplit> D3Q27EsoTwist3DSplittedVectorPtrF, D3Q27EsoTwist3DSplittedVectorPtrH1, D3Q27EsoTwist3DSplittedVectorPtrH2; CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr localDistributionsF, localDistributionsH1, localDistributionsH2; CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributionsF, nonLocalDistributionsH1, nonLocalDistributionsH2; CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr zeroDistributionsF, zeroDistributionsH1, zeroDistributionsH2; @@ -181,12 +181,12 @@ void MPIIORestartSimulationObserver::writeDataSet(int step) dataSetArray[ic].collFactorG = kernel->getCollisionFactorG(); dataSetArray[ic].densityRatio = kernel->getDensityRatio(); - D3Q27EsoTwist3DSplittedVectorPtrF = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(block->getKernel()->getDataSet()->getFdistributions()); + D3Q27EsoTwist3DSplittedVectorPtrF = dynamicPointerCast<EsoSplit>(block->getKernel()->getDataSet()->getFdistributions()); localDistributionsF = D3Q27EsoTwist3DSplittedVectorPtrF->getLocalDistributions(); nonLocalDistributionsF = D3Q27EsoTwist3DSplittedVectorPtrF->getNonLocalDistributions(); zeroDistributionsF = D3Q27EsoTwist3DSplittedVectorPtrF->getZeroDistributions(); - D3Q27EsoTwist3DSplittedVectorPtrH1 = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(block->getKernel()->getDataSet()->getHdistributions()); + D3Q27EsoTwist3DSplittedVectorPtrH1 = dynamicPointerCast<EsoSplit>(block->getKernel()->getDataSet()->getHdistributions()); if (D3Q27EsoTwist3DSplittedVectorPtrH1 != 0) { multiPhase1 = true; @@ -195,7 +195,7 @@ void MPIIORestartSimulationObserver::writeDataSet(int step) zeroDistributionsH1 = D3Q27EsoTwist3DSplittedVectorPtrH1->getZeroDistributions(); } - D3Q27EsoTwist3DSplittedVectorPtrH2 = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(block->getKernel()->getDataSet()->getH2distributions()); + D3Q27EsoTwist3DSplittedVectorPtrH2 = dynamicPointerCast<EsoSplit>(block->getKernel()->getDataSet()->getH2distributions()); if (D3Q27EsoTwist3DSplittedVectorPtrH2 != 0) { multiPhase2 = true; @@ -1156,46 +1156,46 @@ void MPIIORestartSimulationObserver::readDataSet(int step) vectorsOfValuesH23.assign(doubleValuesArrayH2.data() + index, doubleValuesArrayH2.data() + index + vectorSize3); index += vectorSize3; - SPtr<DistributionArray3D> mFdistributions(new D3Q27EsoTwist3DSplittedVector()); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mFdistributions)->setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( + SPtr<DistributionArray3D> mFdistributions(new EsoSplit()); + dynamicPointerCast<EsoSplit>(mFdistributions)->setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( new CbArray4D<real, IndexerX4X3X2X1>(vectorsOfValuesF1, dataSetParamStr1.nx[0], dataSetParamStr1.nx[1], dataSetParamStr1.nx[2], dataSetParamStr1.nx[3]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mFdistributions)->setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( + dynamicPointerCast<EsoSplit>(mFdistributions)->setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( new CbArray4D<real, IndexerX4X3X2X1>(vectorsOfValuesF2, dataSetParamStr2.nx[0], dataSetParamStr2.nx[1], dataSetParamStr2.nx[2], dataSetParamStr2.nx[3]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mFdistributions)->setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>( + dynamicPointerCast<EsoSplit>(mFdistributions)->setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>( vectorsOfValuesF3, dataSetParamStr3.nx[0], dataSetParamStr3.nx[1], dataSetParamStr3.nx[2]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mFdistributions)->setNX1(dataSetParamStr1.nx1); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mFdistributions)->setNX2(dataSetParamStr1.nx2); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mFdistributions)->setNX3(dataSetParamStr1.nx3); + dynamicPointerCast<EsoSplit>(mFdistributions)->setNX1(dataSetParamStr1.nx1); + dynamicPointerCast<EsoSplit>(mFdistributions)->setNX2(dataSetParamStr1.nx2); + dynamicPointerCast<EsoSplit>(mFdistributions)->setNX3(dataSetParamStr1.nx3); - SPtr<DistributionArray3D> mH1distributions(new D3Q27EsoTwist3DSplittedVector()); + SPtr<DistributionArray3D> mH1distributions(new EsoSplit()); if (multiPhase1) { - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH1distributions)->setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( + dynamicPointerCast<EsoSplit>(mH1distributions)->setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( new CbArray4D<real, IndexerX4X3X2X1>(vectorsOfValuesH11, dataSetParamStr1.nx[0], dataSetParamStr1.nx[1], dataSetParamStr1.nx[2], dataSetParamStr1.nx[3]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH1distributions)->setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( + dynamicPointerCast<EsoSplit>(mH1distributions)->setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( new CbArray4D<real, IndexerX4X3X2X1>(vectorsOfValuesH12, dataSetParamStr2.nx[0], dataSetParamStr2.nx[1], dataSetParamStr2.nx[2], dataSetParamStr2.nx[3]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH1distributions)->setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>( + dynamicPointerCast<EsoSplit>(mH1distributions)->setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>( vectorsOfValuesH13, dataSetParamStr3.nx[0], dataSetParamStr3.nx[1], dataSetParamStr3.nx[2]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH1distributions)->setNX1(dataSetParamStr1.nx1); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH1distributions)->setNX2(dataSetParamStr1.nx2); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH1distributions)->setNX3(dataSetParamStr1.nx3); + dynamicPointerCast<EsoSplit>(mH1distributions)->setNX1(dataSetParamStr1.nx1); + dynamicPointerCast<EsoSplit>(mH1distributions)->setNX2(dataSetParamStr1.nx2); + dynamicPointerCast<EsoSplit>(mH1distributions)->setNX3(dataSetParamStr1.nx3); } - SPtr<DistributionArray3D> mH2distributions(new D3Q27EsoTwist3DSplittedVector()); + SPtr<DistributionArray3D> mH2distributions(new EsoSplit()); if (multiPhase2) { - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH2distributions)->setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( + dynamicPointerCast<EsoSplit>(mH2distributions)->setLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( new CbArray4D<real, IndexerX4X3X2X1>(vectorsOfValuesH21, dataSetParamStr1.nx[0], dataSetParamStr1.nx[1], dataSetParamStr1.nx[2], dataSetParamStr1.nx[3]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH2distributions)->setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( + dynamicPointerCast<EsoSplit>(mH2distributions)->setNonLocalDistributions(CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr( new CbArray4D<real, IndexerX4X3X2X1>(vectorsOfValuesH22, dataSetParamStr2.nx[0], dataSetParamStr2.nx[1], dataSetParamStr2.nx[2], dataSetParamStr2.nx[3]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH2distributions)->setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>( + dynamicPointerCast<EsoSplit>(mH2distributions)->setZeroDistributions(CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr(new CbArray3D<real, IndexerX3X2X1>( vectorsOfValuesH23, dataSetParamStr3.nx[0], dataSetParamStr3.nx[1], dataSetParamStr3.nx[2]))); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH2distributions)->setNX1(dataSetParamStr1.nx1); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH2distributions)->setNX2(dataSetParamStr1.nx2); - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(mH2distributions)->setNX3(dataSetParamStr1.nx3); + dynamicPointerCast<EsoSplit>(mH2distributions)->setNX1(dataSetParamStr1.nx1); + dynamicPointerCast<EsoSplit>(mH2distributions)->setNX2(dataSetParamStr1.nx2); + dynamicPointerCast<EsoSplit>(mH2distributions)->setNX3(dataSetParamStr1.nx3); } // find the nesessary block and fill it diff --git a/src/cpu/core/SimulationObservers/NUPSCounterSimulationObserver.cpp b/src/cpu/core/SimulationObservers/NUPSCounterSimulationObserver.cpp index 81d7217c4b848ae3a6510fc1920c7621ee71c0aa..9fd7a3bef5375969d7f79da0b5d8478d369eb241 100644 --- a/src/cpu/core/SimulationObservers/NUPSCounterSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/NUPSCounterSimulationObserver.cpp @@ -42,7 +42,7 @@ NUPSCounterSimulationObserver::NUPSCounterSimulationObserver(SPtr<Grid3D> grid, : SimulationObserver(grid, s), numOfThreads(numOfThreads), nup(0), nup_t(0), nupsStep(0.0), comm(comm) { if (comm->getProcessID() == comm->getRoot()) { - timer.resetAndStart(); + timer.start(); real nop = comm->getNumberOfProcesses(); int minInitLevel = grid->getCoarsestInitializedLevel(); @@ -70,16 +70,17 @@ void NUPSCounterSimulationObserver::update(real step) void NUPSCounterSimulationObserver::collectData(real step) { if (comm->getProcessID() == comm->getRoot()) { - real time = timer.stop(); - real nups_t = nup_t * (step - nupsStep) / time; - real nups = nup * (step - nupsStep) / time; - real tnups = nups / (real)numOfThreads; + timer.end(); + double time = timer.getCurrentRuntimeInSeconds(); + double nups_t = nup_t * (step - nupsStep) / time; + double nups = nup * (step - nupsStep) / time; + double tnups = nups / (double)numOfThreads; UBLOG(logINFO, "Calculation step = " << step); UBLOG(logINFO, "Total performance = " << nups_t << " NUPS"); UBLOG(logINFO, "Performance per update = " << nups << " NUPS"); UBLOG(logINFO, "Performance per thread = " << tnups << " NUPS"); UBLOG(logINFO, "Time for " << step - nupsStep << " steps = " << time << " s"); nupsStep = step; - timer.resetAndStart(); + timer.start(); } } diff --git a/src/cpu/core/SimulationObservers/NUPSCounterSimulationObserver.h b/src/cpu/core/SimulationObservers/NUPSCounterSimulationObserver.h index f0585bbdb911e3dd33262d1a790a10b97da789de..29be2c4c40eeb363ca5eabeadb17b79fb556345d 100644 --- a/src/cpu/core/SimulationObservers/NUPSCounterSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/NUPSCounterSimulationObserver.h @@ -37,7 +37,8 @@ #include <PointerDefinitions.h> #include "SimulationObserver.h" -#include "basics/utilities/UbTiming.h" + +#include <basics/Timer/Timer.h> namespace vf::parallel {class Communicator;} class Grid3D; @@ -63,7 +64,7 @@ protected: //! Collect data for calculation of NUPS //! \param step is a time step void collectData(real step); - UbTimer timer; + vf::basics::Timer timer; int numOfThreads; real numberOfNodes; real numberOfBlocks; diff --git a/src/cpu/core/Visitors/BoundaryConditionsBlockVisitor.cpp b/src/cpu/core/Visitors/BoundaryConditionsBlockVisitor.cpp index b22750db74d12410e2c376c4fabc7d164798ffff..4782937be85e40806b7476cd25fa324bbd410ffb 100644 --- a/src/cpu/core/Visitors/BoundaryConditionsBlockVisitor.cpp +++ b/src/cpu/core/Visitors/BoundaryConditionsBlockVisitor.cpp @@ -36,7 +36,7 @@ #include "BCArray3D.h" #include "BCSet.h" #include "Block3D.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "DataSet3D.h" #include "Grid3D.h" #include "D3Q27System.h" diff --git a/src/cpu/core/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp b/src/cpu/core/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp index e6ab0193cdbc417c28fa90fa83fa897570048ae3..6874c3dcab52601665605d2521372e934dbfd6df 100644 --- a/src/cpu/core/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp +++ b/src/cpu/core/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp @@ -4,7 +4,7 @@ #include "BCSet.h" #include "Block3D.h" -#include "D3Q27EsoTwist3DSplittedVector.h" +#include "EsoSplit.h" #include "DataSet3D.h" #include "Grid3D.h" #include "D3Q27System.h" @@ -120,11 +120,11 @@ void InitDistributionsWithInterpolationGridVisitor::copyRemoteBlock(SPtr<Block3D dynamicPointerCast<EsoTwist3D>(oldKernel->getDataSet()->getFdistributions()); CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr localDistributions = - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(oldDistributions)->getLocalDistributions(); + dynamicPointerCast<EsoSplit>(oldDistributions)->getLocalDistributions(); CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributions = - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(oldDistributions)->getNonLocalDistributions(); + dynamicPointerCast<EsoSplit>(oldDistributions)->getNonLocalDistributions(); CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr zeroDistributions = - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(oldDistributions)->getZeroDistributions(); + dynamicPointerCast<EsoSplit>(oldDistributions)->getZeroDistributions(); MPI_Send(localDistributions->getStartAdressOfSortedArray(0, 0, 0, 0), (int)localDistributions->getDataVector().size(), MPI_DOUBLE, newBlockRank, 0, MPI_COMM_WORLD); @@ -142,11 +142,11 @@ void InitDistributionsWithInterpolationGridVisitor::copyRemoteBlock(SPtr<Block3D dynamicPointerCast<EsoTwist3D>(newKernel->getDataSet()->getFdistributions()); CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr localDistributions = - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(newDistributions)->getLocalDistributions(); + dynamicPointerCast<EsoSplit>(newDistributions)->getLocalDistributions(); CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributions = - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(newDistributions)->getNonLocalDistributions(); + dynamicPointerCast<EsoSplit>(newDistributions)->getNonLocalDistributions(); CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr zeroDistributions = - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(newDistributions)->getZeroDistributions(); + dynamicPointerCast<EsoSplit>(newDistributions)->getZeroDistributions(); MPI_Recv(localDistributions->getStartAdressOfSortedArray(0, 0, 0, 0), (int)localDistributions->getDataVector().size(), MPI_DOUBLE, oldBlockRank, 0, MPI_COMM_WORLD, @@ -270,11 +270,11 @@ void InitDistributionsWithInterpolationGridVisitor::interpolateRemoteBlockCoarse dynamicPointerCast<EsoTwist3D>(oldKernel->getDataSet()->getFdistributions()); CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr localDistributions = - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(oldDistributions)->getLocalDistributions(); + dynamicPointerCast<EsoSplit>(oldDistributions)->getLocalDistributions(); CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributions = - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(oldDistributions)->getNonLocalDistributions(); + dynamicPointerCast<EsoSplit>(oldDistributions)->getNonLocalDistributions(); CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr zeroDistributions = - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(oldDistributions)->getZeroDistributions(); + dynamicPointerCast<EsoSplit>(oldDistributions)->getZeroDistributions(); MPI_Send(localDistributions->getStartAdressOfSortedArray(0, 0, 0, 0), (int)localDistributions->getDataVector().size(), MPI_DOUBLE, newBlockRank, 0, MPI_COMM_WORLD); @@ -315,14 +315,14 @@ void InitDistributionsWithInterpolationGridVisitor::interpolateRemoteBlockCoarse int bMaxX2 = (int)newDistributions->getNX2(); int bMaxX3 = (int)newDistributions->getNX3(); - SPtr<EsoTwist3D> oldDistributions(new D3Q27EsoTwist3DSplittedVector(bMaxX1, bMaxX2, bMaxX3, 0)); + SPtr<EsoTwist3D> oldDistributions(new EsoSplit(bMaxX1, bMaxX2, bMaxX3, 0)); CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr localDistributions = - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(oldDistributions)->getLocalDistributions(); + dynamicPointerCast<EsoSplit>(oldDistributions)->getLocalDistributions(); CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributions = - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(oldDistributions)->getNonLocalDistributions(); + dynamicPointerCast<EsoSplit>(oldDistributions)->getNonLocalDistributions(); CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr zeroDistributions = - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(oldDistributions)->getZeroDistributions(); + dynamicPointerCast<EsoSplit>(oldDistributions)->getZeroDistributions(); MPI_Recv(localDistributions->getStartAdressOfSortedArray(0, 0, 0, 0), (int)localDistributions->getDataVector().size(), MPI_DOUBLE, oldBlockRank, 0, MPI_COMM_WORLD, @@ -505,11 +505,11 @@ void InitDistributionsWithInterpolationGridVisitor::interpolateRemoteBlockFineTo dynamicPointerCast<EsoTwist3D>(oldKernel->getDataSet()->getFdistributions()); CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr localDistributions = - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(oldDistributions)->getLocalDistributions(); + dynamicPointerCast<EsoSplit>(oldDistributions)->getLocalDistributions(); CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributions = - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(oldDistributions)->getNonLocalDistributions(); + dynamicPointerCast<EsoSplit>(oldDistributions)->getNonLocalDistributions(); CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr zeroDistributions = - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(oldDistributions)->getZeroDistributions(); + dynamicPointerCast<EsoSplit>(oldDistributions)->getZeroDistributions(); MPI_Send(localDistributions->getStartAdressOfSortedArray(0, 0, 0, 0), (int)localDistributions->getDataVector().size(), MPI_DOUBLE, newBlockRank, 0, MPI_COMM_WORLD); @@ -550,14 +550,14 @@ void InitDistributionsWithInterpolationGridVisitor::interpolateRemoteBlockFineTo int bMaxX2 = (int)newDistributions->getNX2(); int bMaxX3 = (int)newDistributions->getNX3(); - SPtr<EsoTwist3D> oldDistributions(new D3Q27EsoTwist3DSplittedVector(bMaxX1, bMaxX2, bMaxX3, 0)); + SPtr<EsoTwist3D> oldDistributions(new EsoSplit(bMaxX1, bMaxX2, bMaxX3, 0)); CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr localDistributions = - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(oldDistributions)->getLocalDistributions(); + dynamicPointerCast<EsoSplit>(oldDistributions)->getLocalDistributions(); CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributions = - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(oldDistributions)->getNonLocalDistributions(); + dynamicPointerCast<EsoSplit>(oldDistributions)->getNonLocalDistributions(); CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr zeroDistributions = - dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(oldDistributions)->getZeroDistributions(); + dynamicPointerCast<EsoSplit>(oldDistributions)->getZeroDistributions(); MPI_Recv(localDistributions->getStartAdressOfSortedArray(0, 0, 0, 0), (int)localDistributions->getDataVector().size(), MPI_DOUBLE, oldBlockRank, 0, MPI_COMM_WORLD, diff --git a/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMesh.cpp b/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMesh.cpp index e5ab3c83291b8f4fd27bb3eee5f26d3fcdb69278..0caaff55becfe5d59d9abc70340f9b6c770f8f45 100644 --- a/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMesh.cpp +++ b/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMesh.cpp @@ -97,13 +97,14 @@ void TriangularMesh::findNeighbors() { VF_LOG_INFO("start finding neighbors ..."); - auto t = Timer::makeStart(); + vf::basics::Timer t; + t.start(); TriangleNeighborFinder finder(triangles, size); finder.fillWithNeighborAngles(this); - t->end(); - VF_LOG_INFO("time finding neighbors = {}", t->getTimeInSeconds()); + t.end(); + VF_LOG_INFO("time finding neighbors = {}", t.getTimeInSeconds()); } void TriangularMesh::setTriangles(std::vector<Triangle> triangles) diff --git a/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMeshStrategy.cpp b/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMeshStrategy.cpp index 6d12a19cc097c0b8e98c59a938380be97dc0b15c..03a0ec30ab60075a08007de65a2e349b2b6d93e7 100644 --- a/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMeshStrategy.cpp +++ b/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMeshStrategy.cpp @@ -61,7 +61,8 @@ void PointInObjectDiscretizationStrategy::doDiscretize(TriangularMesh* triangula // trigger the GbTriFaceMesh3D to generate a kd-tree triangularMesh->getGbTriFaceMesh3D()->isPointInGbObject3D(0.0, 0.0, 0.0); - auto timer = Timer::makeStart(); + vf::basics::Timer timer; + timer.start(); real outputTime = 60.0; @@ -78,9 +79,9 @@ void PointInObjectDiscretizationStrategy::doDiscretize(TriangularMesh* triangula //else // grid->setNodeTo(i, OuterType); - if( timer->getCurrentRuntimeInSeconds() > outputTime ){ + if( timer.getCurrentRuntimeInSeconds() > outputTime ){ VF_LOG_INFO(" {} / {} nodes tested", index, grid->getSize()); - timer->start(); + timer.start(); } } VF_LOG_INFO("Done Point-In-Object Test"); diff --git a/src/gpu/GridGenerator/io/SimulationFileWriter/SimulationFileWriter.cpp b/src/gpu/GridGenerator/io/SimulationFileWriter/SimulationFileWriter.cpp index d3a467b0511f7f4b40d06b4c6d9b57ff09b9694a..333462abd76e548a26fb72392ecbd635619a8b4e 100644 --- a/src/gpu/GridGenerator/io/SimulationFileWriter/SimulationFileWriter.cpp +++ b/src/gpu/GridGenerator/io/SimulationFileWriter/SimulationFileWriter.cpp @@ -60,11 +60,12 @@ void SimulationFileWriter::write(const std::string& folder, SPtr<GridBuilder> bu SimulationFileWriter::folder = folder; VF_LOG_INFO("Start writing simulation files to {}", folder); - auto timer = Timer::makeStart(); + vf::basics::Timer timer; + timer.start(); write(builder, format); - VF_LOG_INFO(" Time writing files: {} sec", timer->getCurrentRuntimeInSeconds()); + VF_LOG_INFO(" Time writing files: {} sec", timer.getCurrentRuntimeInSeconds()); VF_LOG_INFO("Done writing simulation Files!"); } diff --git a/src/lbm/constants/D3Q27.h b/src/lbm/constants/D3Q27.h index 292af239e333b79d118150f0cfee5477e895d200..cd40c42786ab760e1b7c77dc229a5e40d7aebc84 100644 --- a/src/lbm/constants/D3Q27.h +++ b/src/lbm/constants/D3Q27.h @@ -64,5 +64,61 @@ static constexpr size_t iMPM = dPMP; static constexpr size_t iPMM = dMPP; static constexpr size_t iMMM = dPPP; +static constexpr size_t eP00 = 0; +static constexpr size_t eM00 = 0; +static constexpr size_t e0P0 = 1; +static constexpr size_t e0M0 = 1; +static constexpr size_t e00P = 2; +static constexpr size_t e00M = 2; +static constexpr size_t ePP0 = 3; +static constexpr size_t eMM0 = 3; +static constexpr size_t ePM0 = 4; +static constexpr size_t eMP0 = 4; +static constexpr size_t eP0P = 5; +static constexpr size_t eM0M = 5; +static constexpr size_t eP0M = 6; +static constexpr size_t eM0P = 6; +static constexpr size_t e0PP = 7; +static constexpr size_t e0MM = 7; +static constexpr size_t e0PM = 8; +static constexpr size_t e0MP = 8; +static constexpr size_t ePPP = 9; +static constexpr size_t eMMM = 9; +static constexpr size_t eMPP = 10; +static constexpr size_t ePMM = 10; +static constexpr size_t ePMP = 11; +static constexpr size_t eMPM = 11; +static constexpr size_t eMMP = 12; +static constexpr size_t ePPM = 12; + +static constexpr unsigned long int et000 = 1; +static constexpr unsigned long int etP00 = 2; +static constexpr unsigned long int etM00 = 4; +static constexpr unsigned long int et0P0 = 8; +static constexpr unsigned long int et0M0 = 16; +static constexpr unsigned long int et00P = 32; +static constexpr unsigned long int et00M = 64; +static constexpr unsigned long int etPP0 = 128; +static constexpr unsigned long int etMM0 = 256; +static constexpr unsigned long int etPM0 = 512; +static constexpr unsigned long int etMP0 = 1024; +static constexpr unsigned long int etP0P = 2048; +static constexpr unsigned long int etM0M = 4096; +static constexpr unsigned long int etP0M = 8192; +static constexpr unsigned long int etM0P = 16384; +static constexpr unsigned long int et0PP = 32768; +static constexpr unsigned long int et0MM = 65536; +static constexpr unsigned long int et0PM = 131072; +static constexpr unsigned long int et0MP = 262144; +static constexpr unsigned long int etPPP = 524288; +static constexpr unsigned long int etMPP = 1048576; +static constexpr unsigned long int etPMP = 2097152; +static constexpr unsigned long int etMMP = 4194304; +static constexpr unsigned long int etPPM = 8388608; +static constexpr unsigned long int etMPM = 16777216; +static constexpr unsigned long int etPMM = 33554432; +static constexpr unsigned long int etMMM = 67108864; + + } // namespace vf::lbm::dir #endif