Skip to content
Snippets Groups Projects
Commit a80b5fc5 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Make the difffloat script use a new line in the files to set a limit below...

Make the difffloat script use a new line in the files to set a limit below which values are ignored as too close to zero.
parent 2545e4ab
Branches
Tags
1 merge request!350Test periodic bc
...@@ -861,6 +861,12 @@ AC_CONFIG_FILES([tests/testParser.sh], [chmod +x tests/testParser.sh]) ...@@ -861,6 +861,12 @@ AC_CONFIG_FILES([tests/testParser.sh], [chmod +x tests/testParser.sh])
# Save the compilation options # Save the compilation options
AC_DEFINE_UNQUOTED([SWIFT_CONFIG_FLAGS],["$swift_config_flags"],[Flags passed to configure]) AC_DEFINE_UNQUOTED([SWIFT_CONFIG_FLAGS],["$swift_config_flags"],[Flags passed to configure])
# Make sure the latest git revision string gets included
touch src/version.c
# Generate output.
AC_OUTPUT
# Report general configuration. # Report general configuration.
AC_MSG_RESULT([ AC_MSG_RESULT([
Compiler : $CC Compiler : $CC
...@@ -894,9 +900,3 @@ AC_MSG_RESULT([ ...@@ -894,9 +900,3 @@ AC_MSG_RESULT([
Debugging checks : $enable_debugging_checks Debugging checks : $enable_debugging_checks
Gravity checks : $gravity_force_checks Gravity checks : $gravity_force_checks
]) ])
# Make sure the latest git revision string gets included
touch src/version.c
# Generate output.
AC_OUTPUT
...@@ -42,11 +42,6 @@ if len(sys.argv) >= 4: ...@@ -42,11 +42,6 @@ if len(sys.argv) >= 4:
if len(sys.argv) >= 5: if len(sys.argv) >= 5:
number_to_check = int(sys.argv[4]) number_to_check = int(sys.argv[4])
if len(sys.argv) == 6:
ignoreSmallRhoDh = int(sys.argv[5])
else:
ignoreSmallRhoDh = 0
# Get the particle properties being compared from the header. # Get the particle properties being compared from the header.
with open(file1, 'r') as f: with open(file1, 'r') as f:
line = f.readline() line = f.readline()
...@@ -69,7 +64,7 @@ n_lines = shape(data1)[0] ...@@ -69,7 +64,7 @@ n_lines = shape(data1)[0]
n_columns = shape(data1)[1] n_columns = shape(data1)[1]
if fileTol != "": if fileTol != "":
if n_linesTol != 2: if n_linesTol != 3:
print "Incorrect number of lines in tolerance file '%s'."%fileTol print "Incorrect number of lines in tolerance file '%s'."%fileTol
if n_columnsTol != n_columns: if n_columnsTol != n_columns:
print "Incorrect number of columns in tolerance file '%s'."%fileTol print "Incorrect number of columns in tolerance file '%s'."%fileTol
...@@ -79,10 +74,12 @@ if fileTol == "": ...@@ -79,10 +74,12 @@ if fileTol == "":
print "Relative difference tolerance:", rel_tol print "Relative difference tolerance:", rel_tol
absTol = ones(n_columns) * abs_tol absTol = ones(n_columns) * abs_tol
relTol = ones(n_columns) * rel_tol relTol = ones(n_columns) * rel_tol
limTol = zeros(n_columns)
else: else:
print "Tolerances read from file" print "Tolerances read from file"
absTol = dataTol[0,:] absTol = dataTol[0,:]
relTol = dataTol[1,:] relTol = dataTol[1,:]
limTol = dataTol[2,:]
n_lines_to_check = 0 n_lines_to_check = 0
if number_to_check > 0: if number_to_check > 0:
...@@ -113,11 +110,8 @@ for i in range(n_lines_to_check): ...@@ -113,11 +110,8 @@ for i in range(n_lines_to_check):
print "" print ""
error = True error = True
if abs(data1[i,j]) < 4e-6 and abs(data2[i,j]) < 4e-6 : continue if abs(data1[i,j]) + abs(data2[i,j]) < limTol[j] : continue
# Ignore pathological cases with rho_dh
if ignoreSmallRhoDh and j == 8 and abs(data1[i,j]) < 2e-4: continue
if( rel_diff > 1.1*relTol[j]): if( rel_diff > 1.1*relTol[j]):
print "Relative difference larger than tolerance (%e) for particle %d, column %s:"%(relTol[j], data1[i,0], part_props[j]) print "Relative difference larger than tolerance (%e) for particle %d, column %s:"%(relTol[j], data1[i,0], part_props[j])
print "%10s: a = %e"%("File 1", data1[i,j]) print "%10s: a = %e"%("File 1", data1[i,j])
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#if defined(WITH_VECTORIZATION) #if defined(WITH_VECTORIZATION)
#define DOSELF1 runner_doself1_density_vec #define DOSELF1 runner_doself1_density_vec
#define DOPAIR1 runner_dopair1_density_vec #define DOPAIR1 runner_dopair1_branch_density
#define DOSELF1_NAME "runner_doself1_density_vec" #define DOSELF1_NAME "runner_doself1_density_vec"
#define DOPAIR1_NAME "runner_dopair1_density_vec" #define DOPAIR1_NAME "runner_dopair1_density_vec"
#endif #endif
...@@ -277,9 +277,8 @@ int check_results(struct part *serial_parts, struct part *vec_parts, int count, ...@@ -277,9 +277,8 @@ int check_results(struct part *serial_parts, struct part *vec_parts, int count,
/* Just a forward declaration... */ /* Just a forward declaration... */
void runner_doself1_density(struct runner *r, struct cell *ci); void runner_doself1_density(struct runner *r, struct cell *ci);
void runner_doself1_density_vec(struct runner *r, struct cell *ci); void runner_doself1_density_vec(struct runner *r, struct cell *ci);
void runner_dopair1_density(struct runner *r, struct cell *ci, struct cell *cj); void runner_dopair1_branch_density(struct runner *r, struct cell *ci,
void runner_dopair1_density_vec(struct runner *r, struct cell *ci, struct cell *cj);
struct cell *cj);
void test_boundary_conditions(struct cell **cells, struct runner runner, void test_boundary_conditions(struct cell **cells, struct runner runner,
const int loc_i, const int loc_j, const int loc_k, const int loc_i, const int loc_j, const int loc_k,
......
# ID pos_x pos_y pos_z v_x v_y v_z rho rho_dh wcount wcount_dh div_v curl_vx curl_vy curl_vz # ID pos_x pos_y pos_z v_x v_y v_z rho rho_dh wcount wcount_dh div_v curl_vx curl_vy curl_vz
0 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 2e-6 4e-5 2e-4 2e-3 1e-5 6e-6 6e-6 6e-6 0 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 3e-6 4e-5 2e-4 3e-3 2e-4 1e-4 1e-4 1e-4
0 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 1.2e-4 1e-4 1e-4 2e-4 1e-4 1e-4 1e-4 0 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 2e-6 1.2e-4 1e-4 1e-4 2e-4 5e-4 5e-4 5e-4
0 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 1e-4 1e-6 1e-4 1e-4 1e-4 1e-4 1e-4
# ID pos_x pos_y pos_z v_x v_y v_z rho rho_dh wcount wcount_dh div_v curl_vx curl_vy curl_vz
0 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 3e-6 4e-5 2e-4 3e-3 2e-4 1e-4 1e-4 1e-4
0 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 2e-6 3e-3 1e-4 1e-4 2e-3 6e-3 6e-3 6e-3
0 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 1e-3 1e-6 1e-4 1e-4 1e-4 1e-4 1e-4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment