Skip to content
Snippets Groups Projects
Commit 4632930a authored by Soeren Peters's avatar Soeren Peters
Browse files

Update connectors.

parent 9d60932d
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ void SlipBCAlgorithm::applyBC()
calcMacrosFct(f, drho, vx1, vx2, vx3);
calcFeqFct(feq, drho, vx1, vx2, vx3);
UbTupleFloat3 normale = bcPtr->getNormalVector();
UbTupleDouble3 normale = bcPtr->getNormalVector();
LBMReal amp = vx1*val<1>(normale)+vx2*val<2>(normale)+vx3*val<3>(normale);
vx1 = vx1 - amp * val<1>(normale); //normale zeigt von struktur weg!
......
// _ ___ __ __________ _ __
// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____
// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/
// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ )
// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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 Block3DConnector.h
//! \ingroup Connectors
//! \author Konstantin Kutscher
//=======================================================================================
#ifndef BLOCK2DCONNECTOR_H
#define BLOCK2DCONNECTOR_H
......@@ -14,43 +41,27 @@
#include <PointerDefinitions.h>
//! \brief Abstract class of connectors
//! \details Connector send and receive full distributions between two blocks in shared memory.
class Block3DConnector
{
//FETOL
#ifdef VF_FETOL
public:
enum TransmitterType{NONE=0, MPI=1, BOND=2};
#endif
public:
Block3DConnector()
: sendDir(-1)
#ifdef VF_FETOL
, ttype(NONE)
#endif
{}
Block3DConnector(const int& sendDir)
: sendDir(sendDir)
#ifdef VF_FETOL
, ttype(NONE)
#endif
{}
Block3DConnector() : sendDir(-1) {}
Block3DConnector(const int& sendDir) : sendDir(sendDir) {}
virtual ~Block3DConnector() {}
//!Iniitializes connector
virtual void init()=0;
//for synchronize the send- and receive-bufferlength
//!Synchronizes the send-buffer length
virtual void sendTransmitterDataSize()=0;
//!Synchronizes the receive-buffer length
virtual void receiveTransmitterDataSize()=0;
//send operations (should be called in given order!!!)
//Send (should be called in given order!!!)
virtual void prepareForSend()=0;
virtual void fillSendVectors()=0;
virtual void sendVectors()=0;
//receive operations (should be called in given order!!!)
//Receive (should be called in given order!!!)
virtual void prepareForReceive()=0;
virtual void receiveVectors()=0;
virtual void distributeReceiveVectors()=0;
......@@ -82,18 +93,8 @@ public:
virtual void receiveVectorsX2() = 0;
virtual void receiveVectorsX3() = 0;
//FETOL
#ifdef VF_FETOL
void setTransmitterType(TransmitterType ttype) { this->ttype=ttype;}
TransmitterType getTransmitterType() {return ttype;}
#endif
protected:
int sendDir;
//FETOL
#ifdef VF_FETOL
TransmitterType ttype;
#endif
};
#endif //BLOCK2DCONNECTOR_H
#endif //BLOCK3DCONNECTOR_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 D3Q27ETFullDirectConnector.cpp
//! \ingroup Connectors
//! \author Konstantin Kutscher
//=======================================================================================
#include "D3Q27ETFullDirectConnector.h"
#include "LBMKernel.h"
#include "D3Q27EsoTwist3DSplittedVector.h"
......@@ -18,19 +51,19 @@ void D3Q27ETFullDirectConnector::init()
maxX2 = (int)this->from.lock()->getKernel()->getDataSet()->getFdistributions()->getNX2() - 1;
maxX3 = (int)this->from.lock()->getKernel()->getDataSet()->getFdistributions()->getNX3() - 1;
fFrom = dynamicPointerCast<EsoTwist3D>(from.lock()->getKernel()->getDataSet()->getFdistributions());
fTo = dynamicPointerCast<EsoTwist3D>(to.lock()->getKernel()->getDataSet()->getFdistributions());
fFrom = dynamic_pointer_cast<EsoTwist3D>(from.lock()->getKernel()->getDataSet()->getFdistributions());
fTo = dynamic_pointer_cast<EsoTwist3D>(to.lock()->getKernel()->getDataSet()->getFdistributions());
}
//////////////////////////////////////////////////////////////////////////
void D3Q27ETFullDirectConnector::sendVectors()
{
localDistributionsFrom = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getLocalDistributions();
nonLocalDistributionsFrom = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getNonLocalDistributions();
zeroDistributionsFrom = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getZeroDistributions();
localDistributionsFrom = dynamic_pointer_cast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getLocalDistributions();
nonLocalDistributionsFrom = dynamic_pointer_cast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getNonLocalDistributions();
zeroDistributionsFrom = dynamic_pointer_cast<D3Q27EsoTwist3DSplittedVector>(this->fFrom)->getZeroDistributions();
localDistributionsTo = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getLocalDistributions();
nonLocalDistributionsTo = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getNonLocalDistributions();
zeroDistributionsTo = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getZeroDistributions();
localDistributionsTo = dynamic_pointer_cast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getLocalDistributions();
nonLocalDistributionsTo = dynamic_pointer_cast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getNonLocalDistributions();
zeroDistributionsTo = dynamic_pointer_cast<D3Q27EsoTwist3DSplittedVector>(this->fTo)->getZeroDistributions();
//EAST
if (sendDir == D3Q27System::E)
......
/**
* @file D3Q27ETFullDirectConnector.h
* @brief Connector send and receive full distribution in shared memory
*
* @author Konstantin Kutscher
* @date 28.04.2016
*/
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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 D3Q27ETFullDirectConnector.h
//! \ingroup Connectors
//! \author Konstantin Kutscher
//=======================================================================================
#ifndef D3Q27ETFULLDIRECTCONNECTOR_H
#define D3Q27ETFULLDIRECTCONNECTOR_H
......@@ -17,8 +43,6 @@
//! \brief Exchange data between blocks.
//! \details Connector send and receive full distributions between two blocks in shared memory.
//! \author Konstantin Kutscher
class D3Q27ETFullDirectConnector : public LocalBlock3DConnector
{
public:
......
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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 LocalBlock3DConnector.h
//! \ingroup Connectors
//! \author Konstantin Kutscher
//=======================================================================================
#ifndef LocalBlock3DConnector_H
#define LocalBlock3DConnector_H
......@@ -5,6 +38,7 @@
#include "Block3D.h"
#include "PointerDefinitions.h"
//! A class provides an interface for connectors in shared memory
class LocalBlock3DConnector : public Block3DConnector
{
public:
......
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