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

Manipulation of cellvalue of a geometricField

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 25, 2008, 09:39
Default Hi to everybody! I'm trying t
  #1
Senior Member
 
Ivan Flaminio Cozza
Join Date: Mar 2009
Location: Torino, Piemonte, Italia
Posts: 207
Rep Power: 9
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, 13:20
Default I don't think that wmake had a
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
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, 13:58
Default Thanks Bernhard, now it works.
  #3
Senior Member
 
Ivan Flaminio Cozza
Join Date: Mar 2009
Location: Torino, Piemonte, Italia
Posts: 207
Rep Power: 9
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

Thread Tools
Display Modes

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 On
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 1 January 22, 2009 12:12
Create GeometricField without IOobject nadine OpenFOAM Running, Solving & CFD 3 August 15, 2008 09:24
Duplicate GeometricField reimund OpenFOAM Running, Solving & CFD 9 June 9, 2008 13:47
Accessing data of geometricField bird OpenFOAM Running, Solving & CFD 1 August 28, 2007 18:21
Table Manipulation furkan CD-adapco 0 April 4, 2006 10:23


All times are GMT -4. The time now is 01:49.