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

How to include external packages

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 6, 2016, 05:49
Default How to include external packages
  #1
New Member
 
Anders Simonsen
Join Date: Sep 2013
Posts: 18
Rep Power: 12
ASimonsen is on a distinguished road
Hi

I'm facing a problem with including some packages in a UDF. I'm looking for a general way or description of how the packages are found and how to include them in the UDF.

All UDF start with:
#include "udf.h"

However, if I want to include other packages such as iostream, I've tried:
#include "iostream"
#include <iostream>
#include "iostream.h"
#include <iostream.h>
, but everytime I try to compile the UDF within Fluent, I get the following errors:

C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xtgmath.h(214) : warning C4602: #pragma pop_macro : 'new' no previous #pragma push_macro for this identifier
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\cmath(23) : error C2061: syntax error : identifier 'abs'
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\cmath(23) : error C2059: syntax error : ';'
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\cmath(23) : error C2061: syntax error : identifier 'acos'
...
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\cmath(53) : error C2061: syntax error : identifier 'erf'
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\cmath(53) : error C2061: syntax error : identifier 'erfc'
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\cmath(53) : fatal error C1003: error count exceeds 100; stopping compilation

It seems like a problem with cmath. I'm using Fluent v. 17.1.

Best regards Anders
ASimonsen is offline   Reply With Quote

Old   September 5, 2016, 10:20
Default
  #2
New Member
 
Join Date: Feb 2011
Location: France
Posts: 9
Rep Power: 15
gghazal is on a distinguished road
Hi Anders,
Have you managed to solve your problem ?
I am facing exaclty the same issue...
Ghassan
gghazal is offline   Reply With Quote

Old   September 5, 2016, 10:42
Default
  #3
New Member
 
Anders Simonsen
Join Date: Sep 2013
Posts: 18
Rep Power: 12
ASimonsen is on a distinguished road
Quote:
Originally Posted by gghazal View Post
Hi Anders,
Have you managed to solve your problem ?
I am facing exaclty the same issue...
Ghassan
Hi. No, I haven't found a solution, so I'm not using that package, though I can't remember, why I wanted it. :P
ASimonsen is offline   Reply With Quote

Old   September 7, 2016, 11:38
Default
  #4
Member
 
ERMACORA Florian
Join Date: May 2016
Posts: 39
Rep Power: 9
flo90000 is on a distinguished road
Quote:
Originally Posted by ASimonsen View Post
Hi
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xtgmath.h(214) : warning C4602: #pragma pop_macro : 'new' no previous #pragma push_macro for this identifier
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\cmath(23) : error C2061: syntax error : identifier 'abs'
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\cmath(23) : error C2059: syntax error : ';'
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\cmath(23) : error C2061: syntax error : identifier 'acos'
...
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\cmath(53) : error C2061: syntax error : identifier 'erf'
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\cmath(53) : error C2061: syntax error : identifier 'erfc'
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\cmath(53) : fatal error C1003: error count exceeds 100; stopping compilation
Quote:
Originally Posted by gghazal View Post
Hi Anders,
Have you managed to solve your problem ?
I am facing exaclty the same issue...
Ghassan
I think you need to include the library "math.h" be cause he doesnt understand the "abs" which for absolute value and "acos" for inverse cosine and "erf" or erfc are some functions of that library. if I dont make a mistake.
flo90000 is offline   Reply With Quote

Reply

Tags
include


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
CGNS Compiling Diego Main CFD Forum 17 December 21, 2014 01:40
cyclic boundary conditions for FSI kanuk OpenFOAM Programming & Development 10 April 25, 2014 02:52
OpenFoam install script Error during paraFoam installation SePe OpenFOAM Installation 10 June 19, 2010 15:15
critical error during installation of openfoam Fabio88 OpenFOAM Installation 21 June 2, 2010 03:01
Problems in compiling paraview in Suse 10.3 platform chiven OpenFOAM Installation 3 December 1, 2009 07:21


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