Hot answers tagged

20 votes
Accepted

What are some good strategies to test a floating point arithmetic implementation for double numbers?

You should test transition points. Floating-point numbers have several distinct "ranges": Standard/Normal arithmetic Subnormal arithmetic Infinite arithmetic NaN arithmetic Zero arithmetic ...
user avatar
  • 3,091
13 votes
Accepted

How to write integration tests for numeric simulation software?

I don't think you can avoid using a tolerance for floating-point comparisons. Error due to round-off, discretization, and so on using floating-point numbers is unavoidable. What I typically do to ...
user avatar
9 votes
Accepted

Poorly conditioned, easily evaluated sum for unit testing

The condition number of sum $s(x) = \sum_{j=1}^n x_j$ is given by $$ \kappa(x) = \frac{\sum_{j=1}^n |x_j|}{|\sum_{j=1}^n x_j|} = \frac{s(|x|)}{|s(x)|}$$ and reflects the sums sensitivity to small ...
user avatar
9 votes

How to write integration tests for numeric simulation software?

Geoff has already given an excellent overview, but I wanted to provide another real world look on it. In the deal.II project (http://www.dealii.org/) we run some 7,000 tests with every change in the ...
user avatar
7 votes
Accepted

Guidelines for choosing manufactured solutions for numerical PDE schemes

The typical approach to this problem is to use infinitely smooth functions like trigonometric, inverse trig, exponential, etc. There's a handy library called MASA that has a library of manufactured ...
user avatar
  • 10.8k
7 votes
Accepted

Testing 1D root-finding procedures for robustness

There are many good open-source implementations of root-finding methods out there already. One example is boost, whose implementation of Newton-Raphson and related methods you can find here. If you ...
user avatar
  • 11.4k
7 votes

Naming scientific output files

The problem of recording how a particular piece of scientific data was generated has come to be known as "provenance tracking". Here is an article on it which also includes the description of a ...
user avatar
  • 586
7 votes

What are some good strategies to test a floating point arithmetic implementation for double numbers?

An online search shows various floating point test suites supporting double precision (64-bit IEEE 754) that are more comprehensive than randomized testing. I have not tested any of these myself. ...
user avatar
  • 171
5 votes
Accepted

Which 2D PDE with an exact solution can I use to test/verify my FEM-PDE code?

As Maxim's comment points out, you ought to be able to create any solution you like, crank it through the original, continuous PDE, generate a forcing function, boundary conditions (time-dependent), ...
user avatar
  • 10.8k
5 votes
Accepted

Local versus remote development

Ask your remote host to install what you need. We do this all the time for folks where I work. Typically they can help you out. Also, it's OK to do some of your development on your machine and then ...
user avatar
  • 10.8k
5 votes

Where can I find matrices and it's preconditioner for testing?

Generally, preconditioners are considered to be part of the solver, so they are not included in test matrix collections. In fact, preconditioners are rarely constructed as an explicit matrix, making ...
user avatar
4 votes

How to write integration tests for numeric simulation software?

A few additional points I would like to add to other answers. Corner test cases should be part of the regression test suite - ill conditioned problems, ill conditioned - bad aspect ratios, ...
user avatar
  • 71
4 votes

Local versus remote development

I want to add something not mentioned yet here that might be useful (too long for a comment), because you say that syncing with git is a pain. There is the tool sshfs (and I believe its osx ...
user avatar
  • 11.4k
4 votes

What are the good testing problems for hyperbolic equation?

The first two can be decomposed into a system of first-order advection equations of which there are a number of standard test problems often involving both smooth and discontinuous initial conditions ...
user avatar
4 votes

Test Case with Known Solution for 3D Navier Stokes Equations

Chapter 7 of the (free in PDF form) book "I do like CFD, Vol. 1" collects many different known solutions for multidimensional flows that can be used for benchmarking.
user avatar
4 votes

Are there testing frameworks for numerical software development

1. This type of test appears to me to be poorly defined because its test condition is tied to the particular machine on which you did tests in development. One of the points of testing is that running ...
user avatar
  • 11.4k
4 votes
Accepted

Test matrices for large sparse overdetermined system of linear equations

I use the following website http://www.cise.ufl.edu/research/sparse/matrices/ and, in particular, this collection http://yifanhu.net/GALLERY/GRAPHS/search.html when I need to find certain kind of ...
user avatar
  • 8,287
4 votes

Causes for different results for different number of nodes in MPI

There is no way for anyone to tell you where the issue comes from without access to the actual code. But here are common reasons why the output (legitimately) differs for different numbers of ...
user avatar
3 votes
Accepted

How to choose a simple manufactured solution for Euler equation?

With manufactured solutions, you pick the form of the solutions you want, crank them through the governing equations, and generate right-hand side functions that you can go implement to drive the ...
user avatar
  • 10.8k
3 votes
Accepted

How can I compare errors in PDE solvers with non-uniform grids?

It is difficult to assess the correctness of a code for only a single value of the mesh sizes $h$, $H$. Rather, one typically evaluates the accuracy for a sequence of mesh sizes $h,H \rightarrow 0$ by ...
user avatar
3 votes

Test Case with Known Solution for 3D Navier Stokes Equations

There are several benchmarks, like the flow around a cylinder, which is described in details at the FEATFLOW web page here. It is a well defined configuration of a flow passing by a cylinder obstacle ...
user avatar
  • 1,246
3 votes
Accepted

Test set for linear solvers

One thing you can do for smoke testing is to take a known solution $x$ (you could generate it randomly or pick something convenient) and a known matrix $A$, and then set $b$ equal to $Ax$, and solve ...
user avatar
3 votes

Any recommendations for unit-testing frameworks compatible with code/libraries that use MPI?

The Teuchos Unit test harness in Trilinos natively supports unit tests that use MPI. Things like controlling output from multiple processes and aggregating pass/fail over all processes is automatic. ...
user avatar
3 votes

Strategies for unit testing and test-driven development

I recently found this thesis on TDD in Computational Science. I haven't read it yet so I have no idea if it is any good, but hopefully it can be of some help. http://cyber.ua.edu/files/2014/12/...
user avatar
  • 261
3 votes

What are some good strategies to test a floating point arithmetic implementation for double numbers?

One under-rated strategy is to just test with a lot of random numbers. Specifically, I've found that reinterpreting a random 64 bit integer as floating point gives a very good distribution since it ...
user avatar
2 votes

Is it worthwhile to write unit tests for scientific research codes?

For bigger code bases, tests (not necessarily unit tests) for the highlevel stuff are useful. Unit tests for some simpler algorithms are useful as well to make sure your code isn't doing nonsense ...
user avatar
  • 577
2 votes

Where can one obtain good data sets/test problems for testing algorithms/routines?

If you're looking for large graphs or network data to test on. The Stanford Network Analysis Project (SNAP) has many large graph datasets typically in the form of an anonymized adjacency list. Some of ...
2 votes
Accepted

How close observed order of accuracy should be to theoretical order of accuracy?

From practical experience, I find plotting the results of discretization refinement studies best to figure out whether or not the observed order of accuracy is "close enough". However, writing an ...
user avatar
2 votes
Accepted

Testing Wiener process splitting in adaptive-step SDE integrators

I discuss the method you describe in more detail in this paper (Rackauckas and Nie 2017) as RSwM2. In that paper I am ever so slightly able to detect that it's sometimes doing something wrong, but ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible