Loading...
Searching...
No Matches
Intersection.cpp
1/*---------------------------------------------------------------------------*\
2 *
3 * bitpit
4 *
5 * Copyright (C) 2015-2021 OPTIMAD engineering Srl
6 *
7 * -------------------------------------------------------------------------
8 * License
9 * This file is part of bitpit.
10 *
11 * bitpit is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License v3 (LGPL)
13 * as published by the Free Software Foundation.
14 *
15 * bitpit is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with bitpit. If not, see <http://www.gnu.org/licenses/>.
22 *
23\*---------------------------------------------------------------------------*/
24
25// =================================================================================== //
26// INCLUDES //
27// =================================================================================== //
28#include "Intersection.hpp"
29
30namespace bitpit {
31
32// =================================================================================== //
33// CLASS IMPLEMENTATION //
34// =================================================================================== //
35
36// =================================================================================== //
37// CONSTRUCTORS AND OPERATORS
38// =================================================================================== //
44 m_owners[0] = 0;
45 m_owners[1] = 0;
46 m_iface = 0;
47 m_isnew = false;
48 m_isghost = false;
49 m_finer = 0;
50 m_out = 0;
51 m_outisghost = false;
52 m_bound = m_pbound = false;
53 m_dim = 2;
54};
55
62 m_owners[0] = 0;
63 m_owners[1] = 0;
64 m_iface = 0;
65 m_isnew = false;
66 m_isghost = false;
67 m_finer = 0;
68 m_out = 0;
69 m_outisghost = false;
70 m_bound = m_pbound = false;
71 m_dim = dim;
72};
73
78 m_owners[0] = intersection.m_owners[0];
79 m_owners[1] = intersection.m_owners[1];
80 m_iface = intersection.m_iface;
81 m_isnew = intersection.m_isnew;
82 m_isghost = intersection.m_isghost;
83 m_finer = intersection.m_finer;
84 m_out = intersection.m_out;
85 m_outisghost = intersection.m_outisghost;
86 m_bound = intersection.m_bound;
87 m_pbound = intersection.m_pbound;
88 m_dim = intersection.m_dim;
89};
90
95 m_owners[0] = intersection.m_owners[0];
96 m_owners[1] = intersection.m_owners[1];
97 m_iface = intersection.m_iface;
98 m_isnew = intersection.m_isnew;
99 m_isghost = intersection.m_isghost;
100 m_finer = intersection.m_finer;
101 m_out = intersection.m_out;
102 m_outisghost = intersection.m_outisghost;
103 m_bound = intersection.m_bound;
104 m_pbound = intersection.m_pbound;
105 m_dim = intersection.m_dim;
106 return *this;
107};
108
112bool Intersection::operator ==(const Intersection & intersection){
113 bool check = true;
114 check = check && (m_owners[0] == intersection.m_owners[0]);
115 check = check && (m_owners[1] == intersection.m_owners[1]);
116 check = check && (m_iface == intersection.m_iface);
117 check = check && (m_isnew == intersection.m_isnew);
118 check = check && (m_isghost == intersection.m_isghost);
119 check = check && (m_out == intersection.m_out);
120 check = check && (m_outisghost == intersection.m_outisghost);
121 check = check && (m_finer == intersection.m_finer);
122 check = check && (m_bound == intersection.m_bound);
123 check = check && (m_pbound == intersection.m_pbound);
124 check = check && (m_dim == intersection.m_dim);
125 return check;
126
127};
128
129// =================================================================================== //
130// METHODS
131// =================================================================================== //
132
133// =================================================================================== //
134// BASIC GET/SET METHODS
135// =================================================================================== //
138uint32_t Intersection::getOut() const {
139 return m_owners[m_out];
140};
141
144uint32_t Intersection::getIn() const {
145 return m_owners[!m_out];
146};
147
150bool Intersection::getOutIsGhost() const {
151 return m_outisghost;
152};
153
156uint32_t Intersection::getFiner() const {
157 return m_owners[m_finer];
158};
159
164void Intersection::getNormal(int8_t normal[3], int8_t normals[6][3]) const {
165 for (int i=0; i<m_dim; i++){
166 normal[i] = normals[m_iface][i];
167 }
168};
169
173bool Intersection::getBound() const {
174 return m_bound;
175};
176
180bool Intersection::getIsGhost() const {
181 return m_isghost;
182};
183
187bool Intersection::getPbound() const {
188 return m_pbound;
189};
190
191}
Intersection class definition.
Intersection & operator=(const Intersection &intersection)
--- layout: doxygen_footer ---