output the face area vectors
Dear All, I write a small utility code to output the face area vectors (it is modified from GradU utility):
Code:
/*---------------------------------------------------------------------------*\ Code:
FaceAreaVector.C:53:5: error: invalid use of incomplete type ‘const struct Foam::surfaceVectorField’ OFFO |
Hi,
Compiler tried to give you a hint: Code:
FaceAreaVector.C:53:5: error: invalid use of incomplete type ‘const struct Foam::surfaceVectorField’ Are you sure you have got only 39 internal faces? |
Thank you so much. I can compile it now.
39 is just an assumed for code debugging. But this is also my question. 39 is hard coded, how can I make the code know automatically about the number of internal faces and boundary faces? Thank you. Quote:
|
Hi,
fvMesh has nInternalFaces (http://foam.sourceforge.net/docs/cpp...b8ffda0dced7bb) and nFaces (http://foam.sourceforge.net/docs/cpp...153de7da0e92e8) methods inherited from primitiveMesh. You can use Lists (http://foam.sourceforge.net/docs/cpp/a01366.html) to store x, y, and z. It has append method, which automatically adjusts the size of list. Also you can write coordinates directly to a file without intermediate storage. |
Thank you so much for your help. When I also tried to write out the area vector of boundary faces, the code is as follows:
Code:
/*---------------------------------------------------------------------------*\ Code:
FaceAreaVector.C:85:9: error: ‘const class Foam::polyPatch’ has no member named ‘Sf’ OFFO Quote:
|
Well, you can try using documentation without my help. It is true, polyPatch does not have Sf method, it has faceAreas method (http://foam.sourceforge.net/docs/cpp...10863a66b838fa).
Alternatively, you can explicitly demand mesh.boundaryMesh()[patchI] as const fvPatch& using assignment before nested loop, fvPatch has Sf method (http://foam.sourceforge.net/docs/cpp...6f373b993f0690). |
All times are GMT -4. The time now is 05:34. |