mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-06-22 16:28:30 +00:00
first commit after code loss - develop branch
This commit is contained in:
64
src/Particles/SphereParticles/boundarySphereParticles.cpp
Normal file
64
src/Particles/SphereParticles/boundarySphereParticles.cpp
Normal file
@ -0,0 +1,64 @@
|
||||
#include "boundarySphereParticles.hpp"
|
||||
#include "boundaryBase.hpp"
|
||||
#include "sphereParticles.hpp"
|
||||
|
||||
|
||||
pFlow::boundarySphereParticles::boundarySphereParticles(
|
||||
const boundaryBase &boundary,
|
||||
sphereParticles &prtcls
|
||||
)
|
||||
:
|
||||
generalBoundary(boundary, prtcls.pStruct(), "", ""),
|
||||
particles_(prtcls)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
pFlow::sphereParticles &pFlow::boundarySphereParticles::Particles()
|
||||
{
|
||||
return particles_;
|
||||
}
|
||||
|
||||
const pFlow::sphereParticles &pFlow::boundarySphereParticles::Particles() const
|
||||
{
|
||||
return particles_;
|
||||
}
|
||||
|
||||
pFlow::uniquePtr<pFlow::boundarySphereParticles> pFlow::boundarySphereParticles::create(
|
||||
const boundaryBase &boundary,
|
||||
sphereParticles &prtcls
|
||||
)
|
||||
{
|
||||
|
||||
word bType = angleBracketsNames2(
|
||||
"boundarySphereParticles",
|
||||
pFlowProcessors().localRunTypeName(),
|
||||
boundary.type());
|
||||
|
||||
word altBType{"boundarySphereParticles<none>"};
|
||||
|
||||
if( boundaryBasevCtorSelector_.search(bType) )
|
||||
{
|
||||
pOutput.space(4)<<"Creating boundary "<< Green_Text(bType)<<
|
||||
" for "<<boundary.name()<<endl;
|
||||
return boundaryBasevCtorSelector_[bType](boundary, prtcls);
|
||||
}
|
||||
else if(boundaryBasevCtorSelector_.search(altBType))
|
||||
{
|
||||
pOutput.space(4)<<"Creating boundary "<< Green_Text(altBType)<<
|
||||
" for "<<boundary.name()<<endl;
|
||||
return boundaryBasevCtorSelector_[altBType](boundary, prtcls);
|
||||
}
|
||||
else
|
||||
{
|
||||
printKeys(
|
||||
fatalError << "Ctor Selector "<< bType<<
|
||||
" and "<< altBType << " do not exist. \n"
|
||||
<<"Avaiable ones are: \n",
|
||||
boundaryBasevCtorSelector_
|
||||
);
|
||||
fatalExit;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
80
src/Particles/SphereParticles/boundarySphereParticles.hpp
Normal file
80
src/Particles/SphereParticles/boundarySphereParticles.hpp
Normal file
@ -0,0 +1,80 @@
|
||||
|
||||
|
||||
#ifndef __boundarySphereParticles_hpp__
|
||||
#define __boundarySphereParticles_hpp__
|
||||
|
||||
#include "generalBoundary.hpp"
|
||||
#include "virtualConstructor.hpp"
|
||||
#include "timeInfo.hpp"
|
||||
|
||||
namespace pFlow
|
||||
{
|
||||
|
||||
class sphereParticles;
|
||||
|
||||
class boundarySphereParticles
|
||||
: public generalBoundary
|
||||
{
|
||||
private:
|
||||
|
||||
sphereParticles& particles_;
|
||||
|
||||
public:
|
||||
|
||||
/// type info
|
||||
TypeInfo("boundarySphereParticles<none>");
|
||||
|
||||
boundarySphereParticles(
|
||||
const boundaryBase &boundary,
|
||||
sphereParticles& prtcls
|
||||
);
|
||||
|
||||
create_vCtor(
|
||||
boundarySphereParticles,
|
||||
boundaryBase,
|
||||
(
|
||||
const boundaryBase &boundary,
|
||||
sphereParticles& prtcls
|
||||
),
|
||||
(boundary, prtcls)
|
||||
);
|
||||
|
||||
add_vCtor(
|
||||
boundarySphereParticles,
|
||||
boundarySphereParticles,
|
||||
boundaryBase
|
||||
);
|
||||
|
||||
sphereParticles& Particles();
|
||||
|
||||
const sphereParticles& Particles()const;
|
||||
|
||||
bool hearChanges(
|
||||
real t,
|
||||
real dt,
|
||||
uint32 iter,
|
||||
const message &msg,
|
||||
const anyList &varList) override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual
|
||||
bool acceleration(const timeInfo& ti, const realx3& g)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static
|
||||
uniquePtr<boundarySphereParticles> create(
|
||||
const boundaryBase &boundary,
|
||||
sphereParticles& prtcls);
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -0,0 +1,19 @@
|
||||
#include "boundarySphereParticlesList.hpp"
|
||||
|
||||
pFlow::boundarySphereParticlesList::boundarySphereParticlesList(
|
||||
const boundaryList &bndrs,
|
||||
sphereParticles &prtcls
|
||||
)
|
||||
:
|
||||
ListPtr(bndrs.size()),
|
||||
boundaries_(bndrs)
|
||||
{
|
||||
for(auto i=0; i<boundaries_.size(); i++)
|
||||
{
|
||||
this->set
|
||||
(
|
||||
i,
|
||||
boundarySphereParticles::create(boundaries_[i], prtcls)
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
|
||||
|
||||
#ifndef __boundarySphereParticlesList_hpp__
|
||||
#define __boundarySphereParticlesList_hpp__
|
||||
|
||||
#include "ListPtr.hpp"
|
||||
#include "boundaryList.hpp"
|
||||
#include "boundarySphereParticles.hpp"
|
||||
|
||||
namespace pFlow
|
||||
{
|
||||
|
||||
class boundarySphereParticlesList
|
||||
:
|
||||
public ListPtr<boundarySphereParticles>
|
||||
{
|
||||
private:
|
||||
|
||||
const boundaryList& boundaries_;
|
||||
|
||||
public:
|
||||
|
||||
boundarySphereParticlesList(
|
||||
const boundaryList& bndrs,
|
||||
sphereParticles& prtcls
|
||||
);
|
||||
|
||||
~boundarySphereParticlesList()=default;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user