NuSiF-Solver/BasicSolver/2D-seq/src/util.h

30 lines
874 B
C
Raw Normal View History

2023-02-05 07:34:23 +01:00
/*
2024-07-08 09:52:11 +02:00
* Copyright (C) NHR@FAU, University Erlangen-Nuremberg.
2023-02-05 07:34:23 +01:00
* All rights reserved.
* Use of this source code is governed by a MIT-style
* license that can be found in the LICENSE file.
*/
#ifndef __UTIL_H_
#define __UTIL_H_
#define HLINE \
2024-07-08 09:52:11 +02:00
"----------------------------------------------------------------------------\n"
2023-02-05 07:34:23 +01:00
#ifndef MIN
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#endif
#ifndef MAX
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#endif
#ifndef ABS
#define ABS(a) ((a) >= 0 ? (a) : -(a))
#endif
2024-07-08 09:52:11 +02:00
#define P(i, j) p[(j) * (imax + 2) + (i)]
#define F(i, j) f[(j) * (imax + 2) + (i)]
#define G(i, j) g[(j) * (imax + 2) + (i)]
#define U(i, j) u[(j) * (imax + 2) + (i)]
#define V(i, j) v[(j) * (imax + 2) + (i)]
#define RHS(i, j) rhs[(j) * (imax + 2) + (i)]
2023-02-05 07:34:23 +01:00
#endif // __UTIL_H_