mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Merge pull request #475 from JonWel/Julia-0.3-wrapper
Julia 0.3 wrapper, fixes #473 Thank you for the contribution.
This commit is contained in:
@@ -14,7 +14,7 @@ Option A: Calling shared library directly
|
||||
|
||||
.. warning::
|
||||
|
||||
For now, only 64-bit architectures are supported, and you need Julia version >= 0.4
|
||||
For now, only 64-bit architectures are supported.
|
||||
|
||||
Download a precompiled shared library appropriate to the computer you are using from :sfdownloads:`sourceforge <shared_library>` or the development version from :sfnightly:`the nightly snapshots <shared_library>`.
|
||||
|
||||
@@ -63,4 +63,4 @@ Usage::
|
||||
User-Compiled Binaries
|
||||
======================
|
||||
|
||||
Build the 64-bit shared library for your architecture following the instructions at :ref:`shared_library`.
|
||||
Build the 64-bit shared library for your architecture following the instructions at :ref:`shared_library`.
|
||||
|
||||
23
wrappers/Julia/0.3/CoolProp.jl
Normal file
23
wrappers/Julia/0.3/CoolProp.jl
Normal file
@@ -0,0 +1,23 @@
|
||||
module CoolProp
|
||||
|
||||
export F2K, HAPropsSI, PropsSI, PhaseSI
|
||||
|
||||
function F2K(TF::Float64)
|
||||
return ccall( (:F2K, "CoolProp"), Cdouble, (Cdouble,), TF)
|
||||
end
|
||||
|
||||
function HAPropsSI(Output::String, Name1::String, Value1::Float64, Name2::String, Value2::Float64, Name3::String, Value3::Float64)
|
||||
return ccall( (:HAPropsSI, "CoolProp"), Cdouble, (Ptr{Uint8},Ptr{Uint8},Float64,Ptr{Uint8},Float64,Ptr{Uint8},Float64), Output,Name1,Value1,Name2,Value2,Name3,Value3)
|
||||
end
|
||||
|
||||
function PropsSI(Output::String, Name1::String, Value1::Float64, Name2::String, Value2::Float64, Fluid::String)
|
||||
return ccall( (:PropsSI, "CoolProp"), Cdouble, (Ptr{Uint8},Ptr{Uint8},Float64,Ptr{Uint8},Float64,Ptr{Uint8}), Output,Name1,Value1,Name2,Value2,Fluid)
|
||||
end
|
||||
|
||||
function PhaseSI(Name1::String, Value1::Float64, Name2::String, Value2::Float64, Fluid::String)
|
||||
outstring = Array(Uint8, 255)
|
||||
val = ccall( (:PhaseSI, "CoolProp"), Int32, (Ptr{Uint8},Float64,Ptr{Uint8},Float64,Ptr{Uint8}, Ptr{Uint8}, Int), Name1,Value1,Name2,Value2,Fluid,outstring,length(outstring))
|
||||
return bytestring(convert(Ptr{Uint8}, outstring))
|
||||
end
|
||||
|
||||
end #module
|
||||
@@ -20,4 +20,4 @@ function PhaseSI(Name1::String, Value1::Float64, Name2::String, Value2::Float64,
|
||||
return bytestring(convert(Ptr{UInt8}, outstring))
|
||||
end
|
||||
|
||||
end #module
|
||||
end #module
|
||||
Reference in New Issue
Block a user