Problem saving value on boundary face
Hello,
I am having a problem saving a calculated value on to the boundary faces of a variable I call "f1". The variable f1 is a surfaceScalarField. I have no problems saving to the internal faces, it is only the boundary faces that are giving me trouble. I have a test case that has one cell, with 6 faces which have 5 boundary patches as 2 faces are defined together (for 2D case). Below is a little excert from the code. Further explaination comes below. Code:
forAll(mesh.faces(), facei) Code:
#0 Foam::error::printStack(Foam::Ostream&) in "/usr/local/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libOpenFOAM.so" When I save the value of "f1temp" to the face of concern for f1, it is done with the following syntax: Code:
f1.boundaryField()[patchID][facei] = f1temp; Code:
Info << f1.boundaryField()[patchID][facei] << endl; Code:
Info << f1 << endl; I can comment out saving the boundary value of f1 (f1.boundaryField()[patchID][facei]), and everything works fine. |
Problem Solved
I found someone at the institute to help me out here. The code that works I have paraphrased below for the purpose of documentation.
I looped first through patches, and then the faces of the given patch. Somehow this works rather than looping through the faces, and calling up patchID. Might anyone have a reason for why this works? Code:
forAll(mesh.boundaryMesh(), patchi) |
All times are GMT -4. The time now is 08:04. |