The volMesh
class is defined in volMesh.H
:
1 | class volMesh |
It is a subclass of GeoMesh
when the template type of GeoMesh
is fvMesh
. The class GeoMesh
is defined in GeoMesh.H
as:
1 | template<class MESH> |
The MESH
here will be substitute as fvMesh
. The fvMesh
is also a class defined in fvMesh.H
:
1 | class fvMesh |
The reason why I dig into this part of the code is because when e.g. we have a object called vf
with a type of GeometricField<Type, fvPatchField, volMesh>& vf
. And if we call vf.mesh()
, it will try to call mesh()
function of the GeometricField
class. It should be noted here, the GeoMesh
has a type of volMesh
. But GeometricField
dose not have a function called mesh()
. But GeometricField
inherits class DimensionedField
:
1 | template<class Type, template<class> class PatchField, class GeoMesh> // GeoMesh <=> volMesh |
And unsurprisingly, in DimensionedField
has a access member function called mesh()
:
1 | // in DimensionedField.H |
And the type Mesh
is defined as:
1 | typedef typename GeoMesh::Mesh Mesh; |
As what it shown before, GeoMesh::Mesh
is defined in class GeoMesh
as:
1 | typedef MESH Mesh; |
Here the MESH
need to be specified with a certain type. As specified in volMesh
class, the MESH type here is fvMesh
. Therefore, MESH
, Mesh
are all fvMesh
. So, vf.mesh()
has a type of fvMesh
.