diff --git a/exercice_3/src/compute_boundary.cc b/exercice_3/src/compute_boundary.cc index 0a63033..43ea767 100644 --- a/exercice_3/src/compute_boundary.cc +++ b/exercice_3/src/compute_boundary.cc @@ -1,28 +1,39 @@ #include "compute_boundary.hh" /* -------------------------------------------------------------------------- */ ComputeBoundary::ComputeBoundary(const Vector& xmin, const Vector& xmax) : xmin(xmin), xmax(xmax) { Vector d = xmax - xmin; for (UInt i = 0; i < Vector::dim; ++i) if (d[i] < 0) { std::cout << "XMax and XMin do not form a domain range" << std::endl; std::exit(1); } } /* -------------------------------------------------------------------------- */ void ComputeBoundary::compute(System& system) { for (auto & par : system) { auto & x = par.getPosition(); auto & v = par.getVelocity(); Vector d1 = xmax - x, d2 = x - xmin; for (UInt i = 0; i < Vector::dim; ++i) { if (d1[i] < 0 or d2[i] < 0) v[i] *= -1; } } } /* -------------------------------------------------------------------------- */ + +void ComputeBoundary::compute(MaterialPoint point){ + auto& x = point.getPosition(); + auto& temperature = point.getTemperature(); + + for (UInt i = 0; i < Vector::dim; ++i){ + if (x[i] == xmax[i] or x[i] == xmin[i]){ + temperature = 0.0; + } + } +}