Hello,
sounds trivial, but ho
Hello,
sounds trivial, but how do I create a volScalarField, if I have a Field<double> and a volMesh? Here mesh.Sf() and U are two volVectorFields from which the operator& calculates the inner product, a scalar field: Field<double> Phi=mesh.Sf() & U; But later I need a volScalarField with the values of Phi, and I see no possibility to construct this volScalarField although all geometric information is available. The problem is that every GeometricField<...> constructor requires an IOobject, and every IOobject constructor requires a filename, so that GeometricFields can never be generated on the fly (unless copied from another GeometricField), but must always be read from a file. Is this true? N. Blanc |
correction:
1)
"Here mesh.
correction:
1) "Here mesh.Sf() and U are two volVectorFields..." should read "Here mesh.Sf() and U are a surfaceScalarField and a volVectorField..." 2) "But later I need a volScalarField with the values of Phi, and I see no possibility to construct this volScalarField..." should read "But later I need a surfaceScalarField with the values of Phi, and I see no possibility to construct this surfaceScalarField..." Still the question is: How can I create a GeometricField from a Field and a Mesh without reading from an IOobject/file? Best, N. Blanc |
GeometricField.H has all the c
GeometricField.H has all the constructors. There are many. For an example on how to create a field without reading, check this file:
src/finiteVolume/lnInclude/createPhi.H To reconstruct a face field: fvc::reconstruct(phi); or fvc::average(phi); Depending on what you want to achieve. |
Thank you, Eugene!
My mistake
Thank you, Eugene!
My mistake was that I thought an IOobject is always initialized from a file. The example createPhi.H made things clearer. NB |
All times are GMT -4. The time now is 09:53. |