|
[Sponsors] |
how to rename a field defined from others fields ? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 25, 2012, 09:34 |
how to rename a field defined from others fields ?
|
#1 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
Hi!
I defined a symmetric tensor field symGradU from a field U Code:
volSymmTensorField symGradU = twoSymm(fvc::grad(U)); Code:
Info << "Field symGradU name = " << symGradU.name() << endl; Field symGradU name = twoSymm(grad(U)) I want to change this name ("symGradU"), in particular to write the output correctly. I tried Code:
symGradU.name() = "symGradU" ; Do you know a simple manner to rename a field ?? Regards, Cyp |
|
April 26, 2012, 10:50 |
|
#2 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
You can do it during construction, (though it must be possible to do it afterwards too...). From GeometricField.H:
Code:
//- Construct as copy resetting IO parameters GeometricField ( const IOobject&, const GeometricField<Type, PatchField, GeoMesh>& ); //- Construct as copy resetting name GeometricField ( const word& newName, const GeometricField<Type, PatchField, GeoMesh>& ); Code:
volSymmTensorField symGradU ( "symmGradU", twoSymm(fvc::grad(U)) );
__________________
~~~ Follow me on twitter @DavidGaden |
|
April 26, 2012, 11:32 |
|
#3 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
Thank you very much ! It is exactly what I was looking for !
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
problems after decomposing for running | alessio.nz | OpenFOAM | 7 | March 5, 2021 04:49 |
Need help evaluating field by interpolation with a "lookup table" | JohnRHawk | OpenFOAM Programming & Development | 2 | June 28, 2011 13:27 |
Vector Fields and Operators on the Boundary | Noggin | OpenFOAM Programming & Development | 3 | February 17, 2011 10:43 |
writing fields with field types "kqRWallFunction" | ubaid | OpenFOAM | 0 | October 2, 2010 14:22 |
Flow field measurement in turbomachinery! | Wanlai Lin | Main CFD Forum | 3 | September 3, 1999 12:06 |