CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

if (NNULLP(T_STORAGE_R_NV(t0, SV_UDSI_G(0))))

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 3, 2020, 07:12
Default if (NNULLP(T_STORAGE_R_NV(t0, SV_UDSI_G(0))))
  #1
Senior Member
 
Join Date: Feb 2020
Posts: 114
Rep Power: 6
lbj007 is on a distinguished road
I want to know what will happen if the gradient of uds is not allocated. Can it lead to that all the Statements relevant to C_UDSI_G will not be executed?or something else.

lbj007 is offline   Reply With Quote

Old   October 5, 2020, 01:23
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
NNULLP returns TRUE if storage is allocated for user-defined storage variable

in case the storage has not been allocated if statement will not be executed
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   October 5, 2020, 22:11
Default
  #3
Senior Member
 
Join Date: Feb 2020
Posts: 114
Rep Power: 6
lbj007 is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
NNULLP returns TRUE if storage is allocated for user-defined storage variable

in case the storage has not been allocated if statement will not be executed
so how do I know the statement is executed, can I add a printf statement to help me judge?so the NNULLP conditional judgment statement just help to let me know the storage has or hasn't been allocated,it won't affect the other code to be executed,am I right?
lbj007 is offline   Reply With Quote

Old   October 6, 2020, 03:42
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
NNULLP conditional i needed to prevent the case, when you read gradient (or any other variable) value , but memory was not allocated.
In that case you will get an error

you can put printf inside if statement,
it is recommended to use Message macro in fluent instead of printf
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   October 6, 2020, 05:58
Default
  #5
Senior Member
 
Join Date: Feb 2020
Posts: 114
Rep Power: 6
lbj007 is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
NNULLP conditional i needed to prevent the case, when you read gradient (or any other variable) value , but memory was not allocated.
In that case you will get an error

you can put printf inside if statement,
it is recommended to use Message macro in fluent instead of printf
so if I don't use NNULLP and memory is just not allocated,it will get an error,
then if I use NNULLP and memory is just not allocated,what it would show?
lbj007 is offline   Reply With Quote

Reply

Tags
udsi


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



All times are GMT -4. The time now is 09:13.