www.cemf.ir
boundarySphereInteraction.cpp
Go to the documentation of this file.
2 /*------------------------------- phasicFlow ---------------------------------
3  O C enter of
4  O O E ngineering and
5  O O M ultiscale modeling of
6  OOOOOOO F luid flow
7 ------------------------------------------------------------------------------
8  Copyright (C): www.cemf.ir
9  email: hamid.r.norouzi AT gmail.com
10 ------------------------------------------------------------------------------
11 Licence:
12  This file is part of phasicFlow code. It is a free software for simulating
13  granular and multiphase flows. You can redistribute it and/or modify it under
14  the terms of GNU General Public License v3 or any other later versions.
15 
16  phasicFlow is distributed to help others in their research in the field of
17  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
18  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 
20 -----------------------------------------------------------------------------*/
21 
22 template <typename cFM, typename gMM>
24 {
25  ppPairs_.reset(nullptr);
26  ppPairs_ = makeUnique<ContactListType>(1);
27 }
28 
29 template <typename cFM, typename gMM>
31 {
32  pwPairs_.reset(nullptr);
33  pwPairs_ = makeUnique<ContactListType>(1);
34 }
35 
36 
37 template <typename cFM, typename gMM>
39  const boundaryBase &boundary,
40  const sphereParticles &sphPrtcls,
41  const GeometryMotionModel &geomMotion)
42  : generalBoundary(boundary, sphPrtcls.pStruct(), "", ""),
43  geometryMotion_(geomMotion),
44  sphParticles_(sphPrtcls)
45 {
46 }
47 
48 template <typename cFM, typename gMM>
51  const boundaryBase &boundary,
52  const sphereParticles &sphPrtcls,
53  const GeometryMotionModel &geomMotion)
54 {
55  word cfTypeName = ContactForceModel::TYPENAME();
56  word gmTypeName = MotionModel::TYPENAME();
57  word bType = boundary.type();
58 
59  word boundaryTypeName = angleBracketsNames3(
60  "boundarySphereInteraction",
61  bType,
62  cfTypeName,
63  gmTypeName);
64 
65  word altBTypeName = angleBracketsNames2(
66  "boundarySphereInteraction",
67  cfTypeName,
68  gmTypeName);
69 
70  if (boundaryBasevCtorSelector_.search(boundaryTypeName))
71  {
72  pOutput.space(4) << "Creating boundry type " << Green_Text(boundaryTypeName) <<
73  " for boundary " << boundary.name() << " . . ." << END_REPORT;
74  return boundaryBasevCtorSelector_[boundaryTypeName](
75  boundary,
76  sphPrtcls,
77  geomMotion);
78  }
79  else if(boundaryBasevCtorSelector_[altBTypeName])
80  {
81  // if boundary condition is not implemented, the default is used
82 
83  pOutput.space(4) << "Creating boundry type " << Green_Text(altBTypeName) <<
84  " for boundary " << boundary.name() << " . . ." << END_REPORT;
85  return boundaryBasevCtorSelector_[altBTypeName](
86  boundary,
87  sphPrtcls,
88  geomMotion);
89  }
90  else
91  {
92  printKeys
93  (
94  fatalError << "Ctor Selector "<< boundaryTypeName<<
95  " and "<< altBTypeName << " do not exist. \n"
96  <<"Avaiable ones are: \n\n"
97  ,
98  boundaryBasevCtorSelector_
99  );
100  fatalExit;
101  }
102 
103  return nullptr;
104 }
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
Green_Text
#define Green_Text(text)
Definition: iOstream.hpp:42
pFlow::pOutput
processorOstream pOutput
pFlow::boundarySphereInteraction::create
static uniquePtr< BoundarySphereInteractionType > create(const boundaryBase &boundary, const sphereParticles &sphPrtcls, const GeometryMotionModel &geomMotion)
Definition: boundarySphereInteraction.cpp:50
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
pFlow::boundarySphereInteraction::allocatePWPairs
void allocatePWPairs()
Definition: boundarySphereInteraction.cpp:30
boundarySphereInteraction.hpp
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::printKeys
iOstream & printKeys(iOstream &os, const wordHashMap< T > &m)
pFlow::boundaryBase::name
const word & name() const
Definition: boundaryBase.hpp:258
pFlow::boundarySphereInteraction::allocatePPPairs
void allocatePPPairs()
Definition: boundarySphereInteraction.cpp:23
pFlow::boundaryBase::type
const word & type() const
Definition: boundaryBase.hpp:252
pFlow::sphereParticles
Class for managing spherical particles.
Definition: sphereParticles.hpp:42
pFlow::angleBracketsNames2
word angleBracketsNames2(const word &base, const word &w1, const word &w2)
Output base<w1,w2>
Definition: bTypesFunctions.cpp:162
pFlow::boundarySphereInteraction::boundarySphereInteraction
boundarySphereInteraction(const boundaryBase &boundary, const sphereParticles &sphPrtcls, const GeometryMotionModel &geomMotion)
Definition: boundarySphereInteraction.cpp:38
pFlow::boundarySphereInteraction::GeometryMotionModel
geometryMotionModel GeometryMotionModel
Definition: boundarySphereInteraction.hpp:41
pFlow::boundaryBase
Definition: boundaryBase.hpp:42
END_REPORT
#define END_REPORT
Definition: streams.hpp:40
fatalError
#define fatalError
Report a fatal error and exit the applicaiton.
Definition: error.hpp:70
pStruct
auto & pStruct
Definition: setPointStructure.hpp:24
pFlow::uniquePtr
Definition: uniquePtr.hpp:42
pFlow::iOstream::space
virtual iOstream & space(int32 n=1)
Write space to stream.
Definition: iOstream.cpp:119
pFlow::generalBoundary
Definition: generalBoundary.hpp:38