2022-09-05 01:56:29 +04:30
|
|
|
/*------------------------------- 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.
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------------*/
|
|
|
|
|
2022-12-10 01:32:54 +03:30
|
|
|
#include "integration.hpp"
|
2024-01-21 13:26:23 -08:00
|
|
|
#include "pointStructure.hpp"
|
|
|
|
#include "repository.hpp"
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2025-02-06 11:04:30 +03:30
|
|
|
bool pFlow::integration::insertValues
|
2022-09-05 01:56:29 +04:30
|
|
|
(
|
2025-02-06 11:04:30 +03:30
|
|
|
const anyList& varList,
|
|
|
|
const deviceViewType1D<realx3>& srcVals,
|
|
|
|
realx3PointField_D& dstFeild
|
2022-09-05 01:56:29 +04:30
|
|
|
)
|
2025-02-06 11:04:30 +03:30
|
|
|
{
|
|
|
|
const word eventName = message::eventName(message::ITEMS_INSERT);
|
|
|
|
|
|
|
|
if(!varList.checkObjectType<uint32IndexContainer>(eventName))
|
|
|
|
{
|
|
|
|
fatalErrorInFunction<<"Insertion failed in integration for "<< baseName_<<
|
|
|
|
", variable "<< eventName <<
|
|
|
|
" does not exist or the type is incorrect"<<endl;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
const auto& indices = varList.getObject<uint32IndexContainer>(
|
|
|
|
eventName);
|
|
|
|
|
|
|
|
dstFeild.field().insertSetElement(indices, srcVals);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
pFlow::integration::integration(
|
|
|
|
const word &baseName,
|
|
|
|
pointStructure &pStruct,
|
|
|
|
const word &,
|
|
|
|
const realx3Field_D &)
|
|
|
|
: owner_(*pStruct.owner()),
|
|
|
|
pStruct_(pStruct),
|
|
|
|
baseName_(baseName)
|
2024-01-21 13:26:23 -08:00
|
|
|
{}
|
2022-09-05 01:56:29 +04:30
|
|
|
|
|
|
|
|
|
|
|
pFlow::uniquePtr<pFlow::integration>
|
2024-01-21 13:26:23 -08:00
|
|
|
pFlow::integration::create
|
|
|
|
(
|
2022-09-05 01:56:29 +04:30
|
|
|
const word& baseName,
|
2024-01-21 13:26:23 -08:00
|
|
|
pointStructure& pStruct,
|
|
|
|
const word& method,
|
|
|
|
const realx3Field_D& initialValField
|
|
|
|
)
|
2022-09-05 01:56:29 +04:30
|
|
|
{
|
|
|
|
if( wordvCtorSelector_.search(method) )
|
|
|
|
{
|
2024-01-21 13:26:23 -08:00
|
|
|
return wordvCtorSelector_[method] (baseName, pStruct, method, initialValField);
|
2022-09-05 01:56:29 +04:30
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
printKeys
|
|
|
|
(
|
|
|
|
fatalError << "Ctor Selector "<< method << " dose not exist. \n"
|
|
|
|
<<"Avaiable ones are: \n\n"
|
|
|
|
,
|
|
|
|
wordvCtorSelector_
|
|
|
|
);
|
|
|
|
fatalExit;
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|