Giter Club home page Giter Club logo

Comments (6)

sundmanbo avatar sundmanbo commented on June 12, 2024

Dear Teslos

I have downloaded your modifications and as it is a long time since I used
linux I have some difficulties testing your modification on Windows. I
will continue working on it, hopefully I can sort it out as it looks very
nice.

My email is [email protected] if you want to contact me directly.

Best wishes

Bosse

2015-01-11 14:21 GMT+01:00 ∃teslos [email protected]:

Dear Prof. Sundman,

I have finished the iso_c_binding for the new TQ interface. The new zip
file you can download from my git repo
https://github.com/Teslos/opencalphad. The main iso binding interface is
in liboctqisoc.F90.
I am also new to git versioning system, so I hope that I properly merged
your version with my modified version.
There still some open issuses with the with deprecated functions for
example tqgcom, which currently don't work in the this version of TQ
interface. But I suppose you will update these functions or removed them in
a new version.
The module variables which are now global to liboctq interface are
exported in iso_c_binding as global variables in C program. I think this is
not a good design decision, but iso_c_binding standard does not give any
other option to do this (at least I don't know of any). Currently, all
global variables and function are prefixed with c_ for example c_ntup. This
reduces the probability that it will clash with names of other variables in
C program but it doesn't eliminate it. Thank you very much for the
opencalphad project!!

Best regards,
∃t


Reply to this email directly or view it on GitHub
#11.

from opencalphad.

Teslos avatar Teslos commented on June 12, 2024

Dear Prof. Sundman,

The first test version of Python interface to TQ using cython is finished. You can test it by building the library with python setup.py build_ext --inplace. Also, liboceq.a has to be in local directory. This creates pyoctq.so that can be imported in python script. For building I have used Cython version 0.21.2 and Python 2.7.9 on mac os x. Running python test_pyoctq.py gives this output:

System with 2 elements: ['FE', 'NI']
and 2 phases: 
['LIQUID', 'FCC_A1']
 Mode :            1
 Composition set(s) created:            1
 Grid minimization:    16 gridpoints   4.6200E-04 s and       0 clockcycles
Phase change: its/add/remove:     7    1    0
Phase change: its/add/remove:    11    0    2
Equilibrium calculation   16, its,   3.3430E-03 s and       3 clockcycles
Amount of 2 phases:
0.000000000
1.000000000
Phase : LIQUID 
Stable phase : LIQUID, amount: 1.000000
 Phase :            1           1
 FE : 0.243154, 
 NI : 0.756846, 
Phase : FCC_A1 
Stable phase : FCC_A1, amount: 0.300000
 Phase :            2           1
 FE : 0.500000, 
 NI : 0.500000, 
Component, mole fraction and chemical potential
FE        0.500000        -48015.506985
NI        0.500000        -54794.509223

I am still working on the problem of one and zero array offset, as defaults in F90 and python are different..So I think it would be wise to set the index of the phases in python from 0--n and not 1--n as in the fortran code.

Best regards,
∃t

from opencalphad.

richardotis avatar richardotis commented on June 12, 2024

@Teslos For this case, have you considered using f2py?

from opencalphad.

Teslos avatar Teslos commented on June 12, 2024

Hi Richard,
Yes I have considered using f2py, but it seems that it is not actively developed. The Cython seems to be good alternative because after doing C interface with iso_c_binding you can get Cython support almost for free. So you get bindings for C and Python...
Do you think that it is better to use f2py? There is also fwrap library that looks good...

Best regards,
∃t

from opencalphad.

richardotis avatar richardotis commented on June 12, 2024

I do not have very much experience with any of them. I only ask about f2py because it's what the developers of numpy use and it's a very well-known and high-quality Python library.

from opencalphad.

Teslos avatar Teslos commented on June 12, 2024

Yes you are right, but I think fwrap was developed to replace f2py, but it is also not updated for several years...

Best regards,
∃t

from opencalphad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.