particles.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 
22 #include "particles.hpp"
23 
24 
26 (
27  systemControl& control,
28  const word& integrationMethod
29 )
30 :
31  demParticles(control),
32  time_(control.time()),
33  integrationMethod_(integrationMethod),
34  /*dynPointStruct_(
35  time_.emplaceObject<dynamicPointStructure>(
36  objectFile(
37  pointStructureFile__,
38  "",
39  objectFile::READ_ALWAYS,
40  objectFile::WRITE_ALWAYS
41  ),
42  control.time(),
43  integrationMethod
44  )
45  ),*/
46  dynPointStruct_(
47  control.time(),
48  integrationMethod),
49  shapeName_(
51  objectFile(
52  "shapeName",
53  "",
54  objectFile::READ_ALWAYS,
55  objectFile::WRITE_ALWAYS,
56  false
57  ),
58  pStruct(),
59  word("NO_NAME_SHAPE")
60  )
61  ),
62  id_(
64  objectFile(
65  "id",
66  "",
67  objectFile::READ_IF_PRESENT,
68  objectFile::WRITE_ALWAYS
69  ),
70  pStruct(),
71  static_cast<int32>(-1)
72  )
73  ),
74  propertyId_(
76  objectFile(
77  "propertyId",
78  "",
79  objectFile::READ_NEVER,
80  objectFile::WRITE_NEVER
81  ),
82  pStruct(),
83  static_cast<int8>(0)
84  )
85  ),
86  diameter_(
88  objectFile(
89  "diameter",
90  "",
91  objectFile::READ_NEVER,
92  objectFile::WRITE_ALWAYS
93  ),
94  pStruct(),
95  static_cast<real>(0.00000000001)
96  )
97  ),
98  mass_(
100  objectFile(
101  "mass",
102  "",
103  objectFile::READ_NEVER,
104  objectFile::WRITE_ALWAYS
105  ),
106  pStruct(),
107  static_cast<real>(0.0000000001)
108  )
109  ),
110  accelertion_(
112  objectFile(
113  "accelertion",
114  "",
115  objectFile::READ_IF_PRESENT,
116  objectFile::WRITE_ALWAYS
117  ),
118  pStruct(),
119  zero3
120  )
121  ),
122  contactForce_(
124  objectFile(
125  "contactForce",
126  "",
127  objectFile::READ_IF_PRESENT,
128  objectFile::WRITE_ALWAYS
129  ),
130  pStruct(),
131  zero3
132  )
133  ),
134  contactTorque_(
136  objectFile(
137  "contactTorque",
138  "",
139  objectFile::READ_IF_PRESENT,
140  objectFile::WRITE_ALWAYS
141  ),
142  pStruct(),
143  zero3
144  )
145  ),
146  idHandler_(id_)
147 {
148 
149  this->subscribe(pStruct());
150 
151 }
152 
155 {
156  auto objListPtr = makeUnique<pFlow::List<pFlow::eventObserver*>>();
157  objListPtr().push_back(
158  static_cast<eventObserver*>(&id_) );
159 
160  objListPtr().push_back(
161  static_cast<eventObserver*>(&propertyId_) );
162 
163  objListPtr().push_back(
164  static_cast<eventObserver*>(&diameter_) );
165 
166  objListPtr().push_back(
167  static_cast<eventObserver*>(&mass_) );
168 
169  objListPtr().push_back(
170  static_cast<eventObserver*>(&shapeName_) );
171 
172  return objListPtr;
173 }
pFlow::particles::shapeName_
wordPointField & shapeName_
Definition: particles.hpp:49
pFlow::real
float real
Definition: builtinTypes.hpp:46
pFlow::word
std::string word
Definition: builtinTypes.hpp:63
pFlow::systemControl
Definition: systemControl.hpp:41
particles.hpp
pFlow::zero3
const realx3 zero3(0.0)
Definition: types.hpp:97
pFlow::repository::emplaceObject
T & emplaceObject(const objectFile &objf, Args &&... args)
Definition: repositoryTemplates.cpp:38
pFlow::eventObserver
Definition: eventObserver.hpp:33
pFlow::particles::id_
int32PointField_HD & id_
Definition: particles.hpp:52
pFlow::pointField
Definition: pointField.hpp:35
pFlow::demParticles
Definition: demParticles.hpp:31
pFlow::int32
int int32
Definition: builtinTypes.hpp:53
pFlow::systemControl::time
const Time & time() const
Definition: systemControl.hpp:123
pFlow::particles::getFieldObjectList
virtual uniquePtr< List< eventObserver * > > getFieldObjectList() const
Definition: particles.cpp:154
pFlow::particles::propertyId_
int8PointField_D & propertyId_
Definition: particles.hpp:55
pFlow::objectFile
Definition: objectFile.hpp:33
pStruct
auto & pStruct
Definition: setPointStructure.hpp:24
pFlow::particles::mass_
realPointField_D & mass_
Definition: particles.hpp:61
pFlow::uniquePtr
Definition: uniquePtr.hpp:44
pFlow::int8
signed char int8
Definition: builtinTypes.hpp:49
pFlow::particles::particles
particles(systemControl &control, const word &integrationMethod)
Definition: particles.cpp:26
pFlow::particles::diameter_
realPointField_D & diameter_
Definition: particles.hpp:58