# PhasicFlow: src/Geometry/geometry/geometry.hpp Source File
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

geometry.hpp
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.
-----------------------------------------------------------------------------*/
#ifndef __geometry_hpp__
#define __geometry_hpp__
#include "virtualConstructor.hpp"
#include "demComponent.hpp"
#include "property.hpp"
#include "multiTriSurface.hpp"
#include "triSurfaceFields.hpp"
//#include "Fields.hpp"
//#include "Vectors.hpp"
namespace pFlow
{
class geometry
:
public multiTriSurface,
public demComponent
{
private:
// - Protected members
const property& wallProperty_;
wordField_H motionComponentName_{
"motionComponentName",
"motionComponentName"};
wordField_H materialName_{
"materialName",
"materialName"};
uint32TriSurfaceField_D propertyId_;
realx3TriSurfaceField_D contactForceWall_;
realx3TriSurfaceField_D normalStressWall_;
realx3TriSurfaceField_D shearStressWall_;
bool readWholeObject_ = true;
// - Protected member functions
bool createPropertyId();
void zeroForce();
public:
TypeInfo("geometry");
// - Constructors
geometry(systemControl& control, const property& prop);
geometry(systemControl& control,
const property& prop,
multiTriSurface& surf,
const wordVector& motionCompName,
const wordVector& materialName,
const dictionary& motionDict);
/*geometry(systemControl& control,
const property& prop,
const multiTriSurface& triSurface,
const wordVector& motionCompName,
const wordVector& propName
);
geometry(systemControl& control,
const property& prop,
const dictionary& dict,
const multiTriSurface& triSurface,
const wordVector& motionCompName,
const wordVector& propName);*/
~geometry()override = default;
create_vCtor
(
geometry,
systemControl,
(
systemControl& control,
const property& prop
),
(control, prop)
);
create_vCtor
(
geometry,
dictionary,
(
systemControl& control,
const property& prop,
multiTriSurface& surf,
const wordVector& motionCompName,
const wordVector& materialName,
const dictionary& motionDic),
(control, prop, surf, motionCompName, materialName, motionDic)
);
//- Methods
inline
const auto& motionComponentName()const
{
return motionComponentName_;
}
inline
auto& contactForceWall()
{
return contactForceWall_;
}
inline
const auto& contactForceWall() const
{
return contactForceWall_;
}
inline
const auto& propertyId()const
{
return propertyId_;
}
inline const auto& wallProperty()const
{
return wallProperty_;
}
virtual
word motionModelTypeName()const = 0;
virtual
const uint32Field_D& triMotionIndex() const =0;
virtual
const uint32Field_D& pointMotionIndex()const = 0;
bool beforeIteration() override;
bool iterate() override;
bool afterIteration() override;
//- IO
bool read(iIstream& is, const IOPattern& iop) override;
bool write( iOstream& os, const IOPattern& iop )const override;
//- Static members
static
uniquePtr<geometry> create(
systemControl& control,
const property& prop);
static
uniquePtr<geometry> create(
systemControl& control,
const property& prop,
multiTriSurface& surf,
const wordVector& motionCompName,
const wordVector& materialName,
const dictionary& motionDic);
};
}
#endif
pFlow::geometry::materialName_
wordField_H materialName_
Material name of each wall surface
Definition: geometry.hpp:62
pFlow::geometry::motionComponentName
const auto & motionComponentName() const
Definition: geometry.hpp:156
pFlow::geometry::contactForceWall_
realx3TriSurfaceField_D contactForceWall_
Contact force on each triangle in the set of wall surfaces.
Definition: geometry.hpp:70
triSurfaceFields.hpp
pFlow::demComponent::control
const auto & control() const
Const ref to systemControl.
Definition: demComponent.hpp:88
pFlow::geometry::pointMotionIndex
virtual const uint32Field_D & pointMotionIndex() const =0
Motion model index of points.
pFlow::geometry::create
static uniquePtr< geometry > create(systemControl &control, const property &prop)
Definition: geometry.cpp:336
pFlow::geometry::motionModelTypeName
virtual word motionModelTypeName() const =0
The name of motion model.
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::systemControl
Definition: systemControl.hpp:41
pFlow::geometry::createPropertyId
bool createPropertyId()
Find property id of each triangle based on the supplied material name and the surface wall that the t...
Definition: geometry.cpp:26
pFlow::geometry::wallProperty_
const property & wallProperty_
Const reference to physical property of materials.
Definition: geometry.hpp:54
pFlow::Field< word, HostSpace >
pFlow::geometry::triMotionIndex
virtual const uint32Field_D & triMotionIndex() const =0
Motion model index of triangles.
pFlow::geometry::normalStressWall_
realx3TriSurfaceField_D normalStressWall_
Stress on each triangle in the set of wall surfaces.
Definition: geometry.hpp:73
pFlow::geometry::~geometry
~geometry() override=default
Construct from components.
pFlow
Definition: demGeometry.hpp:27
pFlow::geometry::contactForceWall
const auto & contactForceWall() const
Access to contact force.
Definition: geometry.hpp:170
pFlow::multiTriSurface
Definition: multiTriSurface.hpp:32
pFlow::geometry::readWholeObject_
bool readWholeObject_
Definition: geometry.hpp:79
pFlow::geometry::afterIteration
bool afterIteration() override
This is called in time loop, after iterate.
Definition: geometry.cpp:275
pFlow::geometry::create_vCtor
create_vCtor(geometry, systemControl,(systemControl &control, const property &prop),(control, prop))
Virtual constructor.
pFlow::triSurfaceField< uint32 >
pFlow::geometry::propertyId
const auto & propertyId() const
Property ide of triangles.
Definition: geometry.hpp:177
pFlow::iIstream
Interface class for any input stream
Definition: iIstream.hpp:37
multiTriSurface.hpp
pFlow::geometry::wallProperty
const auto & wallProperty() const
Access to property.
Definition: geometry.hpp:183
pFlow::demComponent
A base class for every main component of DEM system.
Definition: demComponent.hpp:42
pFlow::geometry::propertyId_
uint32TriSurfaceField_D propertyId_
Property id of each triangle in the set of wall surfaces.
Definition: geometry.hpp:67
pFlow::IOPattern
Definition: IOPattern.hpp:32
pFlow::geometry::contactForceWall
auto & contactForceWall()
Access to contact force.
Definition: geometry.hpp:163
pFlow::geometry::beforeIteration
bool beforeIteration() override
This is called in time loop, before iterate.
Definition: geometry.cpp:264
virtualConstructor.hpp
pFlow::geometry::read
bool read(iIstream &is, const IOPattern &iop) override
Definition: geometry.cpp:301
pFlow::geometry::iterate
bool iterate() override
This is called in time loop.
Definition: geometry.cpp:270
pFlow::geometry::zeroForce
void zeroForce()
Initialize contact force to zero.
Definition: geometry.cpp:64
pFlow::property
property holds the pure properties of materials.
Definition: property.hpp:37
demComponent.hpp
pFlow::geometry::TypeInfo
TypeInfo("geometry")
Type info.
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::geometry::shearStressWall_
realx3TriSurfaceField_D shearStressWall_
Stress on each triangle in the set of wall surfaces.
Definition: geometry.hpp:76
property.hpp
pFlow::Vector< word >
pFlow::iOstream
Interface class for any output stream.
Definition: iOstream.hpp:59
pFlow::geometry::write
bool write(iOstream &os, const IOPattern &iop) const override
write
Definition: geometry.cpp:315
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
pFlow::geometry::geometry
geometry(systemControl &control, const property &prop)
Construct from controlSystem and property, for reading from file.
Definition: geometry.cpp:70
pFlow::geometry::motionComponentName_
wordField_H motionComponentName_
The name of motion component of each wall surface.
Definition: geometry.hpp:57