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)
BoundaryLayer::~BoundaryLayer() { delete closSolver; }
void BoundaryLayer::setMesh(std::vector<double> _x, std::vector<double> _y,
std::vector<double> _z, double _chord, double _xMin,
std::vector<int> const _rows,
std::vector<int> const _no)
void BoundaryLayer::setMesh(const std::vector<double> &_x, const std::vector<double> &_y,
const std::vector<double> &_z, const double &_chord,
const double &_xMin, const std::vector<int> &_rows,
const std::vector<int> &_no)
{
if (_x.size() != _y.size() || _x.size() != _z.size())
throw std::runtime_error("Mesh coordinates are not consistent.");
......@@ -166,8 +166,8 @@ void BoundaryLayer::setStagnationBC(double Re)
* @param UpperCond Variables at the last point on the upper side.
* @param LowerCond Variables at the last point on the lower side.
*/
void BoundaryLayer::setWakeBC(double Re, std::vector<double> UpperCond,
std::vector<double> LowerCond)
void BoundaryLayer::setWakeBC(double Re, std::vector<double> &UpperCond,
std::vector<double> &LowerCond)
{
if (name != "wake")
std::cout << "Warning: Imposing wake boundary condition on " << name
......
......@@ -88,72 +88,62 @@ public:
size_t getnNodes() const { return nNodes; };
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()); };
// Setters
void setMesh(std::vector<double> const _x, std::vector<double> const y,
std::vector<double> const z, double const _chord,
double const _xMin,
std::vector<int> const _rows = std::vector<int>(0),
std::vector<int> const _no = std::vector<int>(0));
void setMesh(const std::vector<double> &_x, const std::vector<double> &y,
const std::vector<double> &z, const double &_chord,
const double &_xMin, const std::vector<int> &_rows = std::vector<int>(0),
const std::vector<int> &_no = std::vector<int>(0));
void computeLocalCoordinates();
void setMe(std::vector<double> const _Me)
void setMe(std::vector<double> const &_Me)
{
if (_Me.size() != nNodes)
throw std::runtime_error("Mach number vector is not consistent.");
Me = _Me;
};
void setVt(std::vector<double> const _vt)
void setVt(std::vector<double> const &_vt)
{
if (_vt.size() != nNodes)
throw std::runtime_error("Velocity vector is not consistent.");
vt = _vt;
};
void setRhoe(std::vector<double> const _rhoe)
void setRhoe(std::vector<double> const &_rhoe)
{
if (_rhoe.size() != nNodes)
throw std::runtime_error("Density vector is not consistent.");
rhoe = _rhoe;
};
void setxxExt(std::vector<double> const _xxExt)
void setxxExt(std::vector<double> const &_xxExt)
{
if (_xxExt.size() != nNodes)
throw std::runtime_error("External mesh vector is not consistent.");
xxExt = _xxExt;
};
void setDeltaStarExt(std::vector<double> const _deltaStarExt)
void setDeltaStarExt(std::vector<double> const &_deltaStarExt)
{
if (_deltaStarExt.size() != nNodes)
throw std::runtime_error(
"Displacement thickness vector is not consistent.");
deltaStarExt = _deltaStarExt;
};
void setVtExt(std::vector<double> const _vtExt)
void setVtExt(std::vector<double> const &_vtExt)
{
if (_vtExt.size() != nNodes)
throw std::runtime_error("Velocity vector is not consistent.");
vtExt = _vtExt;
};
void setxtrF(double const _xtrF) { xtrF = _xtrF; };
void setnCrit(double const _nCrit) { nCrit = _nCrit; };
// Boundary conditions.
void setStagnationBC(double Re);
void setWakeBC(double Re, std::vector<double> upperConditions,
std::vector<double> lowerConditions);
void setWakeBC(double Re, std::vector<double> &upperConditions,
std::vector<double> &lowerConditions);
// Getters.
size_t getnVar() const { return nVar; };
double getnCrit() const { return nCrit; };
void setnCrit(double const _nCrit) { nCrit = _nCrit; };
// Others
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