function of volMesh class
Hi!
In the finiteVolume method the volMesh class can be found, which is derived from GeoMesh. Code:
class volMesh Code:
label size() const I hope someone can help! Best Kathrin |
Convenience, perhaps.
The size(const Mesh&) member is a static function that doesn't require an actual object of the class to be instantiated, so it's good from the stand-point of efficiency. When the size() function is called, there is an implicit assumption that an object _does_ actually exist, and that the reference to mesh_ is valid. So therefore, re-use the other function! |
Quote:
Thanks a LOT for the answer, but I'm not sure that it works like that... Code:
static label size(const Mesh& mesh) Code:
template <class MESH> Also, typedef should be used to shorten names which are complicated for better use, like the volScalarField from GeometricField<blah, blah>... why Mesh from MESH? There's a lot of weird stuff down below in the code, I think. |
Quote:
I also meant that an object of the volMesh class does not need to exist for the static label size(const Mesh& mesh) function to work - so my theory still stands. I agree that the Mesh& reference must be either a primitiveMesh or its derivative, because this is a volMesh, whose intent is to ensure that variables are stored at cells. In contrast, take a look at the equivalent function in pointMesh.H, which stores variables at mesh points, or the areaMesh class in the finiteArea library, which stores them at patch-faces. Things like this are particularly important during the mesh-to-mesh mapping stage, where sizes need to match, depending on the location of the mesh where variables are stored, and yet they must be generic enough to work for all types of meshes - take a look at MapGeometricFields.H to see how this mechanism works. Hope this helps. |
Hi Sandeep,
the forum settings were set for my previous e-mail. :o :D It's used for mapping and the sizes need to correspond. Thanks! MESH and Mesh are equivalent types, which kind of confused me (don't know why, don't ask): Code:
56 const MESH& mesh_; |
All times are GMT -4. The time now is 05:50. |