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 Members List Search Today's Posts Mark Forums Read

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
Member
 
Join Date: Feb 2020
Posts: 77
Rep Power: 3
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: 1,679
Rep Power: 23
AlexanderZ 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
Member
 
Join Date: Feb 2020
Posts: 77
Rep Power: 3
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: 1,679
Rep Power: 23
AlexanderZ 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
Member
 
Join Date: Feb 2020
Posts: 77
Rep Power: 3
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

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



All times are GMT -4. The time now is 10:04.