Skip to content

Commit

Permalink
PABLO: fix indentation of Octant.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardolombardi committed Mar 23, 2020
1 parent 0ec9ffe commit 98fe864
Showing 1 changed file with 101 additions and 101 deletions.
202 changes: 101 additions & 101 deletions src/PABLO/Octant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "bitpit_containers.hpp"

namespace bitpit {
class Octant;
class Octant;
}

bitpit::IBinaryStream& operator>>(bitpit::IBinaryStream &buffer, bitpit::Octant& octant);
Expand Down Expand Up @@ -88,16 +88,16 @@ typedef std::vector<u32array3> u32arr3vector;
*/
class Octant{

// =================================================================================== //
// FRIENDSHIPS
// =================================================================================== //
// =================================================================================== //
// FRIENDSHIPS
// =================================================================================== //

friend class LocalTree;
friend class ParaTree;
friend class LocalTree;
friend class ParaTree;
friend class Global;

friend bitpit::OBinaryStream& (::operator<<) (bitpit::OBinaryStream& buf, const Octant& octant);
friend bitpit::IBinaryStream& (::operator>>) (bitpit::IBinaryStream& buf, Octant& octant);
friend bitpit::OBinaryStream& (::operator<<) (bitpit::OBinaryStream& buf, const Octant& octant);
friend bitpit::IBinaryStream& (::operator>>) (bitpit::IBinaryStream& buf, Octant& octant);


// =================================================================================== //
Expand All @@ -106,9 +106,9 @@ class Octant{

static const TreeConstants::Instances sm_treeConstants; /**< Static member for internal use. */

// =================================================================================== //
// MEMBERS
// =================================================================================== //
// =================================================================================== //
// MEMBERS
// =================================================================================== //
enum OctantInfo {
INFO_BOUNDFACE0 = 0, /**< Identifier to access face bound information in bitset info for face 0 */
INFO_BOUNDFACE1 = 1, /**< Identifier to access face bound information in bitset info for face 1 */
Expand All @@ -131,127 +131,127 @@ class Octant{
};

private:
uint32_t m_x; /**< Coordinate x */
uint32_t m_y; /**< Coordinate y */
uint32_t m_z; /**< Coordinate z (2D case = 0)*/
uint8_t m_level; /**< Refinement level (0=root) */
int8_t m_marker; /**< Set for Refinement(m>0) or Coarsening(m<0) |m|-times */
std::bitset<INFO_ITEM_COUNT> m_info; /**< -Info[0..5]: true if 0..5 face is a boundary face [bound] \n
uint32_t m_x; /**< Coordinate x */
uint32_t m_y; /**< Coordinate y */
uint32_t m_z; /**< Coordinate z (2D case = 0)*/
uint8_t m_level; /**< Refinement level (0=root) */
int8_t m_marker; /**< Set for Refinement(m>0) or Coarsening(m<0) |m|-times */
std::bitset<INFO_ITEM_COUNT> m_info; /**< -Info[0..5]: true if 0..5 face is a boundary face [bound] \n
-Info[6..11]: true if 0..6 face is a process boundary face [pbound] \n
-Info[12/13]: true if octant is new after refinement/coarsening \n
-Info[14] : true if balancing is required for this octant \n
-Info[15] : Aux */
uint8_t m_dim; /**< Dimension of octant (2D/3D) */
int m_ghost; /**< Ghost specifier:\n
uint8_t m_dim; /**< Dimension of octant (2D/3D) */
int m_ghost; /**< Ghost specifier:\n
-1 : internal, \n
0 : ghost in the 0-th layer of the halo, \n
1 : ghost in the 1-st layer of the halo, \n
... \n
n : ghost in the n-th layer of the halo. */

//TODO add bitset for edge & node
//TODO add bitset for edge & node

// =================================================================================== //
// CONSTRUCTORS AND OPERATORS
// =================================================================================== //
// =================================================================================== //
// CONSTRUCTORS AND OPERATORS
// =================================================================================== //
public:
Octant();
Octant();
private:
Octant(uint8_t dim);
Octant(uint8_t dim, uint8_t level, int32_t x, int32_t y, int32_t z = 0);
Octant(bool bound, uint8_t dim, uint8_t level, int32_t x, int32_t y, int32_t z = 0);
bool operator ==(const Octant & oct2);
Octant(uint8_t dim);
Octant(uint8_t dim, uint8_t level, int32_t x, int32_t y, int32_t z = 0);
Octant(bool bound, uint8_t dim, uint8_t level, int32_t x, int32_t y, int32_t z = 0);
bool operator ==(const Octant & oct2);

// =================================================================================== //
// STATIC METHODS
// =================================================================================== //
// =================================================================================== //
// STATIC METHODS
// =================================================================================== //
public:
static unsigned int getBinarySize();
static unsigned int getBinarySize();

private:
// =================================================================================== //
// PRIVATE METHODS
// =================================================================================== //
void initialize();
void initialize(uint8_t dim, uint8_t level, bool bound);
// =================================================================================== //
// PRIVATE METHODS
// =================================================================================== //
void initialize();
void initialize(uint8_t dim, uint8_t level, bool bound);

public:
// =================================================================================== //
// PUBLIC METHODS
// =================================================================================== //
uint64_t computeFatherMorton() const;
u32array3 computeFatherCoordinates() const;
// =================================================================================== //
// PUBLIC METHODS
// =================================================================================== //
uint64_t computeFatherMorton() const;
u32array3 computeFatherCoordinates() const;

// =================================================================================== //
// BASIC GET/SET METHODS
// =================================================================================== //
uint32_t getDim() const;
u32array3 getLogicalCoordinates() const;
uint32_t getLogicalX() const;
uint32_t getLogicalY() const;
uint32_t getLogicalZ() const;
u32array3 getLogicalCoord() const;
uint8_t getLevel() const;
int8_t getMarker() const;
bool getBound(uint8_t face) const;
bool getBound() const;
bool getPbound(uint8_t face) const;
bool getPbound() const;
bool getIsNewR() const;
bool getIsNewC() const;
bool getIsGhost() const;
int getGhostLayer() const;
bool getBalance() const;
// =================================================================================== //
// BASIC GET/SET METHODS
// =================================================================================== //
uint32_t getDim() const;
u32array3 getLogicalCoordinates() const;
uint32_t getLogicalX() const;
uint32_t getLogicalY() const;
uint32_t getLogicalZ() const;
u32array3 getLogicalCoord() const;
uint8_t getLevel() const;
int8_t getMarker() const;
bool getBound(uint8_t face) const;
bool getBound() const;
bool getPbound(uint8_t face) const;
bool getPbound() const;
bool getIsNewR() const;
bool getIsNewC() const;
bool getIsGhost() const;
int getGhostLayer() const;
bool getBalance() const;
protected:
void setBound(uint8_t face);
void setMarker(int8_t marker);
void setBalance(bool balance);
void setLevel(uint8_t level);
void setPbound(uint8_t face, bool flag);
void setGhostLayer(int ghostLayer);
void setBound(uint8_t face);
void setMarker(int8_t marker);
void setBalance(bool balance);
void setLevel(uint8_t level);
void setPbound(uint8_t face, bool flag);
void setGhostLayer(int ghostLayer);

// =================================================================================== //
// OTHER GET/SET METHODS
// =================================================================================== //
// =================================================================================== //
// OTHER GET/SET METHODS
// =================================================================================== //
public:
uint32_t getLogicalSize() const;
uint64_t getLogicalArea() const;
uint64_t getLogicalVolume() const;
darray3 getLogicalCenter() const;
darray3 getLogicalFaceCenter(uint8_t iface) const;
darray3 getLogicalEdgeCenter(uint8_t iedge) const;
void getLogicalNodes(u32arr3vector & nodes) const;
u32arr3vector getLogicalNodes() const;
void getLogicalNode(u32array3 & node, uint8_t inode) const;
u32array3 getLogicalNode(uint8_t inode) const;
void getNormal(uint8_t iface, i8array3 & normal, const int8_t (&normals)[6][3]) const;
uint64_t computeMorton() const;
uint64_t computeNodeMorton(uint8_t inode) const;
uint64_t computeNodeMorton(const u32array3 &node) const;
uint32_t getLogicalSize() const;
uint64_t getLogicalArea() const;
uint64_t getLogicalVolume() const;
darray3 getLogicalCenter() const;
darray3 getLogicalFaceCenter(uint8_t iface) const;
darray3 getLogicalEdgeCenter(uint8_t iedge) const;
void getLogicalNodes(u32arr3vector & nodes) const;
u32arr3vector getLogicalNodes() const;
void getLogicalNode(u32array3 & node, uint8_t inode) const;
u32array3 getLogicalNode(uint8_t inode) const;
void getNormal(uint8_t iface, i8array3 & normal, const int8_t (&normals)[6][3]) const;
uint64_t computeMorton() const;
uint64_t computeNodeMorton(uint8_t inode) const;
uint64_t computeNodeMorton(const u32array3 &node) const;

// =================================================================================== //
// OTHER METHODS //
// =================================================================================== //
Octant buildLastDesc() const;
Octant buildFather() const;
std::vector< Octant > buildChildren() const;
// =================================================================================== //
// OTHER METHODS //
// =================================================================================== //
Octant buildLastDesc() const;
Octant buildFather() const;
std::vector< Octant > buildChildren() const;
protected:
void computeHalfSizeMortons(uint8_t iface, uint32_t *nMortons, std::vector<uint64_t> *mortons) const;
void computeMinSizeMortons(uint8_t iface, uint8_t maxdepth, uint32_t *nMortons, std::vector<uint64_t> *mortons) const;
void computeFaceVirtualMortons(uint8_t iface, uint8_t maxdepth, uint32_t *nMortons, std::vector<uint64_t> *mortons) const;
void computeEdgeHalfSizeMortons(uint8_t iedge, const uint8_t (&edgeface)[12][2], uint32_t *nMortons, std::vector<uint64_t> *mortons) const;
void computeEdgeMinSizeMortons(uint8_t iedge, uint8_t maxdepth, const uint8_t (&edgeface)[12][2], uint32_t *nMortons, std::vector<uint64_t> *mortons) const;
void computeEdgeVirtualMortons(uint8_t iedge, uint8_t maxdepth, uint8_t balance_codim, const uint8_t (&edgeface)[12][2], uint32_t *nMortons, std::vector<uint64_t> *mortons) const;
void computeNodeMinSizeMorton(uint8_t inode, uint8_t maxdepth, const uint8_t (&nodeface)[8][3], bool *hasMorton, uint64_t *morton) const;
void computeNodeVirtualMorton(uint8_t inode, uint8_t maxdepth, const uint8_t (&nodeface)[8][3], bool *hasMorton, uint64_t *morton) const;
uint64_t computePeriodicMorton(uint8_t iface) const;
void computeHalfSizeMortons(uint8_t iface, uint32_t *nMortons, std::vector<uint64_t> *mortons) const;
void computeMinSizeMortons(uint8_t iface, uint8_t maxdepth, uint32_t *nMortons, std::vector<uint64_t> *mortons) const;
void computeFaceVirtualMortons(uint8_t iface, uint8_t maxdepth, uint32_t *nMortons, std::vector<uint64_t> *mortons) const;
void computeEdgeHalfSizeMortons(uint8_t iedge, const uint8_t (&edgeface)[12][2], uint32_t *nMortons, std::vector<uint64_t> *mortons) const;
void computeEdgeMinSizeMortons(uint8_t iedge, uint8_t maxdepth, const uint8_t (&edgeface)[12][2], uint32_t *nMortons, std::vector<uint64_t> *mortons) const;
void computeEdgeVirtualMortons(uint8_t iedge, uint8_t maxdepth, uint8_t balance_codim, const uint8_t (&edgeface)[12][2], uint32_t *nMortons, std::vector<uint64_t> *mortons) const;
void computeNodeMinSizeMorton(uint8_t inode, uint8_t maxdepth, const uint8_t (&nodeface)[8][3], bool *hasMorton, uint64_t *morton) const;
void computeNodeVirtualMorton(uint8_t inode, uint8_t maxdepth, const uint8_t (&nodeface)[8][3], bool *hasMorton, uint64_t *morton) const;
uint64_t computePeriodicMorton(uint8_t iface) const;
Octant computePeriodicOctant(uint8_t iface) const;
Octant computeNodePeriodicOctant(uint8_t inode) const;
Octant computeEdgePeriodicOctant(uint8_t iedge) const;
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;
uint8_t getFamilySplittingNode() const;
};

}
Expand Down

0 comments on commit 98fe864

Please sign in to comment.