Go to the documentation of this file.
20 #ifndef THUNDEREGG_NORMALNBRINFO_H
21 #define THUNDEREGG_NORMALNBRINFO_H
69 void getNbrIds(std::deque<int>& nbr_ids)
const override { nbr_ids.push_back(
id); }
70 void getNbrRanks(std::deque<int>& nbr_ranks)
const override { nbr_ranks.push_back(
rank); }
77 auto iter = id_to_local_index_map.find(
id);
78 if (iter != id_to_local_index_map.end()) {
96 std::unique_ptr<NbrInfoBase>
clone()
const override
98 return std::make_unique<NormalNbrInfo<D>>(*this);
103 to_json(tpl::nlohmann::json& j,
const NormalNbrInfo<D>& n)
107 j[
"ranks"] = { n.rank };
111 from_json(
const tpl::nlohmann::json& j, NormalNbrInfo<D>& n)
114 n.rank = j[
"ranks"][0];
NbrType getNbrType() const override
Get the NbrType.
Definition: NormalNbrInfo.h:68
void getNbrRanks(std::deque< int > &nbr_ranks) const override
Add to a deque of neighbor ranks.
Definition: NormalNbrInfo.h:70
Class that is used to help serialize objects into a buffer.
Definition: BufferWriter.h:38
int local_index
The local index of the neighbor.
Definition: NormalNbrInfo.h:52
NormalNbrInfo()
Construct a new empty NormalNbrInfo object.
Definition: NormalNbrInfo.h:60
std::unique_ptr< NbrInfoBase > clone() const override
get a clone of this object (equivalent to copy constructor)
Definition: NormalNbrInfo.h:96
int deserialize(char *buffer) override
Deserialize an object.
Definition: NormalNbrInfo.h:89
NormalNbrInfo(int id)
Construct a new NormalNbrInfo object.
Definition: NormalNbrInfo.h:67
NbrType
The type of neighbor.
Definition: NbrType.h:34
int global_index
The global index of the neighbor.
Definition: NormalNbrInfo.h:56
The ThunderEgg namespace.
Definition: BiLinearGhostFiller.h:31
Represents information about a patch's neighbor.
Definition: NbrInfo.h:36
int serialize(char *buffer) const override
Serialize object into buffer.
Definition: NormalNbrInfo.h:82
int getPos()
get the current position in the buffer
Definition: BufferReader.h:74
@ Normal
The neighbor is at the same refinement level.
void setGlobalIndexes(const std::map< int, int > &id_to_global_index_map) override
Set the local indexes in the NbrInfo objects.
Definition: NormalNbrInfo.h:71
void setLocalIndexes(const std::map< int, int > &id_to_local_index_map) override
Set the global indexes in the NbrInfo objects.
Definition: NormalNbrInfo.h:75
int getPos()
get the current position in the buffer
Definition: BufferWriter.h:80
Class that is used to help read serialized objects from a buffer.
Definition: BufferReader.h:38
int id
The id of the neighbor.
Definition: NormalNbrInfo.h:48
Represents a neighbor that is at the same refinement level.
Definition: NormalNbrInfo.h:38
int rank
The mpi rank that the neighbor resides on.
Definition: NormalNbrInfo.h:44
void getNbrIds(std::deque< int > &nbr_ids) const override
Add to a deque of neighbor ids.
Definition: NormalNbrInfo.h:69