# PhasicFlow: src/phasicFlow/containers/triSurfaceField/triSurfaceField.cpp Source File

triSurfaceField.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.
-----------------------------------------------------------------------------*/
template<template<class, class> class VectorField, class T, class MemorySpace>
pFlow::triSurfaceField<VectorField, T, MemorySpace>::triSurfaceField
(
const triSurface& surface,
const T& defVal,
bool subscribe
)
:
eventObserver(surface, subscribe),
FieldType(surface.capacity(), surface.size(), RESERVE()),
surface_(surface),
defaultValue_(defVal)
{
this->fill(defVal);
}
template<template<class, class> class VectorField, class T, class MemorySpace>
pFlow::triSurfaceField<VectorField, T, MemorySpace>::triSurfaceField
(
const triSurface& surface,
const T& val,
const T& defVal,
bool subscribe
)
:
eventObserver(surface, subscribe),
FieldType(surface.capacity(), surface.size(), RESERVE()),
surface_(surface),
defaultValue_(defVal)
{
this->fill(val);
}
template<template<class, class> class VectorField, class T, class MemorySpace>
pFlow::triSurfaceField<VectorField, T, MemorySpace>::triSurfaceField
(
const triSurfaceField& src,
bool subscribe
)
:
eventObserver(src.surface(), subscribe),
FieldType(src),
surface_(src.surface()),
defaultValue_(src.defaultValue_)
{
}
template<template<class, class> class VectorField, class T, class MemorySpace>
pFlow::triSurfaceField<VectorField, T, MemorySpace>::triSurfaceField
(
const triSurfaceField& src
)
:
triSurfaceField<VectorField, T, MemorySpace>(src, src.subscribed())
{}
template<template<class, class> class VectorField, class T, class MemorySpace>
pFlow::triSurfaceField<VectorField, T, MemorySpace>&
pFlow::triSurfaceField<VectorField, T, MemorySpace>::operator=
(
const triSurfaceField& rhs
)
{
if(this == &rhs) return *this;
this->VectorField() = rhs.VectorField();
return *this;
}
template<template<class, class> class VectorField, class T, class MemorySpace>
bool pFlow::triSurfaceField<VectorField, T, MemorySpace>::update
(
const eventMessage& msg
)
{
notImplementedFunction;
return true;
}
template<template<class, class> class VectorField, class T, class MemorySpace>
bool pFlow::triSurfaceField<VectorField, T, MemorySpace>::readTriSurfacceField
(
iIstream& is
)
{
return FieldType::readField(is, surface_.size(), false);
}
template<template<class, class> class VectorField, class T, class MemorySpace>
bool pFlow::triSurfaceField<VectorField, T, MemorySpace>::writeTriSurfaceField
(
iOstream& os
)const
{
return FieldType::write(os);
}
notImplementedFunction
#define notImplementedFunction
Definition: error.hpp:47
pFlow::triSurfaceField::surface
const triSurface & surface() const
Definition: triSurfaceField.hpp:115
pFlow::triSurfaceField::readTriSurfacceField
bool readTriSurfacceField(iIstream &is)
Definition: triSurfaceField.cpp:105
pFlow::eventMessage
Definition: eventMessage.hpp:29
pFlow::triSurfaceField::writeTriSurfaceField
bool writeTriSurfaceField(iOstream &os) const
Definition: triSurfaceField.cpp:114
pFlow::eventObserver::subscribed
bool subscribed() const
Definition: eventObserver.hpp:50
pFlow::triSurfaceField::triSurfaceField
triSurfaceField(const triSurface &surface, const T &defVal, bool subscribe=true)
Definition: triSurfaceField.cpp:23
pFlow::eventObserver
Definition: eventObserver.hpp:33
pFlow::Field
Definition: Field.hpp:33
pFlow::triSurfaceField::defaultValue_
T defaultValue_
Definition: triSurfaceField.hpp:67
RESERVE
Definition: Vector.hpp:38
pFlow::triSurfaceField
Definition: triSurfaceField.hpp:34
pFlow::iIstream
Definition: iIstream.hpp:33
fill
void fill(Vector< T, Allocator > &vec, const T &val)
pFlow::triSurface::capacity
size_t capacity() const
Definition: triSurface.hpp:164
pFlow::triSurface
Definition: triSurface.hpp:38
pFlow::iOstream
Definition: iOstream.hpp:53
pFlow::triSurfaceField::update
bool update(const eventMessage &msg)
Definition: triSurfaceField.cpp:94
pFlow::triSurface::size
size_t size() const
Definition: triSurface.hpp:159