Skip to content

Moved local assembler creation to a separate file for TRM and TH2M

Purpose: Improved re-build times of non-unity-builds.

The creation of the local assemblers is the task where the compile has to do the heavy lifting. There, all local assemblers are instantiate and this is the task that consumes most resources while building a process.
In this MR, the local assembler creation for TRM and TH2M is moved to a separate file. Thereby, the corresponding ...Process.cpp files do not depend on the ...FEM.h files anymore, e.g.:

-#include "TH2MFEM.h"

Hence, when there is a change in the ...Process.cpp file only, the local assemblers do not have to be rebuilt (with non-unity builds).

I don't have measurements at hand, but when I wrote this code in November 2022, the rebuild times of the TRM process decreased by a factor of 3 (if I remember correctly 😄) in my setup (dynamic shape matrices, ccache, non-unity-builds, only ThermoRichardsMechanicsProcess.cpp changed). With fixed-size shape matrices the effect might be even greater, but your mileage may vary.

The change in this MR will be handy when changing the process, but not touching the local assemblers – as I did while implementing the submesh residuum output feature.

Edited by Christoph Lehmann

Merge request reports