Skip to content
Snippets Groups Projects
Verified Commit d4b9adaf authored by Paul Dechamps's avatar Paul Dechamps :speech_balloon:
Browse files

(refactor) Added reference to setters in BoundaryLayer

parent 2643ac97
No related branches found
No related tags found
1 merge request!1BLASTER v1.0
...@@ -22,10 +22,10 @@ BoundaryLayer::BoundaryLayer(double _xtrF, std::string _name) ...@@ -22,10 +22,10 @@ BoundaryLayer::BoundaryLayer(double _xtrF, std::string _name)
BoundaryLayer::~BoundaryLayer() { delete closSolver; } BoundaryLayer::~BoundaryLayer() { delete closSolver; }
void BoundaryLayer::setMesh(std::vector<double> _x, std::vector<double> _y, void BoundaryLayer::setMesh(const std::vector<double> &_x, const std::vector<double> &_y,
std::vector<double> _z, double _chord, double _xMin, const std::vector<double> &_z, const double &_chord,
std::vector<int> const _rows, const double &_xMin, const std::vector<int> &_rows,
std::vector<int> const _no) const std::vector<int> &_no)
{ {
if (_x.size() != _y.size() || _x.size() != _z.size()) if (_x.size() != _y.size() || _x.size() != _z.size())
throw std::runtime_error("Mesh coordinates are not consistent."); throw std::runtime_error("Mesh coordinates are not consistent.");
...@@ -166,8 +166,8 @@ void BoundaryLayer::setStagnationBC(double Re) ...@@ -166,8 +166,8 @@ void BoundaryLayer::setStagnationBC(double Re)
* @param UpperCond Variables at the last point on the upper side. * @param UpperCond Variables at the last point on the upper side.
* @param LowerCond Variables at the last point on the lower side. * @param LowerCond Variables at the last point on the lower side.
*/ */
void BoundaryLayer::setWakeBC(double Re, std::vector<double> UpperCond, void BoundaryLayer::setWakeBC(double Re, std::vector<double> &UpperCond,
std::vector<double> LowerCond) std::vector<double> &LowerCond)
{ {
if (name != "wake") if (name != "wake")
std::cout << "Warning: Imposing wake boundary condition on " << name std::cout << "Warning: Imposing wake boundary condition on " << name
......
...@@ -88,72 +88,62 @@ public: ...@@ -88,72 +88,62 @@ public:
size_t getnNodes() const { return nNodes; }; size_t getnNodes() const { return nNodes; };
size_t getnElms() const { return nElms; }; size_t getnElms() const { return nElms; };
std::vector<double> getDeltaStar() const { return deltaStar; };
std::vector<double> getUe() const
{
std::vector<double> ue(nNodes, 0.);
for (size_t i = 0; i < nNodes; ++i)
ue[i] = u[i * nVar + 3];
return ue;
};
std::vector<double> getBlowing() const { return blowingVelocity; };
double getMaxMach() const { return *std::max_element(Me.begin(), Me.end()); }; double getMaxMach() const { return *std::max_element(Me.begin(), Me.end()); };
// Setters // Setters
void setMesh(std::vector<double> const _x, std::vector<double> const y, void setMesh(const std::vector<double> &_x, const std::vector<double> &y,
std::vector<double> const z, double const _chord, const std::vector<double> &z, const double &_chord,
double const _xMin, const double &_xMin, const std::vector<int> &_rows = std::vector<int>(0),
std::vector<int> const _rows = std::vector<int>(0), const std::vector<int> &_no = std::vector<int>(0));
std::vector<int> const _no = std::vector<int>(0));
void computeLocalCoordinates(); void computeLocalCoordinates();
void setMe(std::vector<double> const _Me) void setMe(std::vector<double> const &_Me)
{ {
if (_Me.size() != nNodes) if (_Me.size() != nNodes)
throw std::runtime_error("Mach number vector is not consistent."); throw std::runtime_error("Mach number vector is not consistent.");
Me = _Me; Me = _Me;
}; };
void setVt(std::vector<double> const _vt) void setVt(std::vector<double> const &_vt)
{ {
if (_vt.size() != nNodes) if (_vt.size() != nNodes)
throw std::runtime_error("Velocity vector is not consistent."); throw std::runtime_error("Velocity vector is not consistent.");
vt = _vt; vt = _vt;
}; };
void setRhoe(std::vector<double> const _rhoe) void setRhoe(std::vector<double> const &_rhoe)
{ {
if (_rhoe.size() != nNodes) if (_rhoe.size() != nNodes)
throw std::runtime_error("Density vector is not consistent."); throw std::runtime_error("Density vector is not consistent.");
rhoe = _rhoe; rhoe = _rhoe;
}; };
void setxxExt(std::vector<double> const _xxExt) void setxxExt(std::vector<double> const &_xxExt)
{ {
if (_xxExt.size() != nNodes) if (_xxExt.size() != nNodes)
throw std::runtime_error("External mesh vector is not consistent."); throw std::runtime_error("External mesh vector is not consistent.");
xxExt = _xxExt; xxExt = _xxExt;
}; };
void setDeltaStarExt(std::vector<double> const _deltaStarExt) void setDeltaStarExt(std::vector<double> const &_deltaStarExt)
{ {
if (_deltaStarExt.size() != nNodes) if (_deltaStarExt.size() != nNodes)
throw std::runtime_error( throw std::runtime_error(
"Displacement thickness vector is not consistent."); "Displacement thickness vector is not consistent.");
deltaStarExt = _deltaStarExt; deltaStarExt = _deltaStarExt;
}; };
void setVtExt(std::vector<double> const _vtExt) void setVtExt(std::vector<double> const &_vtExt)
{ {
if (_vtExt.size() != nNodes) if (_vtExt.size() != nNodes)
throw std::runtime_error("Velocity vector is not consistent."); throw std::runtime_error("Velocity vector is not consistent.");
vtExt = _vtExt; vtExt = _vtExt;
}; };
void setxtrF(double const _xtrF) { xtrF = _xtrF; }; void setxtrF(double const _xtrF) { xtrF = _xtrF; };
void setnCrit(double const _nCrit) { nCrit = _nCrit; };
// Boundary conditions. // Boundary conditions.
void setStagnationBC(double Re); void setStagnationBC(double Re);
void setWakeBC(double Re, std::vector<double> upperConditions, void setWakeBC(double Re, std::vector<double> &upperConditions,
std::vector<double> lowerConditions); std::vector<double> &lowerConditions);
// Getters. // Getters.
size_t getnVar() const { return nVar; }; size_t getnVar() const { return nVar; };
double getnCrit() const { return nCrit; }; double getnCrit() const { return nCrit; };
void setnCrit(double const _nCrit) { nCrit = _nCrit; };
// Others // Others
void printSolution(size_t iPoint) const; void printSolution(size_t iPoint) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment