mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-06-12 16:26:23 +00:00
runtime dynamic link library and geometryPhasicFlow modification
This commit is contained in:
140
utilities/Utilities/geometryPhasicFlow/cuboidWall/cuboidWall.cpp
Executable file
140
utilities/Utilities/geometryPhasicFlow/cuboidWall/cuboidWall.cpp
Executable file
@ -0,0 +1,140 @@
|
||||
/*------------------------------- phasicFlow ---------------------------------
|
||||
O C enter of
|
||||
O O E ngineering and
|
||||
O O M ultiscale modeling of
|
||||
OOOOOOO F luid flow
|
||||
------------------------------------------------------------------------------
|
||||
Copyright (C): www.cemf.ir
|
||||
email: hamid.r.norouzi AT gmail.com
|
||||
------------------------------------------------------------------------------
|
||||
Licence:
|
||||
This file is part of phasicFlow code. It is a free software for simulating
|
||||
granular and multiphase flows. You can redistribute it and/or modify it under
|
||||
the terms of GNU General Public License v3 or any other later versions.
|
||||
|
||||
phasicFlow is distributed to help others in their research in the field of
|
||||
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
|
||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
-----------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#include "cuboidWall.hpp"
|
||||
#include "planeWall.hpp"
|
||||
|
||||
|
||||
|
||||
bool pFlow::cuboidWall::readcuboidWall
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
|
||||
auto center = dict.getVal<realx3>("center");
|
||||
auto edgeLength= dict.getVal<realx3>("edgeLength");
|
||||
auto numDivs = dict.getValOrSet<int32x3>("numDivs", int32x3(1,1,1));
|
||||
|
||||
numDivs = max(numDivs, int32x3(1,1,1));
|
||||
|
||||
realx3 p1,p2,p3,p4;
|
||||
|
||||
// left plane
|
||||
p1 = center + edgeLength*realx3(-0.5,-0.5,-0.5);
|
||||
p2 = center + edgeLength*realx3(-0.5, 0.5,-0.5);
|
||||
p3 = center + edgeLength*realx3(-0.5, 0.5, 0.5);
|
||||
p4 = center + edgeLength*realx3(-0.5,-0.5, 0.5);
|
||||
|
||||
planeWall left(p1,p2,p3,p4, numDivs.y(), numDivs.z());
|
||||
|
||||
for(const auto& t:left.triangles())
|
||||
{
|
||||
triangles_.push_back(t);
|
||||
}
|
||||
|
||||
// right plane
|
||||
p1 = center + edgeLength*realx3( 0.5,-0.5,-0.5);
|
||||
p2 = center + edgeLength*realx3( 0.5,-0.5, 0.5);
|
||||
p3 = center + edgeLength*realx3( 0.5, 0.5, 0.5);
|
||||
p4 = center + edgeLength*realx3( 0.5, 0.5,-0.5);
|
||||
|
||||
planeWall right(p1,p2,p3,p4, numDivs.z(), numDivs.y());
|
||||
|
||||
for(const auto& t:right.triangles())
|
||||
{
|
||||
triangles_.push_back(t);
|
||||
}
|
||||
|
||||
// bottom plane
|
||||
p1 = center + edgeLength*realx3(-0.5,-0.5,-0.5);
|
||||
p2 = center + edgeLength*realx3(-0.5,-0.5, 0.5);
|
||||
p3 = center + edgeLength*realx3( 0.5,-0.5, 0.5);
|
||||
p4 = center + edgeLength*realx3( 0.5,-0.5,-0.5);
|
||||
|
||||
planeWall bottom(p1,p2,p3,p4, numDivs.z(), numDivs.x());
|
||||
|
||||
for(const auto& t:bottom.triangles())
|
||||
{
|
||||
triangles_.push_back(t);
|
||||
}
|
||||
|
||||
// top plane
|
||||
p1 = center + edgeLength*realx3(-0.5, 0.5,-0.5);
|
||||
p2 = center + edgeLength*realx3( 0.5, 0.5,-0.5);
|
||||
p3 = center + edgeLength*realx3( 0.5, 0.5, 0.5);
|
||||
p4 = center + edgeLength*realx3(-0.5, 0.5, 0.5);
|
||||
|
||||
planeWall top(p1,p2,p3,p4, numDivs.x(), numDivs.z());
|
||||
|
||||
for(const auto& t:top.triangles())
|
||||
{
|
||||
triangles_.push_back(t);
|
||||
}
|
||||
|
||||
// back plane
|
||||
p1 = center + edgeLength*realx3(-0.5,-0.5,-0.5);
|
||||
p2 = center + edgeLength*realx3( 0.5,-0.5,-0.5);
|
||||
p3 = center + edgeLength*realx3( 0.5, 0.5,-0.5);
|
||||
p4 = center + edgeLength*realx3(-0.5, 0.5,-0.5);
|
||||
|
||||
|
||||
planeWall back(p1,p2,p3,p4, numDivs.x(), numDivs.y());
|
||||
|
||||
for(const auto& t:back.triangles())
|
||||
{
|
||||
triangles_.push_back(t);
|
||||
}
|
||||
|
||||
|
||||
// fron plane
|
||||
p1 = center + edgeLength*realx3(-0.5,-0.5, 0.5);
|
||||
p2 = center + edgeLength*realx3(-0.5, 0.5, 0.5);
|
||||
p3 = center + edgeLength*realx3( 0.5, 0.5, 0.5);
|
||||
p4 = center + edgeLength*realx3( 0.5,-0.5, 0.5);
|
||||
|
||||
planeWall front(p1,p2,p3,p4, numDivs.y(), numDivs.x());
|
||||
|
||||
for(const auto& t:front.triangles())
|
||||
{
|
||||
triangles_.push_back(t);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
pFlow::cuboidWall::cuboidWall()
|
||||
{}
|
||||
|
||||
pFlow::cuboidWall::cuboidWall
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
Wall(dict)
|
||||
{
|
||||
if(!readcuboidWall(dict))
|
||||
{
|
||||
fatalExit;
|
||||
}
|
||||
}
|
60
utilities/Utilities/geometryPhasicFlow/cuboidWall/cuboidWall.hpp
Executable file
60
utilities/Utilities/geometryPhasicFlow/cuboidWall/cuboidWall.hpp
Executable file
@ -0,0 +1,60 @@
|
||||
/*------------------------------- phasicFlow ---------------------------------
|
||||
O C enter of
|
||||
O O E ngineering and
|
||||
O O M ultiscale modeling of
|
||||
OOOOOOO F luid flow
|
||||
------------------------------------------------------------------------------
|
||||
Copyright (C): www.cemf.ir
|
||||
email: hamid.r.norouzi AT gmail.com
|
||||
------------------------------------------------------------------------------
|
||||
Licence:
|
||||
This file is part of phasicFlow code. It is a free software for simulating
|
||||
granular and multiphase flows. You can redistribute it and/or modify it under
|
||||
the terms of GNU General Public License v3 or any other later versions.
|
||||
|
||||
phasicFlow is distributed to help others in their research in the field of
|
||||
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
|
||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
-----------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifndef __cuboidWall_hpp__
|
||||
#define __cuboidWall_hpp__
|
||||
|
||||
|
||||
#include "Wall.hpp"
|
||||
#include "types.hpp"
|
||||
|
||||
namespace pFlow
|
||||
{
|
||||
|
||||
class cuboidWall
|
||||
:
|
||||
public Wall
|
||||
{
|
||||
protected:
|
||||
|
||||
bool readcuboidWall(const dictionary& dict);
|
||||
|
||||
public:
|
||||
|
||||
TypeInfo("cuboidWall");
|
||||
|
||||
cuboidWall();
|
||||
|
||||
cuboidWall(const dictionary& dict);
|
||||
|
||||
add_vCtor
|
||||
(
|
||||
Wall,
|
||||
cuboidWall,
|
||||
dictionary
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
} // pFlow
|
||||
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user