ThunderEgg  1.0.0
NbrInfoBase.h
Go to the documentation of this file.
1 /***************************************************************************
2  * ThunderEgg, a library for solvers on adaptively refined block-structured
3  * Cartesian grids.
4  *
5  * Copyright (c) 2021 Scott Aiton
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  ***************************************************************************/
20 #ifndef THUNDEREGG_NBRINFOBASE_H
21 #define THUNDEREGG_NBRINFOBASE_H
22 
27 #include <ThunderEgg/NbrType.h>
29 #include <deque>
30 #include <map>
31 #include <memory>
32 
33 namespace ThunderEgg {
39 class NbrInfoBase : public Serializable
40 {
41 public:
45  virtual ~NbrInfoBase() = default;
49  virtual NbrType getNbrType() const = 0;
53  virtual void getNbrIds(std::deque<int>& nbr_ids) const = 0;
57  virtual void getNbrRanks(std::deque<int>& nbr_ranks) const = 0;
63  virtual void setGlobalIndexes(const std::map<int, int>& rev_map) = 0;
69  virtual void setLocalIndexes(const std::map<int, int>& rev_map) = 0;
75  virtual std::unique_ptr<NbrInfoBase> clone() const = 0;
76 };
77 } // namespace ThunderEgg
78 #endif
ThunderEgg::NbrInfoBase
Represents information about a patch's neighbor.
Definition: NbrInfoBase.h:39
ThunderEgg::NbrInfoBase::setLocalIndexes
virtual void setLocalIndexes(const std::map< int, int > &rev_map)=0
Set the global indexes in the NbrInfo objects.
ThunderEgg::NbrInfoBase::setGlobalIndexes
virtual void setGlobalIndexes(const std::map< int, int > &rev_map)=0
Set the local indexes in the NbrInfo objects.
ThunderEgg::Serializable
Interface for serializing objects.
Definition: Serializable.h:34
ThunderEgg::NbrInfoBase::getNbrRanks
virtual void getNbrRanks(std::deque< int > &nbr_ranks) const =0
Add to a deque of neighbor ranks.
ThunderEgg::NbrInfoBase::~NbrInfoBase
virtual ~NbrInfoBase()=default
Destroy the NbrInfo object.
ThunderEgg::NbrInfoBase::getNbrType
virtual NbrType getNbrType() const =0
Get the NbrType.
NbrType.h
NbrType class.
ThunderEgg::NbrType
NbrType
The type of neighbor.
Definition: NbrType.h:34
ThunderEgg::NbrInfoBase::clone
virtual std::unique_ptr< NbrInfoBase > clone() const =0
get a clone of this object (equivalent to copy constructor)
ThunderEgg
The ThunderEgg namespace.
Definition: BiLinearGhostFiller.h:31
Serializable.h
Serializable class.
ThunderEgg::NbrInfoBase::getNbrIds
virtual void getNbrIds(std::deque< int > &nbr_ids) const =0
Add to a deque of neighbor ids.