[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TRNSYS-users] C++ Type in TRNSYS solving Differential equations



Patix,

I wonder that the TRNSYS developer group does not provide perfect TRNSYS.H. Why??
Anyway, I think that all arguments must be declared as a pointer, unless they are declared as a Value in FORTRAN.
Try the following declaration.

extern "C" __declspec(dllimport) void _cdecl SOLVEDIFFEQ(double* aa, double* bb, double* INIT_VALUE, double* END_VALUE, double* AVG_VALUE);

I have posted some articles for C++ component on my blog. Please check these articles if you like.
Unfortunately, these are written in Japanese. Try to read them with Google translation tool.
https://kankyoukei.blogspot.jp/2016/04/trnsyscc6.html
https://kankyoukei.blogspot.jp/2016/04/trnsys-cc7.html

Regards,
Yuichi Yasuda

On 2016/12/20 20:36, Patxi Sorbet Presentacion via TRNSYS-users wrote:

Hello Everyone,

I’m, currently dealing with the development of a new type, but not in the Fortran-based official way.

Up to now, I have developed several Types in C++ using information from templates that come included in the program folders, and some imagination.

For the moment, things went well this way.

But now I want to solve a differential equation calling the built-in routine SolveDiffEq(AA, BB, TI, TF, TBAR).

I may develop my own Finite difference scheme and go on, but I’m trying to take advantage from that kernel subroutine.

For the moment I have not found the right way (if it exists) to include the routine header in Trnsys.h, for later compiling and running in the generated dll. I guess It should be this way, but it doesn’t’t work when running trnexe.

 

extern "C" __declspec(dllimport) void _cdecl SOLVEDIFFEQ(double aa, double bb, double* INIT_VALUE, double* END_VALUE, double* AVG_VALUE);

 

If anyone has the same concerns, we may interchange information about how creating & compiling Types this way, without purchasing an IVF license. I will be very pleased to share my work.

Thanks in advance

Regards,

 

----------------------------------------------------------------------

Patxi Sorbet

Research Engineer

Solar Thermal Energy Department

NATIONAL RENEWABLE ENERGY CENTRE

Ciudad de la Innovación, 7 -31621         - Sarriguren (Navarra) Spain

www.cener.com

 

 

 

 

 



_______________________________________________
TRNSYS-users mailing list
TRNSYS-users@lists.onebuilding.org
http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org


--

株式会社クアトロ
http://qcd.co.jp/
ホームページリニューアルしました!!
安田 雄市
TEL 03-5768-6744
FAX 03-5768-6745
e-mail: yasuda@qcd.co.jp