HiRep
0.1
Loading...
Searching...
No Matches
geometry_check.h
Go to the documentation of this file.
1
/***************************************************************************\
2
* Copyright (c) 2022, Claudio Pica, Sofie Martins *
3
* All rights reserved. *
4
\***************************************************************************/
5
13
#ifndef GEOMETRY_CHECK_H
14
#define GEOMETRY_CHECK_H
15
16
#include "
geometry.h
"
17
#include "error.h"
18
19
#ifdef CHECK_SPINOR_MATCHING
20
29
#define _TWO_SPINORS_MATCHING(s1, s2) error((s1)->type != (s2)->type, 1, __FILE__ ": ", "Spinor geometries don't agree!");
30
38
#define _ARRAY_SPINOR_MATCHING(s, n) \
39
for (int _i = 0; _i < n; _i++) \
40
error((s)->type != ((s) + _i)->type, 1, __FILE__ ": ", "Spinors geometries don;t agree!");
41
50
#define _CHECK_GEOMETRY_MATCHING(s1, s2) error((s1)->type != (s2)->type, 1, __FILE__ ": ", "Field geometries don't agree!\n");
51
60
#define _CHECK_GEOMETRY_EO(s1, s2) \
61
do { \
62
int pass1 = (s1)->type == &glattice && (s2)->type == &glattice; \
63
int pass2 = (s1)->type == &glat_odd && (s2)->type == &glat_even; \
64
int pass3 = (s1)->type == &glat_even && (s2)->type == &glat_odd; \
65
error(!(pass1 || pass2 || pass3), 1, __FILE__ ": ", \
66
"Incorrect combination of geometries! " \
67
"Need even to odd, odd to even or both defined on the full lattice\n"); \
68
} while (0)
69
75
#define _CHECK_GEOMETRY_FULL(s1) \
76
do { \
77
error(s1->type != &glattice, 1, __func__, "Field is not defined on all the lattice!"); \
78
} while (0)
79
85
#define _CHECK_GEOMETRY_EVEN(s1) \
86
do { \
87
error(s1->type != &glat_even, 1, __func__, "Spinor needs to be even!"); \
88
} while (0)
89
95
#define _CHECK_GEOMETRY_ODD(s1) \
96
do { \
97
error(s1->type != &glat_odd, 1, __func__, "Spinor needs to be odd!"); \
98
} while (0)
99
100
#else
101
105
#define _TWO_SPINORS_MATCHING(s1, s2)
106
110
#define _ARRAY_SPINOR_MATCHING(s, n)
111
115
#define _CHECK_GEOMETRY_MATCHING(s1, s2)
116
120
#define _CHECK_GEOMETRY_EO(s1, s2)
121
125
#define _CHECK_GEOMETRY_FULL(s1)
126
130
#define _CHECK_GEOMETRY_EVEN(s1)
131
135
#define _CHECK_GEOMETRY_ODD(s1)
136
137
#endif
138
139
#endif
geometry.h
This file contains information on the geometry of the local lattice, block decomposed geometry,...
Include
Geometry
geometry_check.h
Generated by
1.12.0