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

Where are Field<Type> operators defined

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 18, 2009, 16:01
Default Where are Field<Type> operators defined
  #1
New Member
 
Andrew Godfrey
Join Date: Mar 2009
Posts: 7
Rep Power: 17
agodfrey is on a distinguished road
Where can I find the code for operator+, operator-, operator*, operator/ for, say, a volScalarField for example? Surely, these are called when building the transport equations.

Programmer's Guide v1.5 (9 July 2008) says "Algebraic operations can be performed between Fields subject to obvious restrictions such as the fields having the same number of elements" (P-29)

I could re-compile Debug and step through, but can someone spare me the trouble? Thanks
agodfrey is offline   Reply With Quote

Old   June 19, 2009, 07:36
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Here you go. Doxygen will become your friend after a while.

http://foam.sourceforge.net/doc/Doxy...b6d65dfbddd227

Have a nice weekend,

Niels
ngj is offline   Reply With Quote

Old   June 19, 2009, 09:55
Default
  #3
New Member
 
Andrew Godfrey
Join Date: Mar 2009
Posts: 7
Rep Power: 17
agodfrey is on a distinguished road
Thanks for the reply, Niels.

Please let me see if I follow the code correctly by using operator/ as an example

1) Field.C includes "FieldFunctions.C"

2) FieldFunctions.C contains the line
BINARY_OPERATOR(Type, Type, scalar, /, divide)

3) BINARY_OPERATOR is defined in FieldFunctionsM.C as
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpFunc)

part of which compiles as

template<class Type>
tmp<Field<Type> > operator /
(
const UList<Type>& f1,
const UList<scalar>& f2
)
{
tmp<Field<Type> > tRes(new Field<Type>(f1.size()));
divide(tRes(), f1, f2);
return tRes;
}

4) If that's the case, then where is divide(tRes(), f1, f2); defined? I see a version is ops.H, but I'm not sure if I follow the syntax there.

Thanks
agodfrey 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
Creating new user defined material Vidya FLUENT 4 August 26, 2013 09:26
OpenFOAM13 for Mac OSX Darwin 104 hjasak OpenFOAM Installation 70 September 24, 2010 05:06
Please help, Error: No FSIN boundary conditions defined in the model. cfxuser1 CFX 1 April 29, 2009 15:36
Gradient of a User defined Variable Ramadas CFX 2 August 21, 2007 09:19
User Defined Scalars - Returning Values Carlos V. FLUENT 0 April 19, 2006 18:18


All times are GMT -4. The time now is 08:27.