CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Where and how to create additional, temporary scalarFields? (https://www.cfd-online.com/Forums/openfoam-programming-development/253322-where-how-create-additional-temporary-scalarfields.html)

klausb December 6, 2023 16:10

Where and how to create additional, temporary scalarFields?
 
I need additional, temporary scalarFields of the same sizes and data types as diag() and lower() to store intermediate values during the creation of a custom preconditioner.

The sizes should be:
Code:

const label nCells = rD_.size(); // for the scalarFields like diag()
    const label nFaces = solver_.matrix().upper().size(); // for the scalarFields similar to lower()

Where and how should I create additional, temporary scalarFields considering, that they will be used in every timestep?


All times are GMT -4. The time now is 09:47.