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

macro definition about typename

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

Like Tree2Likes
  • 2 Post By bieshuxuhe

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 22, 2014, 00:33
Post macro definition about typename
  #1
Member
 
xuhe-openfoam
Join Date: Aug 2013
Location: DaLian,china
Posts: 82
Rep Power: 12
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 23, 2014, 00:17
Default
  #2
Member
 
xuhe-openfoam
Join Date: Aug 2013
Location: DaLian,china
Posts: 82
Rep Power: 12
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!
Michael@UW and fly_light like this.
bieshuxuhe is offline   Reply With Quote

Reply

Tags
definetemplatetypename

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macros TypeName() , ClassName(), defineTypeNameAndDebug()... jaswi OpenFOAM Running, Solving & CFD 2 June 15, 2020 11:52
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 13:21
HELP! Fluent macro definition hamish888 FLUENT 1 November 1, 2010 07:12
Macro problem cfddummy Siemens 1 April 9, 2007 13:37


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