Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing divergence error with AMR (Issue #617) #625

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/athena.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,26 @@ struct LogicalLocation { // aggregate and POD type
//! prototype for overloading the comparison operator (defined in meshblock_tree.cpp)
bool operator==(const LogicalLocation &l1, const LogicalLocation &l2);


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you say a bit about why this moved from being a (mostly?) "multigrid-specific" feature?
I see that the LogicalLocationHash and unordered_map's are currently used in Multigrid and meshblock_tree.* Can you say more about the maps / can the same maps be shared across these classes?

//! \fn inline std::int64_t rotl(std::int64_t i, int s)
// \brief left bit rotation function for 64bit integers (unsafe if s > 64)

inline std::int64_t rotl(std::int64_t i, int s) {
return (i << s) | (i >> (64 - s));
}


//! \struct LogicalLocationHash
// \brief Hash function object for LogicalLocation

struct LogicalLocationHash {
public:
std::size_t operator()(const LogicalLocation &l) const {
return static_cast<std::size_t>(l.lx1^rotl(l.lx2,21)^rotl(l.lx3,42));
}
};


//----------------------------------------------------------------------------------------
//! \struct RegionSize
//! \brief physical size and number of cells in a Mesh or a MeshBlock
Expand Down
Loading