programming

Can ChatGPT write fully functional CFD solvers?

In this article, we’ll explore ChatGPT’s capabilities to write CFD solvers from scratch. We’ll explore two types of applications: a simple model equation commonly used to study numerical schemes and a 2D CFD solver that hard-codes initial and boundary conditions but otherwise implements enough logic to be classified as a fully functioning CFD solver. We …

Can ChatGPT write fully functional CFD solvers? Read More »

Documenting code; why bother and how to do it right

In this article, we will explore the three main components that makeup code documentation. We will explore why providing documentation is important and how it improves the chance that others will start using your code. We also look at situations where writing documentation for the sake of it may lead to pointless documentation and this …

Documenting code; why bother and how to do it right Read More »

What is test coverage and how to use LCOV/GCOV for testing

In this final article on software testing, we look at test coverage. We discuss first what it is and what a good test coverage looks like. We then jump straight into an example and learn how to use gcov and lcov, two popular tools for reporting test coverage, and see how we can compute test …

What is test coverage and how to use LCOV/GCOV for testing Read More »

How to use mocking in CFD test code using gtest and gmock

In this article, we look at the last remaining topic in our series on software testing; Mocking. This aspect plays a a very big role in the testing of web and mobile applications, but not so much for console applications such as CFD solvers. However, there are specific use cases where mocking can help us …

How to use mocking in CFD test code using gtest and gmock Read More »

How To Test A Linear Algebra Solver Library Using gtest

In this article, we look at how we can test the linear algebra solver library we developed previously. In particular, we will look at how we can write unit, integration, and system tests that ensure our code is working using both white-box and black-box testing. This will provide our code with additional resistance against regressions …

How To Test A Linear Algebra Solver Library Using gtest Read More »

How To Test A CGNS-based Mesh Reading Library Using gtest

In this article, we extend our knowledge on how to integrate gtest into our mesh reading library using the CGNS data format for structured and unstructured grids that we developed in a previous series. We will rewrite the unit tests that we have already written using our own primitive testing framework and highlight how gtest …

How To Test A CGNS-based Mesh Reading Library Using gtest Read More »

How to get started with gtest in C++ for CFD development

In this article, we will look at testing frameworks in C++ and I provide reasons for why I am using Google’s gtest testing framework and why it covers all of our use-cases we have to test CFD solvers and related code. We will use it to rewrite our tests for the complex number class we …

How to get started with gtest in C++ for CFD development Read More »

The test-driven development for writing bug-free CFD code

In this article, we will put the knowledge that we gained from the previous article on software testing principles into practice, and learn about different software project management approaches, that prioritise testing differently. We will see that there are two competing approaches available, the waterfall and agile approach, where the waterfall approach leaves testing to …

The test-driven development for writing bug-free CFD code Read More »