PhasicFlow
v0.1
www.cemf.ir
interaction.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
21
#include "
interaction.hpp
"
22
23
24
pFlow::interaction::interaction
25
(
26
systemControl
& control,
27
const
particles
& prtcl,
28
const
geometry
& geom
29
)
30
:
31
demInteraction
(control, control.
caseSetup
().
path
()+
interactionFile__
),
32
interactionBase
(prtcl, geom),
33
fileDict_(control.
caseSetup
().
emplaceObject
<
dictionary
>(
34
objectFile
(
35
interactionFile__
,
36
""
,
37
objectFile::READ_ALWAYS,
38
objectFile::WRITE_NEVER),
39
interactionFile__
,
40
true
))
41
{
42
this->subscribe(prtcl.
pStruct
());
43
44
contactSearch_ = contactSearch::create(
45
fileDict_.subDict(
"contactSearch"
),
46
this->control().domain(),
47
prtcl,
48
geom,
49
timers()
50
);
51
52
}
53
54
55
pFlow::uniquePtr<pFlow::interaction>
pFlow::interaction::create
56
(
57
systemControl
& control,
58
const
particles
& prtcl,
59
const
geometry
& geom
60
)
61
{
62
word
shapeTypeName = prtcl.
shapeTypeName
();
63
word
motionTypeName = geom.
motionModelTypeName
();
64
65
fileSystem
file = control.
caseSetup
().
path
()+
interactionFile__
;
66
67
dictionary
dict(
interactionFile__
, file);
68
auto
interactionDict= dict.
subDict
(
"model"
);
69
70
word
clType = dict.
getVal
<
word
>(
"contactListType"
);
71
word
cfModel = interactionDict.getVal<
word
>(
"contactForceModel"
);
72
word
rfModel = interactionDict.getVal<
word
>(
"rollingFrictionModel"
);
73
74
75
auto
interactionModel =
angleBracketsNames3
(
76
shapeTypeName+
"Interaction"
,
77
angleBracketsNames
(rfModel,cfModel),
78
motionTypeName,
79
clType);
80
81
82
REPORT
(1)<<
"Selecting interaction model..."
<<
endREPORT
;
83
if
( systemControlvCtorSelector_.search(interactionModel) )
84
{
85
auto
objPtr =
86
systemControlvCtorSelector_[interactionModel]
87
(control, prtcl, geom);
88
89
REPORT
(2)<<
"Model "
<<
greenText
(interactionModel)<<
" is created."
<<
endREPORT
;
90
return
objPtr;
91
}
92
else
93
{
94
printKeys
95
(
96
fatalError
<<
"Ctor Selector "
<<
97
interactionModel <<
" dose not exist. \n"
98
<<
"Avaiable ones are: \n\n"
99
,
100
systemControlvCtorSelector_
101
);
102
fatalExit
;
103
}
104
105
return
nullptr
;
106
107
}
pFlow::angleBracketsNames3
word angleBracketsNames3(const word &base, const word &w1, const word &w2, const word &w3)
Definition:
bTypesFunctions.cpp:146
endREPORT
#define endREPORT
Definition:
streams.hpp:41
fatalExit
#define fatalExit
Definition:
error.hpp:57
REPORT
#define REPORT(n)
Definition:
streams.hpp:40
pFlow::particles::shapeTypeName
virtual word shapeTypeName() const =0
pFlow::geometry::motionModelTypeName
virtual word motionModelTypeName() const =0
pFlow::interaction::create
static uniquePtr< interaction > create(systemControl &control, const particles &prtcl, const geometry &geom)
Definition:
interaction.cpp:56
pFlow::word
std::string word
Definition:
builtinTypes.hpp:63
pFlow::systemControl
Definition:
systemControl.hpp:41
pFlow::printKeys
iOstream & printKeys(iOstream &os, const wordHashMap< T > &m)
pFlow::interactionFile__
const char * interactionFile__
Definition:
vocabs.hpp:48
pFlow::repository::emplaceObject
T & emplaceObject(const objectFile &objf, Args &&... args)
Definition:
repositoryTemplates.cpp:38
interaction.hpp
pFlow::systemControl::caseSetup
const repository & caseSetup() const
Definition:
systemControl.hpp:114
greenText
#define greenText(text)
Definition:
streams.hpp:32
pFlow::fileSystem
Definition:
fileSystem.hpp:63
pFlow::demInteraction
Definition:
demInteraction.hpp:32
pFlow::particles
Definition:
particles.hpp:33
pFlow::angleBracketsNames
word angleBracketsNames(const word &w1, const word &w2)
Definition:
bTypesFunctions.cpp:131
pFlow::particles::pStruct
const auto & pStruct() const
Definition:
particles.hpp:118
pFlow::objectFile
Definition:
objectFile.hpp:33
fatalError
#define fatalError
Definition:
error.hpp:36
pFlow::repository::path
virtual fileSystem path() const
Definition:
repository.cpp:61
pFlow::interactionBase
Definition:
interactionBase.hpp:31
pFlow::dictionary::subDict
dictionary & subDict(const word &keyword)
Definition:
dictionary.cpp:547
pFlow::dictionary::getVal
T getVal(const word &keyword) const
Definition:
dictionary.hpp:309
pFlow::uniquePtr
Definition:
uniquePtr.hpp:44
pFlow::geometry
Definition:
geometry.hpp:37
pFlow::interaction::interaction
interaction(systemControl &control, const particles &prtcl, const geometry &geom)
Definition:
interaction.cpp:25
pFlow::dictionary
Definition:
dictionary.hpp:38
src
Interaction
interaction
interaction.cpp
Generated by
1.8.17