# PhasicFlow: src/phasicFlow/containers/pointField/pointField/pointField_old.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.

pointField_old.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 __pointField_hpp__
#define __pointField_hpp__
#include "Field.hpp"
#include "pointStructure.hpp"
#include "error.hpp"
namespace pFlow
{
template<template<class, class> class VectorField, class T, class MemorySpace=void>
class pointField
:
public eventObserver,
public Field<VectorField, T, MemorySpace>
{
public:
using pointFieldType = pointField<VectorField, T, MemorySpace>;
using FieldType = Field<VectorField, T, MemorySpace>;
using VectorType = typename FieldType::VectorType;
using iterator = typename FieldType::iterator;
using constIterator = typename FieldType::constIterator;
using reference = typename FieldType::reference;
using constReference = typename FieldType::constReference;
using valueType = typename FieldType::valueType;
using pointer = typename FieldType::pointer;
using constPointer = typename FieldType::constPointer;
protected:
const pointStructure& pStruct_;
// - value when a new item is added to field
T defaultValue_;
public:
// - type info
TypeInfoTemplateNV2("pointField", T, VectorType::memoerySpaceName());
// - construct a field from pointStructure and set defaultValue_ and field value to defVal
pointField( const pointStructure& pStruct, const T& defVal, bool subscribe = true);
// - construct from iIOEntity, pointStructure and a value
pointField( const pointStructure& pStruct, const T& val, const T& defVal, bool subscribe = true);
// - construct from another pointField
// subscribe to events if true
pointField( const pointField& src, bool subscribe);
// - copy construct
pointField(const pointField& src);
// - no move construct
pointField(pointField&& src) = delete;
// assignment, only assign the VectorField and preserve other parts of this
pointField& operator = (const pointField& rhs);
// no move assignment
pointField& operator = (pointField&&) = delete;
inline uniquePtr<pointFieldType> clone() const
{
return makeUnique<pointFieldType>(*this);
}
inline pointFieldType* clonePtr()const
{
return new pointFieldType(*this);
}
// - reference to pointStructure
inline const pointStructure& pStruct()const {
return pStruct_;
}
// if all points are active
INLINE_FUNCTION_H
bool allActive()const {
return pStruct_.allActive();
}
INLINE_FUNCTION_H
bool isActive(label i)const {
return pStruct_.isActive(i);
}
const auto& pointFlag()const
{
return pStruct_.pointFlag();
}
range activeRange()const
{
return pStruct_.activeRange();
}
// - update the field if any changes occure in pStruct
// for now it checks for deleted points
bool update(const eventMessage& msg);
bool readPointField(iIstream& is);
bool writePointField(iOstream& os)const;
bool read(iIstream& is)
{
return readPointField(is);
}
bool write(iOstream& os)const
{
return writePointField(os);
}
};
template<template<class, class> class VectorField, class T, class MemorySpace>
iIstream& operator >> (iIstream & is, pointField<VectorField, T, MemorySpace> & pF )
{
if( !pF.read(is))
{
ioErrorInFile( is.name(), is.lineNumber() ) <<
"error in reading pointField from file. \n";
fatalExit;
}
return is;
}
template<template<class, class> class VectorField, class T, class MemorySpace>
iOstream& operator << (iOstream& os, const pointField<VectorField, T, MemorySpace>& pF )
{
if(! pF.write(os) )
{
ioErrorInFile( os.name(), os.lineNumber() )<<
"error in writing pointField into file. \n";
fatalExit;
}
return os;
}
}
#include "pointField.cpp"
#include "pointFieldAlgorithms.hpp"
#endif // __pointField_hpp__
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
pFlow::pointField::operator=
pointField & operator=(const pointField &rhs)
pFlow::pointField::isActive
INLINE_FUNCTION_H bool isActive(label i) const
Definition: pointField_old.hpp:129
pFlow::pointField::pStruct
const pointStructure & pStruct() const
Definition: pointField.hpp:134
pFlow::pointField::pStruct_
const pointStructure & pStruct_
refrence to point structure
Definition: pointField.hpp:62
pFlow::pointField::TypeInfoTemplateNV2
TypeInfoTemplateNV2("pointField", T, VectorType::memoerySpaceName())
pFlow::pointField::pointField
pointField(const objectFile &objf, pointStructure &pStruct, const T &defVal)
Definition: pointField.cpp:22
pFlow::pointField::defaultValue_
T defaultValue_
Definition: pointField_old.hpp:68
pFlow::pointField::read
bool read(iIstream &is)
Definition: pointField_old.hpp:154
pFlow::Field< pFlow::VectorSingle, pFlow::AB3History >
pFlow::pointField< pFlow::VectorSingle, pFlow::AB3History >::constIterator
typename FieldType::constIterator constIterator
Definition: pointField_old.hpp:50
pFlow
Definition: demGeometry.hpp:27
pFlow::pointField::pointFieldType
pointField< VectorField, T, MemorySpace > pointFieldType
Definition: pointField_old.hpp:42
pFlow::pointField< pFlow::VectorSingle, pFlow::AB3History >::constPointer
typename FieldType::constPointer constPointer
Definition: pointField_old.hpp:60
pFlow::pointField
Definition: pointField.hpp:33
pFlow::internalPoints::activeRange
auto activeRange() const
Definition: internalPoints.hpp:201
pFlow::pointStructure
Definition: pointStructure.hpp:34
pFlow::pointField::writePointField
bool writePointField(iOstream &os, const IOPattern &iop) const
Definition: pointField.cpp:283
pFlow::iIstream
Interface class for any input stream
Definition: iIstream.hpp:37
pFlow::internalField< pFlow::VectorSingle, pFlow::AB3History >::VectorType
typename FieldType::VectorType VectorType
Definition: internalField.hpp:47
pFlow::pointField::clonePtr
pointFieldType * clonePtr() const
Definition: pointField_old.hpp:109
pFlow::pointField< pFlow::VectorSingle, pFlow::AB3History >::valueType
typename FieldType::valueType valueType
Definition: pointField_old.hpp:56
pFlow::internalField< pFlow::VectorSingle, pFlow::AB3History >::reference
typename FieldType::reference reference
Definition: pointField copy.hpp:52
pFlow::internalField< pFlow::VectorSingle, pFlow::AB3History >::iterator
typename FieldType::iterator iterator
Definition: pointField copy.hpp:48
pFlow::operator>>
INLINE_FUNCTION iIstream & operator>>(iIstream &str, AB3History &ab3)
Definition: AdamsBashforth3.hpp:41
pFlow::pointField::write
bool write(iOstream &os) const
Definition: pointField_old.hpp:159
INLINE_FUNCTION_H
#define INLINE_FUNCTION_H
Definition: pFlowMacros.hpp:57
pFlow::pointField::activeRange
range activeRange() const
Definition: pointField_old.hpp:138
pFlow::operator<<
INLINE_FUNCTION iOstream & operator<<(iOstream &str, const AB3History &ab3)
Definition: AdamsBashforth3.hpp:57
pFlow::VectorSingle< pFlow::VectorSingle, pFlow::AB3History >
pFlow::pointField::allActive
INLINE_FUNCTION_H bool allActive() const
Definition: pointField_old.hpp:123
pFlow::IOstream::name
virtual const word & name() const
Return the name of the stream.
Definition: IOstream.cpp:31
pFlow::pointField< pFlow::VectorSingle, pFlow::AB3History >::constReference
typename FieldType::constReference constReference
Definition: pointField_old.hpp:54
pFlow::pointField::readPointField
bool readPointField(iIstream &is, const IOPattern &iop)
Definition: pointField.cpp:236
pFlow::Field< pFlow::VectorSingle, pFlow::AB3History >::pointer
typename VectorType::pointer pointer
Definition: Field.hpp:62
pFlow::uniquePtr
Definition: uniquePtr.hpp:42
Field.hpp
pFlow::pointField::clone
uniquePtr< pointFieldType > clone() const
Definition: pointField_old.hpp:104
ioErrorInFile
#define ioErrorInFile(fileName, lineNumber)
Report an error in file operation with supplied fileName and lineNumber.
Definition: error.hpp:87
pFlow::IOstream::lineNumber
int32 lineNumber() const
Const access to the current stream line number.
Definition: IOstream.hpp:223
pFlow::Field< pFlow::VectorSingle, pFlow::AB3History >::iterator
typename VectorType::iterator iterator
Definition: Field.hpp:52
pointField.cpp
pFlow::pointField::update
bool update(const eventMessage &msg)
pointFieldAlgorithms.hpp
pFlow::internalField< pFlow::VectorSingle, pFlow::AB3History >::pointer
typename FieldType::pointer pointer
Definition: pointField copy.hpp:58
pointStructure.hpp
pFlow::iOstream
Interface class for any output stream.
Definition: iOstream.hpp:59
pFlow::observer::subscribe
void subscribe(const subscriber *subscrbr, message msg)
pFlow::pointField::pointFlag
const auto & pointFlag() const
Definition: pointField_old.hpp:133
pFlow::Field< pFlow::VectorSingle, pFlow::AB3History >::reference
typename VectorType::reference reference
Definition: Field.hpp:56
error.hpp