internalField of a volField & geoMesh
Dear All,
I have some questions and I would appreciate if someone help me. Q1: I am a little bit confused about the difference between volField and it's associated internalField. I can't see any difference although many claims that there is (I think that should be the case). In the GeometricField.H we can find the definition of the interalField as Code:
39 Foam::GeometricField<Type, PatchField, GeoMesh>::Internal& Code:
volVectorField U Code:
58539 So may someone elaborate a little bit on the difference between them. Q2: where does GeoMesh class reside in the mesh heirarchy in OpenFoam or simply what is the relation between GeoMesh and fvMesh. I tried to find that by looking into the cpp docs but I caouldn't figure out. Q3: What is the difference/relation between GeometricField and DimensionedField? Best regards. |
Hi,
Won't be able to fully answer your question but can give some input. Q3) GeometricField is derived from DimensionedField. To my basic understanding it adds boundary field to DimensionedField and I guess a bunch of other functions and parameters that are associated with it. Code:
template<class Type, template<class> class PatchField, class GeoMesh> Code:
class volMesh Cheers, Ben |
Dear Ben,
Thanks for your contribution. It really helps. Can you please elaborate on this: Quote:
Best regards. |
I'm not sure how to give you a good answer as I doubt if I have a proper understanding of the matter at hand. But I think reading the programmer's guide might help:
http://foam.sourceforge.net/docs/Gui...mmersGuide.pdf Go to page 27 and start reading from section 2.2 |
Quote:
Hi, Well I used the terminology that is used in description of the GeoMesh file ($FOAM_SRC/OpenFOAM/meshes/GeoMesh/GeoMesh.H). Anyways, I believe that what it means is that GeoMesh is simply a class out of which all of the other mesh classes are derived. My guess is that they call it wrapper because it does not have the regular *.H *.C code structure and it does not really do much. Anyways, we are delving into semantics here (which I probably would be butchered for by proper C++ programmers :D). As I have said classes like volMesh, surfaceMesh, pointMesh, etc. are derived from GeoMesh class/wrapper. For the future hierarchy questions I would recommend checking doxygen page of OpenFOAM as it gives a graphical representation of how parent-daughter classes are connected -> http://openfoam.com/documentation/cpp-guide/html/ volMesh: http://openfoam.com/documentation/cp...ml/a03059.html Hope this helps. Cheers, Ben |
O.K. I think now it's clear enough. Thanks again Ben.
Still question 1 if any one can help |
Better said that GeoMesh is a template parameter, not a wrapper.
|
A volField has dimensions, an internalField and a boundaryField. You'll see this in the field files (eg, 0/U etc).
There are various ways that you could use to have these three bits of information in a class: bundle each as a data member, use multiple inheritance, inherit one or more and add the balance as data members. You could, for instance, think of a volField as an internal field with an additional boundary field 'attached' to it. |
Quote:
|
Quote:
As you said volMesh does inherit from the GeoMesh<fvmesh>. But if you read about the GeoMesh template its actually GeoMesh<MESH>, where MESH is just an identifier for a data type/class that GeoMesh <MESH> template will me 'templated' on. GeoMesh can be templated on, as in our case, fvMesh but also on other types of mesh like polyMesh etc. Now the GeoMesh template is a wrapper class. A wrapper class mean that it will extend the functionalities of 'something' either by giving more functions or changing the interface to the 'somethig' (so its like an API). That 'something' here in our case is fvMesh, but it could also be surfMesh, faMesh, polymesh etc... and the GeoMesh further 'extends' all these different types of meshes by allowing us to deal with all of them in a similar way(ie we don't have to worry if we have a fvMesh or faMesh or polyMesh etc when we 'wrape' it using GeoMesh). You are right in saying that when there is fvMesh we don't actually need volMesh. But volMesh class is created so as to make our life easy in accessing certain info required for FV discritization (for example size() function in volMesh) . That info is ofcourse already present in fvMesh but if we had to access it from fvMesh we would have to write few lines of code. Since this info is required quite regularly a separate class was created called volMesh. Now the info that volMesh deals with has to do with cell centers and it doesn't deal with other info that are present in fvMesh like face centers etc. (That will be delt with by surfaceMesh) Note: Compare volMesh, surfaceMesh, pointMesh with volField<type>, surfaceField<type> and pointField<type> to understand more. If someone with more knowledge can verify what I have written that will be great. |
All times are GMT -4. The time now is 10:59. |