# PhasicFlow: src/phasicFlow/setFieldList/setFieldEntry.cpp Source File

setFieldEntry.cpp
Go to the documentation of this file.
/*------------------------------- 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 "setFieldEntry.hpp"
pFlow::setFieldEntry::setFieldEntry
(
const dataEntry& entry
)
:
entry_(entry)
{}
pFlow::word pFlow::setFieldEntry::fieldName()const
{
return entry_.keyword();
}
bool pFlow::setFieldEntry::checkForTypeAndValueAll()const
{
if(
!(
checkForTypeAndValue<int8>() ||
checkForTypeAndValue<int16>() ||
checkForTypeAndValue<int32>() ||
checkForTypeAndValue<int64>() ||
checkForTypeAndValue<uint32>() ||
checkForTypeAndValue<label>() ||
checkForTypeAndValue<real>() ||
checkForTypeAndValue<realx3>()
)
)
{
fatalErrorInFunction<<
" un-supported data type "<<entry_.firstPart() << " in setField for field " << fieldName() <<endl;
return false;
}
return true;
}
void* pFlow::setFieldEntry::setPointFieldDefaultValueNewAll
(
repository& owner,
pointStructure& pStruct,
bool verbose
)
{
if( void* res = setPointFieldDefaultValueNew<int8> (owner, pStruct, verbose) ; res)
{
return res;
}else if(void* res = setPointFieldDefaultValueNew<int16>(owner, pStruct, verbose); res)
{
return res;
}else if(void* res = setPointFieldDefaultValueNew<int32> (owner, pStruct, verbose); res)
{
return res;
}else if(void* res = setPointFieldDefaultValueNew<int64> (owner, pStruct, verbose); res)
{
return res;
}else if(void* res = setPointFieldDefaultValueNew<uint32> (owner, pStruct, verbose); res)
{
return res;
}else if(void* res = setPointFieldDefaultValueNew<label>(owner, pStruct, verbose); res)
{
return res;
}else if(void* res = setPointFieldDefaultValueNew<real>(owner, pStruct, verbose); res)
{
return res;
}else if(void* res = setPointFieldDefaultValueNew<realx3>(owner, pStruct, verbose); res)
{
return res;
}else if(void* res = setPointFieldDefaultValueStdNew<word>(owner, pStruct, verbose); res)
{
return res;
}else
{
fatalErrorInFunction<<
" un-supported data type "<<entry_.firstPart() << " in setField for field " << fieldName() <<endl;
return nullptr;
}
}
void* pFlow::setFieldEntry::setPointFieldSelectedAll
(
repository& owner,
int32IndexContainer& selected,
bool verbose
)
{
if( void* res = setPointFieldSelected<int8> (owner, selected, verbose) ; res)
{
return res;
}else if(void* res = setPointFieldSelected<int16>(owner, selected, verbose); res)
{
return res;
}else if(void* res = setPointFieldSelected<int32> (owner, selected, verbose); res)
{
return res;
}else if(void* res = setPointFieldSelected<int64> (owner, selected, verbose); res)
{
return res;
}else if(void* res = setPointFieldSelected<uint32> (owner, selected, verbose); res)
{
return res;
}else if(void* res = setPointFieldSelected<label>(owner, selected, verbose); res)
{
return res;
}else if(void* res = setPointFieldSelected<real>(owner, selected, verbose); res)
{
return res;
}else if(void* res = setPointFieldSelected<realx3>(owner, selected, verbose); res)
{
return res;
}else if(void* res = setPointFieldSelectedStd<word>(owner, selected, verbose); res)
{
return res;
}else
{
fatalErrorInFunction<<
" un-supported data type "<<entry_.firstPart() << " in setField for field " << fieldName() <<endl;
return nullptr;
}
}
pFlow::setFieldEntry::checkForTypeAndValueAll
bool checkForTypeAndValueAll() const
Definition: setFieldEntry.cpp:37
setFieldEntry.hpp
pFlow::setFieldEntry::setPointFieldDefaultValueNewAll
void * setPointFieldDefaultValueNewAll(repository &owner, pointStructure &pStruct, bool verbose=false)
Definition: setFieldEntry.cpp:61
pFlow::word
std::string word
Definition: builtinTypes.hpp:63
pFlow::endl
iOstream & endl(iOstream &os)
Definition: iOstream.hpp:312
pFlow::setFieldEntry::fieldName
word fieldName() const
Definition: setFieldEntry.cpp:32
pFlow::pointStructure
Definition: pointStructure.hpp:44
pFlow::dataEntry
Definition: dataEntry.hpp:40
fatalErrorInFunction
#define fatalErrorInFunction
Definition: error.hpp:42
pStruct
auto & pStruct
Definition: setPointStructure.hpp:24
pFlow::twoPartEntry::keyword
const word & keyword() const
Definition: twoPartEntry.hpp:46
pFlow::setFieldEntry::entry_
twoPartEntry entry_
Definition: setFieldEntry.hpp:37
pFlow::setFieldEntry::setPointFieldSelectedAll
void * setPointFieldSelectedAll(repository &owner, int32IndexContainer &selected, bool verbose=false)
Definition: setFieldEntry.cpp:104
pFlow::repository
Definition: repository.hpp:34
pFlow::setFieldEntry::setFieldEntry
setFieldEntry(const dataEntry &entry)
Definition: setFieldEntry.cpp:25
pFlow::indexContainer< int32 >