|
[Sponsors] |
Manipulation of cellvalue of a geometricField |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 25, 2008, 10:39 |
Hi to everybody!
I'm trying t
|
#1 |
Senior Member
|
Hi to everybody!
I'm trying to write a postprocessing utility that modify cell-by-cell the values of a volVectorField, like this: forAll(ut,celli) { ...operations... ut[celli] += 2.0*ampU*cos(xdotk + phi)*sig; } where ampU, xdotk and phi are dimensionedScalar and sig a dimensionedVector. When I compile it, wmake told me that it's wrong. Maybe it's because ut[celli] is not the correct way to access to the cell-value of a volVectorField? Please, help me!!! |
|
September 25, 2008, 14:20 |
I don't think that wmake had a
|
#2 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
I don't think that wmake had a problem. It probably was the compiler. But that's nitpicking.
The problem is that the result on the right hand side is a dimensionedVector while the cell value is a plain vector. So you'll have to use the value() method to get the vector out of the dimensionedVector Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|
September 25, 2008, 14:58 |
Thanks Bernhard, now it works.
|
#3 |
Senior Member
|
Thanks Bernhard, now it works. I'm new in OF and C++, so I'm still having difficulties in thinking in terms of classes and methods, my Fortran background makes me think in terms of vectors and functions!
I really need a paradigm-shift!!! |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to convert from GeometricField to fvMatrix | waynezw0618 | OpenFOAM Running, Solving & CFD | 2 | January 8, 2021 17:35 |
Create GeometricField without IOobject | nadine | OpenFOAM Running, Solving & CFD | 3 | August 15, 2008 10:24 |
Duplicate GeometricField | reimund | OpenFOAM Running, Solving & CFD | 9 | June 9, 2008 14:47 |
Accessing data of geometricField | bird | OpenFOAM Running, Solving & CFD | 1 | August 28, 2007 19:21 |
Table Manipulation | furkan | Siemens | 0 | April 4, 2006 11:23 |