runtime dynamic link library and geometryPhasicFlow modification

This commit is contained in:
Hamidreza Norouzi
2023-02-25 05:15:17 -08:00
parent eef3906a7e
commit 7fec15e3dc
20 changed files with 160 additions and 10 deletions

View File

@ -0,0 +1,103 @@
/*------------------------------- 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 "Wall.hpp"
bool pFlow::Wall::readCommon(const dictionary& dict)
{
materialName_ = dict.getVal<word>("material");
motionName_ = dict.getValOrSet("motion", word("none"));
name_ = dict.name();
return true;
}
pFlow::Wall::Wall(const dictionary& dict)
{
if(!readCommon(dict))
{
fatalExit;
}
}
bool pFlow::Wall::checkTrianlge
(
const realx3 &p1,
const realx3 &p2,
const realx3 &p3
)
{
realx3 ln = cross(p2 - p1, p3 - p1);
if (ln.length() < smallValue) return false;
return true;
}
pFlow::uniquePtr<pFlow::Wall>
pFlow::Wall::create
(
const dictionary& dict
)
{
word type = dict.getVal<word>("type");
if( dictionaryvCtorSelector_.search(type) )
{
return dictionaryvCtorSelector_[type] (dict);
}
else
{
printKeys
(
fatalError << "Ctor Selector "<< type << " dose not exist. \n"
<<"Avaiable ones are: \n\n"
,
dictionaryvCtorSelector_
);
fatalExit;
}
return nullptr;
}
namespace pFlow
{
bool checkNormalVec(
const realx3 &p1,
const realx3 &p2,
const realx3 &p3,
realx3& norm )
{
realx3 ln = cross(p2 - p1, p3 - p1);
real len = length(ln);
if (len < smallValue) return false;
norm = ln/len;
return true;
}
}

View File

@ -0,0 +1,113 @@
/*------------------------------- 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 __Wall_hpp__
#define __Wall_hpp__
#include <vector>
#include "virtualConstructor.hpp"
#include "dictionary.hpp"
namespace pFlow
{
bool checkNormalVec(
const realx3 &p1,
const realx3 &p2,
const realx3 &p3,
realx3& norm );
class Wall
{
protected:
std::vector<realx3x3> triangles_;
word name_;
word materialName_;
word motionName_;
bool readCommon(const dictionary& ditc);
public:
// - type info
TypeInfo("Wall");
//// - Constructors
// - empty
Wall(){}
// - from dictionary
Wall(const dictionary& dict);
virtual ~Wall()=default;
create_vCtor
(
Wall,
dictionary,
(const dictionary& dict),
(dict)
);
//// - Methods
// -
const auto& triangles()const
{
return triangles_;
}
word name()const
{
return name_;
}
word materialName()const
{
return materialName_;
}
word motionName()const
{
return motionName_;
}
static
bool checkTrianlge(const realx3& p1, const realx3& p2, const realx3& p3);
static
uniquePtr<Wall> create(const dictionary& dict);
};
}
#endif