null volScalarField
Since OF2.2 there are a lot of changes to the thermophysicalModels. We are running libs here derived from basicThermo which requires now the specification of several virtual functions. I want to solve this by returning NULL pointer fields. Unfortunately I am not able to clearify how a NULL volScalarField can be returned. Does anyone know this?
Thanks in advance |
Hi Fabian,
In such cases, where certain functions need implementation, but I know that they will never be used/does not make sense, I use the following in the source code: Code:
notImplemented("<some string describing the issue>"); Code:
return <some object>; Niels |
Hi,
return volScalarField::null(); works fine (as well for volScalarField than for tmp<volScalarField>) |
I met again this issue. The ::null() actually works, but I have problems to check, whether it is set or not.
What I am using now is: (schematic) Code:
void request_data(autoPtr<volScalarField> data) |
Be aware that autoPtr takes over control of the prior associated pointer. Instead of autoPtr its better to use tmp. You can use the same syntax, just replace autoPtr with tmp. Instead the set function you have to use data = tmp<volScalarField>(&<object-you-want-to-return);
|
All times are GMT -4. The time now is 06:47. |