# PhasicFlow: src/phasicFlow/structuredData/box/box.hpp Source File

box.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 __box_hpp__
#define __box_hpp__
#include "types.hpp"
#include "dictionary.hpp"
#include "iIstream.hpp"
#include "iOstream.hpp"
namespace pFlow
{
class box
{
protected:
// - min point
realx3 min_{0,0,0};
// - max point
realx3 max_{1,1,1};
public:
// - type info
TypeInfoNV("box");
INLINE_FUNCTION_HD
box(){}
INLINE_FUNCTION_HD
box(const realx3& minP, const realx3& maxP)
:
min_(minP),
max_(maxP)
{}
FUNCTION_H
box(const dictionary& dict);
FUNCTION_H
box(iIstream& is);
FUNCTION_HD
box(const box&) = default;
FUNCTION_HD
box(box&&) = default;
FUNCTION_HD
box& operator=(const box&) = default;
FUNCTION_HD
box& operator=(box&&) = default;
~box()=default;
INLINE_FUNCTION_HD
bool isInside(const realx3& point)const
{
return point > min_ && point <max_;
}
INLINE_FUNCTION_HD
realx3 minPoint()const
{
return min_;
}
INLINE_FUNCTION_HD
realx3 maxPoint()const
{
return max_;
}
FUNCTION_H
bool read(iIstream & is);
FUNCTION_H
bool write(iOstream& os)const;
FUNCTION_H
bool read(const dictionary& dict);
FUNCTION_H
bool write(dictionary& dict)const;
};
FUNCTION_H
iIstream& operator >>(iIstream& is, box& b);
FUNCTION_H
iOstream& operator << (iOstream& os, const box& b);
INLINE_FUNCTION_HD
box extendBox(const box& b, const realx3& dl)
{
return box(b.minPoint()-dl , b.maxPoint()+dl);
}
}
#endif
iIstream.hpp
pFlow::box::box
INLINE_FUNCTION_HD box()
Definition: box.hpp:49
types.hpp
pFlow::box::max_
realx3 max_
Definition: box.hpp:40
pFlow::extendBox
INLINE_FUNCTION_HD box extendBox(const box &b, const realx3 &dl)
Definition: box.hpp:120
pFlow::box::box
INLINE_FUNCTION_HD box(const realx3 &minP, const realx3 &maxP)
Definition: box.hpp:52
pFlow::box::maxPoint
INLINE_FUNCTION_HD realx3 maxPoint() const
Definition: box.hpp:94
pFlow
Definition: demComponent.hpp:28
FUNCTION_H
#define FUNCTION_H
Definition: pFlowMacros.hpp:58
pFlow::iIstream
Definition: iIstream.hpp:33
pFlow::box::~box
~box()=default
dictionary.hpp
pFlow::operator>>
INLINE_FUNCTION iIstream & operator>>(iIstream &str, AB3History &ab3)
Definition: AdamsBashforth3.hpp:41
pFlow::box::write
FUNCTION_H bool write(iOstream &os) const
Definition: box.cpp:65
pFlow::operator<<
INLINE_FUNCTION iOstream & operator<<(iOstream &str, const AB3History &ab3)
Definition: AdamsBashforth3.hpp:57
FUNCTION_HD
#define FUNCTION_HD
Definition: pFlowMacros.hpp:57
pFlow::box::operator=
FUNCTION_HD box & operator=(const box &)=default
pFlow::box
Definition: box.hpp:32
pFlow::box::minPoint
INLINE_FUNCTION_HD realx3 minPoint() const
Definition: box.hpp:88
pFlow::box::TypeInfoNV
TypeInfoNV("box")
iOstream.hpp
INLINE_FUNCTION_HD
#define INLINE_FUNCTION_HD
Definition: pFlowMacros.hpp:51
pFlow::triple< real >
pFlow::box::isInside
INLINE_FUNCTION_HD bool isInside(const realx3 &point) const
Definition: box.hpp:82
pFlow::iOstream
Definition: iOstream.hpp:53
pFlow::box::read
FUNCTION_H bool read(iIstream &is)
Definition: box.cpp:57
pFlow::box::min_
realx3 min_
Definition: box.hpp:37
pFlow::dictionary
Definition: dictionary.hpp:38