Hello, sounds trivial, but ho
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?
correction: 1) "Here mesh.
"Here mesh.Sf() and U are two volVectorFields..."
"Here mesh.Sf() and U are a surfaceScalarField and a volVectorField..."
"But later I need a volScalarField with the values of Phi, and I see no possibility to construct this volScalarField..."
"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?
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:
To reconstruct a face field:
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.
|All times are GMT -4. The time now is 15:45.|