OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/base.git] / src / Tools / crystal / crystalGetLatticeVolume / src / crystalGetLatticeVolume.c
1 /*
2 # crystalGetLatticeVolume : $Revision$  
3 # $Date$ 
4 # Created by $Author$
5 # Usage : crystalGetLatticeVolume
6 # Attention
7 #   $Loccker$
8 #       $State$ 
9 #
10 */
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <string.h>
14 #include <math.h>                  
15 #define GLOBAL_DECLARATION
16 #include "../inc/config.h"
17
18 #define DEBUG
19 #include "genUtil.h"
20 #include "Crystal.h"
21
22 /*
23 Example:
24 typedef struct lcrystalGetLatticeVolumeInfo {
25         float a;
26         int   b;
27 } lcrystalGetLatticeVolumeInfo;
28
29 typedef enum lcrystalGetLatticeVolumeMode {
30         a=0,
31         b=1
32 } lcrystalGetLatticeVolumeMode;
33 */
34
35 int
36 main(int argc, char* argv[]) 
37 {
38     CrystalInfo linfo;
39         crystalGetLatticeVolumeInfo info;
40     double V;
41
42         init0(&info);
43     argCheck(&info, argc, argv);
44     init1(&info);
45
46         DEBUGPRINT("Program Start\n");
47     if(info.flagIn) {
48         crystalInfoRead(info.fptIn, &linfo, 0);
49     }
50     if(info.flagax) {
51         linfo.aAxis.x = info.ax;
52         linfo.aAxis.y = info.ay;
53         linfo.aAxis.z = info.az;
54     }
55     if(info.flagbx) {
56         linfo.bAxis.x = info.bx;
57         linfo.bAxis.y = info.by;
58         linfo.bAxis.z = info.bz;
59     }
60     if(info.flagcx) {
61         linfo.cAxis.x = info.cx;
62         linfo.cAxis.y = info.cy;
63         linfo.cAxis.z = info.cz;
64     }
65
66     V = crystalInfoGetLatticeVolume(&linfo, info.mode);
67
68     fprintf(info.fptOut, "Volume: %f\n", V); 
69         exit(EXIT_SUCCESS);
70 }
71
72 void
73 additionalUsage()
74 {
75         fprintf(stderr, "----- Additional Usage -----\n");
76     fprintf(stderr, "> crystaInfo\n");
77     crystalInfoFileFormat(stderr, 0);
78 }