Skip to content
Snippets Groups Projects
Commit bfe97b89 authored by kutscher's avatar kutscher
Browse files

add two distribution connector

parent b761e863
No related branches found
No related tags found
1 merge request!24Feature/multiphase
#include "ThixotropyFullDirectConnector.h" //=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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 TwoDistributionsFullDirectConnector.cpp
//! \ingroup Connectors
//! \author Konstantin Kutscher
//=======================================================================================
#include "TwoDistributionsFullDirectConnector.h"
#include "LBMKernel.h" #include "LBMKernel.h"
#include "D3Q27EsoTwist3DSplittedVector.h" #include "D3Q27EsoTwist3DSplittedVector.h"
#include "DataSet3D.h" #include "DataSet3D.h"
...@@ -7,14 +40,14 @@ ...@@ -7,14 +40,14 @@
using namespace std; using namespace std;
ThixotropyFullDirectConnector::ThixotropyFullDirectConnector(SPtr<Block3D> from, SPtr<Block3D> to, int sendDir) TwoDistributionsFullDirectConnector::TwoDistributionsFullDirectConnector(SPtr<Block3D> from, SPtr<Block3D> to, int sendDir)
: LocalBlock3DConnector(from, to, sendDir) : LocalBlock3DConnector(from, to, sendDir)
{ {
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void ThixotropyFullDirectConnector::init() void TwoDistributionsFullDirectConnector::init()
{ {
maxX1 = (int)this->from.lock()->getKernel()->getDataSet()->getFdistributions()->getNX1() - 1; maxX1 = (int)this->from.lock()->getKernel()->getDataSet()->getFdistributions()->getNX1() - 1;
maxX2 = (int)this->from.lock()->getKernel()->getDataSet()->getFdistributions()->getNX2() - 1; maxX2 = (int)this->from.lock()->getKernel()->getDataSet()->getFdistributions()->getNX2() - 1;
...@@ -24,31 +57,9 @@ void ThixotropyFullDirectConnector::init() ...@@ -24,31 +57,9 @@ void ThixotropyFullDirectConnector::init()
fTo = dynamicPointerCast<EsoTwist3D>(to.lock()->getKernel()->getDataSet()->getFdistributions()); fTo = dynamicPointerCast<EsoTwist3D>(to.lock()->getKernel()->getDataSet()->getFdistributions());
hFrom = dynamicPointerCast<EsoTwist3D>(from.lock()->getKernel()->getDataSet()->getHdistributions()); hFrom = dynamicPointerCast<EsoTwist3D>(from.lock()->getKernel()->getDataSet()->getHdistributions());
hTo = dynamicPointerCast<EsoTwist3D>(to.lock()->getKernel()->getDataSet()->getHdistributions()); hTo = dynamicPointerCast<EsoTwist3D>(to.lock()->getKernel()->getDataSet()->getHdistributions());
//celltypematrixFrom = from.lock()->getKernel()->getBCProcessor()->getCellsTypeArray();
//fillVolumeMatrixFrom = from.lock()->getKernel()->getBCProcessor()->getFillVolumeArray();
//normalMatrixFrom = from.lock()->getKernel()->getBCProcessor()->getNormalArray();
//changeInConcMatrixFrom = from.lock()->getKernel()->getBCProcessor()->getChangeInConcentrationArray();
//deltaVolumeMatrixFrom = from.lock()->getKernel()->getBCProcessor()->getChangeInVolumeArray();
//celltypematrixTo = to.lock()->getKernel()->getBCProcessor()->getCellsTypeArray();
//fillVolumeMatrixTo = to.lock()->getKernel()->getBCProcessor()->getFillVolumeArray();
//normalMatrixTo = to.lock()->getKernel()->getBCProcessor()->getNormalArray();
//changeInConcMatrixTo = to.lock()->getKernel()->getBCProcessor()->getChangeInConcentrationArray();
//deltaVolumeMatrixTo = to.lock()->getKernel()->getBCProcessor()->getChangeInVolumeArray();
//bcArrayFrom = from.lock()->getKernel()->getBCProcessor()->getBCArray();
//bcArrayTo = to.lock()->getKernel()->getBCProcessor()->getBCArray();
//bcArrayReactiveFrom = from.lock()->getKernel()->getBCProcessor()->getBCArrayReactive();
//bcArrayReactiveTo = to.lock()->getKernel()->getBCProcessor()->getBCArrayReactive();
// maxX1 = (int)this->from.lock()->getKernel()->getBCProcessor()->getCellsTypeArray()->getNX1()/* - 1*/;
// maxX2 = (int)this->from.lock()->getKernel()->getBCProcessor()->getCellsTypeArray()->getNX2()/* - 1*/;
// maxX3 = (int)this->from.lock()->getKernel()->getBCProcessor()->getCellsTypeArray()->getNX3()/* - 1*/;
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void ThixotropyFullDirectConnector::sendVectors() void TwoDistributionsFullDirectConnector::sendVectors()
{ {
localDistributionsFromf = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getLocalDistributions(); localDistributionsFromf = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getLocalDistributions();
nonLocalDistributionsFromf = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getNonLocalDistributions(); nonLocalDistributionsFromf = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getNonLocalDistributions();
...@@ -66,8 +77,6 @@ void ThixotropyFullDirectConnector::sendVectors() ...@@ -66,8 +77,6 @@ void ThixotropyFullDirectConnector::sendVectors()
nonLocalDistributionsToh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo)->getNonLocalDistributions(); nonLocalDistributionsToh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo)->getNonLocalDistributions();
zeroDistributionsToh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo)->getZeroDistributions(); zeroDistributionsToh = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->hTo)->getZeroDistributions();
//bool con = /*(from.lock()->getGlobalID()==11) &&*/ (to.lock()->getGlobalID() == 1);
//EAST //EAST
if (sendDir == D3Q27System::E) if (sendDir == D3Q27System::E)
{ {
...@@ -76,7 +85,6 @@ void ThixotropyFullDirectConnector::sendVectors() ...@@ -76,7 +85,6 @@ void ThixotropyFullDirectConnector::sendVectors()
for (int x2 = 1; x2 < maxX2; x2++) for (int x2 = 1; x2 < maxX2; x2++)
{ {
exchangeData(maxX1 - 1, x2, x3, 0, x2, x3); exchangeData(maxX1 - 1, x2, x3, 0, x2, x3);
//exchangeDataforCells(maxX1 - 1, x2, x3, 0, x2, x3);
} }
} }
} }
...@@ -88,7 +96,6 @@ void ThixotropyFullDirectConnector::sendVectors() ...@@ -88,7 +96,6 @@ void ThixotropyFullDirectConnector::sendVectors()
for (int x2 = 1; x2 < maxX2; x2++) for (int x2 = 1; x2 < maxX2; x2++)
{ {
exchangeData(1, x2, x3, maxX1, x2, x3); exchangeData(1, x2, x3, maxX1, x2, x3);
//exchangeDataforCells(1, x2, x3, maxX1, x2, x3);
} }
} }
} }
...@@ -100,7 +107,6 @@ void ThixotropyFullDirectConnector::sendVectors() ...@@ -100,7 +107,6 @@ void ThixotropyFullDirectConnector::sendVectors()
for (int x1 = 1; x1 < maxX1; x1++) for (int x1 = 1; x1 < maxX1; x1++)
{ {
exchangeData(x1, maxX2 - 1, x3, x1, 0, x3); exchangeData(x1, maxX2 - 1, x3, x1, 0, x3);
//exchangeDataforCells(x1, maxX2 - 1, x3, x1, 0, x3);
} }
} }
} }
...@@ -112,7 +118,6 @@ void ThixotropyFullDirectConnector::sendVectors() ...@@ -112,7 +118,6 @@ void ThixotropyFullDirectConnector::sendVectors()
for (int x1 = 1; x1 < maxX1; x1++) for (int x1 = 1; x1 < maxX1; x1++)
{ {
exchangeData(x1, 1, x3, x1, maxX2, x3); exchangeData(x1, 1, x3, x1, maxX2, x3);
//exchangeDataforCells(x1, 1, x3, x1, maxX2, x3);
} }
} }
} }
...@@ -125,7 +130,6 @@ void ThixotropyFullDirectConnector::sendVectors() ...@@ -125,7 +130,6 @@ void ThixotropyFullDirectConnector::sendVectors()
for (int x1 = 1; x1 < maxX1; x1++) for (int x1 = 1; x1 < maxX1; x1++)
{ {
exchangeData(x1, x2, maxX3 - 1, x1, x2, 0); exchangeData(x1, x2, maxX3 - 1, x1, x2, 0);
//exchangeDataforCells(x1, x2, maxX3 - 1, x1, x2, 0);
} }
} }
} }
...@@ -137,7 +141,6 @@ void ThixotropyFullDirectConnector::sendVectors() ...@@ -137,7 +141,6 @@ void ThixotropyFullDirectConnector::sendVectors()
for (int x1 = 1; x1 < maxX1; x1++) for (int x1 = 1; x1 < maxX1; x1++)
{ {
exchangeData(x1, x2, 1, x1, x2, maxX3); exchangeData(x1, x2, 1, x1, x2, maxX3);
//exchangeDataforCells(x1, x2, 1, x1, x2, maxX3);
} }
} }
} }
...@@ -147,8 +150,6 @@ void ThixotropyFullDirectConnector::sendVectors() ...@@ -147,8 +150,6 @@ void ThixotropyFullDirectConnector::sendVectors()
for (int x3 = 1; x3 < maxX3; x3++) for (int x3 = 1; x3 < maxX3; x3++)
{ {
exchangeData(maxX1 - 1, maxX2 - 1, x3, 0, 0, x3); exchangeData(maxX1 - 1, maxX2 - 1, x3, 0, 0, x3);
//exchangeDataforCells(maxX1 - 1, maxX2 - 1, x3, 0, 0, x3);
} }
} }
//NORTHWEST //NORTHWEST
...@@ -157,7 +158,6 @@ void ThixotropyFullDirectConnector::sendVectors() ...@@ -157,7 +158,6 @@ void ThixotropyFullDirectConnector::sendVectors()
for (int x3 = 1; x3 < maxX3; x3++) for (int x3 = 1; x3 < maxX3; x3++)
{ {
exchangeData(1, maxX2 - 1, x3, maxX1, 0, x3); exchangeData(1, maxX2 - 1, x3, maxX1, 0, x3);
//exchangeDataforCells(1, maxX2 - 1, x3, maxX1, 0, x3);
} }
} }
//SOUTHWEST //SOUTHWEST
...@@ -166,8 +166,6 @@ void ThixotropyFullDirectConnector::sendVectors() ...@@ -166,8 +166,6 @@ void ThixotropyFullDirectConnector::sendVectors()
for (int x3 = 1; x3 < maxX3; x3++) for (int x3 = 1; x3 < maxX3; x3++)
{ {
exchangeData(1, 1, x3, maxX1, maxX2, x3); exchangeData(1, 1, x3, maxX1, maxX2, x3);
//exchangeDataforCells(1, 1, x3, maxX1, maxX2, x3);
} }
} }
//SOUTHEAST //SOUTHEAST
...@@ -176,115 +174,81 @@ void ThixotropyFullDirectConnector::sendVectors() ...@@ -176,115 +174,81 @@ void ThixotropyFullDirectConnector::sendVectors()
for (int x3 = 1; x3 < maxX3; x3++) for (int x3 = 1; x3 < maxX3; x3++)
{ {
exchangeData(maxX1 - 1, 1, x3, 0, maxX2, x3); exchangeData(maxX1 - 1, 1, x3, 0, maxX2, x3);
//exchangeDataforCells(maxX1 - 1, 1, x3, 0, maxX2, x3);
} }
} }
else if (sendDir == D3Q27System::TE) else if (sendDir == D3Q27System::TE)
for (int x2 = 1; x2 < maxX2; x2++) for (int x2 = 1; x2 < maxX2; x2++)
{ {
exchangeData(maxX1 - 1, x2, maxX3 - 1, 0, x2, 0); exchangeData(maxX1 - 1, x2, maxX3 - 1, 0, x2, 0);
//exchangeDataforCells(maxX1 - 1, x2, maxX3 - 1, 0, x2, 0);
} }
else if (sendDir == D3Q27System::BW) else if (sendDir == D3Q27System::BW)
for (int x2 = 1; x2 < maxX2; x2++) for (int x2 = 1; x2 < maxX2; x2++)
{ {
exchangeData(1, x2, 1, maxX1, x2, maxX3); exchangeData(1, x2, 1, maxX1, x2, maxX3);
//exchangeDataforCells(1, x2, 1, maxX1, x2, maxX3);
} }
else if (sendDir == D3Q27System::BE) else if (sendDir == D3Q27System::BE)
for (int x2 = 1; x2 < maxX2; x2++) for (int x2 = 1; x2 < maxX2; x2++)
{ {
exchangeData(maxX1 - 1, x2, 1, 0, x2, maxX3); exchangeData(maxX1 - 1, x2, 1, 0, x2, maxX3);
//exchangeDataforCells(maxX1 - 1, x2, 1, 0, x2, maxX3);
} }
else if (sendDir == D3Q27System::TW) else if (sendDir == D3Q27System::TW)
for (int x2 = 1; x2 < maxX2; x2++) for (int x2 = 1; x2 < maxX2; x2++)
{ {
exchangeData(1, x2, maxX3 - 1, maxX1, x2, 0); exchangeData(1, x2, maxX3 - 1, maxX1, x2, 0);
//exchangeDataforCells(1, x2, maxX3 - 1, maxX1, x2, 0);
} }
else if (sendDir == D3Q27System::TN) else if (sendDir == D3Q27System::TN)
for (int x1 = 1; x1 < maxX1; x1++) for (int x1 = 1; x1 < maxX1; x1++)
{ {
exchangeData(x1, maxX2 - 1, maxX3 - 1, x1, 0, 0); exchangeData(x1, maxX2 - 1, maxX3 - 1, x1, 0, 0);
//exchangeDataforCells(x1, maxX2 - 1, maxX3 - 1, x1, 0, 0);
} }
else if (sendDir == D3Q27System::BS) else if (sendDir == D3Q27System::BS)
for (int x1 = 1; x1 < maxX1; x1++) for (int x1 = 1; x1 < maxX1; x1++)
{ {
exchangeData(x1, 1, 1, x1, maxX2, maxX3); exchangeData(x1, 1, 1, x1, maxX2, maxX3);
//exchangeDataforCells(x1, 1, 1, x1, maxX2, maxX3);
} }
else if (sendDir == D3Q27System::BN) else if (sendDir == D3Q27System::BN)
for (int x1 = 1; x1 < maxX1; x1++) for (int x1 = 1; x1 < maxX1; x1++)
{ {
exchangeData(x1, maxX2 - 1, 1, x1, 0, maxX3); exchangeData(x1, maxX2 - 1, 1, x1, 0, maxX3);
//exchangeDataforCells(x1, maxX2 - 1, 1, x1, 0, maxX3);
} }
else if (sendDir == D3Q27System::TS) else if (sendDir == D3Q27System::TS)
for (int x1 = 1; x1 < maxX1; x1++) for (int x1 = 1; x1 < maxX1; x1++)
{ {
exchangeData(x1, 1, maxX3 - 1, x1, maxX2, 0); exchangeData(x1, 1, maxX3 - 1, x1, maxX2, 0);
//exchangeDataforCells(x1, 1, maxX3 - 1, x1, maxX2, 0);
} }
else if (sendDir == D3Q27System::TSW) else if (sendDir == D3Q27System::TSW)
{ {
exchangeData(1, 1, maxX3 - 1, maxX1, maxX2, 0); exchangeData(1, 1, maxX3 - 1, maxX1, maxX2, 0);
//exchangeDataforCells(1, 1, maxX3 - 1, maxX1, maxX2, 0);
} }
else if (sendDir == D3Q27System::TSE) else if (sendDir == D3Q27System::TSE)
{ {
exchangeData(maxX1 - 1, 1, maxX3 - 1, 0, maxX2, 0); exchangeData(maxX1 - 1, 1, maxX3 - 1, 0, maxX2, 0);
//exchangeDataforCells(maxX1 - 1, 1, maxX3 - 1, 0, maxX2, 0);
} }
else if (sendDir == D3Q27System::TNW) else if (sendDir == D3Q27System::TNW)
{ {
exchangeData(1, maxX2 - 1, maxX3 - 1, maxX1, 0, 0); exchangeData(1, maxX2 - 1, maxX3 - 1, maxX1, 0, 0);
//exchangeDataforCells(1, maxX2 - 1, maxX3 - 1, maxX1, 0, 0);
} }
else if (sendDir == D3Q27System::TNE) else if (sendDir == D3Q27System::TNE)
{ {
exchangeData(maxX1 - 1, maxX2 - 1, maxX3 - 1, 0, 0, 0); exchangeData(maxX1 - 1, maxX2 - 1, maxX3 - 1, 0, 0, 0);
//exchangeDataforCells(maxX1 - 1, maxX2 - 1, maxX3 - 1, 0, 0, 0);
} }
else if (sendDir == D3Q27System::BSW) else if (sendDir == D3Q27System::BSW)
{ {
exchangeData(1, 1, 1, maxX1, maxX2, maxX3); exchangeData(1, 1, 1, maxX1, maxX2, maxX3);
//exchangeDataforCells(1, 1, 1, maxX1, maxX2, maxX3);
} }
else if (sendDir == D3Q27System::BSE) else if (sendDir == D3Q27System::BSE)
{ {
exchangeData(maxX1 - 1, 1, 1, 0, maxX2, maxX3); exchangeData(maxX1 - 1, 1, 1, 0, maxX2, maxX3);
//exchangeDataforCells(maxX1 - 1, 1, 1, 0, maxX2, maxX3);
} }
else if (sendDir == D3Q27System::BNW) else if (sendDir == D3Q27System::BNW)
{ {
exchangeData(1, maxX2 - 1, 1, maxX1, 0, maxX3); exchangeData(1, maxX2 - 1, 1, maxX1, 0, maxX3);
//exchangeDataforCells(1, maxX2 - 1, 1, maxX1, 0, maxX3);
} }
else if (sendDir == D3Q27System::BNE) else if (sendDir == D3Q27System::BNE)
{ {
exchangeData(maxX1 - 1, maxX2 - 1, 1, 0, 0, maxX3); exchangeData(maxX1 - 1, maxX2 - 1, 1, 0, 0, maxX3);
//exchangeDataforCells(maxX1 - 1, maxX2 - 1, 1, 0, 0, maxX3);
} }
else UB_THROW(UbException(UB_EXARGS, "unknown dir")); else UB_THROW(UbException(UB_EXARGS, "unknown dir"));
} }
......
/** //=======================================================================================
* @file ThixotropyFullDirectConnector.h // ____ ____ __ ______ __________ __ __ __ __
* @brief Connector send and receive full distribution in shared memory // \ \ | | | | | _ \ |___ ___| | | | | / \ | |
* // \ \ | | | | | |_) | | | | | | | / \ | |
* @author Hussein Alihussein // \ \ | | | | | _ / | | | | | | / /\ \ | |
* @date 28.11.2018 // \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
*/ // \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
#ifndef ThixotropyFullDirectConnector_H // \ \ | | ________________________________________________________________
#define ThixotropyFullDirectConnector_H // \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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 TwoDistributionsFullDirectConnector.h
//! \ingroup Connectors
//! \author Konstantin Kutscher
//=======================================================================================
#ifndef TwoDistributionsFullDirectConnector_H
#define TwoDistributionsFullDirectConnector_H
#include "LocalBlock3DConnector.h" #include "LocalBlock3DConnector.h"
#include "Block3D.h" #include "Block3D.h"
...@@ -19,38 +45,22 @@ class EsoTwist3D; ...@@ -19,38 +45,22 @@ class EsoTwist3D;
//! \brief Exchange data between blocks. //! \brief Exchange data between blocks.
//! \details Connector send and receive full distributions between two blocks in shared memory. //! \details Connector send and receive full distributions between two blocks in shared memory.
//! \author Hussein Alihussein
class ThixotropyFullDirectConnector : public LocalBlock3DConnector class TwoDistributionsFullDirectConnector : public LocalBlock3DConnector
{ {
public: public:
ThixotropyFullDirectConnector(SPtr<Block3D> from, SPtr<Block3D> to, int sendDir); TwoDistributionsFullDirectConnector(SPtr<Block3D> from, SPtr<Block3D> to, int sendDir);
void init(); void init();
void sendVectors(); void sendVectors();
//void sendCellVectors(); //void sendCellVectors();
protected: protected:
inline void exchangeData(int x1From, int x2From, int x3From, int x1To, int x2To, int x3To); inline void exchangeData(int x1From, int x2From, int x3From, int x1To, int x2To, int x3To);
//inline void exchangeDataforCells(int x1From, int x2From, int x3From, int x1To, int x2To, int x3To);
//void ExchangeDatabcArray(SPtr<BCArray3D> bcArrayFrom, SPtr<BCArray3D> bcArrayTo, int x1From, int x2From, int x3From, int x1To, int x2To, int x3To);
//void ExchangeDatabcArrayReactive(BCArray3DReactivePtr bcArrayFrom, BCArray3DReactivePtr bcArrayTo, int x1From, int x2From, int x3From, int x1To, int x2To, int x3To);
private: private:
int maxX1; int maxX1;
int maxX2; int maxX2;
int maxX3; int maxX3;
//CbArray3D<int>::CbArray3DPtr celltypematrixFrom;
//CbArray3D<double>::CbArray3DPtr fillVolumeMatrixFrom;
//CbArray4D<LBMReal, IndexerX4X3X2X1>::CbArray4DPtr normalMatrixFrom;
//CbArray3D<double>::CbArray3DPtr changeInConcMatrixFrom;
//CbArray3D<double>::CbArray3DPtr deltaVolumeMatrixFrom;
//CbArray3D<int>::CbArray3DPtr celltypematrixTo;
//CbArray3D<double>::CbArray3DPtr fillVolumeMatrixTo;
//CbArray4D<LBMReal, IndexerX4X3X2X1>::CbArray4DPtr normalMatrixTo;
//CbArray3D<double>::CbArray3DPtr changeInConcMatrixTo;
//CbArray3D<double>::CbArray3DPtr deltaVolumeMatrixTo;
CbArray4D <LBMReal, IndexerX4X3X2X1>::CbArray4DPtr localDistributionsFromf; CbArray4D <LBMReal, IndexerX4X3X2X1>::CbArray4DPtr localDistributionsFromf;
CbArray4D <LBMReal, IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributionsFromf; CbArray4D <LBMReal, IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributionsFromf;
CbArray3D <LBMReal, IndexerX3X2X1>::CbArray3DPtr zeroDistributionsFromf; CbArray3D <LBMReal, IndexerX3X2X1>::CbArray3DPtr zeroDistributionsFromf;
...@@ -69,17 +79,9 @@ private: ...@@ -69,17 +79,9 @@ private:
SPtr<EsoTwist3D> fFrom, hFrom; SPtr<EsoTwist3D> fFrom, hFrom;
SPtr<EsoTwist3D> fTo, hTo; SPtr<EsoTwist3D> fTo, hTo;
//BCArray3DPtr bcArrayFrom;
//BCArray3DPtr bcArrayTo;
//BCArray3DReactivePtr bcArrayReactiveFrom;
//BCArray3DReactivePtr bcArrayReactiveTo;
}; };
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
inline void ThixotropyFullDirectConnector::exchangeData(int x1From, int x2From, int x3From, int x1To, int x2To, int x3To) inline void TwoDistributionsFullDirectConnector::exchangeData(int x1From, int x2From, int x3From, int x1To, int x2To, int x3To)
{ {
...@@ -144,79 +146,4 @@ inline void ThixotropyFullDirectConnector::exchangeData(int x1From, int x2From, ...@@ -144,79 +146,4 @@ inline void ThixotropyFullDirectConnector::exchangeData(int x1From, int x2From,
(*this->zeroDistributionsToh)(x1To, x2To, x3To) = (*this->zeroDistributionsFromh)(x1From, x2From, x3From); (*this->zeroDistributionsToh)(x1To, x2To, x3To) = (*this->zeroDistributionsFromh)(x1From, x2From, x3From);
} }
//////////////////////////////////////////////////////////////////////////
//inline void ThixotropyFullDirectConnector::exchangeDataforCells(int x1From, int x2From, int x3From, int x1To, int x2To, int x3To)
//{
// //(*this->celltypematrixTo)( x1To, x2To, x3To) = (*this->celltypematrixFrom)( x1From, x2From, x3From);
//
// (*this->celltypematrixTo)(x1To, x2To, x3To) = (*this->celltypematrixFrom)(x1From, x2From, x3From);
// (*this->fillVolumeMatrixTo)(x1To, x2To, x3To) = (*this->fillVolumeMatrixFrom)(x1From, x2From, x3From);
// (*this->changeInConcMatrixTo)(x1To, x2To, x3To) = (*this->changeInConcMatrixFrom)(x1From, x2From, x3From);
// (*this->deltaVolumeMatrixTo)(x1To, x2To, x3To) = (*this->deltaVolumeMatrixFrom)(x1From, x2From, x3From);
//
// (*this->normalMatrixTo)(0, x1To, x2To, x3To) = (*this->normalMatrixFrom)(0, x1From, x2From, x3From);
// (*this->normalMatrixTo)(1, x1To, x2To, x3To) = (*this->normalMatrixFrom)(1, x1From, x2From, x3From);
// (*this->normalMatrixTo)(2, x1To, x2To, x3To) = (*this->normalMatrixFrom)(2, x1From, x2From, x3From);
// //bcArrayTo->bcindexmatrix(x1To, x2To, x3To) = bcArrayFrom->bcindexmatrix(x1From, x2From, x3From);
// ExchangeDatabcArray(bcArrayFrom, bcArrayTo, x1From, x2From, x3From, x1To, x2To, x3To);
// ExchangeDatabcArrayReactive(bcArrayReactiveFrom, bcArrayReactiveTo, x1From, x2From, x3From, x1To, x2To, x3To);
//}
////////////////////////////////////////////////////////////////////////////
//inline void ThixotropyFullDirectConnector::ExchangeDatabcArray(BCArray3DPtr bcArrayFrom, BCArray3DPtr bcArrayTo, int x1From, int x2From, int x3From, int x1To, int x2To, int x3To)
//{
// if (bcArrayFrom->isFluid(x1From, x2From, x3From))
// {
// if (bcArrayFrom->hasBC(x1From, x2From, x3From))
// {
// BoundaryConditionsPtr bc = bcArrayFrom->getBC(x1From, x2From, x3From);
//
// bcArrayTo->setBC(x1To, x2To, x3To, bc);
//
// }
// else if (bcArrayFrom->isFluidWithoutBC(x1From, x2From, x3From))
// {
// bcArrayTo->setFluid(x1To, x2To, x3To);
// }
// }
// else if (bcArrayFrom->isSolid(x1From, x2From, x3From))
// {
// bcArrayTo->setSolid(x1To, x2To, x3To);
// }
// else
// {
// bcArrayTo->setUndefined(x1To, x2To, x3To);
// }
//
//}
////////////////////////////////////////////////////////////////////////////
//inline void ThixotropyFullDirectConnector::ExchangeDatabcArrayReactive(BCArray3DReactivePtr bcArrayFrom, BCArray3DReactivePtr bcArrayTo, int x1From, int x2From, int x3From, int x1To, int x2To, int x3To)
//{
// if (bcArrayFrom->isFluid(x1From, x2From, x3From))
// {
// if (bcArrayFrom->hasBC(x1From, x2From, x3From))
// {
// BoundaryConditionsPtr bc = bcArrayFrom->getBC(x1From, x2From, x3From);
//
// bcArrayTo->setBC(x1To, x2To, x3To, bc);
//
// }
// else if (bcArrayFrom->isFluidWithoutBC(x1From, x2From, x3From))
// {
// bcArrayTo->setFluid(x1To, x2To, x3To);
// }
// }
// else if (bcArrayFrom->isSolid(x1From, x2From, x3From))
// {
// bcArrayTo->setSolid(x1To, x2To, x3To);
// }
// else if (bcArrayFrom->isReactiveSolid(x1From, x2From, x3From))
// {
// bcArrayTo->setReactiveSolidType1(x1To, x2To, x3To);
// }
// else
// {
// bcArrayTo->setUndefined(x1To, x2To, x3To);
// }
//
//}
#endif #endif
\ No newline at end of file
#include "ThixotropyFullVectorConnector.h" //=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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 TwoDistributionsFullVectorConnector.cpp
//! \ingroup Connectors
//! \author Konstantin Kutscher
//=======================================================================================
#include "TwoDistributionsFullVectorConnector.h"
#include "D3Q27EsoTwist3DSplittedVector.h" #include "D3Q27EsoTwist3DSplittedVector.h"
#include "LBMKernel.h" #include "LBMKernel.h"
#include "Block3D.h" #include "Block3D.h"
...@@ -7,7 +40,7 @@ ...@@ -7,7 +40,7 @@
#include "DataSet3D.h" #include "DataSet3D.h"
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
ThixotropyFullVectorConnector::ThixotropyFullVectorConnector(SPtr<Block3D> block TwoDistributionsFullVectorConnector::TwoDistributionsFullVectorConnector(SPtr<Block3D> block
, VectorTransmitterPtr sender , VectorTransmitterPtr sender
, VectorTransmitterPtr receiver , VectorTransmitterPtr receiver
, int sendDir) , int sendDir)
...@@ -18,7 +51,7 @@ ThixotropyFullVectorConnector::ThixotropyFullVectorConnector(SPtr<Block3D> block ...@@ -18,7 +51,7 @@ ThixotropyFullVectorConnector::ThixotropyFullVectorConnector(SPtr<Block3D> block
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void ThixotropyFullVectorConnector::init() void TwoDistributionsFullVectorConnector::init()
{ {
maxX1 = (int)block.lock()->getKernel()->getDataSet()->getFdistributions()->getNX1() - 1; maxX1 = (int)block.lock()->getKernel()->getDataSet()->getFdistributions()->getNX1() - 1;
maxX2 = (int)block.lock()->getKernel()->getDataSet()->getFdistributions()->getNX2() - 1; maxX2 = (int)block.lock()->getKernel()->getDataSet()->getFdistributions()->getNX2() - 1;
...@@ -66,7 +99,7 @@ void ThixotropyFullVectorConnector::init() ...@@ -66,7 +99,7 @@ void ThixotropyFullVectorConnector::init()
} }
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void ThixotropyFullVectorConnector::fillSendVectors() void TwoDistributionsFullVectorConnector::fillSendVectors()
{ {
localDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getLocalDistributions(); localDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getLocalDistributions();
nonLocalDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getNonLocalDistributions(); nonLocalDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fDis)->getNonLocalDistributions();
...@@ -257,7 +290,7 @@ void ThixotropyFullVectorConnector::fillSendVectors() ...@@ -257,7 +290,7 @@ void ThixotropyFullVectorConnector::fillSendVectors()
else UB_THROW(UbException(UB_EXARGS, "unknown dir")); else UB_THROW(UbException(UB_EXARGS, "unknown dir"));
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
void ThixotropyFullVectorConnector::distributeReceiveVectors() void TwoDistributionsFullVectorConnector::distributeReceiveVectors()
{ {
/*e.g. connector sendet nach EAST --> empfaengt daten aus WEST ;-)*/ /*e.g. connector sendet nach EAST --> empfaengt daten aus WEST ;-)*/
......
#ifndef ThixotropyFullVectorConnector_H //=======================================================================================
#define ThixotropyFullVectorConnector_H // ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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 TwoDistributionsFullVectorConnector.h
//! \ingroup Connectors
//! \author Konstantin Kutscher
//=======================================================================================
#ifndef TwoDistributionsFullVectorConnector_H
#define TwoDistributionsFullVectorConnector_H
#include <vector> #include <vector>
...@@ -18,10 +51,10 @@ class Block3D; ...@@ -18,10 +51,10 @@ class Block3D;
//der vector wird via transmitter uebertragen //der vector wird via transmitter uebertragen
//transmitter kann ein lokal, MPI, RCG, CTL oder was auch immer fuer ein //transmitter kann ein lokal, MPI, RCG, CTL oder was auch immer fuer ein
//transmitter sein, der von Transmitter abgeleitet ist ;-) //transmitter sein, der von Transmitter abgeleitet ist ;-)
class ThixotropyFullVectorConnector : public RemoteBlock3DConnector class TwoDistributionsFullVectorConnector : public RemoteBlock3DConnector
{ {
public: public:
ThixotropyFullVectorConnector(SPtr<Block3D> block TwoDistributionsFullVectorConnector(SPtr<Block3D> block
, VectorTransmitterPtr sender , VectorTransmitterPtr sender
, VectorTransmitterPtr receiver , VectorTransmitterPtr receiver
, int sendDir); , int sendDir);
...@@ -55,7 +88,7 @@ private: ...@@ -55,7 +88,7 @@ private:
}; };
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
inline void ThixotropyFullVectorConnector::fillData(vector_type& sdata, int& index, int x1, int x2, int x3) 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_E, x1, x2, x3);
sdata[index++] = (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); sdata[index++] = (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3);
...@@ -120,7 +153,7 @@ inline void ThixotropyFullVectorConnector::fillData(vector_type& sdata, int& ind ...@@ -120,7 +153,7 @@ inline void ThixotropyFullVectorConnector::fillData(vector_type& sdata, int& ind
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
inline void ThixotropyFullVectorConnector::distributeData(vector_type& rdata, int& index, int x1, int x2, int x3) 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_E, x1, x2, x3) = rdata[index++];
(*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = rdata[index++]; (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = rdata[index++];
......
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
#include "D3Q27ETFullVectorConnector.h" #include "D3Q27ETFullVectorConnector.h"
#include "D3Q27ETCFOffVectorConnector.h" #include "D3Q27ETCFOffVectorConnector.h"
#include "D3Q27ETFCOffVectorConnector.h" #include "D3Q27ETFCOffVectorConnector.h"
#include "ThixotropyFullDirectConnector.h" #include "TwoDistributionsFullDirectConnector.h"
#include "ThixotropyFullVectorConnector.h" #include "TwoDistributionsFullVectorConnector.h"
#include "Grid3DSystem.h" #include "Grid3DSystem.h"
#include <basics/transmitter/TbTransmitterLocal.h> #include <basics/transmitter/TbTransmitterLocal.h>
...@@ -100,8 +100,8 @@ void SetConnectorsBlockVisitor::setSameLevelConnectors(SPtr<Grid3D> grid, SPtr<B ...@@ -100,8 +100,8 @@ void SetConnectorsBlockVisitor::setSameLevelConnectors(SPtr<Grid3D> grid, SPtr<B
if(blockRank == neighBlockRank && neighBlock->isActive()) if(blockRank == neighBlockRank && neighBlock->isActive())
{ {
SPtr<Block3DConnector> connector; SPtr<Block3DConnector> connector;
connector = SPtr<Block3DConnector>(new D3Q27ETFullDirectConnector( block, neighBlock, dir)); //connector = SPtr<Block3DConnector>(new D3Q27ETFullDirectConnector( block, neighBlock, dir));
//connector = SPtr<Block3DConnector>(new ThixotropyFullDirectConnector( block, neighBlock, dir)); connector = SPtr<Block3DConnector>(new TwoDistributionsFullDirectConnector( block, neighBlock, dir));
block->setConnector(connector); block->setConnector(connector);
} }
else if(blockRank != neighBlockRank && neighBlock->isActive()) else if(blockRank != neighBlockRank && neighBlock->isActive())
...@@ -134,8 +134,8 @@ void SetConnectorsBlockVisitor::setRemoteConnectors(SPtr<Block3D> sblock, SPtr<B ...@@ -134,8 +134,8 @@ void SetConnectorsBlockVisitor::setRemoteConnectors(SPtr<Block3D> sblock, SPtr<B
SPtr<Block3DConnector> connector; SPtr<Block3DConnector> connector;
connector = SPtr<Block3DConnector>(new D3Q27ETFullVectorConnector(sblock, sender, receiver, dir)); //connector = SPtr<Block3DConnector>(new D3Q27ETFullVectorConnector(sblock, sender, receiver, dir));
//connector = SPtr<Block3DConnector>(new ThixotropyFullVectorConnector(sblock, sender, receiver, dir)); connector = SPtr<Block3DConnector>(new TwoDistributionsFullVectorConnector(sblock, sender, receiver, dir));
sblock->setConnector(connector); sblock->setConnector(connector);
UBLOG(logDEBUG5, "D3Q27SetConnectorsBlockVisitor::setRemoteConnectors() - end"); UBLOG(logDEBUG5, "D3Q27SetConnectorsBlockVisitor::setRemoteConnectors() - end");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment