diff --git a/cleedpy/cleed/src/leed.c b/cleedpy/cleed/src/leed.c index 7e02eb9..67d7d08 100644 --- a/cleedpy/cleed/src/leed.c +++ b/cleedpy/cleed/src/leed.c @@ -35,6 +35,10 @@ real ** leed( struct eng_str eng; + // Printing stuff + inp_showbop(bulk, over, phs_shifts); + return 0; + eng.ini = energy_list[0]; eng.stp = energy_list[1] - energy_list[0]; eng.fin = energy_list[energy_list_size-1]; @@ -235,3 +239,15 @@ real ** leed( return iv_curves; } + + +int my_test_function(int a, int b, struct cryst_str * bulk){ + printf("vr: %lf\n", bulk->vr); + printf("vi: %lf\n", bulk->vi); + + printf("\nbulk 2-dim. unit cell:\n"); + printf("a1: (%7.4lf %7.4lf)\n", bulk->a[1]*BOHR, bulk->a[3]*BOHR); + printf("a2: (%7.4lf %7.4lf)\n", bulk->a[2]*BOHR, bulk->a[4]*BOHR); + + return a+b; +} diff --git a/cleedpy/cleed/test_cleed.c b/cleedpy/cleed/test_cleed.c index 6713063..4e226ed 100644 --- a/cleedpy/cleed/test_cleed.c +++ b/cleedpy/cleed/test_cleed.c @@ -240,14 +240,6 @@ FILE *res_stream; mk_cg_coef (2*v_par->l_max); mk_ylm_coef(2*v_par->l_max); -#ifdef CONTROL - fprintf(STDCTR, "(LEED_TEMP): E_ini = %.1f, E_fin = %.1f, E_stp %.1f\n", - eng->ini*HART, eng->fin*HART, eng->stp*HART); - - //fprintf(STDCTR, "(LEED_TEMP): lset = %d\n", n_set); -#endif - - // Construct energy list energy_list_size = (eng->fin - eng->ini)/eng->stp + 1; energy_list = (real *) malloc(energy_list_size * sizeof(real)); diff --git a/cleedpy/interface/cleed.py b/cleedpy/interface/cleed.py index 50bfa5d..d31b8ac 100644 --- a/cleedpy/interface/cleed.py +++ b/cleedpy/interface/cleed.py @@ -51,12 +51,15 @@ class Crystal(Structure): ("vr", c_double), ("vi", c_double), ("temp", c_double), + # Not used anymore + # From here ("n_rot", c_int), ("rot_axis", c_double * 4), ("n_mir", c_int), ("m_plane", POINTER(c_double)), ("alpha", POINTER(c_double)), ("symmetry", c_int), + # To here ("a", c_double * 5), ("a_1", c_double * 5), ("area", c_double), @@ -180,9 +183,20 @@ def generate_crystal_structure(input: AtomParametersVariants) -> Crystal: raise ValueError("Not implemented") def call_cleed(): - path = Path(cleedpy.__file__).parent / "cleed" / "build" / "lib" / "libcleed.so" + path = Path(cleedpy.__file__).parent / "cleed" / "build" / "lib" / "libcleed.dylib" lib = cdll.LoadLibrary(str(path)) - lib.leed + + lib.my_test_function.argtypes = [c_int, c_int, POINTER(Crystal)] + lib.my_test_function.restype = c_int + + bulk = Crystal() + bulk.vr = 1.0 + bulk.vi = 2.0 + bulk.temp = 300.0 + + bulk.a = (0.0, 1.0, 2.0, 3.0, 4.0) + + print("Restul is ", lib.my_test_function(1, 2, bulk)) if __name__ == "__main__": diff --git a/examples/cleed_example_old/run.sh b/examples/cleed_example_old/run.sh index 52374d9..854586a 100755 --- a/examples/cleed_example_old/run.sh +++ b/examples/cleed_example_old/run.sh @@ -1,4 +1,4 @@ export CLEED_PHASE=./PHASE -EXECUTABLE=../../cleedpy/cleed/build/test_cleed +EXECUTABLE=../../cleedpy/cleed/build/bin/test_cleed ${EXECUTABLE} -i Ni111_Cu.inp