Skip to content

Commit

Permalink
Extract 2d sources
Browse files Browse the repository at this point in the history
  • Loading branch information
NaokiHori committed Jun 17, 2024
1 parent fbcf4f3 commit 4f0f808
Show file tree
Hide file tree
Showing 68 changed files with 111 additions and 3,035 deletions.
8 changes: 0 additions & 8 deletions include/array_macros/fluid/p.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 2
// [0 : isize+1], [0 : jsize+1]
#define P(I, J) (p[(I ) + (isize+2) * (J )])
#define P_NADDS (int [NDIMS][2]){ {1, 1}, {1, 1}, }
#endif

#if NDIMS == 3
// [0 : isize+1], [0 : jsize+1], [0 : ksize+1]
#define P(I, J, K) (p[(I ) + (isize+2) * ((J ) + (jsize+2) * (K ))])
#define P_NADDS (int [NDIMS][2]){ {1, 1}, {1, 1}, {1, 1}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_FLUID_P_H
8 changes: 0 additions & 8 deletions include/array_macros/fluid/psi.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 2
// [0 : isize+1], [0 : jsize+1]
#define PSI(I, J) (psi[(I ) + (isize+2) * (J )])
#define PSI_NADDS (int [NDIMS][2]){ {1, 1}, {1, 1}, }
#endif

#if NDIMS == 3
// [0 : isize+1], [0 : jsize+1], [0 : ksize+1]
#define PSI(I, J, K) (psi[(I ) + (isize+2) * ((J ) + (jsize+2) * (K ))])
#define PSI_NADDS (int [NDIMS][2]){ {1, 1}, {1, 1}, {1, 1}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_FLUID_PSI_H
8 changes: 0 additions & 8 deletions include/array_macros/fluid/srct.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 2
// [1 : isize+0], [1 : jsize+0]
#define SRCT(I, J) (srct[(I-1) + (isize+0) * (J-1)])
#define SRCT_NADDS (int [NDIMS][2]){ {0, 0}, {0, 0}, }
#endif

#if NDIMS == 3
// [1 : isize+0], [1 : jsize+0], [1 : ksize+0]
#define SRCT(I, J, K) (srct[(I-1) + (isize+0) * ((J-1) + (jsize+0) * (K-1))])
#define SRCT_NADDS (int [NDIMS][2]){ {0, 0}, {0, 0}, {0, 0}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_FLUID_SRCT_H
8 changes: 0 additions & 8 deletions include/array_macros/fluid/srcux.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 2
// [2 : isize+0], [1 : jsize+0]
#define SRCUX(I, J) (srcux[(I-2) + (isize-1) * (J-1)])
#define SRCUX_NADDS (int [NDIMS][2]){ {-1, 0}, {0, 0}, }
#endif

#if NDIMS == 3
// [2 : isize+0], [1 : jsize+0], [1 : ksize+0]
#define SRCUX(I, J, K) (srcux[(I-2) + (isize-1) * ((J-1) + (jsize+0) * (K-1))])
#define SRCUX_NADDS (int [NDIMS][2]){ {-1, 0}, {0, 0}, {0, 0}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_FLUID_SRCUX_H
8 changes: 0 additions & 8 deletions include/array_macros/fluid/srcuy.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 2
// [1 : isize+0], [1 : jsize+0]
#define SRCUY(I, J) (srcuy[(I-1) + (isize+0) * (J-1)])
#define SRCUY_NADDS (int [NDIMS][2]){ {0, 0}, {0, 0}, }
#endif

#if NDIMS == 3
// [1 : isize+0], [1 : jsize+0], [1 : ksize+0]
#define SRCUY(I, J, K) (srcuy[(I-1) + (isize+0) * ((J-1) + (jsize+0) * (K-1))])
#define SRCUY_NADDS (int [NDIMS][2]){ {0, 0}, {0, 0}, {0, 0}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_FLUID_SRCUY_H
6 changes: 0 additions & 6 deletions include/array_macros/fluid/srcuz.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,4 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 3
// [1 : isize+0], [1 : jsize+0], [1 : ksize+0]
#define SRCUZ(I, J, K) (srcuz[(I-1) + (isize+0) * ((J-1) + (jsize+0) * (K-1))])
#define SRCUZ_NADDS (int [NDIMS][2]){ {0, 0}, {0, 0}, {0, 0}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_FLUID_SRCUZ_H
8 changes: 0 additions & 8 deletions include/array_macros/fluid/t.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 2
// [0 : isize+1], [0 : jsize+1]
#define T(I, J) (t[(I ) + (isize+2) * (J )])
#define T_NADDS (int [NDIMS][2]){ {1, 1}, {1, 1}, }
#endif

#if NDIMS == 3
// [0 : isize+1], [0 : jsize+1], [0 : ksize+1]
#define T(I, J, K) (t[(I ) + (isize+2) * ((J ) + (jsize+2) * (K ))])
#define T_NADDS (int [NDIMS][2]){ {1, 1}, {1, 1}, {1, 1}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_FLUID_T_H
8 changes: 0 additions & 8 deletions include/array_macros/fluid/ux.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 2
// [1 : isize+1], [0 : jsize+1]
#define UX(I, J) (ux[(I-1) + (isize+1) * (J )])
#define UX_NADDS (int [NDIMS][2]){ {0, 1}, {1, 1}, }
#endif

#if NDIMS == 3
// [1 : isize+1], [0 : jsize+1], [0 : ksize+1]
#define UX(I, J, K) (ux[(I-1) + (isize+1) * ((J ) + (jsize+2) * (K ))])
#define UX_NADDS (int [NDIMS][2]){ {0, 1}, {1, 1}, {1, 1}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_FLUID_UX_H
8 changes: 0 additions & 8 deletions include/array_macros/fluid/uy.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 2
// [0 : isize+1], [0 : jsize+1]
#define UY(I, J) (uy[(I ) + (isize+2) * (J )])
#define UY_NADDS (int [NDIMS][2]){ {1, 1}, {1, 1}, }
#endif

#if NDIMS == 3
// [0 : isize+1], [0 : jsize+1], [0 : ksize+1]
#define UY(I, J, K) (uy[(I ) + (isize+2) * ((J ) + (jsize+2) * (K ))])
#define UY_NADDS (int [NDIMS][2]){ {1, 1}, {1, 1}, {1, 1}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_FLUID_UY_H
6 changes: 0 additions & 6 deletions include/array_macros/fluid/uz.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,4 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 3
// [0 : isize+1], [0 : jsize+1], [0 : ksize+1]
#define UZ(I, J, K) (uz[(I ) + (isize+2) * ((J ) + (jsize+2) * (K ))])
#define UZ_NADDS (int [NDIMS][2]){ {1, 1}, {1, 1}, {1, 1}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_FLUID_UZ_H
8 changes: 0 additions & 8 deletions include/array_macros/statistics/adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 2
// [1 : isize+1], [1 : jsize+0]
#define ADV(I, J) (adv[(I-1) + (isize+1) * (J-1)])
#define ADV_NADDS (int [NDIMS][2]){ {0, 1}, {0, 0}, }
#endif

#if NDIMS == 3
// [1 : isize+1], [1 : jsize+0], [1 : ksize+0]
#define ADV(I, J, K) (adv[(I-1) + (isize+1) * ((J-1) + (jsize+0) * (K-1))])
#define ADV_NADDS (int [NDIMS][2]){ {0, 1}, {0, 0}, {0, 0}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_STATISTICS_ADV_H
8 changes: 0 additions & 8 deletions include/array_macros/statistics/dif.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 2
// [1 : isize+1], [1 : jsize+0]
#define DIF(I, J) (dif[(I-1) + (isize+1) * (J-1)])
#define DIF_NADDS (int [NDIMS][2]){ {0, 1}, {0, 0}, }
#endif

#if NDIMS == 3
// [1 : isize+1], [1 : jsize+0], [1 : ksize+0]
#define DIF(I, J, K) (dif[(I-1) + (isize+1) * ((J-1) + (jsize+0) * (K-1))])
#define DIF_NADDS (int [NDIMS][2]){ {0, 1}, {0, 0}, {0, 0}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_STATISTICS_DIF_H
8 changes: 0 additions & 8 deletions include/array_macros/statistics/t1.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 2
// [0 : isize+1], [1 : jsize+0]
#define T1(I, J) (t1[(I ) + (isize+2) * (J-1)])
#define T1_NADDS (int [NDIMS][2]){ {1, 1}, {0, 0}, }
#endif

#if NDIMS == 3
// [0 : isize+1], [1 : jsize+0], [1 : ksize+0]
#define T1(I, J, K) (t1[(I ) + (isize+2) * ((J-1) + (jsize+0) * (K-1))])
#define T1_NADDS (int [NDIMS][2]){ {1, 1}, {0, 0}, {0, 0}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_STATISTICS_T1_H
8 changes: 0 additions & 8 deletions include/array_macros/statistics/t2.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 2
// [0 : isize+1], [1 : jsize+0]
#define T2(I, J) (t2[(I ) + (isize+2) * (J-1)])
#define T2_NADDS (int [NDIMS][2]){ {1, 1}, {0, 0}, }
#endif

#if NDIMS == 3
// [0 : isize+1], [1 : jsize+0], [1 : ksize+0]
#define T2(I, J, K) (t2[(I ) + (isize+2) * ((J-1) + (jsize+0) * (K-1))])
#define T2_NADDS (int [NDIMS][2]){ {1, 1}, {0, 0}, {0, 0}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_STATISTICS_T2_H
8 changes: 0 additions & 8 deletions include/array_macros/statistics/ux1.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 2
// [1 : isize+1], [1 : jsize+0]
#define UX1(I, J) (ux1[(I-1) + (isize+1) * (J-1)])
#define UX1_NADDS (int [NDIMS][2]){ {0, 1}, {0, 0}, }
#endif

#if NDIMS == 3
// [1 : isize+1], [1 : jsize+0], [1 : ksize+0]
#define UX1(I, J, K) (ux1[(I-1) + (isize+1) * ((J-1) + (jsize+0) * (K-1))])
#define UX1_NADDS (int [NDIMS][2]){ {0, 1}, {0, 0}, {0, 0}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_STATISTICS_UX1_H
8 changes: 0 additions & 8 deletions include/array_macros/statistics/ux2.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 2
// [1 : isize+1], [1 : jsize+0]
#define UX2(I, J) (ux2[(I-1) + (isize+1) * (J-1)])
#define UX2_NADDS (int [NDIMS][2]){ {0, 1}, {0, 0}, }
#endif

#if NDIMS == 3
// [1 : isize+1], [1 : jsize+0], [1 : ksize+0]
#define UX2(I, J, K) (ux2[(I-1) + (isize+1) * ((J-1) + (jsize+0) * (K-1))])
#define UX2_NADDS (int [NDIMS][2]){ {0, 1}, {0, 0}, {0, 0}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_STATISTICS_UX2_H
8 changes: 0 additions & 8 deletions include/array_macros/statistics/uy1.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 2
// [0 : isize+1], [1 : jsize+0]
#define UY1(I, J) (uy1[(I ) + (isize+2) * (J-1)])
#define UY1_NADDS (int [NDIMS][2]){ {1, 1}, {0, 0}, }
#endif

#if NDIMS == 3
// [0 : isize+1], [1 : jsize+0], [1 : ksize+0]
#define UY1(I, J, K) (uy1[(I ) + (isize+2) * ((J-1) + (jsize+0) * (K-1))])
#define UY1_NADDS (int [NDIMS][2]){ {1, 1}, {0, 0}, {0, 0}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_STATISTICS_UY1_H
8 changes: 0 additions & 8 deletions include/array_macros/statistics/uy2.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 2
// [0 : isize+1], [1 : jsize+0]
#define UY2(I, J) (uy2[(I ) + (isize+2) * (J-1)])
#define UY2_NADDS (int [NDIMS][2]){ {1, 1}, {0, 0}, }
#endif

#if NDIMS == 3
// [0 : isize+1], [1 : jsize+0], [1 : ksize+0]
#define UY2(I, J, K) (uy2[(I ) + (isize+2) * ((J-1) + (jsize+0) * (K-1))])
#define UY2_NADDS (int [NDIMS][2]){ {1, 1}, {0, 0}, {0, 0}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_STATISTICS_UY2_H
6 changes: 0 additions & 6 deletions include/array_macros/statistics/uz1.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,4 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 3
// [0 : isize+1], [1 : jsize+0], [1 : ksize+0]
#define UZ1(I, J, K) (uz1[(I ) + (isize+2) * ((J-1) + (jsize+0) * (K-1))])
#define UZ1_NADDS (int [NDIMS][2]){ {1, 1}, {0, 0}, {0, 0}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_STATISTICS_UZ1_H
6 changes: 0 additions & 6 deletions include/array_macros/statistics/uz2.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,4 @@

// This file is generated by tools/define_arrays.py

#if NDIMS == 3
// [0 : isize+1], [1 : jsize+0], [1 : ksize+0]
#define UZ2(I, J, K) (uz2[(I ) + (isize+2) * ((J-1) + (jsize+0) * (K-1))])
#define UZ2_NADDS (int [NDIMS][2]){ {1, 1}, {0, 0}, {0, 0}, }
#endif

#endif // INCLUDE_ARRAY_MACROS_STATISTICS_UZ2_H
5 changes: 1 addition & 4 deletions include/domain.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "sdecomp.h"

// definition of a structure domain_t | 25
// definition of a structure domain_t
/**
* @struct domain_t
* @brief struct storing parameters relevant to spatial domain
Expand All @@ -25,9 +25,6 @@ typedef struct {
double * restrict xf, * restrict xc;
double * restrict hxxf, * restrict hxxc;
double hy;
#if NDIMS == 3
double hz;
#endif
double * restrict jdxf, * restrict jdxc;
} domain_t;

Expand Down
8 changes: 1 addition & 7 deletions include/fluid.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "array.h"
#include "domain.h"

// definition of a structure fluid_t_ | 30
// definition of a structure fluid_t_
/**
* @struct fluid_t
* @brief struct storing fluid-related variables
Expand All @@ -20,17 +20,11 @@
typedef struct {
array_t ux;
array_t uy;
#if NDIMS == 3
array_t uz;
#endif
array_t p;
array_t psi;
array_t t;
array_t srcux[3];
array_t srcuy[3];
#if NDIMS == 3
array_t srcuz[3];
#endif
array_t srct[3];
double Ra, Pr;
} fluid_t;
Expand Down
7 changes: 0 additions & 7 deletions include/fluid_solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ extern int fluid_update_boundaries_uy(
array_t * uy
);

#if NDIMS == 3
extern int fluid_update_boundaries_uz(
const domain_t * domain,
array_t * uz
);
#endif

extern int fluid_update_boundaries_p(
const domain_t * domain,
array_t * p
Expand Down
8 changes: 0 additions & 8 deletions include/halo.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,4 @@ int halo_communicate_in_y(
array_t * array
);

#if NDIMS == 3
int halo_communicate_in_z(
const domain_t * domain,
MPI_Datatype * dtype,
array_t * array
);
#endif

#endif // HALO_H
Loading

0 comments on commit 4f0f808

Please sign in to comment.