commit cb45fb03663f614cf156f2f8a0416f31e5e49c9d
parent ce4dffb0cf39bf7c20bd48a4c70b8d04a2ad725f
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 6 Feb 2019 11:20:27 +0100
Rename the SDIS_SOLVE_DIMENSION internal macro in SDIS_XD_DIMENSION
Diffstat:
11 files changed, 49 insertions(+), 49 deletions(-)
diff --git a/src/sdis_Xd_begin.h b/src/sdis_Xd_begin.h
@@ -26,15 +26,15 @@ struct rwalk_context {
#endif /* SDIS_XD_BEGIN_H */
/* Check prerequisite */
-#ifndef SDIS_SOLVE_DIMENSION
- #error "The SDIS_SOLVE_DIMENSION macro must be defined."
+#ifndef SDIS_XD_DIMENSION
+ #error "The SDIS_XD_DIMENSION macro must be defined."
#endif
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
#include <rsys/double2.h>
#include <rsys/float2.h>
#include <star/s2d.h>
-#elif SDIS_SOLVE_DIMENSION == 3
+#elif SDIS_XD_DIMENSION == 3
#include <rsys/double3.h>
#include <rsys/float3.h>
#include <star/s3d.h>
@@ -43,9 +43,9 @@ struct rwalk_context {
#endif
/* Syntactic sugar */
-#define DIM SDIS_SOLVE_DIMENSION
+#define DIM SDIS_XD_DIMENSION
-/* Star-XD macros generic to SDIS_SOLVE_DIMENSION */
+/* Star-XD macros generic to SDIS_XD_DIMENSION */
#define sXd(Name) CONCAT(CONCAT(CONCAT(s, DIM), d_), Name)
#define sXd_dev CONCAT(CONCAT(s, DIM), d)
#define SXD_HIT_NONE CONCAT(CONCAT(S,DIM), D_HIT_NONE)
@@ -59,19 +59,19 @@ struct rwalk_context {
#define SXD_FLOAT3 CONCAT(CONCAT(S, DIM), D_FLOAT3)
#define SXD_SAMPLE CONCAT(CONCAT(S, DIM), D_SAMPLE)
-/* Vector macros generic to SDIS_SOLVE_DIMENSION */
+/* Vector macros generic to SDIS_XD_DIMENSION */
#define dX(Func) CONCAT(CONCAT(CONCAT(d, DIM), _), Func)
#define fX(Func) CONCAT(CONCAT(CONCAT(f, DIM), _), Func)
#define fX_set_dX CONCAT(CONCAT(CONCAT(f, DIM), _set_d), DIM)
#define dX_set_fX CONCAT(CONCAT(CONCAT(d, DIM), _set_f), DIM)
-/* Macro making generic its submitted nae to SDIS_SOLVE_DIMENSION */
+/* Macro making generic its submitted nae to SDIS_XD_DIMENSION */
#define XD(Name) CONCAT(CONCAT(CONCAT(Name, _), DIM), d)
/* Generate the generic data structures and constants */
-#if (SDIS_SOLVE_DIMENSION == 2 && !defined(SDIS_2D_H)) \
-|| (SDIS_SOLVE_DIMENSION == 3 && !defined(SDIS_3D_H))
- #if SDIS_SOLVE_DIMENSION == 2
+#if (SDIS_XD_DIMENSION == 2 && !defined(SDIS_2D_H)) \
+|| (SDIS_XD_DIMENSION == 3 && !defined(SDIS_3D_H))
+ #if SDIS_XD_DIMENSION == 2
#define SDIS_2D_H
#else
#define SDIS_3D_H
diff --git a/src/sdis_Xd_end.h b/src/sdis_Xd_end.h
@@ -13,7 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#undef SDIS_SOLVE_DIMENSION
+#undef SDIS_XD_DIMENSION
#undef DIM
#undef sXd
diff --git a/src/sdis_heat_path.c b/src/sdis_heat_path.c
@@ -16,26 +16,26 @@
#include "sdis_heat_path.h"
/* Generate the radiative paths */
-#define SDIS_SOLVE_DIMENSION 2
+#define SDIS_XD_DIMENSION 2
#include "sdis_heat_path_radiative_Xd.h"
-#define SDIS_SOLVE_DIMENSION 3
+#define SDIS_XD_DIMENSION 3
#include "sdis_heat_path_radiative_Xd.h"
/* Generate the convective paths */
-#define SDIS_SOLVE_DIMENSION 2
+#define SDIS_XD_DIMENSION 2
#include "sdis_heat_path_convective_Xd.h"
-#define SDIS_SOLVE_DIMENSION 3
+#define SDIS_XD_DIMENSION 3
#include "sdis_heat_path_convective_Xd.h"
/* Generate the conductive paths */
-#define SDIS_SOLVE_DIMENSION 2
+#define SDIS_XD_DIMENSION 2
#include "sdis_heat_path_conductive_Xd.h"
-#define SDIS_SOLVE_DIMENSION 3
+#define SDIS_XD_DIMENSION 3
#include "sdis_heat_path_conductive_Xd.h"
/* Generate the boundary paths */
-#define SDIS_SOLVE_DIMENSION 2
+#define SDIS_XD_DIMENSION 2
#include "sdis_heat_path_boundary_Xd.h"
-#define SDIS_SOLVE_DIMENSION 3
+#define SDIS_XD_DIMENSION 3
#include "sdis_heat_path_boundary_Xd.h"
diff --git a/src/sdis_heat_path_boundary_Xd.h b/src/sdis_heat_path_boundary_Xd.h
@@ -92,7 +92,7 @@ XD(check_rwalk_fragment_consistency)
|| eq_eps(rwalk->vtx.time, frag->time, 1.e-6))) {
return 0;
}
-#if (SDIS_SOLVE_DIMENSION == 2)
+#if (SDIS_XD_DIMENSION == 2)
uv[0] = rwalk->hit.u;
#else
d2_set_f2(uv, rwalk->hit.uv);
diff --git a/src/sdis_heat_path_convective_Xd.h b/src/sdis_heat_path_convective_Xd.h
@@ -42,7 +42,7 @@ XD(convective_path)
double cp; /* Calorific capacity */
double tmp;
double r;
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
float st;
#else
float st[2];
diff --git a/src/sdis_heat_path_radiative_Xd.h b/src/sdis_heat_path_radiative_Xd.h
@@ -62,7 +62,7 @@ XD(trace_radiative_path)
fX_set_dX(pos, rwalk->vtx.P);
/* Trace the radiative ray */
-#if (SDIS_SOLVE_DIMENSION == 2)
+#if (SDIS_XD_DIMENSION == 2)
SXD(scene_view_trace_ray_3d
(scn->sXd(view), pos, dir, range, &rwalk->hit, &rwalk->hit));
#else
diff --git a/src/sdis_realisation.c b/src/sdis_realisation.c
@@ -16,9 +16,9 @@
#include "sdis_realisation.h"
/* Generate the generic realisations */
-#define SDIS_SOLVE_DIMENSION 2
+#define SDIS_XD_DIMENSION 2
#include "sdis_realisation_Xd.h"
-#define SDIS_SOLVE_DIMENSION 3
+#define SDIS_XD_DIMENSION 3
#include "sdis_realisation_Xd.h"
res_T
diff --git a/src/sdis_realisation_Xd.h b/src/sdis_realisation_Xd.h
@@ -174,7 +174,7 @@ XD(boundary_realisation)
struct XD(rwalk) rwalk = XD(RWALK_NULL);
struct XD(temperature) T = XD(TEMPERATURE_NULL);
struct sXd(attrib) attr;
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
float st;
#else
float st[2];
@@ -188,7 +188,7 @@ XD(boundary_realisation)
rwalk.vtx.time = time;
rwalk.mdm = NULL; /* The random walk is at an interface between 2 media */
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
st = (float)uv[0];
#else
f2_set_d2(st, uv);
@@ -206,7 +206,7 @@ XD(boundary_realisation)
SXD(primitive_get_attrib(&rwalk.hit.prim, SXD_GEOMETRY_NORMAL, st, &attr));
fX(set)(rwalk.hit.normal, attr.value);
-#if SDIS_SOLVE_DIMENSION==2
+#if SDIS_XD_DIMENSION==2
rwalk.hit.u = st;
#else
f2_set(rwalk.hit.uv, st);
@@ -242,20 +242,20 @@ XD(boundary_flux_realisation)
struct XD(temperature) T;
struct sXd(attrib) attr;
struct sXd(primitive) prim;
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
float st;
#else
float st[2];
#endif
- double P[SDIS_SOLVE_DIMENSION];
- float N[SDIS_SOLVE_DIMENSION];
+ double P[SDIS_XD_DIMENSION];
+ float N[SDIS_XD_DIMENSION];
const double Tr3 = Tref * Tref * Tref;
const enum sdis_side fluid_side =
(solid_side == SDIS_FRONT) ? SDIS_BACK : SDIS_FRONT;
res_T res = RES_OK;
ASSERT(uv && fp_to_meter > 0 && weight && time >= 0 && Tref >= 0);
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
#define SET_PARAM(Dest, Src) (Dest).u = (Src);
st = (float)uv[0];
#else
diff --git a/src/sdis_solve.c b/src/sdis_solve.c
@@ -20,9 +20,9 @@
#include "sdis_interface_c.h"
/* Generate the solvers */
-#define SDIS_SOLVE_DIMENSION 2
+#define SDIS_XD_DIMENSION 2
#include "sdis_solve_Xd.h"
-#define SDIS_SOLVE_DIMENSION 3
+#define SDIS_XD_DIMENSION 3
#include "sdis_solve_Xd.h"
#include <star/ssp.h>
diff --git a/src/sdis_solve_Xd.h b/src/sdis_solve_Xd.h
@@ -95,7 +95,7 @@ XD(interface_prebuild_fragment)
struct sXd(primitive) prim;
struct sXd(hit) hit;
struct sdis_rwalk_vertex vtx;
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
float st;
#else
float st[2];
@@ -107,7 +107,7 @@ XD(interface_prebuild_fragment)
*frag = SDIS_INTERFACE_FRAGMENT_NULL;
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
#define SET_PARAM(Dest, Src) (Dest).u = (Src);
st = (float)uv[0];
#else
@@ -192,7 +192,7 @@ XD(solve_probe)
goto error;
}
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
if(scene_is_2d(scn) == 0) { res = RES_BAD_ARG; goto error; }
#else
if(scene_is_2d(scn) != 0) { res = RES_BAD_ARG; goto error; }
@@ -307,7 +307,7 @@ XD(solve_probe_boundary)
goto error;
}
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
if(scene_is_2d(scn) == 0) { res = RES_BAD_ARG; goto error; }
#else
if(scene_is_2d(scn) != 0) { res = RES_BAD_ARG; goto error; }
@@ -458,7 +458,7 @@ XD(solve_boundary)
goto error;
}
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
if(scene_is_2d(scn) == 0) { res = RES_BAD_ARG; goto error; }
#else
if(scene_is_2d(scn) != 0) { res = RES_BAD_ARG; goto error; }
@@ -478,7 +478,7 @@ XD(solve_boundary)
}
/* Create the Star-XD shape of the boundary */
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
res = s2d_shape_create_line_segments(scn->dev->sXd_dev, &shape);
#else
res = s3d_shape_create_mesh(scn->dev->sXd_dev, &shape);
@@ -491,7 +491,7 @@ XD(solve_boundary)
ctx.view = scn->sXd(view);
vdata.usage = SXD_POSITION;
vdata.get = XD(boundary_get_position);
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
vdata.type = S2D_FLOAT2;
res = s2d_line_segments_setup_indexed_vertices(shape, (unsigned)nprimitives,
boundary_get_indices_2d, (unsigned)(nprimitives*2), &vdata, 1, &ctx);
@@ -542,7 +542,7 @@ XD(solve_boundary)
time = sample_time(rng, time_range);
/* Sample a position onto the boundary */
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
res_local = s2d_scene_view_sample
(view,
ssp_rng_canonical_float(rng),
@@ -645,7 +645,7 @@ XD(solve_probe_boundary_flux)
goto error;
}
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
if(scene_is_2d(scn) == 0) { res = RES_BAD_ARG; goto error; }
#else
if(scene_is_2d(scn) != 0) { res = RES_BAD_ARG; goto error; }
@@ -836,7 +836,7 @@ XD(solve_boundary_flux)
goto error;
}
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
if(scene_is_2d(scn) == 0) { res = RES_BAD_ARG; goto error; }
#else
if(scene_is_2d(scn) != 0) { res = RES_BAD_ARG; goto error; }
@@ -856,7 +856,7 @@ XD(solve_boundary_flux)
}
/* Create the Star-XD shape of the boundary */
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
res = s2d_shape_create_line_segments(scn->dev->s2d, &shape);
#else
res = s3d_shape_create_mesh(scn->dev->s3d, &shape);
@@ -868,7 +868,7 @@ XD(solve_boundary_flux)
ctx.primitives = primitives;
ctx.view = scn->sXd(view);
vdata.get = XD(boundary_get_position);
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
vdata.usage = S2D_POSITION;
vdata.type = S2D_FLOAT2;
res = s2d_line_segments_setup_indexed_vertices(shape, (unsigned)nprimitives,
@@ -925,7 +925,7 @@ XD(solve_boundary_flux)
time = sample_time(rng, time_range);
/* Sample a position onto the boundary */
-#if SDIS_SOLVE_DIMENSION == 2
+#if SDIS_XD_DIMENSION == 2
res_local = s2d_scene_view_sample
(view,
ssp_rng_canonical_float(rng),
diff --git a/src/sdis_solve_radiative.c b/src/sdis_solve_radiative.c
@@ -13,8 +13,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#define SDIS_SOLVE_DIMENSION 2
+#define SDIS_XD_DIMENSION 2
#include "sdis_solve_Xd_radiative.h"
-#define SDIS_SOLVE_DIMENSION 3
+#define SDIS_XD_DIMENSION 3
#include "sdis_solve_Xd_radiative.h"