VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
VoxelMatrixUtil.hpp
Go to the documentation of this file.
1//=======================================================================================
2// ____ ____ __ ______ __________ __ __ __ __
3// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
4// \ \ | | | | | |_) | | | | | | | / \ | |
5// \ \ | | | | | _ / | | | | | | / /\ \ | |
6// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
7// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
8// \ \ | | ________________________________________________________________
9// \ \ | | | ______________________________________________________________|
10// \ \| | | | __ __ __ __ ______ _______
11// \ | | |_____ | | | | | | | | | _ \ / _____)
12// \ | | _____| | | | | | | | | | | \ \ \_______
13// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
14// \ _____| |__| |________| \_______/ |__| |______/ (_______/
15//
16// This file is part of VirtualFluids. VirtualFluids is free software: you can
17// redistribute it and/or modify it under the terms of the GNU General Public
18// License as published by the Free Software Foundation, either version 3 of
19// the License, or (at your option) any later version.
20//
21// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
22// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24// for more details.
25//
26// SPDX-License-Identifier: GPL-3.0-or-later
27// SPDX-FileCopyrightText: Copyright © VirtualFluids Project contributors, see AUTHORS.md in root folder
28//
33//=======================================================================================
34
35#ifndef VoxelMatrixUtil_h__
36#define VoxelMatrixUtil_h__
37
38#include "GbCuboid3D.h"
39#include "NoSlipBC.h"
40#include "D3Q27Interactor.h"
42#include "Block3D.h"
43#include "Grid3D.h"
44
45
46namespace utilities
47{
49 {
52
53 if (vmFile)
54 {
55 if (myid == 0) matrix->writeToVTKImageDataASCII(pathname + "/geo/vmatrix" + ub_system::toString(fileCounter));
56 }
57 else
58 {
59 GbCuboid3DPtr vmBox(new GbCuboid3D(matrix->getX1Minimum(), matrix->getX2Minimum(), matrix->getX3Minimum(), matrix->getX1Maximum(), matrix->getX2Maximum(), matrix->getX3Maximum()));
60 if (myid == 0) gb_system_3d::writeGeoObject(vmBox.get(), pathname + "/geo/vmbox" + ub_system::toString(fileCounter), WbWriterVtkXmlASCII::getInstance());
61 }
62
63 //GbCuboid3DPtr vmBox(new GbCuboid3D(matrix->getX1Minimum(), matrix->getX2Minimum(), matrix->getX3Minimum(), matrix->getX1Maximum(), matrix->getX2Maximum(), matrix->getX3Maximum()));
64 //if (myid == 0) gb_system_3d::writeGeoObject(vmBox.get(), pathname + "/geo/vmbox" + UbSystem::toString(fileCounter), WbWriterVtkXmlASCII::getInstance());
65 //SPtr<D3Q27Interactor> vmBoxInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(vmBox, grid, noSlipPM, Interactor3D::SOLID));
66 //SetSolidOrBoundaryBlockVisitor v1(vmBoxInt, SetSolidOrBoundaryBlockVisitor::SOLID);
67 //grid->accept(v1);
68 //SetSolidOrBoundaryBlockVisitor v2(vmBoxInt, SetSolidOrBoundaryBlockVisitor::BC);
69 //grid->accept(v2);
70
71 //std::vector<SPtr<Block3D>> blocks;
72 //std::vector<SPtr<Block3D>>& sb = vmBoxInt->getSolidBlockSet();
73 //if (myid == 0) UBLOG(logINFO, "number of solid blocks = " << sb.size());
74 //blocks.insert(blocks.end(), sb.begin(), sb.end());
75 //std::vector<SPtr<Block3D>>& tb = vmBoxInt->getBcBlocks();
76 //if (myid == 0) UBLOG(logINFO, "number of trans blocks = " << tb.size());
77 //blocks.insert(blocks.end(), tb.begin(), tb.end());
78
79 //if (myid == 0) UBLOG(logINFO, "number of blocks = " << blocks.size());
80
81 //for(SPtr<Block3D> block : blocks)
82 //{
83 // block->setActive(true);
84 // vmInt->setDifferencesToGbObject3D(block);
85 //}
86
88 grid->accept(v);
89 vmInt->initInteractor();
90 }
91}
92#endif // VoxelMatrixUtil_h__
93
94
A specialized class for grid generation.
This Class provides basic 3D box objects.
Definition GbCuboid3D.h:53
A class provides an interface for no-slip boundary condition in grid generator.
Definition NoSlipBC.h:42
A class sets blocks with boundary condition nodes in Interactor3D object.
static WbWriterVtkXmlASCII * getInstance()
std::shared_ptr< T > SPtr
static const int SOLID
SPtr< GbCuboid3D > GbCuboid3DPtr
Definition GbCuboid3D.h:49
std::string toString(const T &x, int precision=15)
Definition UbSystem.h:199
void voxelMatrixDiscretisation(SPtr< GbVoxelMatrix3D > matrix, std::string &pathname, int myid, int fileCounter, SPtr< Grid3D > grid, int bounceBackOption, bool vmFile)