1 /* This file is part of the hkl library.
3 * The hkl library is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
8 * The hkl library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with the hkl library. If not, see <http://www.gnu.org/licenses/>.
16 * Copyright (C) 2003-2017 Synchrotron SOLEIL
17 * L'Orme des Merisiers Saint-Aubin
18 * BP 48 91192 GIF-sur-YVETTE CEDEX
20 * Authors: Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>
22 #include <tap/basic.h>
23 #include <tap/float.h>
24 #include <tap/hkl-tap.h>
26 #include "hkl/ccan/generator/generator.h"
27 #include "hkl-geometry-private.h"
28 #include "hkl-trajectory-private.h"
32 static void stability(void)
35 HklGeometryList
*solutions
;
37 static struct Sample gaas
= {
39 .lattice
= Cubic(5.6533),
40 .ux
= -90.003382 * HKL_DEGTORAD
,
41 .uy
= 0.12907 * HKL_DEGTORAD
,
42 .uz
= -159.91372 * HKL_DEGTORAD
,
45 static struct Geometry gconfig
= \
46 SoleilSiriusKappa(1.458637,
47 -0.5193202, 64.7853160, 133.5621380, -80.9690000, -0.0223369, 30.0000299);
49 static struct Geometry gconfig2
= \
50 SoleilSiriusKappa(1.458637,
51 -0.5193202, 64.7853160, 133.5621380, 124.9690000, -0.0223369, 30.0000299);
53 /* move between each step */
54 static struct Trajectory tconfig1
= TrajectoryHklFromTo(0, 0, 1, 0, 0, 6, 11);
55 solutions
= Trajectory_solve(tconfig1
, gconfig
, gaas
, TRUE
);
56 res
&= DIAG(NULL
!= solutions
);
57 hkl_geometry_list_free(solutions
);
59 solutions
= Trajectory_solve(tconfig1
, gconfig
, gaas
, TRUE
);
60 res
&= DIAG(NULL
!= solutions
);
61 hkl_geometry_list_free(solutions
);
63 static struct Trajectory tconfig2
= TrajectoryHklFromTo(0, 0, 1, 0, 0, 6, 101);
64 solutions
= Trajectory_solve(tconfig2
, gconfig
, gaas
, TRUE
);
65 res
&= DIAG(NULL
!= solutions
);
66 hkl_geometry_list_free(solutions
);
68 solutions
= Trajectory_solve(tconfig2
, gconfig2
, gaas
, TRUE
);
69 res
&= DIAG(NULL
!= solutions
);
70 hkl_geometry_list_free(solutions
);
72 /* do not move between each steps */
73 solutions
= Trajectory_solve(tconfig1
, gconfig
, gaas
, FALSE
);
74 res
&= DIAG(NULL
!= solutions
);
75 hkl_geometry_list_free(solutions
);
77 solutions
= Trajectory_solve(tconfig1
, gconfig
, gaas
, FALSE
);
78 res
&= DIAG(NULL
!= solutions
);
79 hkl_geometry_list_free(solutions
);
81 solutions
= Trajectory_solve(tconfig2
, gconfig
, gaas
, FALSE
);
82 res
&= DIAG(NULL
!= solutions
);
83 hkl_geometry_list_free(solutions
);
85 solutions
= Trajectory_solve(tconfig2
, gconfig2
, gaas
, FALSE
);
86 res
&= DIAG(NULL
!= solutions
);
87 hkl_geometry_list_free(solutions
);
89 ok(res
== TRUE
, __func__
);