# Tag Info

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 ...
• 3,091
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 ...
• 29.8k
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 ...
• 1,351

### 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 ...
• 50.2k
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 ...
• 10.8k
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 ...
• 11.4k

### 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 ...
• 586

### 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. ...
• 171
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), ...
• 10.8k
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 ...
• 10.8k

### 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 ...

### 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, ...
• 71

### 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 ...
• 11.4k

### 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 ...
• 556

### 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.

### 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 ...
• 11.4k
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 ...
• 8,287

### 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 ...
• 50.2k
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 ...
• 10.8k
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 ...
• 50.2k

### 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 ...
• 1,246
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 ...
• 29.8k

### 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. ...

### 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/...
• 261

### 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 ...
• 211

### 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 ...
• 577

### 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 ...
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 ...
• 29.8k