# PhasicFlow: src/Particles/particles/particles.cpp Source File

particles.cpp
Go to the documentation of this file.
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
#include "particles.hpp"
pFlow::particles::particles
(
systemControl& control,
const word& integrationMethod
)
:
demParticles(control),
time_(control.time()),
integrationMethod_(integrationMethod),
/*dynPointStruct_(
time_.emplaceObject<dynamicPointStructure>(
objectFile(
pointStructureFile__,
"",
objectFile::READ_ALWAYS,
objectFile::WRITE_ALWAYS
),
control.time(),
integrationMethod
)
),*/
dynPointStruct_(
control.time(),
integrationMethod),
shapeName_(
control.time().emplaceObject<wordPointField>(
objectFile(
"shapeName",
"",
objectFile::READ_ALWAYS,
objectFile::WRITE_ALWAYS,
false
),
pStruct(),
word("NO_NAME_SHAPE")
)
),
id_(
control.time().emplaceObject<int32PointField_HD>(
objectFile(
"id",
"",
objectFile::READ_IF_PRESENT,
objectFile::WRITE_ALWAYS
),
pStruct(),
static_cast< int32 >(-1)
)
),
propertyId_(
control.time().emplaceObject<int8PointField_D>(
objectFile(
"propertyId",
"",
objectFile::READ_NEVER,
objectFile::WRITE_NEVER
),
pStruct(),
static_cast< int8 >(0)
)
),
diameter_(
control.time().emplaceObject<realPointField_D>(
objectFile(
"diameter",
"",
objectFile::READ_NEVER,
objectFile::WRITE_ALWAYS
),
pStruct(),
static_cast< real >(0.00000000001)
)
),
mass_(
control.time().emplaceObject<realPointField_D>(
objectFile(
"mass",
"",
objectFile::READ_NEVER,
objectFile::WRITE_ALWAYS
),
pStruct(),
static_cast< real >(0.0000000001)
)
),
accelertion_(
control.time().emplaceObject<realx3PointField_D>(
objectFile(
"accelertion",
"",
objectFile::READ_IF_PRESENT,
objectFile::WRITE_ALWAYS
),
pStruct(),
zero3
)
),
contactForce_(
control.time().emplaceObject<realx3PointField_D>(
objectFile(
"contactForce",
"",
objectFile::READ_IF_PRESENT,
objectFile::WRITE_ALWAYS
),
pStruct(),
zero3
)
),
contactTorque_(
control.time().emplaceObject<realx3PointField_D>(
objectFile(
"contactTorque",
"",
objectFile::READ_IF_PRESENT,
objectFile::WRITE_ALWAYS
),
pStruct(),
zero3
)
),
idHandler_(id_)
{
this->subscribe(pStruct());
}
pFlow::uniquePtr<pFlow::List<pFlow::eventObserver*>>
pFlow::particles::getFieldObjectList()const
{
auto objListPtr = makeUnique<pFlow::List<pFlow::eventObserver*>>();
objListPtr().push_back(
static_cast< eventObserver*>(&id_) );
objListPtr().push_back(
static_cast< eventObserver*>(&propertyId_) );
objListPtr().push_back(
static_cast< eventObserver*>(&diameter_) );
objListPtr().push_back(
static_cast< eventObserver*>(&mass_) );
objListPtr().push_back(
static_cast< eventObserver*>(&shapeName_) );
return objListPtr;
}
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