triSurfaceField.cpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 
21 template<template<class, class> class VectorField, class T, class MemorySpace>
23 (
24  const triSurface& surface,
25  const T& defVal,
26  bool subscribe
27 )
28 :
29  eventObserver(surface, subscribe),
30  FieldType(surface.capacity(), surface.size(), RESERVE()),
31  surface_(surface),
32  defaultValue_(defVal)
33 {
34  this->fill(defVal);
35 }
36 
37 template<template<class, class> class VectorField, class T, class MemorySpace>
39 (
40  const triSurface& surface,
41  const T& val,
42  const T& defVal,
43  bool subscribe
44 )
45 :
46  eventObserver(surface, subscribe),
47  FieldType(surface.capacity(), surface.size(), RESERVE()),
48  surface_(surface),
49  defaultValue_(defVal)
50 {
51  this->fill(val);
52 }
53 
54 
55 template<template<class, class> class VectorField, class T, class MemorySpace>
57 (
58  const triSurfaceField& src,
59  bool subscribe
60 )
61 :
62  eventObserver(src.surface(), subscribe),
63  FieldType(src),
64  surface_(src.surface()),
65  defaultValue_(src.defaultValue_)
66 {
67 
68 }
69 
70 template<template<class, class> class VectorField, class T, class MemorySpace>
72 (
73  const triSurfaceField& src
74 )
75 :
77 {}
78 
79 template<template<class, class> class VectorField, class T, class MemorySpace>
82 (
83  const triSurfaceField& rhs
84 )
85 {
86  if(this == &rhs) return *this;
87 
88  this->VectorField() = rhs.VectorField();
89  return *this;
90 }
91 
92 template<template<class, class> class VectorField, class T, class MemorySpace>
94 (
95  const eventMessage& msg
96 )
97 {
99  return true;
100 }
101 
102 
103 template<template<class, class> class VectorField, class T, class MemorySpace>
105 (
106  iIstream& is
107 )
108 {
109  return FieldType::readField(is, surface_.size(), false);
110 }
111 
112 template<template<class, class> class VectorField, class T, class MemorySpace>
114 (
115  iOstream& os
116 )const
117 {
118  return FieldType::write(os);
119 }
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