From 95cf9666e750bae9e6328311034c784da7ee7f08 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Wed, 11 Jul 2018 19:21:48 +0100 Subject: [PATCH] particle: Added some extra debugging statements --- src/lagrangian/basic/particle/particle.C | 40 +++++++++++++++++++ .../basic/particle/particleTemplates.C | 10 +++++ 2 files changed, 50 insertions(+) diff --git a/src/lagrangian/basic/particle/particle.C b/src/lagrangian/basic/particle/particle.C index 7363c553ed..4f69959553 100644 --- a/src/lagrangian/basic/particle/particle.C +++ b/src/lagrangian/basic/particle/particle.C @@ -152,6 +152,11 @@ void Foam::particle::rotate(const bool reverse) void Foam::particle::changeTet(const label tetTriI) { + if (debug) + { + Info << "Particle " << origId() << nl << FUNCTION_NAME << nl << endl; + } + const bool isOwner = mesh_.faceOwner()[tetFacei_] == celli_; const label firstTetPtI = 1; @@ -227,6 +232,11 @@ void Foam::particle::changeTet(const label tetTriI) void Foam::particle::changeFace(const label tetTriI) { + if (debug) + { + Info << "Particle " << origId() << nl << FUNCTION_NAME << nl << endl; + } + // Get the old topology const triFace triOldIs(currentTetIndices().faceTriIs(mesh_)); @@ -342,6 +352,11 @@ void Foam::particle::changeFace(const label tetTriI) void Foam::particle::changeCell() { + if (debug) + { + Info << "Particle " << origId() << nl << FUNCTION_NAME << nl << endl; + } + // Set the cell to be the one on the other side of the face const label ownerCellI = mesh_.faceOwner()[tetFacei_]; const bool isOwner = celli_ == ownerCellI; @@ -354,6 +369,11 @@ void Foam::particle::changeCell() void Foam::particle::changeToMasterPatch() { + if (debug) + { + Info << "Particle " << origId() << nl << FUNCTION_NAME << nl << endl; + } + label thisPatch = patch(); forAll(mesh_.cells()[celli_], cellFaceI) @@ -395,6 +415,11 @@ void Foam::particle::locate const string boundaryMsg ) { + if (debug) + { + Info << "Particle " << origId() << nl << FUNCTION_NAME << nl << endl; + } + // Find the cell, if it has not been given if (celli < 0) { @@ -591,6 +616,11 @@ Foam::scalar Foam::particle::track const scalar fraction ) { + if (debug) + { + Info << "Particle " << origId() << nl << FUNCTION_NAME << nl << endl; + } + scalar f = trackToFace(displacement, fraction); while (onInternalFace()) @@ -610,6 +640,11 @@ Foam::scalar Foam::particle::trackToCell const scalar fraction ) { + if (debug) + { + Info << "Particle " << origId() << nl << FUNCTION_NAME << nl << endl; + } + const scalar f = trackToFace(displacement, fraction); if (onInternalFace()) @@ -627,6 +662,11 @@ Foam::scalar Foam::particle::trackToFace const scalar fraction ) { + if (debug) + { + Info << "Particle " << origId() << nl << FUNCTION_NAME << nl << endl; + } + scalar f = 1; label tetTriI = onFace() ? 0 : -1; diff --git a/src/lagrangian/basic/particle/particleTemplates.C b/src/lagrangian/basic/particle/particleTemplates.C index 7fd4fb34a0..57da1b2d32 100644 --- a/src/lagrangian/basic/particle/particleTemplates.C +++ b/src/lagrangian/basic/particle/particleTemplates.C @@ -108,6 +108,11 @@ void Foam::particle::hitFace trackingData& td ) { + if (debug) + { + Info << "Particle " << origId() << nl << FUNCTION_NAME << nl << endl; + } + typename TrackCloudType::particleType& p = static_cast(*this); typename TrackCloudType::particleType::trackingData& ttd = @@ -183,6 +188,11 @@ void Foam::particle::trackToAndHitFace trackingData& td ) { + if (debug) + { + Info << "Particle " << origId() << nl << FUNCTION_NAME << nl << endl; + } + trackToFace(direction, fraction); hitFace(direction, cloud, td);