www.cemf.ir
setFields.hpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 
21 
22 #ifndef __setFields_hpp__
23 #define __setFields_hpp__
24 
25 #include "pStructSelector.hpp"
26 #include "pointFields.hpp"
27 #include "setFieldList.hpp"
28 #include "systemControl.hpp"
29 
30 namespace pFlow
31 {
32 
33 
34 bool applySelector(systemControl& control, const pointStructure& pStruct, const dictionary& selDict)
35 {
36 
37 
38  auto selector = pStructSelector::create(pStruct, selDict);
39 
40  auto& selected = selector().selectedPoints();
41 
42  uint32IndexContainer selIndex(selected.data(), selected.size());
43 
44  setFieldList sfList(selDict.subDict("fieldValue"));
45 
46  for(auto& sfEntry:sfList)
47  {
48  if(!sfEntry.setPointFieldSelectedAll(control.time(), selIndex, true ))return false;
49  }
50 
51  return true;
52 }
53 
54 } // pFlow
55 
56 #endif //__setFields_hpp__
pFlow::pStructSelector::create
static uniquePtr< pStructSelector > create(const pointStructure &pStruct, const dictionary &dict)
Definition: pStructSelector.cpp:71
setFieldList.hpp
systemControl.hpp
pFlow::systemControl
Definition: systemControl.hpp:41
pointFields.hpp
pFlow
Definition: demGeometry.hpp:27
pStructSelector.hpp
pFlow::pointStructure
Definition: pointStructure.hpp:34
pFlow::systemControl::time
const Time & time() const
Definition: systemControl.hpp:122
pFlow::setFieldList
Definition: setFieldList.hpp:32
pFlow::dictionary::subDict
dictionary & subDict(const word &keyword)
ref to a subdictioanry fatalExit if not found
Definition: dictionary.cpp:560
pStruct
auto & pStruct
Definition: setPointStructure.hpp:24
pFlow::applySelector
bool applySelector(systemControl &control, const pointStructure &pStruct, const dictionary &selDict)
Definition: setFields.hpp:34
pFlow::dictionary
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
Definition: dictionary.hpp:67
pFlow::indexContainer
It holds two vectors of indecis on Host and Device.
Definition: indexContainer.hpp:39