DamBreak++ Wave Simulator 0.3
DamBreak++ Simulation Framework
Loading...
Searching...
No Matches
dbpp_Cell.h
Go to the documentation of this file.
1#pragma once
2
3// C++ include
4#include <iostream>
5// DamBreak++ include
6#include "dbpp_CelLFace.h"
7
8namespace dbpp
9{
34 class Cell
35 {
39 using pairofface = std::pair<cellFace/*left*/, cellFace/*right*/>;
40 public:
46 Cell( short aCellIndex, short aNodeIndex);
54 Cell( short aCellIndex, short aNodeIndex,
55 const cellFace& aLeftFace, const cellFace& aRightFace);
60 void setCellPair( const std::pair<cellFace, cellFace>& aPairFaces)
61 {
62 m_leftFace = aPairFaces.first;
63 m_rightFace = aPairFaces.second;
64 }
65
69 pairofface getPairFaces() const noexcept
70 {
71 // RVO: Return Value Optimization
72 return std::make_pair(m_leftFace, m_rightFace);
73 }
74
78 cellFace getLeftFace() const noexcept { return m_leftFace; }
83 cellFace getRightFace() const noexcept { return m_rightFace; }
88 void setLeftFace( const cellFace& aCellF) noexcept { m_leftFace = aCellF; }
93 void setRightFace(const cellFace& aCellF) noexcept { m_rightFace = aCellF; }
98 void setCellNo( unsigned short aCellNo) noexcept { m_cellIndex = aCellNo; }
103 void setNodeNo( unsigned short aNodeNo) noexcept { m_nodalIndex = aNodeNo; }
108 unsigned cellNo() const noexcept { return m_cellIndex; }
113 unsigned nodeNo() const noexcept { return m_nodalIndex; }
119 auto operator<=> (const Cell& aOther) const = default;
120 //{
121 // return (m_leftFace == aOther.m_leftFace) && (m_rightFace == aOther.m_rightFace);
122 //}
123 // bool operator!= (const cell& aOther) { return !(operator== (aOther)); }
128 void printCell(std::iostream& aStream) { throw "Not implemented yet"; }
135 friend std::ostream& operator<< (std::ostream& os, const Cell& aCell2Print) { throw "Not implemented yet"; }
136 private:
141 };
142} // End of namespace
unsigned cellNo() const noexcept
Getter.
Definition dbpp_Cell.h:108
cellFace m_leftFace
Definition dbpp_Cell.h:139
void printCell(std::iostream &aStream)
print cell information
Definition dbpp_Cell.h:128
pairofface getPairFaces() const noexcept
Getter.
Definition dbpp_Cell.h:69
void setRightFace(const cellFace &aCellF) noexcept
Set cell right face.
Definition dbpp_Cell.h:93
cellFace getRightFace() const noexcept
Getter.
Definition dbpp_Cell.h:83
cellFace m_rightFace
Definition dbpp_Cell.h:140
unsigned nodeNo() const noexcept
Getter.
Definition dbpp_Cell.h:113
std::pair< cellFace, cellFace > pairofface
Alias (pair of cell face)
Definition dbpp_Cell.h:39
void setNodeNo(unsigned short aNodeNo) noexcept
Set node index.
Definition dbpp_Cell.h:103
void setCellNo(unsigned short aCellNo) noexcept
Set cell index.
Definition dbpp_Cell.h:98
void setLeftFace(const cellFace &aCellF) noexcept
Set cell left face.
Definition dbpp_Cell.h:88
friend std::ostream & operator<<(std::ostream &os, const Cell &aCell2Print)
Stream operator.
Definition dbpp_Cell.h:135
void setCellPair(const std::pair< cellFace, cellFace > &aPairFaces)
Intitialize from pair of cell faces.
Definition dbpp_Cell.h:60
Cell(short aCellIndex, short aNodeIndex)
Ctor from cell index and node nodex.
Definition dbpp_Cell.cpp:6
short m_nodalIndex
Definition dbpp_Cell.h:138
cellFace getLeftFace() const noexcept
Getter.
Definition dbpp_Cell.h:78
auto operator<=>(const Cell &aOther) const =default
spaceship operator comparison operator == and != defauted
short m_cellIndex
Definition dbpp_Cell.h:137
Cell face in the finite volume discretization Usage: caculFF(const cellFace& aFace) compute the numer...
Definition dbpp_CellFace.h:29
Definition DamBreakProb.h:15