aboutsummaryrefslogtreecommitdiff
path: root/src/GeneralizedPolynomial-Uniform/template.c
diff options
context:
space:
mode:
authorjthorn <jthorn@df1f8a13-aa1d-4dd4-9681-27ded5b42416>2002-05-12 17:49:50 +0000
committerjthorn <jthorn@df1f8a13-aa1d-4dd4-9681-27ded5b42416>2002-05-12 17:49:50 +0000
commit254411a8cb5aae742d044ff502a214c01f65ec20 (patch)
tree6009f478e2da2bbd2b6ad24451c0a00c6068bfe4 /src/GeneralizedPolynomial-Uniform/template.c
parent373d1495aec9f63a8e00d11fb0be586afb3ff414 (diff)
* switch to passing structure pointers to subfns for query info
--> reduces the number of args quite a bit * streamline notation for molecule min/max m and position queries git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/LocalInterp/trunk@29 df1f8a13-aa1d-4dd4-9681-27ded5b42416
Diffstat (limited to 'src/GeneralizedPolynomial-Uniform/template.c')
-rw-r--r--src/GeneralizedPolynomial-Uniform/template.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/GeneralizedPolynomial-Uniform/template.c b/src/GeneralizedPolynomial-Uniform/template.c
index 42001af..bc84bbf 100644
--- a/src/GeneralizedPolynomial-Uniform/template.c
+++ b/src/GeneralizedPolynomial-Uniform/template.c
@@ -245,29 +245,20 @@ int FUNCTION_NAME(/***** coordinate system *****/
/***** operation info */
const CCTK_INT operand_indices[],
const CCTK_INT operation_codes[],
- /***** error-reporting *****/
- int* error_pt, int* error_axis, int* error_end,
- /***** Jacobian structure *****/
- int* MSS_is_fn_of_interp_coords,
- int* MSS_is_fn_of_which_operation,
- int* MSS_is_fn_of_input_array_values,
- int* Jacobian_is_fn_of_input_array_values,
- /***** Jacobian queries *****/
- CCTK_INT interp_molecule_min_m[],
- CCTK_INT interp_molecule_max_m[],
- CCTK_INT* interp_molecule_positions[])
+ /***** other return results *****/
+ struct error_flags *error_flags,
+ struct molecule_structure_flags *molecule_structure_flags,
+ struct molecule_min_max_m_info *molecule_min_max_m_info,
+ CCTK_INT* molecule_positions[])
{
/*
* Implementation notes:
*
* The basic outline of this function is as follows:
*
- * *MSS_is_fn_of_interp_coords = 0;
- * *MSS_is_fn_of_which_operation = 0;
- * *MSS_is_fn_of_input_array_values = 0;
- * *Jacobian_is_fn_of_input_array_values = 0;
- * if (querying molecule min/max m bounds)
- * then store them
+ * store molecule structure flags
+ * if (querying molecule min/max m)
+ * then store molecule min/max m
* compute "which derivatives are wanted" flags
* precompute 1/dx factors
* for each interpolation point
@@ -392,17 +383,17 @@ int FUNCTION_NAME(/***** coordinate system *****/
/*
* Jacobian structure info
*/
-*MSS_is_fn_of_interp_coords = 0;
-*MSS_is_fn_of_which_operation = 0;
-*MSS_is_fn_of_input_array_values = 0;
-*Jacobian_is_fn_of_input_array_values = 0;
-if ((interp_molecule_min_m != NULL) && (interp_molecule_max_m != NULL))
+molecule_structure_flags->MSS_is_fn_of_interp_coords = 0;
+molecule_structure_flags->MSS_is_fn_of_which_operation = 0;
+molecule_structure_flags->MSS_is_fn_of_input_array_values = 0;
+molecule_structure_flags->Jacobian_is_fn_of_input_array_values = 0;
+if (molecule_min_max_m_info != NULL)
then {
int axis;
for (axis = 0 ; axis < N_DIMS ; ++axis)
{
- interp_molecule_min_m[axis] = MOLECULE_MIN_M;
- interp_molecule_max_m[axis] = MOLECULE_MAX_M;
+ molecule_min_max_m_info->molecule_min_m[axis] = MOLECULE_MIN_M;
+ molecule_min_max_m_info->molecule_max_m[axis] = MOLECULE_MAX_M;
}
}
@@ -694,27 +685,36 @@ int pt;
#if (N_DIMS >= 1)
if ((center_i == INT_MIN) || (center_i == INT_MAX))
then {
- *error_pt = pt;
- *error_axis = X_AXIS;
- *error_end = (center_i == INT_MIN) ? -1 : +1;
+ if (error_flags != NULL)
+ then {
+ error_flags->error_pt = pt;
+ error_flags->error_axis = X_AXIS;
+ error_flags->error_end = (center_i > 0) ? +1 : -1;
+ }
return CCTK_ERROR_INTERP_POINT_X_RANGE; /*** ERROR RETURN ***/
}
#endif
#if (N_DIMS >= 2)
if ((center_j == INT_MIN) || (center_j == INT_MAX))
then {
- *error_pt = pt;
- *error_axis = Y_AXIS;
- *error_end = (center_j == INT_MIN) ? -1 : +1;
+ if (error_flags != NULL)
+ then {
+ error_flags->error_pt = pt;
+ error_flags->error_axis = Y_AXIS;
+ error_flags->error_end = (center_j > 0) ? +1 : -1;
+ }
return CCTK_ERROR_INTERP_POINT_X_RANGE; /*** ERROR RETURN ***/
}
#endif
#if (N_DIMS >= 3)
if ((center_k == INT_MIN) || (center_k == INT_MAX))
then {
- *error_pt = pt;
- *error_axis = Z_AXIS;
- *error_end = (center_k == INT_MIN) ? -1 : +1;
+ if (error_flags != NULL)
+ then {
+ error_flags->error_pt = pt;
+ error_flags->error_axis = Z_AXIS;
+ error_flags->error_end = (center_k > 0) ? +1 : -1;
+ }
return CCTK_ERROR_INTERP_POINT_X_RANGE; /*** ERROR RETURN ***/
}
#endif
@@ -733,16 +733,16 @@ int pt;
#endif
/* molecule position queries */
- if (interp_molecule_positions != NULL)
+ if (molecule_positions != NULL)
then {
#if (N_DIMS >= 1)
- interp_molecule_positions[X_AXIS][pt] = center_i;
+ molecule_positions[X_AXIS][pt] = center_i;
#endif
#if (N_DIMS >= 2)
- interp_molecule_positions[Y_AXIS][pt] = center_j;
+ molecule_positions[Y_AXIS][pt] = center_j;
#endif
#if (N_DIMS >= 3)
- interp_molecule_positions[Z_AXIS][pt] = center_k;
+ molecule_positions[Z_AXIS][pt] = center_k;
#endif
}