www.cemf.ir
boundaryContactSearch.cpp
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 
22 #include "contactSearch.hpp"
23 
25  const dictionary &dict,
26  const boundaryBase &boundary,
27  const contactSearch &cSearch)
29  boundary,
30  cSearch.pStruct(),
31  "",
32  ""),
33  contactSearch_(cSearch),
34  updateInterval_(dict.getVal<uint32>("updateInterval"))
35 {
36 }
37 
40  const dictionary &dict,
41  const boundaryBase &boundary,
42  const contactSearch &cSearch)
43 {
44 
45  word bType = angleBracketsNames2(
46  "boundaryContactSearch",
47  pFlowProcessors().localRunTypeName(),
48  boundary.type());
49  word altBType{"boundaryContactSearch<none>"};
50 
51  if( boundaryBasevCtorSelector_.search(bType) )
52  {
53  pOutput.space(4)<<"Creating contact search boundary "<< Green_Text(bType)<<
54  " for "<<boundary.name()<<endl;
55  return boundaryBasevCtorSelector_[bType](dict, boundary, cSearch);
56  }
57  else if(boundaryBasevCtorSelector_.search(altBType))
58  {
59  pOutput.space(4)<<"Creating contact search boundary "<< Green_Text(altBType)<<
60  " for "<<boundary.name()<<endl;
61  return boundaryBasevCtorSelector_[altBType](dict, boundary, cSearch);
62  }
63  else
64  {
65  printKeys
66  (
67  fatalError << "Ctor Selector "<< bType<<
68  " and "<< altBType << " do not exist. \n"
69  <<"Avaiable ones are: \n"
70  ,
71  boundaryBasevCtorSelector_
72  );
73  fatalExit;
74  }
75 
76  return nullptr;
77 }
Green_Text
#define Green_Text(text)
Definition: iOstream.hpp:42
pFlow::pOutput
processorOstream pOutput
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
pFlow::boundaryContactSearch::boundaryContactSearch
boundaryContactSearch(const dictionary &dict, const boundaryBase &boundary, const contactSearch &cSearch)
Definition: boundaryContactSearch.cpp:24
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::printKeys
iOstream & printKeys(iOstream &os, const wordHashMap< T > &m)
boundaryContactSearch.hpp
pFlow::boundaryBase::name
const word & name() const
Definition: boundaryBase.hpp:258
pFlow::endl
iOstream & endl(iOstream &os)
Add newline and flush stream.
Definition: iOstream.hpp:341
pFlow::boundaryBase::type
const word & type() const
Definition: boundaryBase.hpp:252
pFlow::angleBracketsNames2
word angleBracketsNames2(const word &base, const word &w1, const word &w2)
Output base<w1,w2>
Definition: bTypesFunctions.cpp:162
pFlow::boundaryBase
Definition: boundaryBase.hpp:42
fatalError
#define fatalError
Report a fatal error and exit the applicaiton.
Definition: error.hpp:70
pStruct
auto & pStruct
Definition: setPointStructure.hpp:24
pFlow::boundaryContactSearch::create
static uniquePtr< boundaryContactSearch > create(const dictionary &dict, const boundaryBase &boundary, const contactSearch &cSearch)
Definition: boundaryContactSearch.cpp:39
pFlow::contactSearch
Definition: contactSearch.hpp:42
pFlow::pFlowProcessors
localProcessors & pFlowProcessors()
Definition: pFlowProcessors.cpp:5
pFlow::uniquePtr
Definition: uniquePtr.hpp:42
contactSearch.hpp
pFlow::iOstream::space
virtual iOstream & space(int32 n=1)
Write space to stream.
Definition: iOstream.cpp:119
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::generalBoundary
Definition: generalBoundary.hpp:38