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 #include "particles.hpp"
23 #include "vocabs.hpp"
24 #include "geometry.hpp"
25 
27 (
28  systemControl& control,
29  const particles& prtcl,
30  const geometry& geom
31 )
32 :
34  observer
35  (
36  &prtcl.dynPointStruct(),
37  msg_
38  ),
39  demComponent("interaction", control),
40  particles_(prtcl),
41  geometry_(geom)
42 {
43 
44 }
45 
46 
48 (
49  systemControl& control,
50  const particles& prtcl,
51  const geometry& geom
52 )
53 {
54  word shapeTypeName = prtcl.shapeTypeName();
55  word motionTypeName = geom.motionModelTypeName();
56 
57  fileSystem file = control.caseSetup().path()+interactionFile__;
58 
59  dictionary dict(interactionFile__, file);
60  auto interactionDict= dict.subDict("model");
61 
62  word clType = dict.getVal<word>("contactListType");
63  word cfModel = interactionDict.getVal<word>("contactForceModel");
64  word rfModel = interactionDict.getVal<word>("rollingFrictionModel");
65 
66 
67  auto interactionModel = angleBracketsNames3(
68  shapeTypeName+"Interaction",
69  angleBracketsNames(rfModel,cfModel),
70  motionTypeName,
71  clType);
72 
73 
75  100*(pFlowProcessors().localSize()-pFlowProcessors().localRank()-1));
76  pOutput.space(2)<<"Creating interaction "<<Green_Text(interactionModel)<<" . . ."<<END_REPORT;
77  if( systemControlvCtorSelector_.search(interactionModel) )
78  {
79  auto objPtr =
80  systemControlvCtorSelector_[interactionModel]
81  (control, prtcl, geom);
82  return objPtr;
83  }
84  else
85  {
86  printKeys
87  (
88  fatalError << "Ctor Selector "<<
89  interactionModel << " dose not exist. \n"
90  <<"Avaiable ones are: \n\n"
91  ,
92  systemControlvCtorSelector_
93  );
94  fatalExit;
95  }
96 
97  return nullptr;
98 
99 }
pFlow::angleBracketsNames3
word angleBracketsNames3(const word &base, const word &w1, const word &w2, const word &w3)
Output base<w1,sw2,w3>
Definition: bTypesFunctions.cpp:168
pFlow::observer
Definition: observer.hpp:33
Green_Text
#define Green_Text(text)
Definition: iOstream.hpp:42
pFlow::pOutput
processorOstream pOutput
pFlow::interactionFile__
const char *const interactionFile__
Definition: vocabs.hpp:48
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
pFlow::particles::shapeTypeName
virtual word shapeTypeName() const =0
pFlow::geometry::motionModelTypeName
virtual word motionModelTypeName() const =0
The name of motion model.
pFlow::interaction::create
static uniquePtr< interaction > create(systemControl &control, const particles &prtcl, const geometry &geom)
Definition: interaction.cpp:48
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::systemControl
Definition: systemControl.hpp:41
pFlow::printKeys
iOstream & printKeys(iOstream &os, const wordHashMap< T > &m)
particles.hpp
interaction.hpp
pFlow::systemControl::caseSetup
const repository & caseSetup() const
Definition: systemControl.hpp:113
pFlow::fileSystem
Manages file pathes, manupulate and combines them.
Definition: fileSystem.hpp:71
pFlow::gSettings::sleepMiliSeconds
void sleepMiliSeconds(int miliSeconds)
Definition: globalSettings.cpp:11
pFlow::particles
Definition: particles.hpp:33
pFlow::angleBracketsNames
word angleBracketsNames(const word &w1, const word &w2)
Output <w1,w2>
Definition: bTypesFunctions.cpp:156
pFlow::demComponent
A base class for every main component of DEM system.
Definition: demComponent.hpp:42
geometry.hpp
END_REPORT
#define END_REPORT
Definition: streams.hpp:40
fatalError
#define fatalError
Report a fatal error and exit the applicaiton.
Definition: error.hpp:70
pFlow::repository::path
virtual fileSystem path() const
Definition: repository.cpp:70
pFlow::dictionary::subDict
dictionary & subDict(const word &keyword)
ref to a subdictioanry fatalExit if not found
Definition: dictionary.cpp:560
pFlow::dictionary::getVal
T getVal(const word &keyword) const
get the value of data entry
Definition: dictionary.hpp:379
pFlow::property
property holds the pure properties of materials.
Definition: property.hpp:37
pFlow::pFlowProcessors
localProcessors & pFlowProcessors()
Definition: pFlowProcessors.cpp:5
pFlow::uniquePtr
Definition: uniquePtr.hpp:42
pFlow::geometry
Base class for geometry for managing tri-surfaces, geometry motion, and surface physical properties.
Definition: geometry.hpp:44
pFlow::particles::dynPointStruct
auto & dynPointStruct()
Definition: particles.hpp:74
pFlow::interaction::interaction
interaction(systemControl &control, const particles &prtcl, const geometry &geom)
Definition: interaction.cpp:27
vocabs.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