# Tag Info

10

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 test FEM code I write is: test the stiffness & mass matrices on a single element to make sure I get local element assembly right, compare against a known ...

10

Method of manufactured solutions. Verify through refinement studies that the method achieves the theoretical order of accuracy. Conservation of answer. Bit-wise and norm-wise reproduction of solutions.

9

I'm a happy user of GoogleTest with a C++ MPI code in a CMake/CTest build environment: CMake automatically installs/links googletest from svn! adding tests is a one-liner! writing the tests is easy! (and google mock is very powerful!) CTest can pass command-line parameters to your tests, and exports data to CDash! This is how it works. A batch of unit-...

9

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 changes in the input. Specifically, we have  \underset{\epsilon \rightarrow 0_+}{\lim}\sup \left\{ \frac{1}{\epsilon} \left|\frac{s(x+\Delta x) - s(x)}{s(x)} \...

8

In computational electromagnetism, there is a famous (or infamous because of the difficulties in some) set of test problems: Testing Electromagnetic Analysis Methods (T.E.A.M.). Some of them really need seriously state-of-art numerical techniques to get the correct simulation results aligned with the experimental data. For example, the conductor-coil ...

7

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 solutions and makes it easy to make your own. Your PDE coefficients will become parameters in the forcing function that your chosen solution leads to, so you ...

7

Bill has already listed a few methods which address your concerns. Addressing your third point, no, there is no reason to introduce strong coupling between parts. Just the opposite: if your functions or classes have well defined interfaces, it will be much easier to exchange for instance a linear solver for another, or a time stepping scheme. Just resist it,...

7

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 code base, on multiple platforms. The tests Geoff describes are mostly "integration tests", i.e., they run through a significant part of the code base. You need ...

7

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 read its source code, you will be able to see what issues the authors wanted to address, and how they dealt with issues like convergence, user-specified tolerance ...

7

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 software tool, Sumatra: http://rrcns.readthedocs.io/en/latest/provenance_tracking.html. Another, simpler Python tool to do something similar is recipy.

5

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 port your results to the remote machine.

5

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), and initial condition, plug those into your program, run it, and compare the answer you get to the function you started with. This is known as the Method of ...

4

There are several MPI-enabled software packages that use the CMake set of tools for testing. The ones that I can think of off the top of my head are Trilinos, VTK and ParaView. I would think that you don't want to assume that the executable needs to be launched with mpirun and/or mpiexec. CMake has support for specifying how to properly launch the executable ...

4

We simply roll our own code in deal.II -- in essence, we tell the framework to execute tests using mpirun -np .... We had previously just used a Makefile-based testing scheme (compile, link, execute test, then compare the output with one that had previously been saved) and you can find this here: https://svn.dealii.org/branches/releases/Branch-8-0/tests/mpi/...

4

Try looking into the solutions available within MASA. MASA is a library of manufactured solutions containing many steady and transient problems for the flow physics you describe. These don't tend to be "interesting" in the sense that one stares at the results because they describe canonical engineering flows. However, they're "interesting" in the sense ...

4

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 and all of which can be solved analytically. For instance this solution is to the linearized acoustics equations. The choice between one or the other is ...

4

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.

4

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 equivalent is osxfuse). If your remote machine allows ssh connections, sshfs will be able to mount the remote filesystem locally over ssh. This is useful if, as I think ...

4

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 matrices. Another large collection of matrices is MatrixMarket, though it is a little bit outdated in my opinion. If you search for rectangular matrices, you ...

4

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 your tests on my laptop tells me whether there's something wrong with the code or the environment I've set up. The 53 seconds is specific to your development ...

4

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 processes: If a code has to enumerate objects to be worked on (for example in "embarrassingly parallel" problems, but also degrees of freedom in mesh-based ...

3

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 and values such as the drag and lift can be compared with values obtained with different softwares (a file containing the data is provided). Otherwise there ...

3

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, orthotropic and un-isotropic material properties, improperly constrained models. Make sure reaction forces match. Sturm checks for eigenvalue problems especially when ...

3

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 the equation $Ax = b$ to see if you recover your known solution. This method is known as the method of manufactured solutions. To avoid the influence of ...

3

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 comparing against the exact solution to which your numerical approximations have to converge.

3

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. Take a look: http://trilinos.org/docs/dev/packages/teuchos/doc/html/group__Teuchos__UnitTest__grp.html

3

There is a collection of reference PDE-constrained optimization problems maintained by Roland Herzog at TU-Chemnitz here.

3

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/u0015_0000001_0001551.pdf

3

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 solution to the solution you manufactured. Some solutions are chosen to satisfy other properties that you want. Spencer's comment suggests that boundary conditions ...

2

Check Turek-Hron FSI benchmark.

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