|
[Sponsors] |
July 12, 2017, 08:12 |
Finding the corresponding debug switch
|
#1 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi all,
I never got the point of the correct debug switch name that we can manipulate either global or local. In some particular cases it is obvious e.g. ODE solvers have the ODE or ODESolver debug switch. Lets assume we want to activate the debug output in the fvMatrix class e.g. to output the stuff in the relax(const scalar alpha) function. Right now, I was always checking the TypeName info to activate the debug output (this is also mentioned by sourceflux here http://www.sourceflux.de/blog/openfoam-debug-switch/). However, for the fvMatrix class there is actually no debug switch that I could figure out which is responsible for that class. I also went through older threads but there it was obvious which debug switch we should use. In the following thread (Debug switch) it is mentioned that we build the debug switch using: Code:
defineTypeNameAndDebug
__________________
Keep foaming, Tobias Holzmann |
|
July 12, 2017, 09:47 |
|
#2 |
New Member
Weiwen Zhao
Join Date: Dec 2013
Posts: 19
Rep Power: 13 |
Hello Tobias,
fvMatrix<Type> is a class template. I believe the debug switches are controlled by the specialization of fvMatrix<Type>, e.g., fvScalarMatrix, fvVectorMatrix and fvTensorMatrix etc. Examples can be found in $FOAM_ETC/controlDict. Best, Weiwen |
|
July 12, 2017, 09:50 |
|
#3 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi Weiwen,
well that is really funny. So simple. I was thinking about the template character but I never searched for a fv<Type>Matrix debug switch in the controlDict. Thank you very much. That is the solution.
__________________
Keep foaming, Tobias Holzmann |
|
April 3, 2019, 10:24 |
|
#4 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi all,
I am facing again the same situation for the compressible::turbulentTemperatureCoupledBaffleMix ed boundary condition. In the source code, we find the debug switch: Code:
if (debug) { scalar Q = gSum(kappa(*this)*patch().magSf()*snGrad()); Info<< patch().boundaryMesh().mesh().name() << ':' << patch().name() << ':' << this->internalField().name() << " <- " << nbrMesh.name() << ':' << nbrPatch.name() << ':' << this->internalField().name() << " :" << " heat transfer rate:" << Q << " walltemperature " << " min:" << gMin(*this) << " max:" << gMax(*this) << " avg:" << gAverage(*this) << endl; }
__________________
Keep foaming, Tobias Holzmann |
|
April 3, 2019, 11:02 |
|
#5 |
Member
Andrew Coughtrie
Join Date: May 2011
Posts: 51
Rep Power: 15 |
Hi Tobi,
As far as I can tell in general the debug switch for a patchField is defined through the makePatchTypeField macro at the end of the .C file as you know. so even though the debug switch for turbulentTemperatureCoupledBaffleMixedFvPatchScala rField isn't in the controlDict it should still be that as far as i can tell. I haven't tested it though so.... Andrew Last edited by Andrew.Coughtrie; April 3, 2019 at 11:50. Reason: reread previous posts |
|
April 3, 2019, 11:16 |
|
#6 |
New Member
Weiwen Zhao
Join Date: Dec 2013
Posts: 19
Rep Power: 13 |
Dear Tobi,
I think you should add "compressible::turbulentTemperatureCoupledBaffleMi xed 1;" to DebugSwitches sub-dictionary in system/controlDict. Best, Weiwen |
|
April 29, 2019, 11:49 |
|
#7 |
New Member
Orcun Kozaka
Join Date: Dec 2009
Posts: 6
Rep Power: 17 |
Hi all,
I am trying to turn on the debug switch in cyclicAMIPolyPatch.C. As far as I understood Code:
namespace Foam { defineTypeNameAndDebug(cyclicAMIPolyPatch, 0); addToRunTimeSelectionTable(polyPatch, cyclicAMIPolyPatch, word); addToRunTimeSelectionTable(polyPatch, cyclicAMIPolyPatch, dictionary); } if I set cyclicAMIPolyPatch to 1 in controlDict DebugSwitches subDictionary it will turn the debug switches on for that part of the code. Is this correct? Or do I have to compile the openfoam with certain debug definitions turned on? I am on OpenFoam 5.x by the way. Cheers, Orçun |
|
June 20, 2020, 05:07 |
|
#8 |
Member
|
I ran into a weird debug switch error when I run MPPICFoam. It didn't happen until yesterday.
Code:
$ MPPICFoam debug::switchSet(const char*, dictionary*&): Cannot find DebugSwitches in dictionary IStringStream.sourceFile Today I was tinkering around with how to run MPI over multiple machines and setting up an NFS directory to place a clone case directory there. As soon as I tried running mpirun -np 7 --hosts <machinesfile> MPPICFoam -parallel, I got this error. So I tried running just MPPICFoam without MPI, still the same error. And it's not just in this NFS directory, but happens also on a similar clone directory elsewhere on the same node. But running MPPICFoam from the clone node on the same NFS directory ran just fine. It could be a file corruption somewhere under the OpenFoam directory. I still have the tarball for the OpenFoam build cloning purpose, so I could untar to overwrite my OpenFoam-7 directory and try again. But perhaps before I take that drastic step someone in this thread could give me a tip-off as to where to look for the offending file? =============== The problem went away as mysteriously as it had arrived. After powering it down, powering back up to do some unrelated work, powering down again, and finally powering back up 2nd time to re-try MPPICFoam, it runs without a hitch. Last edited by Mars409; June 20, 2020 at 14:19. Reason: New observation. |
|
October 14, 2020, 10:23 |
|
#9 | |
Member
Julian
Join Date: Sep 2019
Posts: 32
Rep Power: 7 |
Quote:
Code:
$FOAM_ETC/system/controlDict Code:
DebugSwitches { ... compressible::turbulentTemperatureCoupledBaffleMixed 1; ... } Last edited by jmt; October 14, 2020 at 10:25. Reason: missed a tag |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[General] Extracting ParaView Data into Python Arrays | Jeffzda | ParaView | 30 | November 6, 2023 22:00 |
create the file *.foam | phongstar | OpenFOAM | 12 | October 14, 2018 19:06 |
[swak4Foam] segmentation faults when using the debug switch "ExpressionResult" | Astrodan | OpenFOAM Running, Solving & CFD | 1 | February 21, 2016 17:29 |
Eclipse - case debug error | Bufacchi | OpenFOAM | 1 | February 7, 2012 16:15 |
Debug switch | pierre | OpenFOAM Running, Solving & CFD | 5 | July 5, 2007 20:38 |