-
Notifications
You must be signed in to change notification settings - Fork 33
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
PABLO: add node and edge periodic neighbours #58
PABLO: add node and edge periodic neighbours #58
Conversation
examples/CMakeLists.txt
Outdated
@@ -62,7 +62,8 @@ if(BUILD_EXAMPLES) | |||
list(APPEND EXAMPLE_LIST "PABLO_example_00007") | |||
list(APPEND EXAMPLE_LIST "PABLO_example_00008") | |||
list(APPEND EXAMPLE_LIST "PABLO_example_00009") | |||
list(APPEND EXAMPLE_LIST "PABLO_example_00010") | |||
list(APPEND EXAMPLE_LIST "PABLO_example_00010") | |||
list(APPEND EXAMPLE_LIST "PABLO_example_00011") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example 00011 is not introduced by this commit, its introduced in a2f6106. This commit only modifies the example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that something went wrong with my edit/squash/fixup...
@@ -1544,7 +1544,7 @@ Octant Octant::computePeriodicOctant(uint8_t iface) const { | |||
uint32_t dh = this->getLogicalSize(); | |||
|
|||
if (!m_info[iface]){ | |||
return this->computeMorton(); | |||
return *this; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a fix that should be on a stand alone commit.
void findGhostNeighbours(uint32_t idx, uint8_t iface, u32vector & neighbours, bvector & isghost) const; | ||
void findGhostEdgeNeighbours(uint32_t idx, uint8_t iedge, u32vector & neighbours, bvector & isghost) const; | ||
void findGhostNodeNeighbours(uint32_t idx, uint8_t inode, u32vector & neighbours, bvector & isghost) const; | ||
BITPIT_DEPRECATED(void findGhostPeriodicNeighbours(const Octant* oct, uint8_t iface, u32vector & neighbours) const); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit title is "PABLO: added node and edge periodic neighbors", but you are also removing two functions. Better remove this two functions in a separate commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above...
if (!m_info[iface1] && !m_info[iface2] && !m_info[iface3]){ | ||
return *this; | ||
} | ||
else{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can 'getNodePeriodicCoord' be used to evaluate the coordinates instead of duplicating the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, they deal with periodic octant in different way.
for (int idim=0; idim<m_dim; idim++){ | ||
cxyz[idim] = sm_treeConstants[m_dim].edgeCoeffs[iedge][idim]; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can 'getEdgePeriodicCoord' be used to evaluate the coordinates instead of duplicating the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, they deal with periodic octant in different way.
u32array3 coordtry = m_ghosts[idxtry].getLogicalCoord(); | ||
u32array3 coord1 = { {1,1,1} }; | ||
array<int64_t,3> coord1 = { {1,1,1} }; | ||
u32array3 coordtry1 = { {1,1,1} }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated, please remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's correct.
if (m_periodic[iface]){ | ||
isperiodic = true; | ||
// findPeriodicNeighbours(oct, iface, neighbours, isghost); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes belong to the previous commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, right.
std::array<int64_t,3> getPeriodicCoord(uint8_t iface) const; | ||
std::array<int64_t,3> getNodePeriodicCoord(uint8_t inode) const; | ||
std::array<int64_t,3> getEdgePeriodicCoord(uint8_t iedge) const; | ||
uint8_t getFamilySplittingNode() const; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that indentation is not coherent with the surrounding code.
examples/PABLO_example_00011.cpp
Outdated
* | ||
* bitpit | ||
* | ||
* Copyright (C) 2015-2019 OPTIMAD engineering Srl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/PABLO/Octant.cpp
Outdated
switch (iface1) { | ||
case 0 : | ||
{ | ||
if (m_info[0]){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are constants to access the m_info entries (OctantInfo enum in Octant.hpp).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll use this enum.
src/PABLO/Octant.cpp
Outdated
*/ | ||
Octant Octant::computeNodePeriodicOctant(uint8_t inode) const { | ||
Octant degOct(this->m_dim, this->m_level, this->m_x, this->m_y, this->m_z); | ||
uint32_t maxLength = uint32_t(1)<<TreeConstants::MAX_LEVEL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a constant for the max length: MAX_LENGTH in TreeConstants (should be accessible through sm_treeConstants).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I think I used some lines above....
All Octant coordinates are uint32_t, whereas get*PeriodicCoord() functions return int64_t. Is this intentional? |
Maybe I get it, is to allow negative numbers? |
Yes, this is the reason (I quickly commented in the inline comment). Maybe there is some inconsistent compares in the code, I check form them. |
src/PABLO/Octant.cpp
Outdated
/*! Get the coordinates of the octant shifted through edge iedge and | ||
* near the opposite periodic boundary (i.e. the coordinates considering this octant | ||
* as a ghost periodic octant). | ||
* The face through the octant is periodic has to be passed as boolean flags. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this comments it seems there should be an additional argument that tells which are the periodic faces. (same applies for the other getPeriodicCoord() and computePeriodicOctant functions).
I tried to check if the calculations in get*PeriodicCoord and compute*PeriodicOctant are correct, but I can't fully understand what these function do. If you want me to really check the calculations, I need some details on what is the purpose of the functions. However, if the functions pass the tests and I'm fine with them. |
Sure:
|
5138494
to
e28da13
Compare
PR updated. |
98fe864
to
2a8bf2c
Compare
…urs function Special function for finding periodic neighbours are no more needed and thus they are now dropped.
2a8bf2c
to
d0869b8
Compare
I fixed the indentation in a couple of places and remove some "unused variables" warnings. I will do the marge later this afternoon. |
It enables finding node and edge neighbours with periodic boundaries (#55).