CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Manipulation of cellvalue of a geometricField

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 25, 2008, 10:39
Default Hi to everybody! I'm trying t
  #1
Senior Member
 
Ivan Flaminio Cozza
Join Date: Mar 2009
Location: Torino, Piemonte, Italia
Posts: 210
Rep Power: 18
ivan_cozza is on a distinguished road
Send a message via MSN to ivan_cozza
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!!!
ivan_cozza is offline   Reply With Quote

Old   September 25, 2008, 14:20
Default I don't think that wmake had a
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
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
gschaider is offline   Reply With Quote

Old   September 25, 2008, 14:58
Default Thanks Bernhard, now it works.
  #3
Senior Member
 
Ivan Flaminio Cozza
Join Date: Mar 2009
Location: Torino, Piemonte, Italia
Posts: 210
Rep Power: 18
ivan_cozza is on a distinguished road
Send a message via MSN to ivan_cozza
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!!!
ivan_cozza is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 11:30.