CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums

Function component in field

Register Blogs Community New Posts Updated Threads Search

Rate this Entry

Function component in field

Posted June 9, 2017 at 04:10 by kindle
Updated June 9, 2017 at 12:05 by kindle

On the explaination of laplacianFoam
This is extracted from the blog dyfluid.com.

Code:
volVectorField gradT(fvc::grad(T));//创建gradT场,其值为fvc::grad(T),即为T显性离散的值          
volScalarField gradTx        
(             IOobject             
              ("gradTx",
                 runTime.timeName(),
                 DimensionedFieldmesh,
                 IOobject::NO_READ,
                 IOobject::AUTO_WRITE
              ),
             gradT.component(vector::X)         
);//创建gradTx场,其值为矢量gradT的x的值
Function component is defined in class GeometricField.H (but in class GeometricBoudnaryField). It takes a
Code:
 const direction
and return a component typed GeometricField.

Well, since it is declared in GeometricBoudnaryField (not really class GeometricField). Let's see the mother class of GeometricField which is DimensionedField and she has a function component which does practically the same thing except that a DimensionedField is returned instead of GeometricField.

So, going back to the construction of object gradTx. I found one constructor corresponding to what is written above
Code:
        //- Construct as copy resetting IO parameters
        GeometricField
        (
            const IOobject&,
            const GeometricField<Type, PatchField, GeoMesh>&
        );
Is it legal to pass a mother class object to son class by reference ?

Maybe this one explains https://manski.net/2012/02/cpp-refer...d-inheritance/
Posted in programming
Views 2286 Comments 0 Edit Tags Email Blog Entry
« Prev     Main     Next »
Total Comments 0

Comments

 

All times are GMT -4. The time now is 15:07.