OpenLB 1.7
Loading...
Searching...
No Matches
aggParticle3D.hh
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2016 Thomas Henn, Davide Dapelo
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22 */
23
24#ifndef AGG_PARTICLE_3D_HH
25#define AGG_PARTICLE_3D_HH
26
27#include <string>
28#include <iostream>
29#include <set>
30#include <vector>
31#include <list>
32#include <deque>
33
34#include "aggParticle3D.h"
35
36namespace olb {
37
38
39template<typename T>
42{
43 _aggl = false;
44}
45
46template<typename T>
47AggParticle3D<T>::AggParticle3D(std::vector<T> pos, T mas, T rad)
48 : Particle3D<T>::Particle3D(pos, mas, rad)
49{
50 _aggl = false;
51}
52
53template<typename T>
55 : Particle3D<T>::Particle3D(p)
56{
57 _aggl = false;
58}
59
60template<typename T>
61AggParticle3D<T>::AggParticle3D(std::vector<T> pos, std::vector<T> vel, T mas,
62 T rad)
63 : Particle3D<T>::Particle3D(pos, vel, mas, rad)
64{
65 _aggl = false;
66}
67
68template<typename T>
69inline void AggParticle3D<T>::setMass(T mas)
70{
71 this->_mas = mas;
72}
73
74template<typename T>
75inline void AggParticle3D<T>::setRad(T rad)
76{
77 this->_rad = rad;
78}
79
80template<typename T>
81inline const bool& AggParticle3D<T>::getAggl()
82{
83 return _aggl;
84}
85
86template<typename T>
87inline const bool& AggParticle3D<T>::getAggl() const
88{
89 return _aggl;
90}
91
92template<typename T>
93inline void AggParticle3D<T>::setAggl(bool aggl)
94{
95 _aggl = aggl;
96 if (aggl) {
97 this->setActive(false);
98 }
99}
100
101template<typename T>
103{
104 for (int i = 0; i < 3; i++) {
105 serial[i] = this->_pos[i];
106 serial[i + 3] = this->_vel[i];
107 serial[i + 6] = this->_force[i];
108 }
109 serial[9] = this->_mas;
110 serial[10] = this->_rad;
111 serial[11] = this->_cuboid;
112 serial[12] = (double) this->_active;
113 serial[13] = (double) _aggl;
114}
115
116template<typename T>
118{
119 for (int i = 0; i < 3; i++) {
120 this->_pos[i] = data[i];
121 this->_vel[i] = data[i + 3];
122 this->_force[i] = data[i + 6];
123 }
124 this->_mas = data[9];
125 this->_rad = data[10];
126 this->_cuboid = int(data[11]);
127 this->_active = (bool) data[12];
128 _aggl = (bool) data[13];
129}
130
131
132}
133
134#endif
void setAggl(bool aggl)
const bool & getAggl()
void serialize(T serial[])
Top level namespace for all of OpenLB.