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/)
-   -   create a new field inside a tmp<class> member function (https://www.cfd-online.com/Forums/openfoam-programming-development/152339-create-new-field-inside-tmp-class-member-function.html)

roadRunner April 29, 2015 04:39

create a new field inside a tmp<class> member function
 
Hello,
I want to create a new field inside tmp<volVectorField> class::func()
assign it to existing vector field, do some operations on it end return the result.

So far, I was unable to do this, or figure out how to do it. I can create a new field, and assign a value. And after that I can only return it, and not access it again. example:
tmp<class> func() const {
return (
new class("Name", a + b)
);
}

Where I would like to do some other operations on Name before I return it.
Is that a silly thing to do?
Thanks for reading


All times are GMT -4. The time now is 02:41.