2023-01-08 04:36:15 +00:00
|
|
|
/*------------------------------- 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 "multiRotatingAxisMotion.hpp"
|
|
|
|
|
2025-03-15 16:36:38 +00:00
|
|
|
void pFlow::multiRotatingAxisMotion::impl_setTime
|
2023-01-08 04:36:15 +00:00
|
|
|
(
|
2025-03-15 16:36:38 +00:00
|
|
|
uint32 iter,
|
|
|
|
real t,
|
|
|
|
real dt
|
|
|
|
)const
|
2023-01-08 04:36:15 +00:00
|
|
|
{
|
2025-03-15 16:36:38 +00:00
|
|
|
auto motion = motionComponents_.deviceViewAll();
|
|
|
|
Kokkos::parallel_for(
|
|
|
|
"multiRotatingAxisMotion::impl_setTime",
|
|
|
|
deviceRPolicyStatic(0, numComponents_),
|
|
|
|
LAMBDA_HD(uint32 i){
|
|
|
|
motion[i].setTime(t);
|
|
|
|
});
|
|
|
|
Kokkos::fence();
|
2023-01-08 04:36:15 +00:00
|
|
|
}
|
|
|
|
|
2025-03-15 16:36:38 +00:00
|
|
|
pFlow::multiRotatingAxisMotion::multiRotatingAxisMotion(
|
|
|
|
const objectFile &objf,
|
|
|
|
repository *owner)
|
|
|
|
: fileDictionary(objf, owner)
|
2023-01-08 04:36:15 +00:00
|
|
|
{
|
|
|
|
|
2025-03-16 07:15:49 +00:00
|
|
|
if(! impl_readDictionary(*this) )
|
|
|
|
{
|
|
|
|
fatalErrorInFunction;
|
|
|
|
fatalExit;
|
|
|
|
}
|
2023-01-08 04:36:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pFlow::multiRotatingAxisMotion::multiRotatingAxisMotion
|
|
|
|
(
|
2025-03-15 16:36:38 +00:00
|
|
|
const objectFile &objf,
|
|
|
|
const dictionary &dict,
|
|
|
|
repository *owner
|
2023-01-08 04:36:15 +00:00
|
|
|
)
|
2025-03-15 16:36:38 +00:00
|
|
|
:
|
|
|
|
fileDictionary(objf, dict, owner)
|
2023-01-08 04:36:15 +00:00
|
|
|
{
|
2025-03-15 16:36:38 +00:00
|
|
|
if(!impl_readDictionary(*this) )
|
2023-01-08 04:36:15 +00:00
|
|
|
{
|
2025-03-15 16:36:38 +00:00
|
|
|
fatalErrorInFunction;
|
2023-01-08 04:36:15 +00:00
|
|
|
fatalExit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool pFlow::multiRotatingAxisMotion::write
|
|
|
|
(
|
2025-03-15 16:36:38 +00:00
|
|
|
iOstream &os,
|
|
|
|
const IOPattern &iop
|
|
|
|
) const
|
2023-01-08 04:36:15 +00:00
|
|
|
{
|
2025-03-15 16:36:38 +00:00
|
|
|
// a global dictionary
|
|
|
|
dictionary newDict(fileDictionary::dictionary::name(), true);
|
|
|
|
if( iop.thisProcWriteData() )
|
2023-01-08 04:36:15 +00:00
|
|
|
{
|
2025-03-15 16:36:38 +00:00
|
|
|
if( !this->impl_writeDictionary(newDict) ||
|
|
|
|
!newDict.write(os))
|
|
|
|
{
|
|
|
|
fatalErrorInFunction<<
|
|
|
|
" error in writing to dictionary "<< newDict.globalName()<<endl;
|
|
|
|
return false;
|
|
|
|
}
|
2023-01-08 04:36:15 +00:00
|
|
|
}
|
2025-03-15 16:36:38 +00:00
|
|
|
return true;
|
2023-01-08 04:36:15 +00:00
|
|
|
}
|