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

Small clean ups.

parent 30dd35aa
No related branches found
No related tags found
1 merge request!20Remove all warnings in VirtualFluids CPU (Closes #6, #7)
...@@ -33,7 +33,7 @@ list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-unused-function") ...@@ -33,7 +33,7 @@ list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-unused-function")
list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-unused-parameter") list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-unused-parameter")
list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-reorder") list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-reorder")
list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-unknown-pragmas") list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-unknown-pragmas")
list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-cast-function-type")
############################################################################################################# #############################################################################################################
# linker options # linker options
......
...@@ -63,11 +63,11 @@ void BCArray3D::resize(std::size_t nx1, std::size_t nx2, std::size_t nx3, int va ...@@ -63,11 +63,11 @@ void BCArray3D::resize(std::size_t nx1, std::size_t nx2, std::size_t nx3, int va
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
bool BCArray3D::validIndices(std::size_t x1, std::size_t x2, std::size_t x3) const bool BCArray3D::validIndices(std::size_t x1, std::size_t x2, std::size_t x3) const
{ {
if (x1 < 0 || x1 >= this->bcindexmatrix.getNX1()) if (x1 >= this->bcindexmatrix.getNX1())
return false; return false;
if (x2 < 0 || x2 >= this->bcindexmatrix.getNX2()) if (x2 >= this->bcindexmatrix.getNX2())
return false; return false;
if (x3 < 0 || x3 >= this->bcindexmatrix.getNX3()) if (x3 >= this->bcindexmatrix.getNX3())
return false; return false;
return true; return true;
} }
......
...@@ -60,15 +60,14 @@ void DensityAndThixotropyBCAlgorithm::applyBC() ...@@ -60,15 +60,14 @@ void DensityAndThixotropyBCAlgorithm::applyBC()
int nx1 = x1; int nx1 = x1;
int nx2 = x2; int nx2 = x2;
int nx3 = x3; int nx3 = x3;
int direction = -1;
//flag points in direction of fluid //flag points in direction of fluid
if (bcPtr->hasDensityBoundaryFlag(D3Q27System::E)) { nx1 -= 1; direction = D3Q27System::E; } if (bcPtr->hasDensityBoundaryFlag(D3Q27System::E)) { nx1 -= 1; }
else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::W)) { nx1 += 1; direction = D3Q27System::W; } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::W)) { nx1 += 1; }
else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::N)) { nx2 -= 1; direction = D3Q27System::N; } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::N)) { nx2 -= 1; }
else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::S)) { nx2 += 1; direction = D3Q27System::S; } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::S)) { nx2 += 1; }
else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::T)) { nx3 -= 1; direction = D3Q27System::T; } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::T)) { nx3 -= 1; }
else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::B)) { nx3 += 1; direction = D3Q27System::B; } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::B)) { nx3 += 1; }
else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on density boundary...")); else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on density boundary..."));
LBMReal rhoBC = bcPtr->getBoundaryDensity(); LBMReal rhoBC = bcPtr->getBoundaryDensity();
......
...@@ -29,7 +29,7 @@ void SimpleSlipBCAlgorithm::applyBC() ...@@ -29,7 +29,7 @@ void SimpleSlipBCAlgorithm::applyBC()
LBMReal f[D3Q27System::ENDF+1]; LBMReal f[D3Q27System::ENDF+1];
LBMReal feq[D3Q27System::ENDF+1]; LBMReal feq[D3Q27System::ENDF+1];
distributions->getDistributionInv(f, x1, x2, x3); distributions->getDistributionInv(f, x1, x2, x3);
LBMReal rho, vx1, vx2, vx3, drho; LBMReal vx1, vx2, vx3, drho;
calcMacrosFct(f, drho, vx1, vx2, vx3); calcMacrosFct(f, drho, vx1, vx2, vx3);
calcFeqFct(feq, drho, vx1, vx2, vx3); calcFeqFct(feq, drho, vx1, vx2, vx3);
...@@ -40,8 +40,6 @@ void SimpleSlipBCAlgorithm::applyBC() ...@@ -40,8 +40,6 @@ void SimpleSlipBCAlgorithm::applyBC()
vx2 = vx2 - amp * val<2>(normale); //normale zeigt von struktur weg! vx2 = vx2 - amp * val<2>(normale); //normale zeigt von struktur weg!
vx3 = vx3 - amp * val<3>(normale); //normale zeigt von struktur weg! vx3 = vx3 - amp * val<3>(normale); //normale zeigt von struktur weg!
rho = 1.0+drho*compressibleFactor;
for (int fdir = D3Q27System::FSTARTDIR; fdir<=D3Q27System::FENDDIR; fdir++) for (int fdir = D3Q27System::FSTARTDIR; fdir<=D3Q27System::FENDDIR; fdir++)
{ {
if (bcPtr->hasSlipBoundaryFlag(fdir)) if (bcPtr->hasSlipBoundaryFlag(fdir))
......
...@@ -61,12 +61,10 @@ void SimpleVelocityBCAlgorithm::applyBC() ...@@ -61,12 +61,10 @@ void SimpleVelocityBCAlgorithm::applyBC()
LBMReal f[D3Q27System::ENDF+1]; LBMReal f[D3Q27System::ENDF+1];
LBMReal feq[D3Q27System::ENDF+1]; LBMReal feq[D3Q27System::ENDF+1];
distributions->getDistributionInv(f, x1, x2, x3); distributions->getDistributionInv(f, x1, x2, x3);
LBMReal rho, vx1, vx2, vx3, drho; LBMReal vx1, vx2, vx3, drho;
calcMacrosFct(f, drho, vx1, vx2, vx3); calcMacrosFct(f, drho, vx1, vx2, vx3);
calcFeqFct(feq, drho, vx1, vx2, vx3); calcFeqFct(feq, drho, vx1, vx2, vx3);
rho = 1.0+drho*compressibleFactor;
for (int fdir = D3Q27System::FSTARTDIR; fdir<=D3Q27System::FENDDIR; fdir++) for (int fdir = D3Q27System::FSTARTDIR; fdir<=D3Q27System::FENDDIR; fdir++)
{ {
if (bcPtr->hasVelocityBoundaryFlag(fdir)) if (bcPtr->hasVelocityBoundaryFlag(fdir))
......
...@@ -58,15 +58,14 @@ void VelocityAndThixotropyBCAlgorithm::applyBC() ...@@ -58,15 +58,14 @@ void VelocityAndThixotropyBCAlgorithm::applyBC()
int nx1 = x1; int nx1 = x1;
int nx2 = x2; int nx2 = x2;
int nx3 = x3; int nx3 = x3;
int direction = -1;
//flag points in direction of fluid //flag points in direction of fluid
if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::E)) { nx1 -= 1; direction = D3Q27System::E; } if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::E)) { nx1 -= 1; }
else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::W)) { nx1 += 1; direction = D3Q27System::W; } else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::W)) { nx1 += 1; }
else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::N)) { nx2 -= 1; direction = D3Q27System::N; } else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::N)) { nx2 -= 1; }
else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::S)) { nx2 += 1; direction = D3Q27System::S; } else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::S)) { nx2 += 1; }
else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::T)) { nx3 -= 1; direction = D3Q27System::T; } else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::T)) { nx3 -= 1; }
else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::B)) { nx3 += 1; direction = D3Q27System::B; } else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::B)) { nx3 += 1; }
else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on velocity boundary...")); else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on velocity boundary..."));
//lambdaBC = bcPtr->getBoundaryThixotropy(); //lambdaBC = bcPtr->getBoundaryThixotropy();
......
...@@ -51,15 +51,14 @@ void VelocityWithDensityAndThixotropyBCAlgorithm::applyBC() ...@@ -51,15 +51,14 @@ void VelocityWithDensityAndThixotropyBCAlgorithm::applyBC()
int nx1 = x1; int nx1 = x1;
int nx2 = x2; int nx2 = x2;
int nx3 = x3; int nx3 = x3;
int direction = -1;
//flag points in direction of fluid //flag points in direction of fluid
if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::E)) { nx1 -= 1; direction = D3Q27System::E; } if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::E)) { nx1 -= 1; }
else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::W)) { nx1 += 1; direction = D3Q27System::W; } else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::W)) { nx1 += 1; }
else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::N)) { nx2 -= 1; direction = D3Q27System::N; } else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::N)) { nx2 -= 1; }
else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::S)) { nx2 += 1; direction = D3Q27System::S; } else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::S)) { nx2 += 1; }
else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::T)) { nx3 -= 1; direction = D3Q27System::T; } else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::T)) { nx3 -= 1; }
else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::B)) { nx3 += 1; direction = D3Q27System::B; } else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::B)) { nx3 += 1; }
else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on velocity boundary...")); else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on velocity boundary..."));
for (int fdir = D3Q27System::FSTARTDIR; fdir <= D3Q27System::FENDDIR; fdir++) for (int fdir = D3Q27System::FSTARTDIR; fdir <= D3Q27System::FENDDIR; fdir++)
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "EsoTwist3D.h" #include "EsoTwist3D.h"
#include "DistributionArray3D.h" #include "DistributionArray3D.h"
CalculateTorqueCoProcessor::CalculateTorqueCoProcessor( SPtr<Grid3D> grid, SPtr<UbScheduler> s, const std::string &path_, SPtr<Communicator> comm) : CoProcessor(grid, s), path(path), comm(comm), forceX1global(0), forceX2global(0), forceX3global(0) CalculateTorqueCoProcessor::CalculateTorqueCoProcessor( SPtr<Grid3D> grid, SPtr<UbScheduler> s, const std::string &path_, SPtr<Communicator> comm) : CoProcessor(grid, s), path(path_), comm(comm), forceX1global(0), forceX2global(0), forceX3global(0)
{ {
if (comm->getProcessID() == comm->getRoot()) if (comm->getProcessID() == comm->getRoot())
{ {
......
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