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

macro definition about typename

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 21, 2014, 23:33
Post macro definition about typename
  #1
Member
 
xuhe-openfoam
Join Date: Aug 2013
Location: DaLian,china
Posts: 82
Rep Power: 3
bieshuxuhe is on a distinguished road
hi !
I am interested in a line of code , that is
Code:
defineTemplateTypeNameAndDebug(volScalarField, 0);
Then I check the source guide , there is
Code:
00154 #define defineTemplateTypeNameAndDebug(Type, DebugSwitch)                     \
00155     defineTemplateTypeNameAndDebugWithName(Type, #Type, DebugSwitch)
Note the red #Type , I guess it could for example get volScalarField to become the string "volScalarField" . And the string "volScalarField" will be put into the typeName !
please help me : Am I right ?
I never know the symbol # could be used for that ! is it defined in openfoam or is it default C++ behavior ?

thank you very much!
bieshuxuhe is offline   Reply With Quote

Old   April 22, 2014, 23:17
Default
  #2
Member
 
xuhe-openfoam
Join Date: Aug 2013
Location: DaLian,china
Posts: 82
Rep Power: 3
bieshuxuhe is on a distinguished road
hi !
I have found it !I am right ! it is default C++ behavior !Stringfication
#Type is "Type"
for example #volScalarField is "volScalarField"

thanks!
bieshuxuhe is offline   Reply With Quote

Reply

Tags
definetemplatetypename

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
StarCCM+ Command line options and Macro execution isidp STAR-CCM+ 8 January 29, 2013 06:00
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21
HELP! Fluent macro definition hamish888 FLUENT 1 November 1, 2010 07:12
Macros TypeName() , ClassName(), defineTypeNameAndDebug()... jaswi OpenFOAM Running, Solving & CFD 0 March 23, 2009 08:01
Macro problem cfddummy CD-adapco 1 April 9, 2007 12:37


All times are GMT -4. The time now is 02:20.