Commit 4fa4a4aa authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

tags for open boundaries in python

parent 79602e8d
......@@ -13,6 +13,10 @@
using namespace std;
bool particleArray::isOpenBoundary(const std::string tag) const {
return (std::find(_openBoundaries.begin(), _openBoundaries.end(), tag) != _openBoundaries.end());
}
void convertVectorCoords(double target_v[3],double original_v[3], const fullMatrix<double> &jac);
void primaryPnt(const nodalBasis &basis, const fullMatrix<double> &ecoord, const double uvw[3], double xyz[3]) {
double f[3];
......@@ -616,7 +620,7 @@ void dgParticleTracker2D::particleMove(dgDofContainer* solution, fullMatrix<doub
int faceGroupId, faceId, connectionId;
_neighbourMap->getFace(iGroup, iElem, edge_id, faceGroupId, faceId, connectionId);
std::string tag = _group->getFaceGroup(faceGroupId)->physicalTag();
if (tag == "Open Sea North" || tag == "Open Sea Central" || tag == "Open Sea South" || tag == "Open Sea Mid South" || tag == "Open Sea South Tip" || tag == "Open Sea Neutral") {
if (_ParticleArray->isOpenBoundary(tag)) {
outOfDomain++;
_ParticleArray->getParticle(m)->setState(3);
break;
......
......@@ -180,6 +180,7 @@ private:
std::vector<particle> _particle_array;
int _alive, _settled, _dead, _outOfDomain, _aliveAndCompetent;
int _totalSeeded;
std::vector<std::string> _openBoundaries;
public:
/** Default constructor: use this in conjunction with addParticles to seed particles. */
......@@ -267,6 +268,9 @@ public:
* x y state sourceReef competency groupId elementId
* */
void saveState(const std::string &filename);
void setOpenBoundaries(std::vector<std::string> tags) {_openBoundaries = tags;}
bool isOpenBoundary(std::string tag) const;
/** Method to load state of a particle array from file generated using saveState(). */
void loadState(const std::string &filename);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment