<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing with OASIS Tables v3.0 20080202//EN" "journalpub-oasis3.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:oasis="http://docs.oasis-open.org/ns/oasis-exchange/table" xml:lang="en" dtd-version="3.0" article-type="research-article"><?xmltex \bartext{Development and technical paper}?>
  <front>
    <journal-meta><journal-id journal-id-type="publisher">GMD</journal-id><journal-title-group>
    <journal-title>Geoscientific Model Development</journal-title>
    <abbrev-journal-title abbrev-type="publisher">GMD</abbrev-journal-title><abbrev-journal-title abbrev-type="nlm-ta">Geosci. Model Dev.</abbrev-journal-title>
  </journal-title-group><issn pub-type="epub">1991-9603</issn><publisher>
    <publisher-name>Copernicus Publications</publisher-name>
    <publisher-loc>Göttingen, Germany</publisher-loc>
  </publisher></journal-meta>
    <article-meta>
      <article-id pub-id-type="doi">10.5194/gmd-15-5127-2022</article-id><title-group><article-title>Towards automatic finite-element methods for <?xmltex \hack{\break}?> geodynamics via Firedrake</article-title><alt-title>Firedrake</alt-title>
      </title-group><?xmltex \runningtitle{Firedrake}?><?xmltex \runningauthor{D. R. Davies et al.}?>
      <contrib-group>
        <contrib contrib-type="author" corresp="yes" rid="aff1">
          <name><surname>Davies</surname><given-names>D. Rhodri</given-names></name>
          <email>rhodri.davies@anu.edu.au</email>
        <ext-link>https://orcid.org/0000-0002-7662-9468</ext-link></contrib>
        <contrib contrib-type="author" corresp="no" rid="aff2">
          <name><surname>Kramer</surname><given-names>Stephan C.</given-names></name>
          
        <ext-link>https://orcid.org/0000-0002-9193-5092</ext-link></contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1">
          <name><surname>Ghelichkhan</surname><given-names>Sia</given-names></name>
          
        <ext-link>https://orcid.org/0000-0002-1316-3170</ext-link></contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1">
          <name><surname>Gibson</surname><given-names>Angus</given-names></name>
          
        </contrib>
        <aff id="aff1"><label>1</label><institution>Research School of Earth Sciences, Australian National University, Canberra, ACT, Australia</institution>
        </aff>
        <aff id="aff2"><label>2</label><institution>Department of Earth Science and Engineering, Imperial College London, London, UK</institution>
        </aff>
      </contrib-group>
      <author-notes><corresp id="corr1">D. Rhodri Davies (rhodri.davies@anu.edu.au)</corresp></author-notes><pub-date><day>5</day><month>July</month><year>2022</year></pub-date>
      
      <volume>15</volume>
      <issue>13</issue>
      <fpage>5127</fpage><lpage>5166</lpage>
      <history>
        <date date-type="received"><day>4</day><month>November</month><year>2021</year></date>
           <date date-type="rev-request"><day>13</day><month>January</month><year>2022</year></date>
           <date date-type="rev-recd"><day>9</day><month>May</month><year>2022</year></date>
           <date date-type="accepted"><day>9</day><month>May</month><year>2022</year></date>
      </history>
      <permissions>
        <copyright-statement>Copyright: © 2022 </copyright-statement>
        <copyright-year>2022</copyright-year>
      <license license-type="open-access"><license-p>This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this licence, visit <ext-link ext-link-type="uri" xlink:href="https://creativecommons.org/licenses/by/4.0/">https://creativecommons.org/licenses/by/4.0/</ext-link></license-p></license></permissions><self-uri xlink:href="https://gmd.copernicus.org/articles/.html">This article is available from https://gmd.copernicus.org/articles/.html</self-uri><self-uri xlink:href="https://gmd.copernicus.org/articles/.pdf">The full text article is available as a PDF file from https://gmd.copernicus.org/articles/.pdf</self-uri>
      <abstract><title>Abstract</title>

      <p id="d1e117">Firedrake is an automated system for solving partial differential equations using the finite-element method. By applying sophisticated performance optimisations through automatic code-generation techniques, it provides a means of creating accurate, efficient, flexible, easily extensible, scalable, transparent and reproducible research software that is ideally suited to simulating a wide range of problems in geophysical fluid dynamics. Here, we demonstrate the applicability of Firedrake for geodynamical simulation, with a focus on mantle dynamics. The accuracy and efficiency of the approach are confirmed via comparisons against a suite of analytical and benchmark cases of systematically increasing complexity, whilst parallel scalability is demonstrated up to 12 288 compute cores, where the problem size and the number of processing cores are simultaneously increased. In addition, Firedrake's flexibility is highlighted via straightforward application to different physical (e.g. complex non-linear rheologies, compressibility) and geometrical (2-D and 3-D Cartesian and spherical domains) scenarios. Finally, a representative simulation of global mantle convection is examined, which incorporates 230 Myr of plate motion history as a kinematic surface boundary condition, confirming Firedrake's suitability for addressing research problems at the frontiers of global mantle dynamics research.</p>
  </abstract>
    </article-meta>
  </front>
<body>
      

<sec id="Ch1.S1" sec-type="intro">
  <label>1</label><title>Introduction</title>
      <p id="d1e129">Since the advent of plate tectonic theory, there has been a long and successful history of research software development within the geodynamics community. The earliest modelling tools provided fundamental new insight into the process of mantle convection, its sensitivity to variations in viscosity, and its role in controlling Earth's surface plate motions and heat transport (e.g. <xref ref-type="bibr" rid="bib1.bibx90 bib1.bibx92 bib1.bibx125 bib1.bibx91" id="altparen.1"/>). Although transformative at the time, computational and algorithmic limitations dictated that these tools were restricted to a simplified approximation of the underlying physics and, excluding some notable exceptions (e.g. <xref ref-type="bibr" rid="bib1.bibx12 bib1.bibx52" id="altparen.2"/>), to 2-D Cartesian geometries. They were specifically designed to address targeted scientific questions. As such, they offered limited flexibility, were not easily extensible, and were not portable across different platforms. Furthermore, since they were often developed for use by one or two expert practitioners, they were poorly documented: details of the implementation could only be determined by analysing the underlying code, which was often a non-trivial and specialised task.</p>
      <p id="d1e138">Growing computational resources and significant theoretical and algorithmic advances have since underpinned the development of more advanced research software, which incorporates, for example, better approximations to the fundamental physical principles, including compressibility (e.g. <xref ref-type="bibr" rid="bib1.bibx66 bib1.bibx14 bib1.bibx119 bib1.bibx21 bib1.bibx47" id="altparen.3"/>), mineralogical-phase transformations (e.g. <xref ref-type="bibr" rid="bib1.bibx123 bib1.bibx99 bib1.bibx62" id="altparen.4"/>), multi-phase flow (e.g. <xref ref-type="bibr" rid="bib1.bibx67 bib1.bibx133" id="altparen.5"/>), variable and non-linear rheologies (e.g. <xref ref-type="bibr" rid="bib1.bibx96 bib1.bibx20 bib1.bibx128 bib1.bibx120 bib1.bibx94 bib1.bibx64 bib1.bibx116 bib1.bibx2 bib1.bibx81 bib1.bibx46 bib1.bibx63" id="altparen.6"/>), and feedbacks between chemical heterogeneity and buoyancy (e.g. <xref ref-type="bibr" rid="bib1.bibx129 bib1.bibx122 bib1.bibx32" id="altparen.7"/>). In addition, these more recent tools can often be applied in more representative 2-D cylindrical and/or 3-D spherical shell geometries (e.g. <xref ref-type="bibr" rid="bib1.bibx12 bib1.bibx13 bib1.bibx65 bib1.bibx21 bib1.bibx130 bib1.bibx137 bib1.bibx138 bib1.bibx121 bib1.bibx135 bib1.bibx116 bib1.bibx33" id="altparen.8"/>). The user base of these tools has rapidly increased, with software development teams emerging to enhance their applicability and ensure their ongoing functionality. These teams have done so by adopting best practices in modern software development, including version control, unit and regression testing across a range of platforms and validation of model predictions against a suite of analytical and benchmark solutions (e.g. <xref ref-type="bibr" rid="bib1.bibx17 bib1.bibx25 bib1.bibx68 bib1.bibx126 bib1.bibx76" id="altparen.9"/>).</p>
      <p id="d1e163">Nonetheless, given rapid and ongoing improvements in algorithmic design and software engineering alongside the development of robust and flexible scientific computing libraries that provide access to much of the low-level numerical functionality required by geodynamical models, a next generation of open-source and community-driven geodynamical research software has emerged, exploiting developments from the forefront of computational engineering. This includes ASPECT (e.g. <xref ref-type="bibr" rid="bib1.bibx78 bib1.bibx57 bib1.bibx11" id="altparen.10"/>), built on the deal.II <xref ref-type="bibr" rid="bib1.bibx10" id="paren.11"/>, p4est <xref ref-type="bibr" rid="bib1.bibx23" id="paren.12"/> and Trilinos <xref ref-type="bibr" rid="bib1.bibx58 bib1.bibx127" id="paren.13"/> libraries, Fluidity (e.g. <xref ref-type="bibr" rid="bib1.bibx31 bib1.bibx75 bib1.bibx76 bib1.bibx77" id="altparen.14"/>), which is underpinned by the PETSc <xref ref-type="bibr" rid="bib1.bibx7 bib1.bibx8 bib1.bibx9" id="paren.15"/> and Spud <xref ref-type="bibr" rid="bib1.bibx54" id="paren.16"/> libraries, Underworld2 (e.g. <xref ref-type="bibr" rid="bib1.bibx95 bib1.bibx15" id="altparen.17"/>), core aspects of which are built on the St Germain <xref ref-type="bibr" rid="bib1.bibx102" id="paren.18"/> and PETSc libraries, and TerraFERMA <xref ref-type="bibr" rid="bib1.bibx134" id="paren.19"/>, which has foundations in the FEniCS <xref ref-type="bibr" rid="bib1.bibx86 bib1.bibx3" id="paren.20"/>, PETSc and Spud libraries. By building on existing computational libraries that are highly efficient, extensively tested and validated, modern geodynamical research software is becoming increasingly reliable and reproducible. Its modular design also facilitates the addition of new features and provides a degree of confidence about the validity of previous developments, as evidenced by growth in the use and applicability of ASPECT over recent years.</p>
      <p id="d1e200">However, even with these modern research software frameworks, some fundamental development decisions, such as the core physical equations, numerical approximations and general solution strategy, have been integrated into the basic building blocks of the code. Whilst there remains some flexibility within the context of a single problem, modifications to include different physical approximations or components, which can affect non-linear coupling and associated solution strategies, often require extensive and time-consuming development and testing, using either separate code forks or increasingly complex option systems. This makes reproducibility of a given simulation difficult, resulting in a lack of transparency – even with detailed documentation, specific details of the implementation are sometimes only available by reading the code itself, which, as noted previously, is non-trivial, particularly across different forks or with increasing code complexity <xref ref-type="bibr" rid="bib1.bibx134" id="paren.21"/>. This makes scientific studies into the influence of different physical or geometrical scenarios, using a consistent code base, extremely challenging. Those software frameworks that try to maintain some degree of flexibility often do so at the expense of performance: the flexibility to configure different equations, numerical discretisations and solver strategies, in different dimensions and geometries, requires implementation compromises in the choice of optimal algorithms and specific low-level optimisations for all possible configurations.</p>
      <p id="d1e207">A challenge that remains central to research software development in geodynamics, therefore, is the need to provide accurate, efficient, flexible, easily extensible, scalable, transparent and reproducible research software that can be applied to simulating a wide range of scenarios, including problems in different geometries and those incorporating different approximations of the underlying physics <xref ref-type="bibr" rid="bib1.bibx134" id="paren.22"><named-content content-type="pre">e.g.</named-content></xref>. However, this requires a large time commitment and knowledge that spans several academic disciplines. Arriving at a physical description of a complex system, such as global mantle convection, demands expertise in geology, geophysics, geochemistry, fluid mechanics and rheology. Discretising the governing partial differential equations (PDEs) to produce a suitable numerical scheme requires proficiency in mathematical analysis, whilst its translation into efficient code for massively parallel systems demands advanced knowledge in low-level code optimisation and computer architectures <xref ref-type="bibr" rid="bib1.bibx105" id="paren.23"><named-content content-type="pre">e.g.</named-content></xref>. The consequence of this is that the development of research software for geodynamics has now become a multi-disciplinary effort, and its design must enable scientists across several disciplines to collaborate effectively, without requiring each of them to comprehend all aspects of the system.</p>
      <p id="d1e220">Key to achieving this is to abstract, automate and compose the various processes involved in numerically solving the PDEs governing a specific problem (e.g. <xref ref-type="bibr" rid="bib1.bibx86 bib1.bibx3 bib1.bibx105 bib1.bibx134" id="altparen.24"/>) to enable a separation of concerns between developing a technique and using it. As such, software projects involving automatic code generation have become increasingly popular, as these help to separate different aspects of development. Such an approach facilitates collaboration between computational engineers with expertise in hardware and software, computer scientists and applied mathematicians with expertise in numerical algorithms, and domain-specific scientists, such as geodynamicists.</p>
      <p id="d1e226">In this study, we introduce Firedrake to the geodynamical modelling community: a next-generation automated system for solving PDEs using the finite-element method (e.g. <xref ref-type="bibr" rid="bib1.bibx105 bib1.bibx51" id="altparen.25"/>). As we will show, the finite-element method is well-suited to automatic code-generation techniques: a weak formulation of the governing PDEs, together with a mesh, initial and boundary conditions, and appropriate discrete function spaces, is sufficient to fully represent the problem. The purpose of this paper is to demonstrate the applicability of Firedrake for geodynamical simulation whilst also highlighting its advantages over existing geodynamical research software. We do so via comparisons against a suite of analytical and benchmark cases of systematically increasing complexity.</p>
      <p id="d1e232">The remainder of the paper is structured as follows. In Sect. <xref ref-type="sec" rid="Ch1.S2"/>, we provide a background to the Firedrake project and the various dependencies of its software stack. In Sect. <xref ref-type="sec" rid="Ch1.S3"/>, we introduce the equations governing mantle convection which will be central to the examples developed herein, followed, in Sect. <xref ref-type="sec" rid="Ch1.S4"/>, by a description of their discretisation via the finite-element method and the associated solution strategies. In Sect. <xref ref-type="sec" rid="Ch1.S5"/>, we introduce a series of benchmark cases in Cartesian and spherical shell geometries. These are commonly examined within the geodynamical modelling community, and we describe the steps involved with setting up these cases in Firedrake, allowing us to highlight its ease of use. Parallel performance is analysed in Sect. <xref ref-type="sec" rid="Ch1.S6"/>, with a representative example of global mantle convection described and analysed in Sect. <xref ref-type="sec" rid="Ch1.S7"/>. The latter case confirms Firedrake's suitability for addressing research problems at the frontiers of global mantle dynamics research. Other components of Firedrake, which have not been showcased in this paper but which may be beneficial to various future research endeavours, are discussed in Sect. <xref ref-type="sec" rid="Ch1.S8"/>.</p>
</sec>
<sec id="Ch1.S2">
  <label>2</label><title>Firedrake</title>
      <p id="d1e258">The Firedrake project is an automated system for solving partial differential equations using the finite-element method <xref ref-type="bibr" rid="bib1.bibx105" id="paren.26"><named-content content-type="pre">e.g.</named-content></xref>. Using a high-level language that reflects the mathematical description of the governing equations <xref ref-type="bibr" rid="bib1.bibx3" id="paren.27"><named-content content-type="pre">e.g.</named-content></xref>, the user specifies the finite-element problem symbolically. The high-performance implementation of assembly operations for the discrete operators is then generated “automatically” by a sequence of specialised compiler passes that apply symbolic mathematical transformations to the input equations to ultimately produce C (and C++) code <xref ref-type="bibr" rid="bib1.bibx105 bib1.bibx61" id="paren.28"/>. Firedrake compiles and executes this code to create linear or non-linear systems, which are solved by PETSc <xref ref-type="bibr" rid="bib1.bibx7 bib1.bibx9 bib1.bibx8" id="paren.29"/>. As stated by <xref ref-type="bibr" rid="bib1.bibx105" id="text.30"/>, in comparison to conventional finite-element libraries, and even more so with handwritten code, Firedrake provides a higher-productivity mechanism for solving finite-element problems whilst simultaneously applying sophisticated performance optimisations that few users would have the resources to code by hand.</p>
      <p id="d1e280">Firedrake builds on the concepts and some of the code of the FEniCS project <xref ref-type="bibr" rid="bib1.bibx86" id="paren.31"><named-content content-type="pre">e.g.</named-content></xref>, particularly its representation of variational problems via the Unified Form Language (UFL) <xref ref-type="bibr" rid="bib1.bibx3" id="paren.32"/>. We note that the applicability of FEniCS for geodynamical problems has already been demonstrated (e.g. <xref ref-type="bibr" rid="bib1.bibx132 bib1.bibx134" id="altparen.33"/>). Both frameworks have the goal of saving users from manually writing low-level code for assembling the systems of equations that discretise their model physics. An important architectural difference is that, while FEniCS has components written in C++ and Python, Firedrake is completely written in Python, including its run-time environment (it is only the automatically generated assembly code that is in C/C++, although it does leverage the PETSc library, written in C, to solve the assembled systems, albeit through its Python interface – <monospace>petsc4py</monospace>). This provides a highly flexible user interface with ease of introspection of data structures. We note that the Python environment also allows deployment of handwritten C kernels should the need arise to perform discrete mesh-based operations that cannot be expressed in the finite-element framework, such as sophisticated slope limiters or bespoke sub-grid physics.</p>
      <p id="d1e297">Firedrake offers several highly desirable features, rendering it well-suited to problems in geophysical fluid dynamics. As will be illustrated through a series of examples below, of particular importance in the context of this paper is Firedrake's support for a range of different finite-element discretisations, including a highly efficient implementation of those based on extruded meshes, programmable non-linear solvers and composable operator-aware solver preconditioners. As the importance of reproducibility in the computational geosciences is increasingly recognised, we note that Firedrake integrates with Zenodo and GitHub to provide users with the ability to generate a set of DOIs corresponding to the exact set of Firedrake components used to conduct a particular simulation, in full compliance with FAIR (findable, accessible, interoperable, reusable) principles.</p>
<sec id="Ch1.S2.SS1">
  <label>2.1</label><title>Dependencies</title>
      <p id="d1e307">Firedrake treats finite-element problems as a composition of several abstract processes, using separate packages for each. The framework imposes a clear separation of concerns between the definition of the problem (UFL, Firedrake language), the generation of computational kernels used to assemble the coefficients of the discrete equations (Two-Stage Form Compiler – TSFC – and FInAT), the parallel execution of this kernel (PyOP2) over a given mesh topology (DMPlex) and the solution of the resulting linear or non-linear systems (PETSc). These layers allow various types of optimisation to be applied at different stages of the solution process. The key components of this software stack are described next.</p>
      <p id="d1e310"><list list-type="order">
            <list-item>

      <p id="d1e315">UFL – as we will see in the examples below, a core part of finite-element problems is the specification of the weak form of the governing PDEs. UFL, a domain-specific symbolic language with well-defined and mathematically consistent semantics that is embedded in Python, provides an elegant solution to this problem. It was pioneered by the FEniCS project <xref ref-type="bibr" rid="bib1.bibx86" id="paren.34"/>, although Firedrake has added several extensions.</p>
            </list-item>
            <list-item>

      <p id="d1e324">Firedrake language – in addition to the weak form of the PDEs, finite-element problems require the user to select appropriate finite elements, specify the mesh to be employed, set field values for initial and boundary conditions and specify the sequence in which solves occur. Firedrake implements its own language for these tasks, which was designed to be to a large extent compatible with DOLFIN <xref ref-type="bibr" rid="bib1.bibx86" id="paren.35"/>, the runtime application programming interface (API) of the FEniCS project. We note that Firedrake implements various extensions to DOLFIN, whilst some features of DOLFIN are not supported by Firedrake.</p>
            </list-item>
            <list-item>

      <p id="d1e333">FInAT <xref ref-type="bibr" rid="bib1.bibx71" id="paren.36"/> incorporates all information required to evaluate the basis functions of the different finite-element families supported by Firedrake. In earlier versions of Firedrake this was done through tabulation of the basis functions evaluated at Gauss points (FIAT: <xref ref-type="bibr" rid="bib1.bibx69" id="altparen.37"/>). FInAT, however, provides this information to the form compiler as a combination of symbolic expressions and numerical values, allowing for further optimisations. FInAT allows Firedrake to support a wide range of finite elements, including continuous, discontinuous, <inline-formula><mml:math id="M1" display="inline"><mml:mi>H</mml:mi></mml:math></inline-formula>(div) and <inline-formula><mml:math id="M2" display="inline"><mml:mi>H</mml:mi></mml:math></inline-formula>(curl) discretisations and elements with continuous derivatives such as the Argyris and Bell elements.</p>
            </list-item>
            <list-item>

      <p id="d1e359">TSFC – a form compiler takes a high-level description of the weak form of PDEs (here in the UFL) and produces low-level code that carries out the finite-element assembly. Firedrake uses the TSFC, which was developed specifically for the Firedrake project <xref ref-type="bibr" rid="bib1.bibx61" id="paren.38"/>, to generate its local assembly kernels. TSFC invokes two stages, where in the first stage UFL is translated to an intermediate symbolic tensor algebra language before translating this into assembly kernels written in C. In comparison to the form compilers of FEniCS (FFC and UFLACS), TSFC aims to maintain the algebraic structure of the input expression for longer, which opens up additional opportunities for optimisation.</p>
            </list-item>
            <list-item>

      <p id="d1e368">PyOP2 – a key component of Firedrake's software stack is PyOP2, a high-level framework that optimises the parallel execution of computational kernels on unstructured meshes <xref ref-type="bibr" rid="bib1.bibx104 bib1.bibx88" id="paren.39"/>. Where the local assembly kernels generated by TSFC calculate the values of a local tensor from local input tensors, all associated with the degrees of freedom (DOFs) of a single element, PyOP2 wraps this code in an additional layer responsible for the extraction and addition of these local tensors out of/into global structures such as vectors and sparse matrices. It is also responsible for the maintenance of halo layers, the overlapping regions in a parallel decomposed problem. PyOP2 allows for a clean separation of concerns between the specification of the local kernel functions, in which the numerics of the method are encoded, and their efficient parallel execution. More generally, this separation of concerns is the key novel abstraction that underlies the design of the Firedrake system.</p>
            </list-item>
            <list-item>

      <p id="d1e378">DMPlex – PyOP2 has no concept of the topological construction of a mesh. Firedrake derives the required maps through DMPlex, a data management abstraction that represents unstructured mesh data, which is part of the PETSc project <xref ref-type="bibr" rid="bib1.bibx72" id="paren.40"/>. This allows Firedrake to leverage the DMPlex partitioning and data migration interfaces to perform domain decomposition at run time whilst supporting multiple mesh file formats. Moreover, Firedrake reorders mesh entities to ensure computational efficiency <xref ref-type="bibr" rid="bib1.bibx80" id="paren.41"/>.</p>
            </list-item>
            <list-item>

      <p id="d1e390">Linear and non-linear solvers – Firedrake passes solver problems on to PETSc <xref ref-type="bibr" rid="bib1.bibx7 bib1.bibx8 bib1.bibx9" id="paren.42"/>, a well-established, high-performance solver library that provides access to several of its own and third-party implementations of solver algorithms. The Python interface to PETSc <xref ref-type="bibr" rid="bib1.bibx29" id="paren.43"/> makes integration with Firedrake straightforward. We note that employing PETSc for both its solver library and for DMPlex has the additional advantage that the set of library dependencies required by Firedrake is kept small <xref ref-type="bibr" rid="bib1.bibx105" id="paren.44"/>.</p>
            </list-item>
          </list></p>
</sec>
</sec>
<sec id="Ch1.S3">
  <label>3</label><title>Governing equations</title>
      <p id="d1e413">Our focus here is on mantle convection, the slow creeping motion of Earth's mantle over geological timescales. The equations governing mantle convection are derived from the conservation laws of mass, momentum and energy. The simplest mathematical formulation assumes a single incompressible material and the Boussinesq approximation <xref ref-type="bibr" rid="bib1.bibx91" id="paren.45"/>, under which the non-dimensional momentum and continuity equations are given by

              <disp-formula specific-use="gather" content-type="numbered"><mml:math id="M3" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="Ch1.E1"><mml:mtd><mml:mtext>1</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mover><mml:mi mathvariant="italic">σ</mml:mi><mml:mo>=</mml:mo></mml:mover><mml:mo>+</mml:mo><mml:mi>R</mml:mi><mml:msub><mml:mi>a</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mi>T</mml:mi><mml:mover accent="true"><mml:mi mathvariant="bold-italic">k</mml:mi><mml:mo mathvariant="normal" stretchy="false">^</mml:mo></mml:mover><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E2"><mml:mtd><mml:mtext>2</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula>

          where <inline-formula><mml:math id="M4" display="inline"><mml:mover><mml:mi mathvariant="italic">σ</mml:mi><mml:mo>=</mml:mo></mml:mover></mml:math></inline-formula> is the stress tensor, <inline-formula><mml:math id="M5" display="inline"><mml:mi mathvariant="bold-italic">u</mml:mi></mml:math></inline-formula>  is the velocity and <inline-formula><mml:math id="M6" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula> is the
temperature. <inline-formula><mml:math id="M7" display="inline"><mml:mover accent="true"><mml:mi mathvariant="bold-italic">k</mml:mi><mml:mo stretchy="false" mathvariant="normal">^</mml:mo></mml:mover></mml:math></inline-formula> is the unit vector in the direction opposite to gravity and <inline-formula><mml:math id="M8" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:msub><mml:mi>a</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> denotes the Rayleigh number, a dimensionless number that quantifies the vigour of convection:
          <disp-formula id="Ch1.E3" content-type="numbered"><label>3</label><mml:math id="M9" display="block"><mml:mrow><mml:mi>R</mml:mi><mml:msub><mml:mi>a</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mi mathvariant="italic">α</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>T</mml:mi><mml:mi>g</mml:mi><mml:msup><mml:mi>d</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msup></mml:mrow><mml:mrow><mml:msub><mml:mi mathvariant="italic">μ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mi mathvariant="italic">κ</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
        Here, <inline-formula><mml:math id="M10" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> denotes the reference density, <inline-formula><mml:math id="M11" display="inline"><mml:mi mathvariant="italic">α</mml:mi></mml:math></inline-formula> the thermal expansion coefficient, <inline-formula><mml:math id="M12" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>T</mml:mi></mml:mrow></mml:math></inline-formula> the characteristic temperature change across the domain, <inline-formula><mml:math id="M13" display="inline"><mml:mi>g</mml:mi></mml:math></inline-formula> the gravitational acceleration, <inline-formula><mml:math id="M14" display="inline"><mml:mi>d</mml:mi></mml:math></inline-formula> the characteristic length, <inline-formula><mml:math id="M15" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">μ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> the reference dynamic viscosity and <inline-formula><mml:math id="M16" display="inline"><mml:mi mathvariant="italic">κ</mml:mi></mml:math></inline-formula> the thermal diffusivity. Note that the above non-dimensional equations are obtained through the following characteristic scales: length <inline-formula><mml:math id="M17" display="inline"><mml:mi>d</mml:mi></mml:math></inline-formula>, time <inline-formula><mml:math id="M18" display="inline"><mml:mrow><mml:msup><mml:mi>d</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mo>/</mml:mo><mml:mi mathvariant="italic">κ</mml:mi></mml:mrow></mml:math></inline-formula> and temperature <inline-formula><mml:math id="M19" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>T</mml:mi></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e671">When simulating incompressible flow, the full stress tensor, <inline-formula><mml:math id="M20" display="inline"><mml:mover><mml:mi mathvariant="italic">σ</mml:mi><mml:mo>=</mml:mo></mml:mover></mml:math></inline-formula>, is decomposed into deviatoric and volumetric components:
          <disp-formula id="Ch1.E4" content-type="numbered"><label>4</label><mml:math id="M21" display="block"><mml:mrow><mml:mover><mml:mi mathvariant="italic">σ</mml:mi><mml:mo>=</mml:mo></mml:mover><mml:mo>=</mml:mo><mml:mover><mml:mi mathvariant="italic">τ</mml:mi><mml:mo>=</mml:mo></mml:mover><mml:mo>-</mml:mo><mml:mi>p</mml:mi><mml:mi mathvariant="bold">I</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        where <inline-formula><mml:math id="M22" display="inline"><mml:mover><mml:mi mathvariant="italic">τ</mml:mi><mml:mo>=</mml:mo></mml:mover></mml:math></inline-formula> is the deviatoric stress tensor, <inline-formula><mml:math id="M23" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula> is dynamic pressure and <inline-formula><mml:math id="M24" display="inline"><mml:mi mathvariant="bold">I</mml:mi></mml:math></inline-formula> is the identity matrix. Substituting Eq. (<xref ref-type="disp-formula" rid="Ch1.E4"/>) into Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>) and utilizing the constitutive relation
          <disp-formula id="Ch1.E5" content-type="numbered"><label>5</label><mml:math id="M25" display="block"><mml:mrow><mml:mover><mml:mi mathvariant="italic">τ</mml:mi><mml:mo>=</mml:mo></mml:mover><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">μ</mml:mi><mml:mover accent="true"><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mo mathvariant="normal">˙</mml:mo></mml:mover><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">μ</mml:mi><mml:mi mathvariant="normal">sym</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi mathvariant="italic">μ</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>+</mml:mo><mml:msup><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        which relates the deviatoric stress tensor, <inline-formula><mml:math id="M26" display="inline"><mml:mover><mml:mi mathvariant="italic">τ</mml:mi><mml:mo>=</mml:mo></mml:mover></mml:math></inline-formula>, to the strain-rate tensor, <inline-formula><mml:math id="M27" display="inline"><mml:mrow><mml:mover accent="true"><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mo mathvariant="normal">˙</mml:mo></mml:mover><mml:mo>=</mml:mo><mml:mi mathvariant="normal">sym</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, yields
          <disp-formula id="Ch1.E6" content-type="numbered"><label>6</label><mml:math id="M28" display="block"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="italic">μ</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>+</mml:mo><mml:msup><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mfenced><mml:mo>-</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mi>p</mml:mi><mml:mo>+</mml:mo><mml:mi>R</mml:mi><mml:msub><mml:mi>a</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mi>T</mml:mi><mml:mover accent="true"><mml:mi mathvariant="bold-italic">k</mml:mi><mml:mo stretchy="false" mathvariant="normal">^</mml:mo></mml:mover><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
        The viscous flow problem can thus be posed in terms of pressure, <inline-formula><mml:math id="M29" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula>, velocity, <inline-formula><mml:math id="M30" display="inline"><mml:mi mathvariant="bold-italic">u</mml:mi></mml:math></inline-formula>, and temperature, <inline-formula><mml:math id="M31" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula>. The evolution of the thermal field is controlled by an advection–diffusion equation:
          <disp-formula id="Ch1.E7" content-type="numbered"><label>7</label><mml:math id="M32" display="block"><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>+</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mi>T</mml:mi><mml:mo>-</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="italic">κ</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:mi>T</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
        These governing equations are sufficient to solve for the three unknowns together with adequate boundary and initial conditions.</p>
</sec>
<sec id="Ch1.S4">
  <label>4</label><title>Finite-element discretisation and solution strategy</title>
      <p id="d1e971">For the derivation of the finite-element discretisation of Eqs. (<xref ref-type="disp-formula" rid="Ch1.E6"/>), (<xref ref-type="disp-formula" rid="Ch1.E2"/>) and (<xref ref-type="disp-formula" rid="Ch1.E7"/>), we start by writing these in their weak form. We select appropriate function spaces <inline-formula><mml:math id="M33" display="inline"><mml:mi>V</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M34" display="inline"><mml:mi>W</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M35" display="inline"><mml:mi>Q</mml:mi></mml:math></inline-formula> that contain respectively the solution fields for velocity <inline-formula><mml:math id="M36" display="inline"><mml:mi mathvariant="bold-italic">u</mml:mi></mml:math></inline-formula>, pressure <inline-formula><mml:math id="M37" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula> and temperature <inline-formula><mml:math id="M38" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula> and also contain the test functions <inline-formula><mml:math id="M39" display="inline"><mml:mrow><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>,</mml:mo><mml:mi>w</mml:mi></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M40" display="inline"><mml:mi>q</mml:mi></mml:math></inline-formula>. The weak form is then obtained by multiplying these equations by the test functions and integrating over the domain <inline-formula><mml:math id="M41" display="inline"><mml:mi mathvariant="normal">Ω</mml:mi></mml:math></inline-formula>:

              <disp-formula specific-use="align" content-type="numbered"><mml:math id="M42" display="block"><mml:mtable displaystyle="true"><mml:mtr><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">v</mml:mi></mml:mrow></mml:mfenced><mml:mo>:</mml:mo><mml:mi mathvariant="italic">μ</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>+</mml:mo><mml:msup><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi><mml:mo>-</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">v</mml:mi></mml:mrow></mml:mfenced><mml:mi>p</mml:mi><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mlabeledtr id="Ch1.E8"><mml:mtd><mml:mtext>8</mml:mtext></mml:mtd><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mspace linebreak="nobreak" width="1em"/><mml:mo>-</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mi>R</mml:mi><mml:msub><mml:mi>a</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mi>T</mml:mi><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>⋅</mml:mo><mml:mover accent="true"><mml:mi mathvariant="bold-italic">k</mml:mi><mml:mo stretchy="false" mathvariant="normal">^</mml:mo></mml:mover><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mtext> for all </mml:mtext><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>∈</mml:mo><mml:mi>V</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E9"><mml:mtd><mml:mtext>9</mml:mtext></mml:mtd><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mi>w</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mtext> for all </mml:mtext><mml:mi>w</mml:mi><mml:mo>∈</mml:mo><mml:mi>W</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mtr><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mi>q</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi><mml:mo>+</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mi>q</mml:mi><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mi>T</mml:mi><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi><mml:mo>+</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi>q</mml:mi></mml:mrow></mml:mfenced><mml:mo>⋅</mml:mo><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="italic">κ</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:mi>T</mml:mi></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mlabeledtr id="Ch1.E10"><mml:mtd><mml:mtext>10</mml:mtext></mml:mtd><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mspace linebreak="nobreak" width="1em"/><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mtext> for all </mml:mtext><mml:mi>q</mml:mi><mml:mo>∈</mml:mo><mml:mi>Q</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula>

          Note that we have integrated by parts the viscosity and pressure gradient terms in Eq. (<xref ref-type="disp-formula" rid="Ch1.E6"/>) and the diffusion term in Eq. (<xref ref-type="disp-formula" rid="Ch1.E7"/>) but have omitted the corresponding boundary terms, which will be considered in the following section.</p>
      <p id="d1e1321">Equations (<xref ref-type="disp-formula" rid="Ch1.E8"/>)–(<xref ref-type="disp-formula" rid="Ch1.E10"/>) are a more general representation of the continuous PDEs in strong form (Eqs. <xref ref-type="disp-formula" rid="Ch1.E6"/>, <xref ref-type="disp-formula" rid="Ch1.E2"/>
and <xref ref-type="disp-formula" rid="Ch1.E7"/>), provided suitable function spaces with sufficient regularity
are chosen (see for example <xref ref-type="bibr" rid="bib1.bibx139 bib1.bibx40" id="altparen.46"/>). Finite-element discretisation proceeds by restricting these function spaces to finite-dimensional subspaces. These are typically constructed by dividing the domain into cells or elements and restricting it to piecewise polynomial subspaces with various continuity requirements between cells.
Firedrake offers a very wide range of such finite-element function spaces <xref ref-type="bibr" rid="bib1.bibx71" id="paren.47"><named-content content-type="pre">see</named-content><named-content content-type="post">for an overview</named-content></xref>. It should be noted however that, in practice, this choice is guided by numerical stability considerations in relation to the specific equations that are being solved. In particular, the choice of velocity and pressure function spaces used in the Stokes system
is restricted by the Ladyzhenskaya–Babuška–Brezzi (LBB) condition (see  <xref ref-type="bibr" rid="bib1.bibx124" id="altparen.48"/>, for an overview of common choices for geodynamical flow). In this paper, we focus on the use of  the familiar Q2Q1 element pair for velocity and pressure, which employs piecewise continuous bi-quadratic and bilinear polynomials on quadrilaterals or hexahedra for velocity and pressure respectively. In addition, to showcase Firedrake's flexibility, we use the less familiar Q2P<inline-formula><mml:math id="M43" display="inline"><mml:msub><mml:mi/><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mtext>DG</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula> pair in a number of cases, in which pressure is discontinuous and piecewise linear (but not bilinear). For temperature, we primarily use a Q2 discretisation but also show some results using a Q1 discretisation.</p>
      <p id="d1e1360">All that is required for the implementation of these choices is that a basis can be found for the function space such that each solution can be written as a linear combination of basis functions. For example, if we have a basis <inline-formula><mml:math id="M44" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> of the finite-dimensional function space <inline-formula><mml:math id="M45" display="inline"><mml:mrow><mml:msub><mml:mi>Q</mml:mi><mml:mi>h</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> of temperature solutions, then we can write each temperature solution as
          <disp-formula id="Ch1.E11" content-type="numbered"><label>11</label><mml:math id="M46" display="block"><mml:mrow><mml:mi>T</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mi>i</mml:mi></mml:munder><mml:msub><mml:mi>T</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        where <inline-formula><mml:math id="M47" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> represents the coefficients that we can collect into a discrete
solution vector <inline-formula><mml:math id="M48" display="inline"><mml:munder><mml:mi>T</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder></mml:math></inline-formula>. Using a Lagrangian polynomial basis, the coefficients <inline-formula><mml:math id="M49" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> correspond to values at the nodes, where each node <inline-formula><mml:math id="M50" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula> is associated with
one basis function <inline-formula><mml:math id="M51" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, but this is not generally true for other choices of
finite-element bases.</p>
      <p id="d1e1476">In curved domains, boundaries can be approximated with a finite number of triangles, tetrahedrals, quadrilaterals or hexahedrals. This can be seen as a piecewise linear (or bilinear/trilinear) approximation where the domain is approximated by straight lines (edges) between vertices. A more accurate representation of the domain is obtained by allowing higher-order polynomials that describe the physical embedding of the element within the
domain.
A typical choice is to use a so-called iso-parametric representation in which the polynomial order of the embedding is the same as that of the discretised functions that are solved for.</p>
      <p id="d1e1480">Finally, we note that it is common to use a subscript <inline-formula><mml:math id="M52" display="inline"><mml:msub><mml:mi/><mml:mi>h</mml:mi></mml:msub></mml:math></inline-formula> for the
discrete, finite-dimensional function subspaces and <inline-formula><mml:math id="M53" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>h</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> for the
discretised approximation by the mesh of the domain <inline-formula><mml:math id="M54" display="inline"><mml:mi mathvariant="normal">Ω</mml:mi></mml:math></inline-formula>, but since the remainder of this
paper focusses on the details and implementation of this discretisation, we simply drop the <inline-formula><mml:math id="M55" display="inline"><mml:msub><mml:mi/><mml:mi>h</mml:mi></mml:msub></mml:math></inline-formula> subscripts from here on.</p>
<sec id="Ch1.S4.SS1">
  <label>4.1</label><title>Boundary conditions</title>
      <p id="d1e1526">In the Cartesian examples considered below, zero-slip and free-slip boundary conditions for Eqs. (<xref ref-type="disp-formula" rid="Ch1.E8"/>) and (<xref ref-type="disp-formula" rid="Ch1.E9"/>) are imposed through strong Dirichlet boundary conditions for velocity <inline-formula><mml:math id="M56" display="inline"><mml:mi mathvariant="bold-italic">u</mml:mi></mml:math></inline-formula>. This is achieved by restricting the velocity function space <inline-formula><mml:math id="M57" display="inline"><mml:mi>V</mml:mi></mml:math></inline-formula> to a subspace <inline-formula><mml:math id="M58" display="inline"><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>
of vector functions for which all components (zero-slip) or only the normal
component (free-slip) are zero at the boundary. Since this restriction also
applies to the test functions <inline-formula><mml:math id="M59" display="inline"><mml:mi mathvariant="bold-italic">v</mml:mi></mml:math></inline-formula>, the weak form only needs to be
satisfied for all test functions <inline-formula><mml:math id="M60" display="inline"><mml:mrow><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>∈</mml:mo><mml:msub><mml:mi>V</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> that satisfy the homogeneous boundary conditions. Therefore, the omitted boundary integral
            <disp-formula id="Ch1.E12" content-type="numbered"><label>12</label><mml:math id="M61" display="block"><mml:mrow><mml:mo>-</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:mrow></mml:munder><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>⋅</mml:mo><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="italic">μ</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>+</mml:mo><mml:msup><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">n</mml:mi><mml:mi mathvariant="normal">d</mml:mi><mml:mi>s</mml:mi></mml:mrow></mml:math></disp-formula>
          that was required to obtain the integrated-by-parts viscosity term in Eq. (<xref ref-type="disp-formula" rid="Ch1.E8"/>) automatically vanishes for zero-slip boundary conditions as <inline-formula><mml:math id="M62" display="inline"><mml:mrow><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula> at the domain boundary, <inline-formula><mml:math id="M63" display="inline"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:mrow></mml:math></inline-formula>. In the case of a free-slip
boundary condition for which the tangential components of <inline-formula><mml:math id="M64" display="inline"><mml:mi mathvariant="bold-italic">v</mml:mi></mml:math></inline-formula> are
non-zero, the boundary term does not vanish, but by omitting that term in Eq. (<xref ref-type="disp-formula" rid="Ch1.E8"/>), we weakly impose a zero shear stress condition. The boundary term obtained by integrating the pressure gradient term in Eq. (<xref ref-type="disp-formula" rid="Ch1.E2"/>) by parts,
            <disp-formula id="Ch1.E13" content-type="numbered"><label>13</label><mml:math id="M65" display="block"><mml:mrow><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:mrow></mml:munder><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">n</mml:mi><mml:mi>p</mml:mi><mml:mi mathvariant="normal">d</mml:mi><mml:mi>s</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          also vanishes as <inline-formula><mml:math id="M66" display="inline"><mml:mrow><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">n</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula> for <inline-formula><mml:math id="M67" display="inline"><mml:mrow><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>∈</mml:mo><mml:msub><mml:mi>V</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> in both the
zero-slip and free-slip cases.</p>
      <p id="d1e1725">Similarly, in the examples presented below, we impose strong Dirichlet boundary conditions for temperature at the top and bottom boundaries of our domain. The test functions are restricted to <inline-formula><mml:math id="M68" display="inline"><mml:mrow><mml:msub><mml:mi>Q</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>, which consists of temperature functions that satisfy homogeneous boundary conditions at these boundaries, and thus
            <disp-formula id="Ch1.E14" content-type="numbered"><label>14</label><mml:math id="M69" display="block"><mml:mrow><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:mrow></mml:munder><mml:mi>q</mml:mi><mml:mi mathvariant="bold-italic">n</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="italic">κ</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:mi>T</mml:mi><mml:mi mathvariant="normal">d</mml:mi><mml:mi>s</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          the boundary term associated with integrating by parts of the diffusion term, vanishes. In Cartesian domains the boundary term does not vanish for the lateral boundaries, but by omitting this term from Eq. (<xref ref-type="disp-formula" rid="Ch1.E10"/>) we weakly impose a homogeneous Neumann (zero-flux) boundary condition at these boundaries. The temperature solution itself is found in <inline-formula><mml:math id="M70" display="inline"><mml:mrow><mml:msub><mml:mi>Q</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:mo mathvariant="italic">{</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mtext>inhom</mml:mtext></mml:msub><mml:mo mathvariant="italic">}</mml:mo></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M71" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mtext>inhom</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> is any representative temperature function that satisfies the required inhomogeneous boundary conditions.</p>
      <p id="d1e1806">In curved domains, such as the 2-D cylindrical shell and 3-D spherical shell cases examined below, imposing free-slip boundary conditions is complicated by the fact that it is not
straightforward to decompose the degrees of freedom of the velocity space <inline-formula><mml:math id="M72" display="inline"><mml:mi>V</mml:mi></mml:math></inline-formula>
into tangential and lateral components for many finite-element discretisations. For Lagrangian-based discretisations we could define normal vectors at the Lagrangian nodes on the surface and decompose accordingly, but these normal vectors would have
to be averaged due to the piecewise approximation of the curved surface. To
avoid such complications for our examples in cylindrical and spherical geometries, we employ a
symmetric Nitsche penalty method <xref ref-type="bibr" rid="bib1.bibx101" id="paren.49"/> where the velocity space is not restricted and,
thus, retains all discrete solutions with a non-zero normal component. This entails
adding the following three surface integrals to Eq. (<xref ref-type="disp-formula" rid="Ch1.E8"/>):
            <disp-formula id="Ch1.E15" content-type="numbered"><label>15</label><mml:math id="M73" display="block"><mml:mtable class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:mrow></mml:munder><mml:mi mathvariant="bold-italic">v</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">n</mml:mi><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mi mathvariant="bold-italic">n</mml:mi><mml:mo>⋅</mml:mo><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="italic">μ</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>+</mml:mo><mml:msup><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">n</mml:mi><mml:mi mathvariant="normal">d</mml:mi><mml:mi>s</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:mrow></mml:munder><mml:mi mathvariant="bold-italic">n</mml:mi><mml:mo>⋅</mml:mo><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="italic">μ</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>+</mml:mo><mml:msup><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">v</mml:mi></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">n</mml:mi><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">n</mml:mi><mml:mi mathvariant="normal">d</mml:mi><mml:mi>s</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>+</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:mrow></mml:munder><mml:msub><mml:mi>C</mml:mi><mml:mtext>Nitsche</mml:mtext></mml:msub><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mi mathvariant="italic">μ</mml:mi><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">n</mml:mi><mml:mspace width="0.25em" linebreak="nobreak"/><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">n</mml:mi><mml:mi mathvariant="normal">d</mml:mi><mml:mi>s</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
          The first of these corresponds to the normal component of Eq. (<xref ref-type="disp-formula" rid="Ch1.E12"/>)
associated with integration by parts of the viscosity term. The tangential
component, as before, is omitted and weakly imposes a zero shear stress
condition. The second term ensures symmetry of Eq. (<xref ref-type="disp-formula" rid="Ch1.E8"/>)
with respect to <inline-formula><mml:math id="M74" display="inline"><mml:mi mathvariant="bold-italic">u</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M75" display="inline"><mml:mi mathvariant="bold-italic">v</mml:mi></mml:math></inline-formula>. The third term penalises the normal component of <inline-formula><mml:math id="M76" display="inline"><mml:mi mathvariant="bold-italic">u</mml:mi></mml:math></inline-formula> and involves a penalty parameter <inline-formula><mml:math id="M77" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mtext>Nitsche</mml:mtext></mml:msub><mml:mo>&gt;</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>
that should be sufficiently large to ensure coercivity of
the bilinear form <inline-formula><mml:math id="M78" display="inline"><mml:mrow><mml:msub><mml:mi>F</mml:mi><mml:mtext>Stokes</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> introduced in
Sect. <xref ref-type="sec" rid="Ch1.S4.SS3"/>.
Lower bounds for <inline-formula><mml:math id="M79" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mtext>Nitsche,f</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> on each face <inline-formula><mml:math id="M80" display="inline"><mml:mi>f</mml:mi></mml:math></inline-formula> can be derived for simplicial <xref ref-type="bibr" rid="bib1.bibx111" id="paren.50"/> and quadrilateral/hexahedral <xref ref-type="bibr" rid="bib1.bibx60" id="paren.51"/> meshes respectively:

                <disp-formula specific-use="align" content-type="numbered"><mml:math id="M81" display="block"><mml:mtable displaystyle="true"><mml:mtr><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mtext>Triangular</mml:mtext><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mo>(</mml:mo><mml:mi>d</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mo>)</mml:mo><mml:mo>/</mml:mo><mml:mtext>tetrahedral</mml:mtext><mml:mspace width="0.25em" linebreak="nobreak"/><mml:mo>(</mml:mo><mml:mi>d</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">3</mml:mn><mml:mo>)</mml:mo><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mtext>meshes:</mml:mtext></mml:mrow></mml:mtd></mml:mtr><mml:mlabeledtr id="Ch1.E16"><mml:mtd><mml:mtext>16</mml:mtext></mml:mtd><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mspace linebreak="nobreak" width="1em"/><mml:msub><mml:mi>C</mml:mi><mml:mtext>Nitsche,f</mml:mtext></mml:msub><mml:mo>&gt;</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>p</mml:mi></mml:mrow></mml:msub><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi>p</mml:mi><mml:mo>(</mml:mo><mml:mi>p</mml:mi><mml:mo>+</mml:mo><mml:mi>d</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>)</mml:mo></mml:mrow><mml:mi>d</mml:mi></mml:mfrac></mml:mstyle><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>A</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mrow><mml:msub><mml:mi>c</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msub></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mtr><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mtext>Quadrilateral</mml:mtext><mml:mo>/</mml:mo><mml:mtext>hexahedral meshes:</mml:mtext></mml:mrow></mml:mtd></mml:mtr><mml:mlabeledtr id="Ch1.E17"><mml:mtd><mml:mtext>17</mml:mtext></mml:mtd><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mspace width="1em" linebreak="nobreak"/><mml:msub><mml:mi>C</mml:mi><mml:mtext>Nitsche,f</mml:mtext></mml:msub><mml:mo>&gt;</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>p</mml:mi></mml:mrow></mml:msub><mml:mo>(</mml:mo><mml:mi>p</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:msup><mml:mo>)</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>A</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mrow><mml:msub><mml:mi>c</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msub></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula>

            <inline-formula><mml:math id="M82" display="inline"><mml:mrow><mml:msub><mml:mi>A</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> is the facet area of face f, <inline-formula><mml:math id="M83" display="inline"><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mrow><mml:msub><mml:mi>c</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msub></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> the cell volume of the adjacent cell <inline-formula><mml:math id="M84" display="inline"><mml:mrow><mml:msub><mml:mi>c</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M85" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula> the polynomial degree of the velocity discretisation. Here, we introduce an additional factor, <inline-formula><mml:math id="M86" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>p</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>,  to
account for spatial variance of the viscosity <inline-formula><mml:math id="M87" display="inline"><mml:mi mathvariant="italic">μ</mml:mi></mml:math></inline-formula> in the adjacent cell and domain curvature, which are not taken into account in the standard lower bounds
(using <inline-formula><mml:math id="M88" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>p</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>). In all free-slip cylindrical and spherical shell examples
presented below, we use <inline-formula><mml:math id="M89" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>p</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">100</mml:mn></mml:mrow></mml:math></inline-formula>. Finally, because the normal
component of velocity is not restricted in the velocity function space, the boundary term
(<xref ref-type="disp-formula" rid="Ch1.E13"/>) no longer vanishes, and
we also need to weakly impose
the non-normal flow condition on the continuity equation by adding the following integral to Eq. (<xref ref-type="disp-formula" rid="Ch1.E9"/>):
            <disp-formula id="Ch1.E18" content-type="numbered"><label>18</label><mml:math id="M90" display="block"><mml:mrow><mml:mo>-</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:mrow></mml:munder><mml:mi>w</mml:mi><mml:mi mathvariant="bold-italic">n</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mi mathvariant="normal">d</mml:mi><mml:mi>s</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
</sec>
<sec id="Ch1.S4.SS2">
  <label>4.2</label><title>Temporal discretisation and solution process for temperature</title>
      <p id="d1e2383">For temporal integration, we apply a simple <inline-formula><mml:math id="M91" display="inline"><mml:mi mathvariant="italic">θ</mml:mi></mml:math></inline-formula> scheme to the energy Eq. (<xref ref-type="disp-formula" rid="Ch1.E10"/>):
            <disp-formula id="Ch1.E19" content-type="numbered"><label>19</label><mml:math id="M92" display="block"><mml:mtable class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi>F</mml:mi><mml:mtext>energy</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi>q</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>:=</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mi>q</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>-</mml:mo><mml:msup><mml:mi>T</mml:mi><mml:mi>n</mml:mi></mml:msup></mml:mrow><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>+</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mi>q</mml:mi><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="italic">θ</mml:mi></mml:mrow></mml:msup><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi><mml:mo>+</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi>q</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>⋅</mml:mo><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="italic">κ</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="italic">θ</mml:mi></mml:mrow></mml:msup></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mtext> for all </mml:mtext><mml:mi>q</mml:mi><mml:mo>∈</mml:mo><mml:mi>Q</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
          where
            <disp-formula id="Ch1.E20" content-type="numbered"><label>20</label><mml:math id="M93" display="block"><mml:mrow><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="italic">θ</mml:mi></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:mi mathvariant="italic">θ</mml:mi><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>+</mml:mo><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:mi mathvariant="italic">θ</mml:mi><mml:mo>)</mml:mo><mml:msup><mml:mi>T</mml:mi><mml:mi>n</mml:mi></mml:msup></mml:mrow></mml:math></disp-formula>
          is interpolated between the temperature solutions <inline-formula><mml:math id="M94" display="inline"><mml:mrow><mml:msup><mml:mi>T</mml:mi><mml:mi>n</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M95" display="inline"><mml:mrow><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> at the
beginning and end of the <inline-formula><mml:math id="M96" display="inline"><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>th time step using a parameter <inline-formula><mml:math id="M97" display="inline"><mml:mrow><mml:mn mathvariant="normal">0</mml:mn><mml:mo>≤</mml:mo><mml:mi mathvariant="italic">θ</mml:mi><mml:mo>≤</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>. In all examples that follow, we use a Crank–Nicolson scheme, where <inline-formula><mml:math id="M98" display="inline"><mml:mrow><mml:mi mathvariant="italic">θ</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.5</mml:mn></mml:mrow></mml:math></inline-formula>. It should be noted that the time-dependent energy equation is coupled with the Stokes system through the buoyancy term and, in some cases, the temperature dependence of viscosity. At the same time, the Stokes equation couples to the energy equation through the advective velocity. These combined equations can therefore be considered a coupled system that should be iterated over. The solution algorithm used here follows a standard time-splitting approach. We solve the Stokes system for velocity and pressure with buoyancy and viscosity terms, based on a given prescribed initial temperature field. In a separate step, we solve for the new temperature <inline-formula><mml:math id="M99" display="inline"><mml:mrow><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> using the new velocity, advance in time and repeat. The same time loop is used to converge the coupling in steady-state cases.</p>
      <p id="d1e2685">Because <inline-formula><mml:math id="M100" display="inline"><mml:mrow><mml:msub><mml:mi>F</mml:mi><mml:mtext>energy</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> is linear in <inline-formula><mml:math id="M101" display="inline"><mml:mi>q</mml:mi></mml:math></inline-formula>, if we expand the test function <inline-formula><mml:math id="M102" display="inline"><mml:mi>q</mml:mi></mml:math></inline-formula> as a linear combination of basis functions <inline-formula><mml:math id="M103" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> of <inline-formula><mml:math id="M104" display="inline"><mml:mi>Q</mml:mi></mml:math></inline-formula>,
            <disp-formula id="Ch1.E21" content-type="numbered"><label>21</label><mml:math id="M105" display="block"><mml:mtable rowspacing="0.2ex" class="split" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi>F</mml:mi><mml:mtext>energy</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi>q</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:msub><mml:mi>F</mml:mi><mml:mtext>energy</mml:mtext></mml:msub><mml:mfenced open="(" close=")"><mml:mrow><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mi>i</mml:mi></mml:munder><mml:msub><mml:mi>q</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>;</mml:mo><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:mfenced></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mi>i</mml:mi></mml:munder><mml:msub><mml:mi>q</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mi>F</mml:mi><mml:mtext>energy</mml:mtext></mml:msub><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>;</mml:mo><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:mfenced></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:mo>:</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mi>i</mml:mi></mml:munder><mml:msub><mml:mi>q</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:munder><mml:mi>F</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo>(</mml:mo><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:msub><mml:mo>)</mml:mo><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
          where <inline-formula><mml:math id="M106" display="inline"><mml:mrow><mml:munder><mml:mi>F</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo>(</mml:mo><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is the vector with coefficients
<inline-formula><mml:math id="M107" display="inline"><mml:mrow><mml:msub><mml:mi>F</mml:mi><mml:mtext>energy</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>;</mml:mo><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> (i.e. the energy equation tested with the basis
functions <inline-formula><mml:math id="M108" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>). Thus, to satisfy Eq. (<xref ref-type="disp-formula" rid="Ch1.E19"/>), we need to solve for a temperature <inline-formula><mml:math id="M109" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula> for which the entire vector <inline-formula><mml:math id="M110" display="inline"><mml:mrow><mml:munder><mml:mi>F</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo>(</mml:mo><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is zero.</p>
      <p id="d1e2987">In the general non-linear case (for example, if the thermal diffusivity is temperature-dependent), this can be solved using a Newton solver, but here the system of equations <inline-formula><mml:math id="M111" display="inline"><mml:mrow><mml:munder><mml:mi>F</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo>(</mml:mo><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is also linear in <inline-formula><mml:math id="M112" display="inline"><mml:mrow><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> and, accordingly, if we also expand the temperature with respect to the same basis, <inline-formula><mml:math id="M113" display="inline"><mml:mrow><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:msub><mml:mo>∑</mml:mo><mml:mi>j</mml:mi></mml:msub><mml:msubsup><mml:mi>T</mml:mi><mml:mi>j</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, where we store the coefficients <inline-formula><mml:math id="M114" display="inline"><mml:mrow><mml:msubsup><mml:mi>T</mml:mi><mml:mi>j</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup></mml:mrow></mml:math></inline-formula> in a vector <inline-formula><mml:math id="M115" display="inline"><mml:munder><mml:mi>T</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder></mml:math></inline-formula>, we can write it in the usual form as a linear system of equations
            <disp-formula id="Ch1.E22" content-type="numbered"><label>22</label><mml:math id="M116" display="block"><mml:mrow><mml:mi mathvariant="bold">A</mml:mi><mml:munder><mml:mi>T</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo>=</mml:mo><mml:munder><mml:mi>b</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          with <inline-formula><mml:math id="M117" display="inline"><mml:mi mathvariant="bold">A</mml:mi></mml:math></inline-formula> the matrix that represents the Jacobian <inline-formula><mml:math id="M118" display="inline"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mo>∂</mml:mo><mml:mi>F</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>T</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:math></inline-formula> with respect to the basis <inline-formula><mml:math id="M119" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and the right-hand-side vector <inline-formula><mml:math id="M120" display="inline"><mml:munder><mml:mi>b</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder></mml:math></inline-formula> containing all terms in Eq. (<xref ref-type="disp-formula" rid="Ch1.E19"/>) that do not depend on <inline-formula><mml:math id="M121" display="inline"><mml:mrow><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>, specifically

                <disp-formula specific-use="align" content-type="numbered"><mml:math id="M122" display="block"><mml:mtable displaystyle="true"><mml:mtr><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:msub><mml:mi>A</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>F</mml:mi><mml:mtext>energy</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>;</mml:mo><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msubsup><mml:mi>T</mml:mi><mml:mi>j</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mlabeledtr id="Ch1.E23"><mml:mtd><mml:mtext>23</mml:mtext></mml:mtd><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mo>+</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="italic">θ</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi><mml:mo>+</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mo>⋅</mml:mo><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="italic">κ</mml:mi><mml:mi mathvariant="italic">θ</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mtr><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:msub><mml:munder><mml:mi>b</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:msub><mml:mi>F</mml:mi><mml:mtext>energy</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>;</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msup><mml:mi>T</mml:mi><mml:mi>n</mml:mi></mml:msup></mml:mrow><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>-</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>⋅</mml:mo><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:mi mathvariant="italic">θ</mml:mi><mml:mo>)</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:msup><mml:mi>T</mml:mi><mml:mi>n</mml:mi></mml:msup><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mlabeledtr id="Ch1.E24"><mml:mtd><mml:mtext>24</mml:mtext></mml:mtd><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mo>-</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mo>⋅</mml:mo><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="italic">κ</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:mi mathvariant="italic">θ</mml:mi><mml:mo>)</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:msup><mml:mi>T</mml:mi><mml:mi>n</mml:mi></mml:msup></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula>

            In the non-linear case, every Newton iteration requires the solution of such a linear system with a Jacobian matrix <inline-formula><mml:math id="M123" display="inline"><mml:mrow><mml:msub><mml:mi>A</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mo>∂</mml:mo><mml:msub><mml:mi>F</mml:mi><mml:mtext>energy</mml:mtext></mml:msub><mml:mo>/</mml:mo><mml:mo>∂</mml:mo><mml:msubsup><mml:mi>T</mml:mi><mml:mi>j</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msubsup></mml:mrow></mml:math></inline-formula> and a right-hand-side vector based on the residual <inline-formula><mml:math id="M124" display="inline"><mml:mrow><mml:msub><mml:munder><mml:mi>b</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mi>i</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>F</mml:mi><mml:mtext>energy</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, both of which are to be reassembled every iteration as <inline-formula><mml:math id="M125" display="inline"><mml:mrow><mml:msup><mml:mi>T</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> is iteratively improved. For the 2-D cases presented in this paper, this asymmetric linear system is solved with a direct solver and in 3-D using a combination of the generalised minimal residual method (GMRES) Krylov subspace method with a symmetric successive over-relaxation (SSOR) preconditioner.</p>
</sec>
<sec id="Ch1.S4.SS3">
  <label>4.3</label><title>Solving for velocity and pressure</title>
      <p id="d1e3630">In a separate step, we solve Eqs. (<xref ref-type="disp-formula" rid="Ch1.E8"/>) and (<xref ref-type="disp-formula" rid="Ch1.E9"/>) for
velocity and pressure. Since these weak equations need to hold for all test
functions <inline-formula><mml:math id="M126" display="inline"><mml:mrow><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>∈</mml:mo><mml:mi>V</mml:mi></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M127" display="inline"><mml:mrow><mml:mi>w</mml:mi><mml:mo>∈</mml:mo><mml:mi>W</mml:mi></mml:mrow></mml:math></inline-formula>, we can equivalently write, using a single residual functional <inline-formula><mml:math id="M128" display="inline"><mml:mrow><mml:msub><mml:mi>F</mml:mi><mml:mtext>Stokes</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>,
            <disp-formula id="Ch1.E25" content-type="numbered"><label>25</label><mml:math id="M129" display="block"><mml:mtable class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi>F</mml:mi><mml:mtext>Stokes</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>,</mml:mo><mml:mi>w</mml:mi><mml:mo>;</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>,</mml:mo><mml:mi>p</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">v</mml:mi></mml:mrow></mml:mfenced><mml:mo>:</mml:mo><mml:mi mathvariant="italic">μ</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>+</mml:mo><mml:msup><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">v</mml:mi></mml:mrow></mml:mfenced><mml:mi>p</mml:mi><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mi>R</mml:mi><mml:msub><mml:mi>a</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mi>T</mml:mi><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>⋅</mml:mo><mml:mover accent="true"><mml:mi mathvariant="bold-italic">k</mml:mi><mml:mo stretchy="false" mathvariant="normal">^</mml:mo></mml:mover><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi><mml:mo>-</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mi>w</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mtext> for all </mml:mtext><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>∈</mml:mo><mml:mi>V</mml:mi><mml:mo>,</mml:mo><mml:mi>w</mml:mi><mml:mo>∈</mml:mo><mml:mi>W</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
          where we have multiplied the continuity equation by <inline-formula><mml:math id="M130" display="inline"><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> to ensure symmetry between the <inline-formula><mml:math id="M131" display="inline"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi>p</mml:mi></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M132" display="inline"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow></mml:math></inline-formula> terms. This combined weak form
that we simultaneously solve for a velocity <inline-formula><mml:math id="M133" display="inline"><mml:mrow><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>∈</mml:mo><mml:mi>V</mml:mi></mml:mrow></mml:math></inline-formula> and pressure <inline-formula><mml:math id="M134" display="inline"><mml:mrow><mml:mi>p</mml:mi><mml:mo>∈</mml:mo><mml:mi>W</mml:mi></mml:mrow></mml:math></inline-formula>
is referred to as a <italic>mixed problem</italic>, and the combined solution <inline-formula><mml:math id="M135" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>,</mml:mo><mml:mi>p</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is said to be found in the <italic>mixed function space</italic> <inline-formula><mml:math id="M136" display="inline"><mml:mrow><mml:mi>V</mml:mi><mml:mo>⊕</mml:mo><mml:mi>W</mml:mi></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e3940">As before, we expand the discrete solutions <inline-formula><mml:math id="M137" display="inline"><mml:mi mathvariant="bold-italic">u</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M138" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula> and test functions <inline-formula><mml:math id="M139" display="inline"><mml:mi mathvariant="bold-italic">v</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M140" display="inline"><mml:mi>w</mml:mi></mml:math></inline-formula> in terms of basis functions for <inline-formula><mml:math id="M141" display="inline"><mml:mi>V</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M142" display="inline"><mml:mi>W</mml:mi></mml:math></inline-formula>:

                <disp-formula specific-use="align" content-type="numbered"><mml:math id="M143" display="block"><mml:mtable displaystyle="true"><mml:mlabeledtr id="Ch1.E26"><mml:mtd><mml:mtext>26</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mo>=</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mi>i</mml:mi></mml:munder><mml:msub><mml:mi>u</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mi mathvariant="bold-italic">v</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mo>=</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mi>i</mml:mi></mml:munder><mml:msub><mml:mi>v</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mi mathvariant="normal">span</mml:mi><mml:mo mathvariant="italic">{</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo mathvariant="italic">}</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>=</mml:mo><mml:mi>V</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E27"><mml:mtd><mml:mtext>27</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mi>p</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>=</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mi>k</mml:mi></mml:munder><mml:msub><mml:mi>p</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="italic">χ</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mi>w</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>=</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mi>k</mml:mi></mml:munder><mml:msub><mml:mi>w</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="italic">χ</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>span</mml:mo><mml:mo mathvariant="italic">{</mml:mo><mml:msub><mml:mi mathvariant="italic">χ</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo mathvariant="italic">}</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>=</mml:mo><mml:mi>W</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula>

            For isoviscous cases, where <inline-formula><mml:math id="M144" display="inline"><mml:mrow><mml:msub><mml:mi>F</mml:mi><mml:mtext>Stokes</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> is linear in <inline-formula><mml:math id="M145" display="inline"><mml:mi mathvariant="bold-italic">u</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M146" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula>, we then derive a linear system of the following form:
            <disp-formula id="Ch1.E28" content-type="numbered"><label>28</label><mml:math id="M147" display="block"><mml:mrow><mml:mfenced open="(" close=")"><mml:mtable class="matrix" columnalign="center center" framespacing="0em"><mml:mtr><mml:mtd><mml:mi mathvariant="bold">K</mml:mi></mml:mtd><mml:mtd><mml:mi mathvariant="bold">G</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mfenced open="(" close=")"><mml:mtable class="matrix" columnalign="center" framespacing="0em"><mml:mtr><mml:mtd><mml:munder><mml:mi>u</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:munder><mml:mi>p</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mo>=</mml:mo><mml:mfenced close=")" open="("><mml:mtable class="matrix" columnalign="center" framespacing="0em"><mml:mtr><mml:mtd><mml:munder><mml:mi>f</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:munder><mml:mn mathvariant="normal">0</mml:mn><mml:mo mathvariant="normal">¯</mml:mo></mml:munder></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          <?xmltex \hack{\newpage}?><?xmltex \hack{\noindent}?>where

                <disp-formula specific-use="align" content-type="numbered"><mml:math id="M148" display="block"><mml:mtable displaystyle="true"><mml:mtr><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:msub><mml:mi>K</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>F</mml:mi><mml:mtext>Stokes</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>;</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>,</mml:mo><mml:mi>p</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mlabeledtr id="Ch1.E29"><mml:mtd><mml:mtext>29</mml:mtext></mml:mtd><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mo>:</mml:mo><mml:mi mathvariant="italic">μ</mml:mi><mml:mfenced close="]" open="["><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:msup><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mtr><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>F</mml:mi><mml:mtext>Stokes</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>;</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>,</mml:mo><mml:mi>p</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>p</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi mathvariant="italic">χ</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mlabeledtr id="Ch1.E30"><mml:mtd><mml:mtext>30</mml:mtext></mml:mtd><mml:mtd><mml:mstyle displaystyle="true" class="stylechange"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>F</mml:mi><mml:mtext>Stokes</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo><mml:msub><mml:mi mathvariant="italic">χ</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>;</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>,</mml:mo><mml:mi>p</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr><mml:mlabeledtr id="Ch1.E31"><mml:mtd><mml:mtext>31</mml:mtext></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:msub><mml:munder><mml:mi>f</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>=</mml:mo><mml:mi>R</mml:mi><mml:msub><mml:mi>a</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mi>T</mml:mi><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>⋅</mml:mo><mml:mover accent="true"><mml:mi mathvariant="bold-italic">k</mml:mi><mml:mo stretchy="false" mathvariant="normal">^</mml:mo></mml:mover><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula></p>
      <p id="d1e4556">For cases with more general rheologies, in particular those with a strain-rate-dependent viscosity, the system <inline-formula><mml:math id="M149" display="inline"><mml:mrow><mml:msub><mml:munder><mml:mi>F</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mtext>Stokes</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>,</mml:mo><mml:mi>p</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:munder><mml:mn mathvariant="normal">0</mml:mn><mml:mo mathvariant="normal">¯</mml:mo></mml:munder></mml:mrow></mml:math></inline-formula> is non-linear and can be solved using Newton's method. This requires the solution in every Newton iteration of a linear system of the same form as in Eq. (<xref ref-type="disp-formula" rid="Ch1.E28"/>) but with an additional term in <inline-formula><mml:math id="M150" display="inline"><mml:mi mathvariant="bold">K</mml:mi></mml:math></inline-formula> associated
with <inline-formula><mml:math id="M151" display="inline"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">μ</mml:mi><mml:mo>/</mml:mo><mml:mo>∂</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow></mml:math></inline-formula>. For the strain-rate-dependent cases presented in this paper, this takes the following form:
            <disp-formula id="Ch1.E32" content-type="numbered"><label>32</label><mml:math id="M152" display="block"><mml:mtable rowspacing="0.2ex" class="split" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi>K</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>F</mml:mi><mml:mtext>Stokes</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>;</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>,</mml:mo><mml:mi>p</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mo>:</mml:mo><mml:mi mathvariant="italic">μ</mml:mi><mml:mfenced open="[" close="]"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:msup><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>+</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mo>:</mml:mo><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow></mml:mfenced><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">μ</mml:mi><mml:mo>(</mml:mo><mml:mover accent="true"><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mo mathvariant="normal">˙</mml:mo></mml:mover><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mover accent="true"><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mo mathvariant="normal">˙</mml:mo></mml:mover></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>:</mml:mo><mml:mfenced open="[" close="]"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:msup><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
          Note that the additional term makes the matrix explicitly dependent on the
solution <inline-formula><mml:math id="M153" display="inline"><mml:mi mathvariant="bold-italic">u</mml:mi></mml:math></inline-formula> itself and is asymmetric. Here, for brevity we have not expanded the derivative of <inline-formula><mml:math id="M154" display="inline"><mml:mi mathvariant="italic">μ</mml:mi></mml:math></inline-formula> with respect to the strain-rate tensor
<inline-formula><mml:math id="M155" display="inline"><mml:mover accent="true"><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mo mathvariant="normal">˙</mml:mo></mml:mover></mml:math></inline-formula>. Such additional terms require a significant amount of effort to implement in traditional codes and need adapting to the specific rheological approximation that is used, but this is all handled automatically here through the combination of symbolic differentiation and code generation in Firedrake.</p>
      <p id="d1e4834">There is a wide-ranging literature on iterative methods for solving saddle point systems of the form in Eq. (<xref ref-type="disp-formula" rid="Ch1.E28"/>). For an overview of the methods commonly used in geodynamics, see <xref ref-type="bibr" rid="bib1.bibx89" id="text.52"/>. Here we employ the Schur complement approach, where pressure <inline-formula><mml:math id="M156" display="inline"><mml:munder><mml:mi>p</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder></mml:math></inline-formula> is determined by solving
            <disp-formula id="Ch1.E33" content-type="numbered"><label>33</label><mml:math id="M157" display="block"><mml:mrow><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:msup><mml:mi mathvariant="bold">K</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:munder><mml:mi>p</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo>=</mml:mo><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:msup><mml:mi mathvariant="bold">K</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:munder><mml:mi>f</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
          It should be noted that <inline-formula><mml:math id="M158" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">K</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> is not assembled explicitly. Rather, in a first step we obtain <inline-formula><mml:math id="M159" display="inline"><mml:mrow><mml:munder><mml:mi>y</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo>=</mml:mo><mml:msup><mml:mi mathvariant="bold">K</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:munder><mml:mi>f</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder></mml:mrow></mml:math></inline-formula> by solving <inline-formula><mml:math id="M160" display="inline"><mml:mrow><mml:mi mathvariant="bold">K</mml:mi><mml:munder><mml:mi>y</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo>=</mml:mo><mml:munder><mml:mi>f</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder></mml:mrow></mml:math></inline-formula> so that we can construct the right-hand side of the equation. We subsequently apply the flexible GMRES <xref ref-type="bibr" rid="bib1.bibx108" id="paren.53"/> iterative method to the linear system as a whole, in which each iteration requires matrix–vector multiplication by the matrix <inline-formula><mml:math id="M161" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:msup><mml:mi mathvariant="bold">K</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mi mathvariant="bold">G</mml:mi></mml:mrow></mml:math></inline-formula> that again involves the solution of a linear system with matrix <inline-formula><mml:math id="M162" display="inline"><mml:mi mathvariant="bold">K</mml:mi></mml:math></inline-formula>. We also need a suitable preconditioner. Here we follow the inverse scaled-mass matrix approach which uses the following approximation:
            <disp-formula id="Ch1.E34" content-type="numbered"><label>34</label><mml:math id="M163" display="block"><mml:mrow><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:msup><mml:mi mathvariant="bold">K</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mo>≈</mml:mo><mml:mi mathvariant="bold">M</mml:mi><mml:mo>,</mml:mo><mml:mspace linebreak="nobreak" width="1em"/><mml:msub><mml:mi>M</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mi mathvariant="italic">μ</mml:mi><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
          Finally, after solving Eq. (<xref ref-type="disp-formula" rid="Ch1.E33"/>) for <inline-formula><mml:math id="M164" display="inline"><mml:munder><mml:mi>p</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder></mml:math></inline-formula>, we obtain <inline-formula><mml:math id="M165" display="inline"><mml:munder><mml:mi>u</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder></mml:math></inline-formula> in a final solve <inline-formula><mml:math id="M166" display="inline"><mml:mrow><mml:mi mathvariant="bold">K</mml:mi><mml:munder><mml:mi>u</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo>=</mml:mo><mml:munder><mml:mi>f</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo>-</mml:mo><mml:mi mathvariant="bold">G</mml:mi><mml:munder><mml:mi>p</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e5103">Since this solution process involves multiple solves with the matrix <inline-formula><mml:math id="M167" display="inline"><mml:mi mathvariant="bold">K</mml:mi></mml:math></inline-formula>, we
also need an efficient algorithm to solve that system. For this, we combine the conjugate gradient method with an algebraic multigrid approach, specifically the geometric algebraic multigrid (GAMG) method implemented in PETSc <xref ref-type="bibr" rid="bib1.bibx7 bib1.bibx8 bib1.bibx9" id="paren.54"/>.</p>
      <p id="d1e5116">Depending on boundary conditions, the linearised Stokes system admits a number of
null modes. In the absence of open boundaries, which is the case for all cases examined
here, the pressure admits a constant null mode, where any arbitrary constant can
be added to the pressure solution and remain a valid solution to the
equations. In addition, cylindrical and spherical shell cases with free-slip
boundary conditions at both boundaries admit respectively one and three independent rotational null modes in velocity. As these null modes result in singular matrices, preconditioned iterative methods should typically be provided with the null vectors.</p>
      <p id="d1e5119">In the absence of any Dirichlet conditions on velocity, the null space of the velocity block <inline-formula><mml:math id="M168" display="inline"><mml:mi mathvariant="bold">K</mml:mi></mml:math></inline-formula> also consists of a further two independent translational modes in 2-D and three in 3-D. Even in simulations where boundary conditions do not admit any rotational and translational modes, these solutions remain associated with low-energy modes of the matrix. Some multigrid methods use this information to improve their performance by ensuring that these so-called <italic>near-null-space</italic> modes are accurately represented at the coarser levels <xref ref-type="bibr" rid="bib1.bibx131" id="paren.55"/>. We make use of this in several of the examples considered below.</p>
</sec>
</sec>
<sec id="Ch1.S5">
  <label>5</label><title>Examples: benchmark cases and validation</title>
      <p id="d1e5145">Firedrake provides a complete framework for solving finite-element problems, highlighted in this section through a series of examples. We start in Sect. <xref ref-type="sec" rid="Ch1.S5.SS1"/> with the most basic problem – isoviscous, incompressible convection, in an enclosed 2-D Cartesian box – and systematically build complexity, initially moving into more realistic physical approximations (Sect. <xref ref-type="sec" rid="Ch1.S5.SS2"/>) and, subsequently, geometries that are more representative of Earth's mantle (Sect. <xref ref-type="sec" rid="Ch1.S5.SS3"/>). The cases examined and the challenges associated with each are summarised in Table <xref ref-type="table" rid="Ch1.T1"/>.</p>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T1" specific-use="star"><?xmltex \currentcnt{1}?><label>Table 1</label><caption><p id="d1e5159">Summary of cases examined here, which systematically increase in complexity. The key differences and challenges differentiating each case from the base case are highlighted in the final column.</p></caption><oasis:table frame="topbot"><?xmltex \begin{scaleboxenv}{.9}[.9]?><oasis:tgroup cols="5">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="left"/>
     <oasis:colspec colnum="3" colname="col3" align="left"/>
     <oasis:colspec colnum="4" colname="col4" align="left"/>
     <oasis:colspec colnum="5" colname="col5" align="left"/>
     <oasis:thead>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1">Name</oasis:entry>
         <oasis:entry colname="col2">Source</oasis:entry>
         <oasis:entry colname="col3">Geometry</oasis:entry>
         <oasis:entry colname="col4">Rheology</oasis:entry>
         <oasis:entry colname="col5">Additional functionality</oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1">Base case</oasis:entry>
         <oasis:entry colname="col2"><xref ref-type="bibr" rid="bib1.bibx17" id="text.56"/></oasis:entry>
         <oasis:entry colname="col3">2-D Cartesian</oasis:entry>
         <oasis:entry colname="col4">Isoviscous</oasis:entry>
         <oasis:entry colname="col5">–</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">2-D compressible</oasis:entry>
         <oasis:entry colname="col2"><xref ref-type="bibr" rid="bib1.bibx68" id="text.57"/></oasis:entry>
         <oasis:entry colname="col3">2-D Cartesian</oasis:entry>
         <oasis:entry colname="col4">Isoviscous</oasis:entry>
         <oasis:entry colname="col5">UFL changes, reference state, boundary conditions (BCs)</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">2-D viscoplastic</oasis:entry>
         <oasis:entry colname="col2"><xref ref-type="bibr" rid="bib1.bibx126" id="text.58"/></oasis:entry>
         <oasis:entry colname="col3">2-D Cartesian</oasis:entry>
         <oasis:entry colname="col4"><inline-formula><mml:math id="M169" display="inline"><mml:mrow><mml:mi mathvariant="italic">μ</mml:mi><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>z</mml:mi><mml:mo>,</mml:mo><mml:mover accent="true"><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mo mathvariant="normal">˙</mml:mo></mml:mover><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col5"><inline-formula><mml:math id="M170" display="inline"><mml:mi mathvariant="italic">μ</mml:mi></mml:math></inline-formula> calculation, non-linear solvers (SNES)</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">3-D Cartesian</oasis:entry>
         <oasis:entry colname="col2"><xref ref-type="bibr" rid="bib1.bibx25" id="text.59"/></oasis:entry>
         <oasis:entry colname="col3">3-D Cartesian</oasis:entry>
         <oasis:entry colname="col4">Isoviscous</oasis:entry>
         <oasis:entry colname="col5">Iterative solvers, near-null spaces (NNS)</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">2-D cylindrical shell</oasis:entry>
         <oasis:entry colname="col2">–</oasis:entry>
         <oasis:entry colname="col3">2-D cylindrical shell</oasis:entry>
         <oasis:entry colname="col4">Isoviscous</oasis:entry>
         <oasis:entry colname="col5">Radial <inline-formula><mml:math id="M171" display="inline"><mml:mi mathvariant="bold-italic">g</mml:mi></mml:math></inline-formula>, Nitsche BCs, null spaces, NNS, iterative solvers</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">3-D spherical shell</oasis:entry>
         <oasis:entry colname="col2"><xref ref-type="bibr" rid="bib1.bibx138" id="text.60"/></oasis:entry>
         <oasis:entry colname="col3">3-D spherical shell</oasis:entry>
         <oasis:entry colname="col4">Isoviscous</oasis:entry>
         <oasis:entry colname="col5">Radial <inline-formula><mml:math id="M172" display="inline"><mml:mi mathvariant="bold-italic">g</mml:mi></mml:math></inline-formula>, Nitsche BCs, null spaces, NNS, iterative solvers</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Global circulation</oasis:entry>
         <oasis:entry colname="col2">–</oasis:entry>
         <oasis:entry colname="col3">3-D spherical shell</oasis:entry>
         <oasis:entry colname="col4"><inline-formula><mml:math id="M173" display="inline"><mml:mrow><mml:mi mathvariant="italic">μ</mml:mi><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>z</mml:mi><mml:mo>,</mml:mo><mml:mover accent="true"><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mo mathvariant="normal">˙</mml:mo></mml:mover><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col5">Radial <inline-formula><mml:math id="M174" display="inline"><mml:mi mathvariant="bold-italic">g</mml:mi></mml:math></inline-formula>, BCs (Nitsche, GPlates), NNS, iterative solvers</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup><?xmltex \end{scaleboxenv}?></oasis:table></table-wrap>

<?xmltex \hack{\newpage}?>
<sec id="Ch1.S5.SS1">
  <label>5.1</label><title>Basic example: 2-D convection in a square box</title><?xmltex \setfigures?><?xmltex \setlistings?><?xmltex \floatpos{!t}?><fig id="Ch1.F1" specific-use="star"><?xmltex \currentcnt{1}?><?xmltex \def\figurename{Listing}?><label>Listing 1</label><caption><p id="d1e5420">Firedrake code required to reproduce 2-D Cartesian incompressible isoviscous benchmark cases from <xref ref-type="bibr" rid="bib1.bibx17" id="text.61"/>.</p></caption>
          <?xmltex \igopts{width=497.923228pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-l01.png"/>

        </fig>

      <p id="d1e5432">A simple 2-D square convection problem, from <xref ref-type="bibr" rid="bib1.bibx17" id="text.62"/>, for execution in Firedrake, is displayed in Listing 1. The problem is incompressible, isoviscous, heated from below and cooled from above, with closed, free-slip boundaries, on a unit square mesh. Solutions are obtained by solving the Stokes equations for velocity and pressure alongside the energy equation for temperature. The initial temperature distribution is prescribed as follows:
            <disp-formula id="Ch1.E35" content-type="numbered"><label>35</label><mml:math id="M175" display="block"><mml:mrow><mml:mi>T</mml:mi><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:mi>y</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mi>A</mml:mi><mml:mi>cos⁡</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="italic">π</mml:mi><mml:mi>x</mml:mi><mml:mo>)</mml:mo><mml:mi>sin⁡</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="italic">π</mml:mi><mml:mi>y</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
          where <inline-formula><mml:math id="M176" display="inline"><mml:mrow><mml:mi>A</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.05</mml:mn></mml:mrow></mml:math></inline-formula> is the amplitude of the initial perturbation.</p>
      <p id="d1e5508">We have set up the problem using a bilinear quadrilateral element pair (Q2Q1) for velocity and pressure, with Q2 elements for temperature. Firedrake user code is written in Python, so the first step, illustrated in line 1 of Listing 1, is to import the Firedrake module. We next need a mesh: for simple domains such as the unit square, Firedrake provides built-in meshing functions. As such, line 5 defines the mesh, with 40 quadrilateral elements in the <inline-formula><mml:math id="M177" display="inline"><mml:mi>x</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M178" display="inline"><mml:mi>y</mml:mi></mml:math></inline-formula> directions. We also need function spaces, which is achieved by associating the mesh with the relevant finite element in lines 11–13: <inline-formula><mml:math id="M179" display="inline"><mml:mi>V</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M180" display="inline"><mml:mi>W</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M181" display="inline"><mml:mi>Q</mml:mi></mml:math></inline-formula> are symbolic variables representing function spaces. They also contain the function space's computational implementation, recording the association of degrees of freedom with the mesh and pointing to the finite-element basis. The user does not usually need to pay any attention to this: the function space just behaves as a mathematical
object <xref ref-type="bibr" rid="bib1.bibx105" id="paren.63"/>. Function spaces can be combined in the natural way to create mixed function spaces, as we do in line 14, combining the velocity and pressure function spaces to form a function space for the mixed Stokes problem, <inline-formula><mml:math id="M182" display="inline"><mml:mi>Z</mml:mi></mml:math></inline-formula>. Here we specify continuous Lagrange elements (CG) of polynomial degree 2 and 1 for velocity and pressure respectively, on a quadrilateral mesh, which gives us the Q2Q1 element pair. Test functions <inline-formula><mml:math id="M183" display="inline"><mml:mi mathvariant="bold-italic">v</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M184" display="inline"><mml:mi>w</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M185" display="inline"><mml:mi>q</mml:mi></mml:math></inline-formula> are subsequently defined (lines
17–18), and we also specify functions to hold our solutions (lines 19–22): <inline-formula><mml:math id="M186" display="inline"><mml:mi>z</mml:mi></mml:math></inline-formula> in the mixed function space, noting that a symbolic representation of the two parts – velocity and pressure – is obtained with <monospace>split</monospace> in line 20 and <inline-formula><mml:math id="M187" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mtext>old</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M188" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mtext>new</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> (line 21), required for the Crank–Nicolson scheme used for temporal discretisation in our energy equation (see Eqs. <xref ref-type="disp-formula" rid="Ch1.E19"/> and <xref ref-type="disp-formula" rid="Ch1.E20"/> in Sect. <xref ref-type="sec" rid="Ch1.S4.SS2"/>), where <inline-formula><mml:math id="M189" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mi mathvariant="italic">θ</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> is defined in line 22.</p>
      <p id="d1e5630">We obtain symbolic expressions for coordinates in the physical
mesh (line 25) and subsequently use these to initialise the old temperature field, via Eq. (<xref ref-type="disp-formula" rid="Ch1.E35"/>), in line 26. This is where Firedrake transforms a symbolic operation into a numerical computation for the first time: the <monospace>interpolate</monospace> method generates C code that evaluates this expression in the function space associated with <inline-formula><mml:math id="M190" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mtext>old</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> and immediately executes it to populate the coefficient values of <inline-formula><mml:math id="M191" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mtext>old</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>. We initialise <inline-formula><mml:math id="M192" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mtext>new</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> with the values of <inline-formula><mml:math id="M193" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mtext>old</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>, in line 27, via the <monospace>assign</monospace> function. Important constants in this problem (Rayleigh number, <inline-formula><mml:math id="M194" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi></mml:mrow></mml:math></inline-formula>; viscosity, <inline-formula><mml:math id="M195" display="inline"><mml:mi mathvariant="italic">μ</mml:mi></mml:math></inline-formula>; thermal diffusivity, <inline-formula><mml:math id="M196" display="inline"><mml:mi mathvariant="italic">κ</mml:mi></mml:math></inline-formula>) and unit vector (<inline-formula><mml:math id="M197" display="inline"><mml:mover accent="true"><mml:mi mathvariant="bold-italic">k</mml:mi><mml:mo mathvariant="normal" stretchy="false">^</mml:mo></mml:mover></mml:math></inline-formula>) are defined in lines 30–31. In addition, we define a constant for the time step (<inline-formula><mml:math id="M198" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>) with an initial value of <inline-formula><mml:math id="M199" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">6</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>. <monospace>Constant</monospace> objects define spatial constants, with a value that can be overwritten in later time steps, as we do in this example using an adaptive time step. We note that viscosity could also be a <monospace>Function</monospace> if we wanted spatial variation.</p>
      <p id="d1e5752">We are now in a position to define the variational problems expressed in Eqs. (<xref ref-type="disp-formula" rid="Ch1.E25"/>) and (<xref ref-type="disp-formula" rid="Ch1.E19"/>). Although
in this test case the problems are linear, we maintain the more general
non-linear residual form <inline-formula><mml:math id="M200" display="inline"><mml:mrow><mml:msub><mml:mi>F</mml:mi><mml:mtext>Stokes</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M201" display="inline"><mml:mrow><mml:msub><mml:mi>F</mml:mi><mml:mtext>energy</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi>q</mml:mi><mml:mo>,</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula> to allow for straightforward extension to non-linear problems below. The symbolic expressions for <inline-formula><mml:math id="M202" display="inline"><mml:mrow><mml:msub><mml:mi>F</mml:mi><mml:mtext>Stokes</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>
and <inline-formula><mml:math id="M203" display="inline"><mml:mrow><mml:msub><mml:mi>F</mml:mi><mml:mtext>Energy</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> in the UFL are given in lines 34–38: the resemblance to the mathematical formulation is immediately apparent. Integration over the domain is indicated by multiplication by <monospace>dx</monospace>.</p>
      <p id="d1e5835">Strong Dirichlet boundary conditions for velocity (bcvx, bcvy) and temperature (bctb, bctt) are specified in lines 41–42. A Dirichlet boundary condition is created by constructing a <monospace>DirichletBC</monospace> object, where the user must provide the function space with the boundary condition value and the part of the mesh at which it applies. The latter uses integer mesh markers which are commonly used by mesh generation software to tag entities of meshes. Boundaries are automatically tagged by the built-in meshes supported by Firedrake. For <monospace>UnitSquareMesh</monospace> being used here, tag 1 corresponds to the plane <inline-formula><mml:math id="M204" display="inline"><mml:mrow><mml:mi>x</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>, 2 to <inline-formula><mml:math id="M205" display="inline"><mml:mrow><mml:mi>x</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>, 3 to <inline-formula><mml:math id="M206" display="inline"><mml:mrow><mml:mi>y</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula> and 4 to <inline-formula><mml:math id="M207" display="inline"><mml:mrow><mml:mi>y</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> (these integer values are assigned to left, right, bottom and top in line 6). Note how boundary conditions are being applied to the velocity part of the mixed finite-element space <inline-formula><mml:math id="M208" display="inline"><mml:mi>Z</mml:mi></mml:math></inline-formula>, indicated by <monospace>Z.sub(0)</monospace>. Within <monospace>Z.sub(0)</monospace> we can further subdivide into <monospace>Z.sub(0).sub(0)</monospace> and <monospace>Z.sub(0).sub(1)</monospace> to apply boundary conditions to the <inline-formula><mml:math id="M209" display="inline"><mml:mi>x</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M210" display="inline"><mml:mi>y</mml:mi></mml:math></inline-formula> components of the velocity field only. To apply conditions to the pressure space, we would use <monospace>Z.sub(1)</monospace>. This problem has a constant pressure null space, and we must ensure that our solver removes this space. To do so, we build a null-space object in line 43, which will subsequently be passed to the solver, and PETSc will seek a solution in the space orthogonal to the provided null space.</p>
      <p id="d1e5930">We finally come to solving the variational problem, with problems and solver
objects created in lines 59–62. We pass in the residual functions <inline-formula><mml:math id="M211" display="inline"><mml:mrow><mml:msub><mml:mi>F</mml:mi><mml:mtext>Stokes</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M212" display="inline"><mml:mrow><mml:msub><mml:mi>F</mml:mi><mml:mtext>Energy</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>, solution fields (z,
<inline-formula><mml:math id="M213" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mtext>new</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>), boundary conditions and, for the Stokes system, the null-space object. Solution of the two variational problems is undertaken by the PETSc library <xref ref-type="bibr" rid="bib1.bibx7" id="paren.64"/>, guided by the solver parameters specified in lines 51–56 (see <xref ref-type="bibr" rid="bib1.bibx8 bib1.bibx9" id="altparen.65"/>, for comprehensive documentation of all the PETSc options). The first option in line 52 instructs the Jacobian to be assembled in PETSc's default <monospace>aij</monospace> sparse matrix type. Although the Stokes and energy problems in this example are linear, for consistency with the latter cases, we use Firedrake's <monospace>NonlinearVariationalSolver</monospace>, which makes use of PETSc's Scalable
Nonlinear Equations Solvers (SNES) interface. However, since we do not actually need a non-linear solver for this case, we choose the <monospace>ksponly</monospace> method in line 53 indicating that only a single linear solve needs to be performed. The linear solvers are configured through PETSc's Krylov subspace (KSP) interface, where we can request a direct solver by choosing the <monospace>preonly</monospace> KSP method, in combination with <monospace>lu</monospace> as the “preconditioner” (PC) type (lines 54–55). The specific implementation of the LU-decomposition-based direct solver is selected in line 56 as the MUMPS library <xref ref-type="bibr" rid="bib1.bibx4 bib1.bibx5" id="paren.66"/>. As we shall see through subsequent examples, the solution process is fully programmable, enabling the creation of sophisticated solvers by combining multiple layers of Krylov methods and preconditioners <xref ref-type="bibr" rid="bib1.bibx70" id="paren.67"/>.</p>
      <p id="d1e5995">The time loop is defined in lines 75–84, with the Stokes system solved in line 80 and the energy equation in line 81. These <monospace>solve</monospace> calls once again convert symbolic mathematics into computation. The linear systems for both problems are based on the Jacobian matrix and a right-hand-side vector based on the residual, as indicated in Eqs. (<xref ref-type="disp-formula" rid="Ch1.E22"/>), (<xref ref-type="disp-formula" rid="Ch1.E23"/>) and (<xref ref-type="disp-formula" rid="Ch1.E24"/>) for the energy equation and  Eqs. (<xref ref-type="disp-formula" rid="Ch1.E28"/>), (<xref ref-type="disp-formula" rid="Ch1.E29"/>), (<xref ref-type="disp-formula" rid="Ch1.E30"/>) and (<xref ref-type="disp-formula" rid="Ch1.E31"/>) for the Stokes equation. Note, however, that the symbolic expression for the Jacobian is derived automatically in the UFL. Firedrake's TSFC <xref ref-type="bibr" rid="bib1.bibx61" id="paren.68"/> subsequently converts the UFL into highly optimised assembly code, which is then executed to create the matrix and vectors, with the resulting system passed to PETSc for solution. Output is written in lines 78–79 to a <inline-formula><mml:math id="M214" display="inline"><mml:mrow><mml:mo>.</mml:mo><mml:mi>p</mml:mi><mml:mi>v</mml:mi><mml:mi>d</mml:mi></mml:mrow></mml:math></inline-formula> file, initialised in line 46, for visualisation in software such as ParaView <xref ref-type="bibr" rid="bib1.bibx1" id="paren.69"><named-content content-type="pre">e.g.</named-content></xref>.</p><?xmltex \setfigures?><?xmltex \floatpos{t}?><fig id="Ch1.F2" specific-use="star"><?xmltex \currentcnt{1}?><?xmltex \def\figurename{Figure}?><label>Figure 1</label><caption><p id="d1e6041">Results from 2‐D incompressible isoviscous square convection benchmark cases: <bold>(a)</bold> Nusselt number vs. number of pressure and velocity degrees of freedom (DOFs) at <inline-formula><mml:math id="M215" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">4</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> (Case 1a – <xref ref-type="bibr" rid="bib1.bibx17" id="altparen.70"/>) for a series of uniform, structured meshes; <bold>(b)</bold> rms velocity vs. number of pressure and velocity DOFs at <inline-formula><mml:math id="M216" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">4</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>; <bold>(c, d)</bold> as in panels <bold>(a)</bold> and <bold>(b)</bold> but at <inline-formula><mml:math id="M217" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">5</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> (Case 1b – <xref ref-type="bibr" rid="bib1.bibx17" id="altparen.71"/>); <bold>(e, f)</bold> at <inline-formula><mml:math id="M218" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">6</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> (Case 1c – <xref ref-type="bibr" rid="bib1.bibx17" id="altparen.72"/>). Benchmark values are denoted by dashed red lines. In panels <bold>(c)</bold> and <bold>(d)</bold>, we also display results from simulations where the Stokes system uses the Q2P<inline-formula><mml:math id="M219" display="inline"><mml:msub><mml:mi/><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mtext>DG</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula> finite-element pair (Q2P<inline-formula><mml:math id="M220" display="inline"><mml:mrow><mml:msub><mml:mi/><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mtext>DG</mml:mtext></mml:mrow></mml:msub><mml:mo>:</mml:mo><mml:mi>Q</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:math></inline-formula>) and in panels <bold>(e)</bold> and <bold>(f)</bold>, where temperature is represented using a Q1 discretisation (Q2Q1 : Q1), for comparison to our standard Q2Q1 : Q2 discretisations.</p></caption>
          <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-f01.png"/>

        </fig>

      <p id="d1e6207">After the first time step the time-step size <inline-formula><mml:math id="M221" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:math></inline-formula> is adapted (lines 76–77) to a value computed in the <monospace>compute_timestep</monospace> function (lines 69–72). This function computes a Courant–Friedrichs–Lewy (CFL)-bound time step by first computing the velocity transformed from physical coordinates into the local coordinates of the reference element. This transformation is performed by multiplying velocity by the inverse of the Jacobian of the physical coordinate transformation and interpolating this into a predefined vector function <monospace>u_ref</monospace> (line 71). Since the dimensions of all quadrilaterals/hexahedrals in local coordinates have unit length in each direction, the CFL
condition now simplifies to <inline-formula><mml:math id="M222" display="inline"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mtext>ref</mml:mtext></mml:msub><mml:mo>⋅</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi><mml:mo>≤</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>, which needs to be satisfied for all components of <inline-formula><mml:math id="M223" display="inline"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mtext>ref</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>. The maximum allowable
time step can thus be computed by extracting the reference velocity vectors at all nodal locations, obtained by taking the maximum absolute value of the <monospace>.dat.data</monospace> property of the interpolated function.
The advantage of this method of computing the time step over one based on the traditional CFL condition in the form of <inline-formula><mml:math id="M224" display="inline"><mml:mrow><mml:mi>u</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi><mml:mo>/</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>x</mml:mi><mml:mo>≤</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> is that it generalises to non-uniform and curved (iso-parametric) meshes.</p>
      <p id="d1e6284">In 84 lines of Python (57 excluding comments and blank lines), we are able to produce a model that can be executed and quantitatively compared to benchmark results from <xref ref-type="bibr" rid="bib1.bibx17" id="text.73"/>. To do so, we have computed the root mean square (rms) velocity (line 82, using the domain volume specified in line 8) and surface Nusselt number (line 83, using a unit normal vector defined in line 7) at a range of different mesh resolutions and Rayleigh numbers, with results presented in Fig. <xref ref-type="fig" rid="Ch1.F2"/>. Results converge towards the benchmark solutions, with increasing resolution. The final steady-state temperature field, at <inline-formula><mml:math id="M225" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">6</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>, is illustrated in Fig. <xref ref-type="fig" rid="Ch1.F3"/>a.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F3" specific-use="star"><?xmltex \currentcnt{2}?><?xmltex \def\figurename{Figure}?><label>Figure 2</label><caption><p id="d1e6317">Final steady-state temperature field, in 2-D and 3-D, from Firedrake simulations, designed to match: <bold>(a)</bold> Case 1a from <xref ref-type="bibr" rid="bib1.bibx17" id="text.74"/>, with contours spanning temperatures of 0 to 1 at 0.05 intervals. <bold>(b)</bold> Case 1a is from <xref ref-type="bibr" rid="bib1.bibx25" id="text.75"/>, with transparent isosurfaces plotted at <inline-formula><mml:math id="M226" display="inline"><mml:mrow><mml:mi>T</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.3</mml:mn></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M227" display="inline"><mml:mn mathvariant="normal">0.5</mml:mn></mml:math></inline-formula> and <inline-formula><mml:math id="M228" display="inline"><mml:mn mathvariant="normal">0.7</mml:mn></mml:math></inline-formula>.</p></caption>
          <?xmltex \igopts{width=355.659449pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-f02.png"/>

        </fig>

      <p id="d1e6365">To further highlight the flexibility of Firedrake, we have also simulated some of these cases using a Q2P<inline-formula><mml:math id="M229" display="inline"><mml:msub><mml:mi/><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mtext>DG</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula> discretisation for the Stokes system and a Q1 discretisation for the temperature field. The modifications necessary are minimal: for the former, in line 12, the finite-element family is specified as “DPC”, which instructs Firedrake to use a discontinuous, piecewise linear discretisation for pressure. Note that this choice is distinct from a discontinuous, piecewise bilinear pressure space, which, in combination with Q2 velocities, is not LBB-stable, whereas the Q2P<inline-formula><mml:math id="M230" display="inline"><mml:msub><mml:mi/><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mtext>DG</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula> pair is <?xmltex \hack{\mbox\bgroup}?><xref ref-type="bibr" rid="bib1.bibx124" id="text.76"/><?xmltex \hack{\egroup}?>. For temperature, the degree specified in line 13 is changed from 2 to 1. Results using a discontinuous linear pressure, at <inline-formula><mml:math id="M231" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">5</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>, are presented in Fig. <xref ref-type="fig" rid="Ch1.F2"/>c, d, showing a similar trend to those of the Q2Q1 element pair, albeit with rms velocities converging towards benchmark values from above rather than below. Results using a Q1 discretisation for temperature, at <inline-formula><mml:math id="M232" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">6</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>, are presented in Fig. <xref ref-type="fig" rid="Ch1.F2"/>e, f, converging towards benchmark values with increasing resolution. We find that, as expected, a Q2 temperature discretisation leads to more accurate results, although results converge towards the benchmark solutions from different directions. For the remainder of the examples considered herein, we use a Q2Q1 discretisation for the Stokes system and a Q2 discretisation for temperature.</p>
</sec>
<sec id="Ch1.S5.SS2">
  <label>5.2</label><title>Extension: more realistic physics</title>
      <p id="d1e6452">We next highlight the ease with which simulations can be updated to incorporate more realistic physical approximations. We first account for compressibility under the anelastic liquid approximation (ALA) <xref ref-type="bibr" rid="bib1.bibx109" id="paren.77"><named-content content-type="pre">e.g.</named-content></xref>, simulating a well-established benchmark case from <xref ref-type="bibr" rid="bib1.bibx68" id="text.78"/> (Sect. <xref ref-type="sec" rid="Ch1.S5.SS2.SSS1"/>). We subsequently focus on a case with a more Earth-like approximation of the rheology (Sect. <xref ref-type="sec" rid="Ch1.S5.SS2.SSS2"/>), simulating another well-established benchmark case from <xref ref-type="bibr" rid="bib1.bibx126" id="text.79"/>. All cases are set up in an enclosed 2-D Cartesian box with free-slip boundary conditions, with the required changes discussed relative to the base case presented in Sect. <xref ref-type="sec" rid="Ch1.S5.SS1"/>.</p>
<sec id="Ch1.S5.SS2.SSS1">
  <label>5.2.1</label><title>Compressibility</title><?xmltex \setfigures?><?xmltex \setlistings?><?xmltex \floatpos{t}?><fig id="Ch1.F4" specific-use="star"><?xmltex \currentcnt{2}?><?xmltex \def\figurename{Listing}?><label>Listing 2</label><caption><p id="d1e6483">Difference in Firedrake code required to reproduce compressible ALA cases from <xref ref-type="bibr" rid="bib1.bibx68" id="text.80"/> relative to our base case.</p></caption>
            <?xmltex \igopts{width=497.923228pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-l02.png"/>

          </fig>

      <p id="d1e6495">The governing equations applicable for compressible mantle convection, under the ALA, are presented in Appendix <xref ref-type="sec" rid="App1.Ch1.S1"/> (based on, for example, <xref ref-type="bibr" rid="bib1.bibx109" id="altparen.81"/>). Their weak forms are derived by multiplying these equations by appropriate test functions and integrating over the domain, as we did with their incompressible counterparts in Sect. <xref ref-type="sec" rid="Ch1.S4"/>. They differ appreciably from the incompressible approximations that have been utilised thus far, with important updates to all three governing equations. Despite this, the changes required to incorporate these equations, within the UFL and Firedrake, are minimal.</p>
      <p id="d1e6505">Although <xref ref-type="bibr" rid="bib1.bibx68" id="text.82"/> examined a number of cases, we focus on one illustrative example here, at <inline-formula><mml:math id="M233" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">5</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> and a dissipation number <inline-formula><mml:math id="M234" display="inline"><mml:mrow><mml:mi>D</mml:mi><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.5</mml:mn></mml:mrow></mml:math></inline-formula>. This allows us to demonstrate the ease with which these cases can be configured within Firedrake. The required changes, relative to the base case, are displayed in Listing 2. They can be summarised as follows.
<list list-type="order"><list-item>
      <p id="d1e6544">Definition and initialisation of additional constants and the 1-D reference state, derived here via an Adams–Williamson equation of state (lines 1–12). In this benchmark example, several of the key constants and parameters required for compressible convection are assigned values of 1 and could be removed. However, to ensure consistency between the governing equations presented in Appendix <xref ref-type="sec" rid="App1.Ch1.S1"/> and the UFL, we chose not to omit these constants in Listing 2.</p></list-item><list-item>
      <p id="d1e6550">The UFL for the momentum, mass conservation and energy equations is updated, emphasising once again the resemblance to the mathematical formulation (lines 16–20). The key changes are as follows: (i) the stress tensor is updated to account for a non-zero velocity divergence (line 17), where <monospace>Identity</monospace> represents a unit matrix of a given size (2 in this case) and <monospace>div</monospace> represents the symbolic divergence of a field. (ii) The Stokes equations are further modified to account for dynamic pressure's influence on buoyancy (final term in line 18). (iii) The mass conservation equation includes the depth-dependent reference density, <inline-formula><mml:math id="M235" display="inline"><mml:mover accent="true"><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover></mml:math></inline-formula> (line 19), and (iv) the energy equation is updated to incorporate adiabatic heating and viscous dissipation terms (final two terms in line 20).</p></list-item><list-item>
      <p id="d1e6570">Temperature boundary conditions are updated, noting that we are solving for deviatoric temperature rather than the full temperature, which also includes the reference state.</p></list-item><list-item>
      <p id="d1e6574">In our Stokes solver, we only specify the <monospace>transpose_nullspace</monospace> option (as opposed to both the <monospace>nullspace</monospace> and <monospace>transpose_nullspace</monospace> options for our base case): the incorporation of dynamic pressure's impact on buoyancy implies that the (right-hand-side) pressure null space is no longer the same as the (left-hand-side) transpose null space. The transpose null space remains the same space of constant pressure solutions and is used to project out these modes from the initial residual vector to ensure that the linear system is well-posed. The right-hand-side null space now consists of different modes, which can be found through integration. However, this null space is only required for iterative linear solvers in which the modes are projected out from the solution vector at each iteration to prevent its unbounded growth.</p></list-item></list></p><?xmltex \setfigures?><?xmltex \floatpos{t}?><fig id="Ch1.F5" specific-use="star"><?xmltex \currentcnt{3}?><?xmltex \def\figurename{Figure}?><label>Figure 3</label><caption><p id="d1e6589">Results from Firedrake simulations configured to reproduce the 2‐D compressible benchmark case from <xref ref-type="bibr" rid="bib1.bibx68" id="text.83"/> at <inline-formula><mml:math id="M236" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">5</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M237" display="inline"><mml:mrow><mml:mi>D</mml:mi><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.5</mml:mn></mml:mrow></mml:math></inline-formula>: <bold>(a)</bold> final steady-state (full) temperature field, with contours spanning temperatures of 0 to 1 at 0.05 intervals; <bold>(b)</bold> Nusselt number vs. number of pressure and velocity DOFs for a series of uniform, structured meshes; <bold>(c)</bold> rms velocity vs. number of pressure and velocity DOFs. The range of solutions provided by different codes in the <xref ref-type="bibr" rid="bib1.bibx68" id="text.84"/> benchmark study is bounded by dashed red lines.</p></caption>
            <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-f03.png"/>

          </fig>

      <p id="d1e6645">We note that, in setting up the Stokes solver as we have, we incorporate the pressure effect on buoyancy implicitly, as advocated by <xref ref-type="bibr" rid="bib1.bibx82" id="text.85"/>. As this term depends on the pressure that we are solving for, an extra term is required in addition to the pressure gradient matrix <inline-formula><mml:math id="M238" display="inline"><mml:mi mathvariant="bold">G</mml:mi></mml:math></inline-formula> in the Jacobian matrix in Eq. (<xref ref-type="disp-formula" rid="Ch1.E28"/>). The inclusion of <inline-formula><mml:math id="M239" display="inline"><mml:mover accent="true"><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover></mml:math></inline-formula> in the continuity constraint also means that this term is no longer simply represented by the transpose of <inline-formula><mml:math id="M240" display="inline"><mml:mi mathvariant="bold">G</mml:mi></mml:math></inline-formula>. Such changes are automatically incorporated by Firedrake, highlighting a major benefit of the automatic assembly approach that is utilised. To ensure the validity of our approach, we have computed the rms velocity and Nusselt number at a range of different mesh resolutions, for direct comparison to <xref ref-type="bibr" rid="bib1.bibx68" id="text.86"/>, with results presented in Fig. <xref ref-type="fig" rid="Ch1.F5"/>, alongside the final steady-state (full) temperature field. As expected, results converge towards the benchmark solutions, with increasing resolution, demonstrating the applicability and accuracy of Firedrake for compressible simulations of this nature.</p>
</sec>
<sec id="Ch1.S5.SS2.SSS2">
  <label>5.2.2</label><title>Viscoplastic rheology</title><?xmltex \setfigures?><?xmltex \setlistings?><?xmltex \floatpos{t}?><fig id="Ch1.F6" specific-use="star"><?xmltex \currentcnt{3}?><?xmltex \def\figurename{Listing}?><label>Listing 3</label><caption><p id="d1e6694">Difference in Firedrake code required to reproduce viscoplastic rheology cases from <xref ref-type="bibr" rid="bib1.bibx126" id="text.87"/> relative to our base case.</p></caption>
            <?xmltex \igopts{width=497.923228pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-l03.png"/>

          </fig>

      <p id="d1e6706">To illustrate the changes necessary to incorporate a viscoplastic rheology which is more representative of deformation within Earth's mantle and lithosphere, we examine a case from <xref ref-type="bibr" rid="bib1.bibx126" id="text.88"/>, a benchmark study intended to form a straightforward extension to <xref ref-type="bibr" rid="bib1.bibx17" id="text.89"/>. Indeed, aside from the viscosity and reference Rayleigh number (<inline-formula><mml:math id="M241" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:msub><mml:mi>a</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>), all other aspects of this case are identical to the case presented in Sect. <xref ref-type="sec" rid="Ch1.S5.SS1"/>. The viscosity field, <inline-formula><mml:math id="M242" display="inline"><mml:mi mathvariant="italic">μ</mml:mi></mml:math></inline-formula>, is calculated as the harmonic mean between a linear component, <inline-formula><mml:math id="M243" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">μ</mml:mi><mml:mtext>lin</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>, and a non-linear plastic component, <inline-formula><mml:math id="M244" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">μ</mml:mi><mml:mtext>plast</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>, which is dependent on the strain rate, as follows:
              <disp-formula id="Ch1.E36" content-type="numbered"><label>36</label><mml:math id="M245" display="block"><mml:mrow><mml:mi mathvariant="italic">μ</mml:mi><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>z</mml:mi><mml:mo>,</mml:mo><mml:mover accent="true"><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mo mathvariant="normal">˙</mml:mo></mml:mover><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mo mathsize="2.5em">(</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:msub><mml:mi mathvariant="italic">μ</mml:mi><mml:mrow><mml:mtext>lin</mml:mtext><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>z</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>+</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:msub><mml:mi mathvariant="italic">μ</mml:mi><mml:mrow><mml:mtext>plast</mml:mtext><mml:mo>(</mml:mo><mml:mover accent="true"><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mo mathvariant="normal">˙</mml:mo></mml:mover><mml:mo>)</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:msup><mml:mo mathsize="2.5em">)</mml:mo><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
            The linear part is given by an Arrhenius law (the so-called Frank–Kamenetskii approximation):
              <disp-formula id="Ch1.E37" content-type="numbered"><label>37</label><mml:math id="M246" display="block"><mml:mrow><mml:msub><mml:mi mathvariant="italic">μ</mml:mi><mml:mrow><mml:mtext>lin</mml:mtext><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>z</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mi>exp⁡</mml:mi><mml:mo>(</mml:mo><mml:mo>-</mml:mo><mml:msub><mml:mi mathvariant="italic">γ</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mi>T</mml:mi><mml:mo>+</mml:mo><mml:msub><mml:mi mathvariant="italic">γ</mml:mi><mml:mi>z</mml:mi></mml:msub><mml:mi>z</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
            where <inline-formula><mml:math id="M247" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">γ</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi>ln⁡</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi mathvariant="italic">μ</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M248" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">γ</mml:mi><mml:mi>z</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi>ln⁡</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi mathvariant="italic">μ</mml:mi><mml:mi>z</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> are parameters controlling the total viscosity contrast due to temperature and depth respectively. The non-linear component is given by
              <disp-formula id="Ch1.E38" content-type="numbered"><label>38</label><mml:math id="M249" display="block"><mml:mrow><mml:msub><mml:mi mathvariant="italic">μ</mml:mi><mml:mtext>plast</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mover accent="true"><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mo mathvariant="normal">˙</mml:mo></mml:mover><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msup><mml:mi mathvariant="italic">μ</mml:mi><mml:mo>⋆</mml:mo></mml:msup><mml:mo>+</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi mathvariant="italic">σ</mml:mi><mml:mi>y</mml:mi></mml:msub></mml:mrow><mml:msqrt><mml:mrow><mml:mover accent="true"><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mo mathvariant="normal">˙</mml:mo></mml:mover><mml:mo>:</mml:mo><mml:mover accent="true"><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mo mathvariant="normal">˙</mml:mo></mml:mover></mml:mrow></mml:msqrt></mml:mfrac></mml:mstyle><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
            where <inline-formula><mml:math id="M250" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">μ</mml:mi><mml:mo>⋆</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula> is a constant representing the effective viscosity at high stresses and <inline-formula><mml:math id="M251" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">σ</mml:mi><mml:mi>y</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> is the yield stress. The denominator of the second term in Eq. (<xref ref-type="disp-formula" rid="Ch1.E38"/>) represents the second invariant of the strain-rate tensor. The viscoplastic flow law (Eq. <xref ref-type="disp-formula" rid="Ch1.E36"/>) leads to linear viscous deformation at low stresses and plastic deformation at stresses that exceed <inline-formula><mml:math id="M252" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">σ</mml:mi><mml:mi>y</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, with the decrease in viscosity limited by the choice of <inline-formula><mml:math id="M253" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">μ</mml:mi><mml:mo>⋆</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula>.
<?xmltex \setfigures?></p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F7" specific-use="star"><?xmltex \currentcnt{4}?><?xmltex \def\figurename{Figure}?><label>Figure 4</label><caption><p id="d1e7062">Results from the 2‐D benchmark case from <xref ref-type="bibr" rid="bib1.bibx126" id="text.90"/>, with a viscoplastic rheology at <inline-formula><mml:math id="M254" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:msub><mml:mi>a</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>: <bold>(a)</bold> Nusselt number vs. number of pressure and velocity DOFs for a series of uniform, structured meshes; <bold>(b)</bold> final steady-state temperature field, with contours spanning temperatures of 0 to 1, at 0.05 intervals; <bold>(c)</bold> rms velocity vs. number of pressure and velocity DOFs; <bold>(d)</bold> final steady-state viscosity field (note logarithmic scale). In panels <bold>(a)</bold> and <bold>(c)</bold>, the range of solutions provided by different codes in the <xref ref-type="bibr" rid="bib1.bibx126" id="text.91"/> benchmark study is bounded by dashed red lines.</p></caption>
            <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-f04.png"/>

          </fig>

      <p id="d1e7116">Although <xref ref-type="bibr" rid="bib1.bibx126" id="text.92"/> examined a number of cases, we focus on one here (Case 4: <inline-formula><mml:math id="M255" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:msub><mml:mi>a</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M256" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi mathvariant="italic">μ</mml:mi><mml:mi>T</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">5</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M257" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi mathvariant="italic">μ</mml:mi><mml:mi>y</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">10</mml:mn></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M258" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">μ</mml:mi><mml:mo>⋆</mml:mo></mml:msup><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>), which allows us to demonstrate how a temperature-, depth- and strain-rate-dependent viscosity is incorporated within Firedrake. The changes required to simulate this case, relative to our base case, are displayed in Listing 3. These are the following.
<list list-type="order"><list-item>
      <p id="d1e7203">Linear solver options are no longer applicable, given the dependence of viscosity on the flow field, through the strain rate. Accordingly, the solver dictionary is updated to account for the non-linear nature of our Stokes system (lines 2–11). For the first time, we fully exploit the SNES using a set-up based on Newton's method (<monospace>"snes_type": "newtonls"</monospace>) with a secant line search over the L2 norm of the function (<monospace>"snes_linesearch_type": "l2"</monospace>). As we target a steady-state solution, an absolute tolerance is specified for our non-linear solver (<monospace>"snes_atol": 1e-10</monospace>).</p></list-item><list-item>
      <p id="d1e7216">Solver options differ between the (non-linear) Stokes and (linear) energy systems. As such, a separate solver dictionary is specified for solution of the energy equation (lines 13–20). Consistent with our base case, we use a direct solver for solution of the energy equation based on the MUMPS library.</p></list-item><list-item>
      <p id="d1e7220">Viscosity is calculated as a function of temperature, depth (<inline-formula><mml:math id="M259" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">μ</mml:mi><mml:mtext>lin</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> – line 29) and strain rate (<inline-formula><mml:math id="M260" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">μ</mml:mi><mml:mtext>plast</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> – line 30), using constants specified in lines 25–26. Linear and non-linear components are subsequently combined via a harmonic mean (line 31).</p></list-item><list-item>
      <p id="d1e7246">Updated solver dictionaries are incorporated into their respective solvers in lines 35 and 36, noting that for this case both the null-space and transpose<inline-formula><mml:math id="M261" display="inline"><mml:mi mathvariant="italic">_</mml:mi></mml:math></inline-formula>nullspace options are provided for the Stokes system, consistent with the base case.</p></list-item></list></p>
      <p id="d1e7256">We note that even though the UFL for the Stokes and energy systems remains identical to our base case, assembly of additional terms in the Jacobian, associated with the non-linearity in this system, is once again handled automatically by Firedrake. To compare our results to those of <xref ref-type="bibr" rid="bib1.bibx126" id="text.93"/>, we have computed the rms velocity and Nusselt number at a range of different mesh resolutions. These are presented in Fig. <xref ref-type="fig" rid="Ch1.F7"/> and, once again, results converge towards the benchmark solutions, with increasing resolution. Final steady-state temperature and viscosity fields are also illustrated to allow for straightforward comparison to those presented by <xref ref-type="bibr" rid="bib1.bibx126" id="text.94"/>, illustrating that viscosity varies by roughly 4 orders of magnitude across the computational domain.</p>
      <p id="d1e7267">Taken together, our compressible and viscoplastic rheology results demonstrate the accuracy and applicability of Firedrake for problems incorporating a range of different approximations to the underlying physics. They have allowed us to illustrate Firedrake's flexibility: by leveraging the UFL and PETSc, the framework is easily extensible, allowing for straightforward application to scenarios involving different physical approximations, even if they require distinct solution strategies.</p>
</sec>
</sec>
<sec id="Ch1.S5.SS3">
  <label>5.3</label><title>Extension: dimensions and geometry</title>
      <p id="d1e7279">In this section we highlight the ease with which simulations can be examined in different dimensions and geometries by modifying our basic 2-D case. We primarily simulate benchmark cases that are well-known within the geodynamical community, initially matching the steady-state, isoviscous simulation of <xref ref-type="bibr" rid="bib1.bibx25" id="text.95"/> in a 3-D Cartesian domain. There is currently no published community benchmark for simulations in the 2-D cylindrical shell domain. As such, we next compare results for an isoviscous, steady-state case in a 2-D cylindrical shell domain to those of the Fluidity and ASPECT computational modelling frameworks, noting that Fluidity has been carefully validated against the extensive set of analytical solutions introduced by <xref ref-type="bibr" rid="bib1.bibx76" id="text.96"/> in both cylindrical and spherical shell geometries. Finally, we analyse an isoviscous 3-D spherical shell benchmark case from <xref ref-type="bibr" rid="bib1.bibx138" id="text.97"/>. Once again, the changes required to run these cases are discussed relative to our base case (Sect. <xref ref-type="sec" rid="Ch1.S5.SS1"/>) unless noted otherwise.</p>
<sec id="Ch1.S5.SS3.SSS1">
  <label>5.3.1</label><title>3-D Cartesian domain</title>
      <p id="d1e7300">We first examine and validate our set-up in a 3-D Cartesian domain for a steady-state, isoviscous case – specifically Case 1a from <xref ref-type="bibr" rid="bib1.bibx25" id="text.98"/>. The domain is a box of dimensions <inline-formula><mml:math id="M262" display="inline"><mml:mrow><mml:mn mathvariant="normal">1.0079</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">0.6283</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>. The initial temperature distribution, chosen to produce a single ascending and descending flow, at <inline-formula><mml:math id="M263" display="inline"><mml:mrow><mml:mi>x</mml:mi><mml:mo>=</mml:mo><mml:mi>y</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M264" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1.0079</mml:mn><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.6283</mml:mn><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> respectively is prescribed as<?xmltex \hack{\newpage}?>
              <disp-formula id="Ch1.E39" content-type="numbered"><label>39</label><mml:math id="M265" display="block"><mml:mtable class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:mi>T</mml:mi><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>,</mml:mo><mml:mi>z</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:mo mathsize="1.5em">[</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="normal">erf</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:mi>z</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="normal">erf</mml:mi><mml:mo>(</mml:mo><mml:mo>-</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mi>z</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow><mml:mn mathvariant="normal">2</mml:mn></mml:mfrac></mml:mstyle><mml:mo mathsize="1.5em">]</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>+</mml:mo><mml:mi>A</mml:mi><mml:mo>[</mml:mo><mml:mi>cos⁡</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="italic">π</mml:mi><mml:mi>x</mml:mi><mml:mo>/</mml:mo><mml:mn mathvariant="normal">1.0079</mml:mn><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>+</mml:mo><mml:mi>cos⁡</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="italic">π</mml:mi><mml:mi>y</mml:mi><mml:mo>/</mml:mo><mml:mn mathvariant="normal">0.6283</mml:mn><mml:mo>)</mml:mo><mml:mo>]</mml:mo><mml:mi>sin⁡</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="italic">π</mml:mi><mml:mi>z</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
            where <inline-formula><mml:math id="M266" display="inline"><mml:mrow><mml:mi>A</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.2</mml:mn></mml:mrow></mml:math></inline-formula> is the amplitude of the initial perturbation. We note that this initial condition differs from that specified in <xref ref-type="bibr" rid="bib1.bibx25" id="text.99"/>, through the addition of boundary layers at the bottom and top of the domain (through the <inline-formula><mml:math id="M267" display="inline"><mml:mi mathvariant="normal">erf</mml:mi></mml:math></inline-formula> terms), although it more consistently drives solutions towards the final published steady-state results. Boundary conditions for temperature are <inline-formula><mml:math id="M268" display="inline"><mml:mrow><mml:mi>T</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula> at the surface (<inline-formula><mml:math id="M269" display="inline"><mml:mrow><mml:mi>z</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>) and <inline-formula><mml:math id="M270" display="inline"><mml:mrow><mml:mi>T</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> at the base (<inline-formula><mml:math id="M271" display="inline"><mml:mrow><mml:mi>z</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>), with insulating (homogeneous Neumann) sidewalls. No‐slip velocity boundary conditions are specified at the top surface and base of the domain, with free‐slip boundary conditions on all sidewalls. The Rayleigh number is <inline-formula><mml:math id="M272" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">3</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">4</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>.
<?xmltex \setfigures?><?xmltex \setlistings?></p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F8" specific-use="star"><?xmltex \currentcnt{4}?><?xmltex \def\figurename{Listing}?><label>Listing 4</label><caption><p id="d1e7595">Changes required to reproduce a 3-D Cartesian case from <xref ref-type="bibr" rid="bib1.bibx25" id="text.100"/> relative to Listing 1.</p></caption>
            <?xmltex \igopts{width=497.923228pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-l04.png"/>

          </fig>

      <p id="d1e7607">In comparison to Listing 1, the changes required to simulate this case, using Q2Q1 elements for velocity and pressure, are minimal. The key differences, summarised in Listing 4, are the following.
<list list-type="order"><list-item>
      <p id="d1e7612">The creation of the underlying mesh (lines 1–5), which we generate by extruding a 2-D quadrilateral mesh in the <inline-formula><mml:math id="M273" display="inline"><mml:mi>z</mml:mi></mml:math></inline-formula> direction to a layered 3-D hexahedral mesh. Our final mesh has <inline-formula><mml:math id="M274" display="inline"><mml:mrow><mml:mn mathvariant="normal">20</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">12</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">20</mml:mn></mml:mrow></mml:math></inline-formula> elements in the <inline-formula><mml:math id="M275" display="inline"><mml:mi>x</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M276" display="inline"><mml:mi>y</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M277" display="inline"><mml:mi>z</mml:mi></mml:math></inline-formula> directions respectively (noting that the default value for layer height is <inline-formula><mml:math id="M278" display="inline"><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>/</mml:mo><mml:mi>n</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:math></inline-formula>). For extruded meshes, top and bottom boundaries are tagged by <monospace>top</monospace> and <monospace>bottom</monospace> respectively, whilst boundary markers from the base mesh can be used to set boundary conditions on the relevant side of the extruded mesh. We note that Firedrake exploits the regularity of extruded meshes to enhance performance.</p></list-item><list-item>
      <p id="d1e7681">Specification of the initial condition for temperature, following Eq. (<xref ref-type="disp-formula" rid="Ch1.E39"/>), updated values for <inline-formula><mml:math id="M279" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi></mml:mrow></mml:math></inline-formula> and definition of the 3-D unit vector (lines 9–11).</p></list-item><list-item>
      <p id="d1e7697">The inclusion of Python dictionaries that define iterative solver parameters for the Stokes and energy systems (lines 15–47). Although direct solves provide robust performance in the 2-D cases examined above, in 3-D the computational (CPU and memory) requirements quickly become intractable.
PETSc's <monospace>fieldsplit</monospace> <monospace>pc_type</monospace> provides a class of preconditioners for mixed problems that allows one to apply different preconditioners to different blocks of the system. This opens up a large array of potential solver strategies for the Stokes saddle
point system (e.g. many of the methods described in <xref ref-type="bibr" rid="bib1.bibx89" id="altparen.101"/>).
Here we configure the Schur complement approach as described in Sect. <xref ref-type="sec" rid="Ch1.S4.SS3"/>. We note that this <monospace>fieldsplit</monospace>
functionality can also be used to provide a stronger coupling between the Stokes system and energy equation in strongly non-linear problems, where the Stokes and energy systems are solved together in a single Newton solve that is decomposed through a series of preconditioner stages.</p>
      <p id="d1e7714">The <monospace>fieldsplit_0</monospace> entries configure solver options for the first of these blocks, the <inline-formula><mml:math id="M280" display="inline"><mml:mi mathvariant="bold">K</mml:mi></mml:math></inline-formula> matrix. The linear systems associated with this matrix are solved using a combination of the conjugate gradient method (<monospace>cg</monospace>, line 23) and an algebraic multigrid preconditioner (<monospace>gamg</monospace>, line 27). We also specify two options (<monospace>gamg_threshold</monospace> and <monospace>gamg_square_graph</monospace>) that control the aggregation method (coarsening strategy) in the GAMG preconditioner, which balance the multigrid effectiveness (convergence rate) with coarse grid complexity (cost per iteration) <xref ref-type="bibr" rid="bib1.bibx8" id="paren.102"/>.</p>
      <p id="d1e7743">The <monospace>fieldsplit_1</monospace> entries contain solver options for the Schur complement solve itself. As explained in Sect. <xref ref-type="sec" rid="Ch1.S4.SS3"/>, we do not have explicit access to the Schur complement matrix, <inline-formula><mml:math id="M281" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:msup><mml:mi mathvariant="bold">K</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mi mathvariant="bold">G</mml:mi></mml:mrow></mml:math></inline-formula>, but can compute its action on any vector, at the cost of a <monospace>fieldsplit_0</monospace> solve with the <inline-formula><mml:math id="M282" display="inline"><mml:mi mathvariant="bold">K</mml:mi></mml:math></inline-formula> matrix, which is sufficient to solve the system using a Krylov method. However, for preconditioning, we do need access to the values of the matrix or its approximation. For this purpose we approximate the Schur complement matrix with a mass matrix scaled by viscosity, which is implemented in <monospace>MassInvPC</monospace> (line 35) with the viscosity provided through the optional <monospace>appctx</monospace> argument in line 71. This is a simple example of Firedrake's powerful programmable preconditioner interface, which, in turn, connects with the Python preconditioner interface of PETSc (line 34). In more complex cases the user can specify their own linear operator in the UFL that approximates the true linear operator but is easier to invert. The <monospace>MassInvPC</monospace> preconditioner step itself is performed through a linear solve with the approximate matrix with options prefixed with <monospace>Mp_</monospace> to specify a conjugate gradient solver with symmetric SOR (SSOR) preconditioning (lines 36–38). Note that PETSc's <monospace>sor</monospace> preconditioner type, specified in line 38, defaults to the symmetric SOR variant. Since this preconditioner step now involves an iterative solve, the Krylov method used for the Schur complement needs to be of a flexible type, and we specify <monospace>fgmres</monospace> in line 32.</p>
      <p id="d1e7801">Specification of the matrix type <monospace>matfree</monospace> (line 16) for the
combined system ensures that we do not explicitly assemble its associated sparse matrix, instead computing the matrix–vector multiplications required by the Krylov iterations as they arise. For example, the action of the sub-matrix <inline-formula><mml:math id="M283" display="inline"><mml:mi mathvariant="bold">G</mml:mi></mml:math></inline-formula> on a sub-vector <inline-formula><mml:math id="M284" display="inline"><mml:munder><mml:mi>p</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder></mml:math></inline-formula> can be evaluated as (cf. Eqs. <xref ref-type="disp-formula" rid="Ch1.E28"/>, <xref ref-type="disp-formula" rid="Ch1.E30"/>)<disp-formula id="Ch1.E40" content-type="numbered"><label>40</label><mml:math id="M285" display="block"><mml:mrow><mml:mi mathvariant="bold">G</mml:mi><mml:munder><mml:mi>p</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo>=</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mi>k</mml:mi></mml:munder><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>p</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:munder><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">ψ</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mfenced><mml:mi>p</mml:mi><mml:mi mathvariant="normal">d</mml:mi><mml:mi>x</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>which is assembled by Firedrake directly from the symbolic expression into a discrete vector.
Again, for preconditioning in the <inline-formula><mml:math id="M286" display="inline"><mml:mi mathvariant="bold">K</mml:mi></mml:math></inline-formula>-matrix solve, we need access to matrix values, which is achieved using <monospace>AssembledPC</monospace>. This explicitly assembles the <inline-formula><mml:math id="M287" display="inline"><mml:mi mathvariant="bold">K</mml:mi></mml:math></inline-formula> matrix by extracting relevant terms from the <monospace>F_Stokes</monospace> form.</p>
      <p id="d1e7911">Finally, the energy solve is performed through a combination of the GMRES (<monospace>gmres</monospace>) Krylov method and SSOR preconditioning (lines 42–47). For all iterative solves we specify a convergence criterion based on the relative reduction of the preconditioned residual (<monospace>ksp_rtol</monospace>: lines 24, 33, 36 and 46).</p></list-item><list-item>
      <p id="d1e7921">Velocity boundary conditions, which must be specified along all six faces, are modified in lines 51–53, with temperature boundary conditions specified in line 54.</p></list-item><list-item>
      <p id="d1e7925">Generating near-null-space information for the GAMG preconditioner (lines 58–66), consisting of three rotational (<monospace>x_rotV</monospace>, <monospace>y_rotV</monospace>, <monospace>z_rotV</monospace>) and three translational (<monospace>nns_x</monospace>, <monospace>nns_y</monospace>, <monospace>nns_z</monospace>) modes, as outlined in Sect. <xref ref-type="sec" rid="Ch1.S4.SS3"/>. These are combined in the mixed function space in line 66.</p></list-item><list-item>
      <p id="d1e7950">Updating of the Stokes problem (line 70) to account for additional boundary conditions and the Stokes solver (line 71) to include the near-null-space options defined above, in addition to the optional <monospace>appctx</monospace> keyword argument that passes the viscosity through to our <monospace>MassInvPC</monospace> Schur complement preconditioner. Energy solver options are also updated relative to our base case (lines 72–73), using the dictionary created in lines 42–47.</p></list-item></list></p><?xmltex \setfigures?><?xmltex \floatpos{t}?><fig id="Ch1.F9" specific-use="star"><?xmltex \currentcnt{5}?><?xmltex \def\figurename{Figure}?><label>Figure 5</label><caption><p id="d1e7962">Results from 3‐D isoviscous simulations in Firedrake, configured to reproduce benchmark results from Case 1a of <xref ref-type="bibr" rid="bib1.bibx25" id="text.103"/>: <bold>(a)</bold> Nusselt number vs. number of pressure and velocity DOFs at <inline-formula><mml:math id="M288" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">3</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">4</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> for a series of uniform, structured meshes; <bold>(b)</bold> rms velocity vs. number of pressure and velocity DOFs. Benchmark values are denoted by dashed red lines.</p></caption>
            <?xmltex \igopts{width=369.885827pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-f05.png"/>

          </fig>

<?xmltex \setfigures?><?xmltex \setlistings?><?xmltex \floatpos{t}?><fig id="Ch1.F10" specific-use="star"><?xmltex \currentcnt{5}?><?xmltex \def\figurename{Listing}?><label>Listing 5</label><caption><p id="d1e8005">Difference in Firedrake code required to reproduce the isoviscous case in a 2-D cylindrical shell domain.</p></caption>
            <?xmltex \igopts{width=497.923228pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-l05.png"/>

          </fig>

      <p id="d1e8014">Our model results can be validated against those of <xref ref-type="bibr" rid="bib1.bibx25" id="text.104"/>. As with our previous examples, we compute the Nusselt number and rms velocity at a range of different mesh resolutions, with results presented in Fig. <xref ref-type="fig" rid="Ch1.F9"/>. We find that results converge towards the benchmark solutions with increasing resolution, as expected. The final steady-state temperature field is illustrated in Fig. <xref ref-type="fig" rid="Ch1.F3"/>b.</p>
</sec>
<sec id="Ch1.S5.SS3.SSS2">
  <label>5.3.2</label><title>2-D cylindrical shell domain</title>
      <p id="d1e8032">We next examine simulations in a 2-D cylindrical shell domain, defined by the radii of the inner (<inline-formula><mml:math id="M289" display="inline"><mml:mrow><mml:msub><mml:mi>r</mml:mi><mml:mtext>min</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>) and outer (<inline-formula><mml:math id="M290" display="inline"><mml:mrow><mml:msub><mml:mi>r</mml:mi><mml:mtext>max</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>) boundaries. These are chosen such that the non-dimensional depth of the mantle is <inline-formula><mml:math id="M291" display="inline"><mml:mrow><mml:mi>z</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mtext>max</mml:mtext></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mtext>min</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> and the ratio of the inner and outer radii is <inline-formula><mml:math id="M292" display="inline"><mml:mrow><mml:mi>f</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mtext>min</mml:mtext></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mtext>max</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.55</mml:mn></mml:mrow></mml:math></inline-formula>, thus approximating the ratio between the radii of Earth's surface and the core–mantle boundary (CMB). Specifically, we set <inline-formula><mml:math id="M293" display="inline"><mml:mrow><mml:msub><mml:mi>r</mml:mi><mml:mtext>min</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1.22</mml:mn></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M294" display="inline"><mml:mrow><mml:msub><mml:mi>r</mml:mi><mml:mtext>max</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2.22</mml:mn></mml:mrow></mml:math></inline-formula>. The initial temperature distribution, chosen to produce four equidistant plumes, is prescribed as
              <disp-formula id="Ch1.E41" content-type="numbered"><label>41</label><mml:math id="M295" display="block"><mml:mtable class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:mi>T</mml:mi><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:mo>(</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mtext>max</mml:mtext></mml:msub><mml:mo>-</mml:mo><mml:mi>r</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>+</mml:mo><mml:mi>A</mml:mi><mml:mi>cos⁡</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mspace width="0.25em" linebreak="nobreak"/><mml:mtext>atan2</mml:mtext><mml:mo>(</mml:mo><mml:mi>y</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo><mml:mi>sin⁡</mml:mi><mml:mo>(</mml:mo><mml:mi>r</mml:mi><mml:mo>-</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mtext>min</mml:mtext></mml:msub><mml:mo>)</mml:mo><mml:mi mathvariant="italic">π</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
            where <inline-formula><mml:math id="M296" display="inline"><mml:mrow><mml:mi>A</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.02</mml:mn></mml:mrow></mml:math></inline-formula> is the amplitude of the initial perturbation. Boundary conditions for temperature are <inline-formula><mml:math id="M297" display="inline"><mml:mrow><mml:mi>T</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula> at the surface (<inline-formula><mml:math id="M298" display="inline"><mml:mrow><mml:msub><mml:mi>r</mml:mi><mml:mtext>max</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>) and <inline-formula><mml:math id="M299" display="inline"><mml:mrow><mml:mi>T</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> at the base (<inline-formula><mml:math id="M300" display="inline"><mml:mrow><mml:msub><mml:mi>r</mml:mi><mml:mtext>min</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>). Free‐slip velocity boundary conditions are specified on both boundaries, which we incorporate weakly through the Nitsche approximation (see Sect. <xref ref-type="sec" rid="Ch1.S4.SS1"/>). The Rayleigh number is <inline-formula><mml:math id="M301" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">5</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>.</p><?xmltex \setfigures?><?xmltex \floatpos{t}?><fig id="Ch1.F11" specific-use="star"><?xmltex \currentcnt{6}?><?xmltex \def\figurename{Figure}?><label>Figure 6</label><caption><p id="d1e8313"><bold>(a, b)</bold> Nusselt number/rms velocity vs. number of pressure and velocity DOFs at <inline-formula><mml:math id="M302" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">5</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> for a series of uniform, structured meshes in a 2-D cylindrical shell domain. High-resolution, adaptive mesh results from the Fluidity computational modelling framework <xref ref-type="bibr" rid="bib1.bibx31" id="paren.105"/> are delineated by dashed red lines, with results from ASPECT delineated by dotted red lines <xref ref-type="bibr" rid="bib1.bibx11" id="paren.106"/>; <bold>(c)</bold> final steady-state temperature field, with contours spanning temperatures of 0 to 1, at intervals of 0.05.</p></caption>
            <?xmltex \igopts{width=369.885827pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-f06.png"/>

          </fig>

      <?xmltex \floatpos{p}?><fig id="Ch1.F12" specific-use="star"><?xmltex \currentcnt{7}?><?xmltex \def\figurename{Figure}?><label>Figure 7</label><caption><p id="d1e8356">Convergence for 2-D cylindrical shell cases with zero-slip <bold>(a–d)</bold> and free-slip <bold>(e–h)</bold> boundary conditions, driven by smooth forcing at a series of different wave numbers, <inline-formula><mml:math id="M303" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula>, and different polynomial orders of the radial dependence, <inline-formula><mml:math id="M304" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula>, as indicated in the legend (see <xref ref-type="bibr" rid="bib1.bibx76" id="altparen.107"/>, for further details). Convergence rate is indicated by dashed lines, with the order of convergence provided in the legend. For the cases plotted, the series of meshes start at refinement level 1, where the mesh consists of 1024 divisions in the tangential direction and 64 radial layers. At each subsequent level the mesh is refined by doubling resolution in both directions.</p></caption>
            <?xmltex \igopts{width=355.659449pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-f07.png"/>

          </fig>

      <p id="d1e8389">With a free-slip boundary condition on both boundaries, one can add an arbitrary rotation of the form <inline-formula><mml:math id="M305" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mo>-</mml:mo><mml:mi>y</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi>r</mml:mi><mml:mover accent="true"><mml:mi mathvariant="italic">θ</mml:mi><mml:mo stretchy="false" mathvariant="normal">^</mml:mo></mml:mover></mml:mrow></mml:math></inline-formula> to the velocity solution (i.e. this case incorporates a velocity null space as well as a pressure null space). As noted in Sect. <xref ref-type="sec" rid="Ch1.S4"/>, these lead to null modes (eigenvectors) for the linear system, rendering the resulting matrix singular. In preconditioned Krylov methods, these null modes must be subtracted from the approximate solution at every iteration <xref ref-type="bibr" rid="bib1.bibx76" id="paren.108"><named-content content-type="pre">e.g.</named-content></xref>, which we illustrate through this example. The key changes required to simulate this case, displayed in Listing 5, are the following.
<list list-type="order"><list-item>
      <p id="d1e8428">Mesh generation: we generate a circular manifold mesh (with 256 elements in this example) and extrude in the radial direction, using the optional keyword argument <monospace>extrusion_type</monospace>, forming 64 layers (lines 2–4). To better represent the curvature of the domain and ensure accuracy of our quadratic representation of velocity, we approximate the curved cylindrical shell domain quadratically, using the optional keyword argument <monospace>degree</monospace><inline-formula><mml:math id="M306" display="inline"><mml:mrow><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:math></inline-formula> (see Sect. <xref ref-type="sec" rid="Ch1.S4"/> for further details).</p></list-item><list-item>
      <p id="d1e8449">The unit vector, <inline-formula><mml:math id="M307" display="inline"><mml:mover accent="true"><mml:mi mathvariant="bold-italic">k</mml:mi><mml:mo mathvariant="normal" stretchy="false">^</mml:mo></mml:mover></mml:math></inline-formula>, points radially in the direction opposite to gravity, as defined in line 10. The temperature field is initialised using Eq. (<xref ref-type="disp-formula" rid="Ch1.E41"/>) in line 11.</p></list-item><list-item>
      <p id="d1e8465">Boundary conditions are no longer aligned with Cartesian directions. We use the Nitsche method (see Sect. <xref ref-type="sec" rid="Ch1.S4.SS1"/>) to impose our free-slip boundary conditions weakly (lines 15–27). The fudge factor in the interior penalty term is set to 100 in line 16, with Nitsche-related contributions to the UFL added in lines 24–27. Note that, for extruded meshes in Firedrake, <monospace>ds_tb</monospace> denotes an integral over both the top and bottom surfaces of the mesh (<monospace>ds_t</monospace> and <monospace>ds_b</monospace> denote integrals over the top or bottom surface of the mesh respectively). <monospace>FacetArea</monospace> and <monospace>CellVolume</monospace> return respectively <inline-formula><mml:math id="M308" display="inline"><mml:mrow><mml:msub><mml:mi>A</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M309" display="inline"><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mrow><mml:msub><mml:mi>c</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msub></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> required by Eq. (<xref ref-type="disp-formula" rid="Ch1.E17"/>). Given that velocity boundary conditions are handled weakly through the UFL, they are no longer passed to the Stokes problem as a separate option (line 46). Note that, in addition to the Nitsche terms, the UFL for the Stokes equations now also includes boundary terms associated with the pressure gradient and velocity divergence terms, which were omitted in Cartesian cases (for details, see Sect. <xref ref-type="sec" rid="Ch1.S4.SS1"/>).</p></list-item><list-item>
      <p id="d1e8517">We define the rotational null space for velocity and combine this with the pressure null space in the mixed finite-element space <inline-formula><mml:math id="M310" display="inline"><mml:mi>Z</mml:mi></mml:math></inline-formula> (lines 30–34). Constant and rotational near-null spaces, utilised by our GAMG preconditioner, are also defined in lines 37–41, with this information passed to the solver in line 46. Note that iterative solver parameters, identical to those presented in the previous example, are used (see Sect. <xref ref-type="sec" rid="Ch1.S5.SS3.SSS1"/>).</p></list-item></list>
<?xmltex \setfigures?><?xmltex \setlistings?></p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F13" specific-use="star"><?xmltex \currentcnt{6}?><?xmltex \def\figurename{Listing}?><label>Listing 6</label><caption><p id="d1e8534">Difference in Firedrake code required to reproduce 3-D spherical shell benchmark cases from <xref ref-type="bibr" rid="bib1.bibx138" id="text.109"/>.</p></caption>
            <?xmltex \igopts{width=497.923228pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-l06.png"/>

          </fig>

<?xmltex \setfigures?><?xmltex \floatpos{t}?><fig id="Ch1.F14" specific-use="star"><?xmltex \currentcnt{8}?><?xmltex \def\figurename{Figure}?><label>Figure 8</label><caption><p id="d1e8549"><bold>(a, b)</bold> Nusselt number/rms velocity vs. number of pressure and velocity DOFs, designed to match an isoviscous 3-D spherical shell benchmark case at <inline-formula><mml:math id="M311" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">7</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">3</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> for a series of uniform, structured meshes. The range of solutions predicted in previous studies is bounded by dashed red lines <xref ref-type="bibr" rid="bib1.bibx13 bib1.bibx103 bib1.bibx136 bib1.bibx117 bib1.bibx26 bib1.bibx121 bib1.bibx138 bib1.bibx33 bib1.bibx85" id="paren.110"/>. <bold>(c)</bold> Final steady-state temperature field highlighted through isosurfaces at temperature anomalies (i.e. away from the radial average) of <inline-formula><mml:math id="M312" display="inline"><mml:mrow><mml:mi>T</mml:mi><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mn mathvariant="normal">0.15</mml:mn></mml:mrow></mml:math></inline-formula> (blue) and <inline-formula><mml:math id="M313" display="inline"><mml:mrow><mml:mi>T</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.15</mml:mn></mml:mrow></mml:math></inline-formula> (orange), with the core–mantle boundary at the base of the spherical shell marked by a red surface; <bold>(d–f)</bold> as in <bold>(a)</bold>–<bold>(c)</bold> but for a temperature-dependent viscosity case, with thermally induced viscosity contrasts of <inline-formula><mml:math id="M314" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>. Fewer codes have published predictions for this case, but results of <xref ref-type="bibr" rid="bib1.bibx138" id="text.111"/> are marked by dashed red lines for comparison.</p></caption>
            <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-f08.png"/>

          </fig>

      <p id="d1e8637">Our predicted Nusselt numbers and rms velocities converge towards those of existing codes with increasing resolution (Fig. <xref ref-type="fig" rid="Ch1.F11"/>), demonstrating the accuracy of our approach. To further assess the validity of our set-up, we have confirmed the accuracy of our solutions to the Stokes system in this 2-D cylindrical shell geometry, through comparisons to analytical solutions from <xref ref-type="bibr" rid="bib1.bibx76" id="text.112"/> for both zero-slip and free-slip boundary conditions. These provide a suite of solutions based upon a smooth forcing term at a range of wave numbers <inline-formula><mml:math id="M315" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula>, with radial dependence formed by a polynomial of arbitrary order <inline-formula><mml:math id="M316" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula>. We study the convergence of our Q2Q1 discretisation with respect to these solutions. Convergence plots are illustrated in Fig. <xref ref-type="fig" rid="Ch1.F12"/>. We observe super-convergence for the Q2Q1 element pair at fourth and second order, for velocity and pressure respectively, with both zero-slip and free-slip boundary conditions, which is higher than the theoretical (minimum) expected order of convergence of 3 for velocity and 2 for pressure (we note that super-convergence was also observed in <xref ref-type="bibr" rid="bib1.bibx138" id="altparen.113"/>, and <xref ref-type="bibr" rid="bib1.bibx76" id="altparen.114"/>). Cases with lower wave number, <inline-formula><mml:math id="M317" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula>, show smaller relative error than those at higher <inline-formula><mml:math id="M318" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula>, as expected. The same observation holds for lower and higher polynomial orders, <inline-formula><mml:math id="M319" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M320" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">4</mml:mn></mml:mrow></mml:math></inline-formula>, for the radial density profile. To demonstrate the flexibility of Firedrake, we have also run comparisons against analytical solutions using a (discontinuous) delta-function forcing. In this case, convergence for the Q2Q1 discretisation (Fig. <xref ref-type="fig" rid="App1.Ch1.S1.F20"/>) drops to 1.5 and 0.5 for velocity and pressure respectively. However, by employing the Q2P<inline-formula><mml:math id="M321" display="inline"><mml:msub><mml:mi/><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mtext>DG</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula> finite-element pair, we observe convergence at 3.5 and 2.0 (Fig. <xref ref-type="fig" rid="App1.Ch1.S1.F21"/>). Consistent with <xref ref-type="bibr" rid="bib1.bibx76" id="text.115"/>, this demonstrates that the continuous approximation of pressure can lead to a reduced order of convergence in the presence of discontinuities, which can be overcome using a discontinuous pressure discretisation. Python scripts for these analytical comparisons can be found in the repository accompanying this paper.</p>
</sec>
<sec id="Ch1.S5.SS3.SSS3">
  <label>5.3.3</label><title>3-D spherical shell domain</title>
      <p id="d1e8734">We next move into a 3-D spherical shell geometry, which is required to simulate global mantle convection. We examine a well-known isoviscous community benchmark case (e.g. <xref ref-type="bibr" rid="bib1.bibx13 bib1.bibx103 bib1.bibx138 bib1.bibx33" id="altparen.116"/>), at a Rayleigh number of <inline-formula><mml:math id="M322" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">7</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">3</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>, with free-slip velocity boundary conditions. Temperature boundary conditions are set to 1 at the base of the domain (<inline-formula><mml:math id="M323" display="inline"><mml:mrow><mml:msub><mml:mi>r</mml:mi><mml:mtext>min</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1.22</mml:mn></mml:mrow></mml:math></inline-formula>) and 0 at the surface (<inline-formula><mml:math id="M324" display="inline"><mml:mrow><mml:msub><mml:mi>r</mml:mi><mml:mtext>max</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2.22</mml:mn></mml:mrow></mml:math></inline-formula>), with the initial temperature distribution approximating a conductive profile with superimposed perturbations triggering tetrahedral symmetry at spherical harmonic degree <inline-formula><mml:math id="M325" display="inline"><mml:mrow><mml:mi>l</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:math></inline-formula> and order <inline-formula><mml:math id="M326" display="inline"><mml:mrow><mml:mi>m</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:math></inline-formula> (see <xref ref-type="bibr" rid="bib1.bibx138" id="altparen.117"/>, for further details).</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F15" specific-use="star"><?xmltex \currentcnt{9}?><?xmltex \def\figurename{Figure}?><label>Figure 9</label><caption><p id="d1e8821">Convergence of velocity and pressure for 3-D spherical shell cases with zero-slip and free-slip boundary conditions for perturbations at a range of spherical harmonic degrees <inline-formula><mml:math id="M327" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula> and orders <inline-formula><mml:math id="M328" display="inline"><mml:mi>m</mml:mi></mml:math></inline-formula>. Note that all cases with a smooth forcing are run at <inline-formula><mml:math id="M329" display="inline"><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mi>l</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>. Refinement level 3 corresponds to the level specified for our cubed sphere mesh, comprising 386 elements in the tangential direction, which is extruded radially to eight layers. Resolution is doubled in all directions at subsequent refinement levels.</p></caption>
            <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-f09.png"/>

          </fig>

      <p id="d1e8860">As illustrated in Listing 6, when compared to the 2-D cylindrical shell case examined in Sect. <xref ref-type="sec" rid="Ch1.S5.SS3.SSS2"/>, the most notable change required to simulate this 3-D case is the generation of the underlying mesh. We use Firedrake's built-in <monospace>CubedSphereMesh</monospace> and extrude it radially through 16 layers, forming hexahedral elements. As with our cylindrical shell example, we approximate the curved spherical domain quadratically using the optional keyword argument <monospace>degree</monospace><inline-formula><mml:math id="M330" display="inline"><mml:mrow><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:math></inline-formula>. Further required changes, highlighted in Listing 6, relate to 3-D extensions of the velocity null space and the near-null spaces required by the GAMG preconditioner, all of which are simple. We do not show the changes associated with extending the radial unit vector to 3-D or the initial condition for temperature, given that they are straightforward, although, as with all examples, a complete Python script for this case can be found in the repository accompanying this paper.</p>
      <p id="d1e8881">Despite the simplicity of our set-up, the accuracy of our approach is confirmed via comparison of both Nusselt numbers and rms velocities to those of previous studies (e.g. <xref ref-type="bibr" rid="bib1.bibx13 bib1.bibx103 bib1.bibx136 bib1.bibx117 bib1.bibx26 bib1.bibx121 bib1.bibx138 bib1.bibx33 bib1.bibx85" id="altparen.118"/>). For completeness, the final steady-state temperature field is illustrated in Fig. <xref ref-type="fig" rid="Ch1.F14"/>c. Furthermore, in line with our 2-D cases, we have confirmed the accuracy of our Stokes solver for both zero-slip and free-slip boundary conditions in a 3-D spherical shell geometry through comparisons to analytical solutions from <xref ref-type="bibr" rid="bib1.bibx76" id="text.119"/>, which provide solutions based upon a smooth forcing term at a range of spherical harmonic degrees, <inline-formula><mml:math id="M331" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula>, and orders, <inline-formula><mml:math id="M332" display="inline"><mml:mi>m</mml:mi></mml:math></inline-formula>, with radial dependence formed by a polynomial of arbitrary order <inline-formula><mml:math id="M333" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula>. As with our 2-D cases, we observe super-convergence for the Q2Q1 element pair at fourth and second order for velocity and pressure respectively, with both zero-slip and free-slip boundary conditions (Fig. <xref ref-type="fig" rid="Ch1.F15"/>).</p>
      <p id="d1e8916">This section has allowed us to highlight a number of Firedrake's benefits over other codes: (i) the ease with which simulations can be examined in different geometries, with minimal changes to the Python code, facilitated by Firedrake's built-in mesh generation utilities and extrusion functionality; (ii) the ease with which iterative solver configurations and preconditioners can be updated and tested, including scenarios incorporating multiple null spaces, facilitated by Firedrake's fully programmable solver interface, alongside its customisable preconditioner interface, both of which are seamlessly coupled to PETSc; (iii) the convergence properties of our finite-element system in geometries that are representative of Earth's mantle. Taken together, these confirm Firedrake's suitability for simulations of global mantle dynamics, as will be further highlighted in Sect. <xref ref-type="sec" rid="Ch1.S7"/>.</p>
</sec>
</sec>
</sec>
<sec id="Ch1.S6">
  <label>6</label><title>Parallel scaling</title>
      <p id="d1e8931">We assess parallel scalability using a 3-D spherical shell case similar to that presented in Sect. <xref ref-type="sec" rid="Ch1.S5.SS3.SSS3"/>, albeit incorporating a temperature-dependent viscosity, following the relation
          <disp-formula id="Ch1.E42" content-type="numbered"><label>42</label><mml:math id="M334" display="block"><mml:mrow><mml:mi mathvariant="italic">μ</mml:mi><mml:mo>=</mml:mo><mml:mtext>exp</mml:mtext><mml:mo>[</mml:mo><mml:mi>E</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">0.5</mml:mn><mml:mo>-</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo><mml:mo>]</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        where <inline-formula><mml:math id="M335" display="inline"><mml:mi>E</mml:mi></mml:math></inline-formula> is a parameter that controls the temperature dependence of viscosity. In the example considered – Case A4 from <xref ref-type="bibr" rid="bib1.bibx138" id="text.120"/> – we set <inline-formula><mml:math id="M336" display="inline"><mml:mrow><mml:mi>E</mml:mi><mml:mo>=</mml:mo><mml:mi>ln⁡</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">100</mml:mn><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, leading to thermally induced viscosity contrasts of <inline-formula><mml:math id="M337" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> across the computational domain. For completeness, our steady-state results, highlighting the consistency of our results for this case with the predictions of <xref ref-type="bibr" rid="bib1.bibx138" id="text.121"/>, are displayed in Fig. <xref ref-type="fig" rid="Ch1.F14"/>, although for the purposes of parallel scaling analyses, we run simulations for 20 time steps only.</p>
      <p id="d1e9012">We focus on weak scaling, where the problem size and the number of processing cores are simultaneously increased. Cases are examined on 24, 192, 1536 and 12 288 cores, maintaining 4096 elements per core and ensuring a constant element aspect ratio across all resolutions examined. Simulations were examined on the Gadi supercomputer at the National Computational Infrastructure (NCI) in Australia, using compute nodes with <inline-formula><mml:math id="M338" display="inline"><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">24</mml:mn></mml:mrow></mml:math></inline-formula> core Intel Xeon Platinum 8274 (Cascade Lake) 3.2 GHz CPUs and 192 GB RAM per node. Linking the nodes is the latest-generation HDR InfiniBand technology in a Dragonfly<inline-formula><mml:math id="M339" display="inline"><mml:mo>+</mml:mo></mml:math></inline-formula> topology, capable of transferring data at up to 200 GB s<inline-formula><mml:math id="M340" display="inline"><mml:msup><mml:mi/><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:math></inline-formula>.</p>
      <p id="d1e9046">The most challenging aspect of weak parallel scaling is solver performance as the problem size increases. Whilst the amount of computation in equation assembly typically scales linearly with the number of DOFs – before taking parallel aspects such as communication into account – solver scaling is generally worse. In the case of iterative solvers, this is due to a deterioration in the conditioning of the matrix, driving an increase in the number of iterations required for convergence. As a result, even if the cost per iteration scales linearly, the overall cost will not. This implies that, for weak scaling, the amount of work per core may increase rapidly despite the number of DOFs per core remaining consistent.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F16" specific-use="star"><?xmltex \currentcnt{10}?><?xmltex \def\figurename{Figure}?><label>Figure 10</label><caption><p id="d1e9052">Weak scaling analyses for a 20 time-step, temperature-dependent viscosity, spherical shell simulation with free-slip boundary conditions: <bold>(a)</bold> mean number of iterations per time step for energy (blue stars), pressure (red squares) and velocity (green circles) solves respectively; <bold>(b)</bold> time spent in assembly of finite-element systems; <bold>(c)</bold> time spent setting up the algebraic multigrid preconditioner; <bold>(d)</bold> time spent solving the Schur complement (Stokes) system; <bold>(e)</bold> cost per velocity solve iterations; <bold>(f)</bold> total simulation time, which closely mimics the Schur complement solution time.</p></caption>
        <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-f10.png"/>

      </fig>

      <p id="d1e9080">The deterioration in conditioning is intimately related to the fact that an increase in resolution increases the ratio between the smallest and largest resolvable length scales. For elliptic operators, like the viscosity matrix <inline-formula><mml:math id="M341" display="inline"><mml:mi mathvariant="bold">K</mml:mi></mml:math></inline-formula>, the condition number scales with the square of that ratio <xref ref-type="bibr" rid="bib1.bibx74" id="paren.122"><named-content content-type="pre">e.g.</named-content></xref>. Multigrid approaches, which separate smaller and larger length scales on a hierarchy of fine to coarse meshes, are commonly used to address this problem, which motivates the choice of the algebraic multigrid preconditioner, GAMG, used here. Such approaches aim to maintain a constant or only slowly increasing number of iterations and, thus, a near-linear scaling of the overall cost as the problem size increases. This can be a challenge however, as, for instance, an increase in resolution will require more multigrid levels, which will lead to an increased set-up time and cost per iteration. In practice, when configuring the multigrid method, a compromise needs to be found between the effectiveness of a multigrid in limiting the number of iterations and not allowing the set-up and costs per iteration to grow too rapidly. The two options, <monospace>gamg_threshold</monospace> and <monospace>gamg_square_graph</monospace>, specified in our solver set-up ensure a balance between multigrid effectiveness and coarse grid complexity.</p>
      <p id="d1e9101">A breakdown of key parallel scaling results is presented in Fig. <xref ref-type="fig" rid="Ch1.F16"/>. Panel (a) displays the average number of iterations per solve over the 20 time steps. We find that the number of pressure (the Schur complement solve: <monospace>fieldsplit_1</monospace>) and energy solve iterations remains flat (12 and <inline-formula><mml:math id="M342" display="inline"><mml:mrow><mml:mo>∼</mml:mo><mml:mn mathvariant="normal">10.5</mml:mn></mml:mrow></mml:math></inline-formula> respectively), whilst the number of velocity solve iterations (inversion of the matrix <inline-formula><mml:math id="M343" display="inline"><mml:mi mathvariant="bold">K</mml:mi></mml:math></inline-formula>, using the GAMG preconditioner: <monospace>fieldsplit_0</monospace>) increases only slowly, from <inline-formula><mml:math id="M344" display="inline"><mml:mrow><mml:mo>∼</mml:mo><mml:mn mathvariant="normal">41</mml:mn></mml:mrow></mml:math></inline-formula> to <inline-formula><mml:math id="M345" display="inline"><mml:mrow><mml:mo>∼</mml:mo><mml:mn mathvariant="normal">51</mml:mn></mml:mrow></mml:math></inline-formula>, over a greater than 3 order of magnitude increase in problem size and number of processor cores. This demonstrates algorithmic scalability on up to 12 288 cores and <inline-formula><mml:math id="M346" display="inline"><mml:mrow><mml:mo>∼</mml:mo><mml:mn mathvariant="normal">50</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">6</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> elements (which corresponds to <inline-formula><mml:math id="M347" display="inline"><mml:mrow><mml:mo>∼</mml:mo><mml:mn mathvariant="normal">1.26</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">9</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> velocity and pressure degrees of freedom).</p>
      <p id="d1e9184">Parallel scalability can also be assessed by analysing the growth in CPU time of the dominant components of our problem: assembly of finite-element systems (Fig. <xref ref-type="fig" rid="Ch1.F16"/>b), set-up of the algebraic multigrid (GAMG) preconditioner (Fig. <xref ref-type="fig" rid="Ch1.F16"/>c), and time spent solving the Schur complement system (Fig. <xref ref-type="fig" rid="Ch1.F16"/>d). We find that the assembly time is a negligible fraction of this problem. The set-up time for our GAMG preconditioner grows from <inline-formula><mml:math id="M348" display="inline"><mml:mrow><mml:mo>∼</mml:mo><mml:mn mathvariant="normal">240</mml:mn></mml:mrow></mml:math></inline-formula> s on 24 cores to <inline-formula><mml:math id="M349" display="inline"><mml:mrow><mml:mo>∼</mml:mo><mml:mn mathvariant="normal">470</mml:mn></mml:mrow></mml:math></inline-formula> s on 12 288 cores. This is understandable given the high communication costs associated with setting up various multigrid levels, particularly for problems incorporating null spaces and near-null spaces, as is the case here. We note, however, that this is not a concern: as a fraction of the entire solution time for the Schur complement solve (Fig. <xref ref-type="fig" rid="Ch1.F16"/>d), GAMG set-up remains small. We do observe an increase in time required for solution of the Schur complement (Stokes solve) from <inline-formula><mml:math id="M350" display="inline"><mml:mrow><mml:mo>∼</mml:mo><mml:mn mathvariant="normal">6500</mml:mn></mml:mrow></mml:math></inline-formula> s on 24 cores to <inline-formula><mml:math id="M351" display="inline"><mml:mrow><mml:mo>∼</mml:mo><mml:mn mathvariant="normal">12</mml:mn><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mn mathvariant="normal">100</mml:mn></mml:mrow></mml:math></inline-formula> s on 12 288 cores. This results primarily from the minor increase in the number of velocity solve iterations and the increased cost per iteration (Fig. <xref ref-type="fig" rid="Ch1.F16"/>e), which rises from <inline-formula><mml:math id="M352" display="inline"><mml:mn mathvariant="normal">155</mml:mn></mml:math></inline-formula> s on 24 cores to <inline-formula><mml:math id="M353" display="inline"><mml:mn mathvariant="normal">225</mml:mn></mml:math></inline-formula> s on 12 288 cores, reflecting costs associated with increasing the number of multigrid levels for higher-resolution problems. The total time spent in running this problem mirrors the time spent in solving the Schur complement system (Fig. <xref ref-type="fig" rid="Ch1.F16"/>f), indicating where future optimisation efforts should be directed.</p>
</sec>
<sec id="Ch1.S7">
  <label>7</label><title>Application in 3-D spherical shell geometry: global mantle convection</title>
      <p id="d1e9266">In this section, we demonstrate application of Firedrake to a time-dependent simulation of global mantle convection in a 3-D spherical shell geometry, at a realistic Rayleigh number. We assume a compressible mantle, under the ALA, and a temperature-, depth-, and strain-rate-dependent rheology, in line with the viscoplastic case analysed in Sect. <xref ref-type="sec" rid="Ch1.S5.SS2.SSS2"/>. Viscosity increases below the mantle transition zone and we include a brittle-failure-type yield-stress law, ensuring that yielding concentrates at shallow depths. As with the examples provided above, calculations are performed using a hexahedral Q2Q1 element pair for velocity and pressure. We use a Q2 discretisation for temperature and, given the increased importance of advection at higher Rayleigh numbers, incorporate stabilisation through a streamline upwinding scheme, following <xref ref-type="bibr" rid="bib1.bibx39" id="text.123"/>. We employ a cubed sphere mesh with 98 304 elements on each spherical surface and extrude it radially through 64 layers, with spacing reduced adjacent to the top and bottom boundaries of the domain. This results in a problem with <inline-formula><mml:math id="M354" display="inline"><mml:mrow><mml:mo>∼</mml:mo><mml:mn mathvariant="normal">1.26</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">9</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> velocity and pressure degrees of freedom and <inline-formula><mml:math id="M355" display="inline"><mml:mrow><mml:mo>∼</mml:mo><mml:mn mathvariant="normal">5.0</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">7</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> temperature degrees of freedom. Our solution strategy for the Stokes equations is similar to the spherical shell examples presented above, albeit exploiting PETSc's SNES functionality using a set-up based on Newton's method to handle the non-linearity in the system. The solution strategy for the energy equation is identical to the previous example.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F17" specific-use="star"><?xmltex \currentcnt{11}?><?xmltex \def\figurename{Figure}?><label>Figure 11</label><caption><p id="d1e9310">Present-day thermal structure, predicted from our global mantle convection simulation where the geographic distribution of heterogeneity is dictated by 230 Myr of imposed plate motion history <xref ref-type="bibr" rid="bib1.bibx97" id="paren.124"/>. Each image includes a radial surface at <inline-formula><mml:math id="M356" display="inline"><mml:mrow><mml:mi>r</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1.25</mml:mn></mml:mrow></mml:math></inline-formula> (i.e. immediately above the core–mantle boundary), a cross section and transparent isosurfaces at temperature anomalies (i.e. away from the radial average) of <inline-formula><mml:math id="M357" display="inline"><mml:mrow><mml:mi>T</mml:mi><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mn mathvariant="normal">0.075</mml:mn></mml:mrow></mml:math></inline-formula> (blue) and <inline-formula><mml:math id="M358" display="inline"><mml:mrow><mml:mi>T</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.075</mml:mn></mml:mrow></mml:math></inline-formula> (red), highlighting the location of downwelling slabs and upwelling mantle plumes (below <inline-formula><mml:math id="M359" display="inline"><mml:mrow><mml:mi>r</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2.13</mml:mn></mml:mrow></mml:math></inline-formula>) respectively. Continental boundaries provide geographic reference. Panel <bold>(a)</bold> provides an Africa-centred view, with panel <bold>(b)</bold> centred on the Pacific Ocean and including (green) glyphs at the surface highlighting the imposed plate velocities.</p></caption>
        <?xmltex \igopts{width=412.564961pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-f11.png"/>

      </fig>

      <p id="d1e9379">We achieve a (basally heated) Rayleigh number of <inline-formula><mml:math id="M360" display="inline"><mml:mrow><mml:mn mathvariant="normal">7.5</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">7</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> in the asthenosphere, which is comparable to estimates of Earth's mantle <xref ref-type="bibr" rid="bib1.bibx38" id="paren.125"><named-content content-type="pre">e.g.</named-content></xref> and also includes internal heating at a non-dimensional heating rate of 10. The simulation is spun up with free-slip and isothermal boundaries at both surfaces. After the model reaches a quasi-steady state (i.e. when the surface and basal Nusselt numbers both change by less than 0.1 % over 10 consecutive time steps), surface velocities are assimilated through a kinematic boundary condition, according to 230 Myr of plate motion histories <xref ref-type="bibr" rid="bib1.bibx97" id="paren.126"/>, using the Python interface to GPlates <xref ref-type="bibr" rid="bib1.bibx53 bib1.bibx98" id="paren.127"><named-content content-type="pre">e.g.</named-content></xref>. Our simulation then runs forward towards the present day. This case is therefore similar to the simulations examined when addressing questions from the very frontiers of geodynamical research, albeit incorporating a more representative treatment of mantle and lithosphere rheology (e.g. <xref ref-type="bibr" rid="bib1.bibx110 bib1.bibx30 bib1.bibx32 bib1.bibx18 bib1.bibx55 bib1.bibx100 bib1.bibx107 bib1.bibx73 bib1.bibx49 bib1.bibx43" id="altparen.128"/>). The simulation was executed across 1344 CPUs, on the same architecture as outlined above, and took <inline-formula><mml:math id="M361" display="inline"><mml:mrow><mml:mo>∼</mml:mo><mml:mn mathvariant="normal">92</mml:mn></mml:mrow></mml:math></inline-formula> h.</p>
      <p id="d1e9425">Our results are illustrated in Fig. <xref ref-type="fig" rid="Ch1.F17"/>. We find that the present-day upper-mantle convective planform is dominated by strong downwellings in regions of plate convergence. In the middle mantle, cold downwellings are prominent beneath North America and South-East Asia, whilst remnants of older subduction are visible above the core–mantle boundary. The location of hot upwelling material is strongly modulated by these downwellings, with upwelling plumes concentrating in two clusters beneath the African continent and the central Pacific Ocean (i.e. away from regions that have experienced subduction over the past 150 Myr or so). The cluster of plumes in the Pacific is reasonably circular, whilst those beneath Africa extend in a NW–SE-trending structure, which to the north curves eastward under Europe and to the south extends into the Indian Ocean.</p>
      <p id="d1e9430">Further analysis of this proof-of-concept simulation is beyond the scope of this study. However, when combined with the benchmark and parallel scaling analyses presented above, our model predictions, which are consistent with those from a number of previous studies (e.g. <xref ref-type="bibr" rid="bib1.bibx19 bib1.bibx32 bib1.bibx18 bib1.bibx34" id="altparen.129"/>), confirm Firedrake's applicability for time-dependent global mantle dynamics simulations of this nature.</p>
</sec>
<sec id="Ch1.S8">
  <label>8</label><title>Discussion</title>
      <p id="d1e9444">Firedrake is a next-generation automated system for solving variational problems using the finite-element method (e.g. <xref ref-type="bibr" rid="bib1.bibx105 bib1.bibx51" id="altparen.130"/>). It has a number of features that are ideally suited to simulating geophysical fluid dynamics problems, as exemplified by its use in application areas such as coastal ocean modelling <xref ref-type="bibr" rid="bib1.bibx79" id="paren.131"/>, numerical weather prediction <xref ref-type="bibr" rid="bib1.bibx114" id="paren.132"/> and glacier flow modelling <xref ref-type="bibr" rid="bib1.bibx112" id="paren.133"/>. The focus of this paper has been to demonstrate Firedrake's applicability for geodynamical simulation, with an emphasis on global mantle dynamics. To do so, we have presented, analysed and validated Firedrake against a number of benchmark and analytical cases of systematically increasing complexity, building towards a time-dependent global simulation at realistic convective vigour.</p>
      <p id="d1e9459">To introduce its core components and illustrate the elegance of setting up and validating a geodynamical model in Firedrake, we started with a simple, incompressible, isoviscous case in an enclosed 2-D Cartesian box. Setting up this problem was straightforward, requiring only a weak formulation of the governing equations for specification in the UFL, together with a mesh, initial and boundary conditions, and appropriate discrete function spaces. We utilised Firedrake's built-in meshing functionality and default direct solver options and demonstrated the framework's accuracy for simulations of this nature: in only 56 lines of Python (excluding comments and blank lines), we reproduced results from the well-established benchmark study of <xref ref-type="bibr" rid="bib1.bibx17" id="text.134"/>.</p>
      <p id="d1e9465">Representative simulations of mantle and lithosphere dynamics, however, incorporate more complicated physics. To demonstrate Firedrake's applicability in such scenarios, we next set up 2-D simulations that accounted for compressibility through the anelastic liquid approximation <xref ref-type="bibr" rid="bib1.bibx109" id="paren.135"/> and a non-linear viscosity that depends upon temperature, depth and strain rate. Our results were validated through comparison to the benchmark studies of <xref ref-type="bibr" rid="bib1.bibx68" id="text.136"/> and <xref ref-type="bibr" rid="bib1.bibx126" id="text.137"/> respectively. For compressible cases, despite the governing equations differing appreciably from their incompressible counterparts, the modifications required to our set-up were minimal, with the most notable change being the UFL describing the relevant PDEs. For the viscoplastic rheology case, where viscosity varied by several orders of magnitude across the domain, an appropriate solution strategy was required to deal with non-linear coupling between strain rate and viscosity: Firedrake's fully programmable solver interface and seamless coupling to PETSc facilitated the straightforward use of PETSc's SNES <xref ref-type="bibr" rid="bib1.bibx70" id="paren.138"/>. Taken together, these examples highlight one of Firedrake's key benefits: by leveraging the UFL <xref ref-type="bibr" rid="bib1.bibx3" id="paren.139"/>, associated strategies for automatic assembly of finite-element systems, and PETSc <xref ref-type="bibr" rid="bib1.bibx7 bib1.bibx8 bib1.bibx9" id="paren.140"/>, the framework is easily extensible, allowing for straightforward application to problems involving different physical approximations, even when they require distinct solution strategies.</p>
      <p id="d1e9487">This is further highlighted with the transition from 2-D to 3-D. With modifications to only a few lines of Python, the basic 2-D Cartesian case described above was easily extended to 3-D, allowing for comparison and validation against the well-established benchmark results of <xref ref-type="bibr" rid="bib1.bibx25" id="text.141"/>. However, the direct solvers used for our 2-D cases quickly become computationally intractable in 3-D, necessitating the use of an iterative approach. Firedrake's programmable solver interface facilitates the straightforward inclusion of Python dictionaries that define iterative solver parameters for the Stokes and energy systems. A number of different schemes have been advocated by the geodynamical modelling community <xref ref-type="bibr" rid="bib1.bibx89 bib1.bibx24" id="paren.142"><named-content content-type="pre">e.g.</named-content></xref>, but in all 3-D simulations examined herein, the Schur complement approach was utilised for solution of our Stokes system, exploiting the fieldsplit preconditioner type to apply preconditioners, including an algebraic multigrid, to different blocks of the system. A Crank–Nicolson scheme was utilised for temporal discretisation of the energy equation, with a standard GMRES Krylov method with SOR preconditioning used for solution. We have demonstrated that such solution strategies are effective and scalable, with algorithmic scalability confirmed on up to 12 288 cores.</p>
      <p id="d1e9499">Cartesian simulations offer a means of better understanding the physical mechanisms controlling mantle convection, but a 3-D spherical shell geometry is required to simulate global mantle dynamics. We have demonstrated how Firedrake's built-in meshing and extrusion functionality facilitates the effortless transition to such geometries (in addition to comparable 2-D cylindrical shell geometries), whilst its Python user interface allows for the simple inclusion of a radial gravity direction and boundary conditions that are not aligned with Cartesian directions. The convergence properties and accuracy of our simulations in a 3-D spherical shell geometry have been demonstrated through comparison to the extensive set of analytical solutions introduced by <xref ref-type="bibr" rid="bib1.bibx76" id="text.143"/> and a series of low Rayleigh number isoviscous and temperature-dependent viscosity simulations from <xref ref-type="bibr" rid="bib1.bibx138" id="text.144"/>. We observed super-convergence for the Q2Q1 element pair at fourth and second order for velocity and pressure respectively.</p>
      <p id="d1e9508">Having validated Firedrake against this broad suite of cases, we finally applied the framework to a simulation of global mantle convection at realistic convective vigour. We assumed a compressible mantle and a non-linear temperature-, depth- and strain-rate-dependent viscosity, assimilating 230 Myr of plate motion histories <xref ref-type="bibr" rid="bib1.bibx97" id="paren.145"/> through a kinematic surface boundary condition. These prescribed plate velocities modulate underlying mantle flow, such that the predicted present-day convective planform is dominated by cold downwellings in regions of plate convergence, with upwellings concentrating elsewhere, particularly beneath the African continent and the Pacific Ocean. Our model predictions, which are consistent with those from a number of previous studies (e.g. <xref ref-type="bibr" rid="bib1.bibx19 bib1.bibx118 bib1.bibx32 bib1.bibx18 bib1.bibx34" id="altparen.146"/>), reproduce first-order characteristics of the structure of Earth's mantle imaged through seismology (e.g. <xref ref-type="bibr" rid="bib1.bibx106 bib1.bibx45" id="altparen.147"/>) and the geographical distribution of mantle plumes (e.g. <xref ref-type="bibr" rid="bib1.bibx6 bib1.bibx35" id="altparen.148"/>). They serve as a proof of concept, confirming Firedrake's applicability for time-dependent, global simulations of this nature and, accordingly, its suitability for addressing research problems from the very frontiers of global geodynamical research.</p><?xmltex \setfigures?><?xmltex \setlistings?><?xmltex \floatpos{t}?><fig id="Ch1.F18" specific-use="star"><?xmltex \currentcnt{7}?><?xmltex \def\figurename{Listing}?><label>Listing 7</label><caption><p id="d1e9526">Re-implementation by user code of
the <monospace>MassInvPC</monospace> preconditioner for the Schur complement first used in Sect. <xref ref-type="sec" rid="Ch1.S5.SS3.SSS1"/>. The UFL in line 3 that defines a mass matrix scaled by the inverse of viscosity <inline-formula><mml:math id="M362" display="inline"><mml:mi mathvariant="italic">μ</mml:mi></mml:math></inline-formula> could be replaced by any other expression approximating the Schur complement (see <xref ref-type="bibr" rid="bib1.bibx89" id="altparen.149"/>, for an overview). Preconditioners that are expressed through linear algebra operations on sub-matrices of the saddle point matrix, e.g.
<inline-formula><mml:math id="M363" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:mi mathvariant="bold">KG</mml:mi><mml:mo>≈</mml:mo><mml:mi mathvariant="normal">diag</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:mi mathvariant="normal">diag</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold">K</mml:mi><mml:mo>)</mml:mo><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula>, can be constructed by applying these operations through the <monospace>petsc4py</monospace> interface.</p></caption>
        <?xmltex \igopts{width=497.923228pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-l07.png"/>

      </fig>

      <p id="d1e9591">Despite this, several components of Firedrake have not been fully examined in this paper. Many of these will likely be useful for geodynamical simulation and, accordingly, will be examined in the future. These include the following.
<list list-type="order"><list-item>
      <p id="d1e9596">A range of finite elements: in most examples considered herein, we utilised a continuous Q2Q1 element pair for velocity and pressure with a Q2 discretisation for temperature. In addition, in some cases we instead employ the Q2P<inline-formula><mml:math id="M364" display="inline"><mml:msub><mml:mi/><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mtext>DG</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula> finite-element pair for the Stokes system or a Q1 discretisation for temperature. Despite this, we have not fully demonstrated Firedrake's support for a wide array of finite elements, including continuous, discontinuous, <inline-formula><mml:math id="M365" display="inline"><mml:mi>H</mml:mi></mml:math></inline-formula>(div) and <inline-formula><mml:math id="M366" display="inline"><mml:mi>H</mml:mi></mml:math></inline-formula>(curl) discretisations and elements with continuous derivatives such as the Argyris and Bell elements <xref ref-type="bibr" rid="bib1.bibx71" id="paren.150"><named-content content-type="pre">see</named-content><named-content content-type="post">for an overview</named-content></xref>. Some of these could offer major advantages for geodynamical simulation.</p></list-item><list-item>
      <p id="d1e9633">The use of discontinuous Galerkin (DG) schemes for the solution of the energy equation: a number of studies now advocate the use of DG schemes for solution of the energy equation <xref ref-type="bibr" rid="bib1.bibx132 bib1.bibx56" id="paren.151"><named-content content-type="pre">e.g.</named-content></xref>. Importantly, Firedrake's simple API allows a user to escape the UFL abstraction and implement common operations that fall outside of pure variational formulations, such as flux limiters, which are central to DG schemes.</p></list-item><list-item>
      <p id="d1e9642">Hybridisation strategies: Firedrake provides the necessary infrastructure for hybridisation strategies <xref ref-type="bibr" rid="bib1.bibx51" id="paren.152"/>, which allow for a reduction of the many extra degrees of freedom introduced by DG schemes in the global system to a smaller subset, defined on element interfaces through so-called trace elements. This could facilitate more efficient ways of solving the Stokes system <xref ref-type="bibr" rid="bib1.bibx27" id="paren.153"><named-content content-type="pre">e.g.</named-content></xref>. Such possibilities will be explored in future work, noting that Firedrake's existing support for these elements will facilitate rapid and efficient testing and validation.</p></list-item><list-item>
      <p id="d1e9654">Fully coupled non-linear systems: in all examples considered herein, we solve for velocity and pressure in a separate step to temperature, largely owing to our familiarity with this approach from previous work (e.g. <xref ref-type="bibr" rid="bib1.bibx31 bib1.bibx36 bib1.bibx76" id="altparen.154"/>). However, a number of studies advocate solving for these fields simultaneously <xref ref-type="bibr" rid="bib1.bibx134" id="paren.155"><named-content content-type="pre">e.g.</named-content></xref>, particularly for strongly coupled, highly non-linear, multi-physics problems. By leveraging the UFL, in combination with PETSc's fieldsplit preconditioning approach, future work to configure and test such coupled schemes within Firedrake will be relatively straightforward.</p></list-item><list-item>
      <p id="d1e9666">Preconditioners: a major benefit of Firedrake for the problems considered herein is access to the wide variety of solution algorithms and preconditioning strategies provided by the PETSc library, which can be flexibly configured through the solver parameter dictionary, allowing one to test and apply different strategies with ease. The development of preconditioners for the Stokes problem is an active area of research (e.g. <xref ref-type="bibr" rid="bib1.bibx89 bib1.bibx78 bib1.bibx24 bib1.bibx113" id="altparen.156"/>). As noted above, Firedrake supports a powerful programmable preconditioner interface which, in turn, connects with the Python preconditioner interface
of PETSc and allows users to specify their own linear operator in the UFL (see Listing 7 for an example), enabling preconditioning techniques with bespoke operator approximations. We note that, in addition to the complete range of algebraic solvers offered by PETSc, Firedrake also provides access to multilevel solvers with geometric hierarchies, opening up the possibility of exploring geometric multigrid approaches in the future.</p></list-item></list>
<?xmltex \setfigures?></p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F19" specific-use="star"><?xmltex \currentcnt{12}?><?xmltex \def\figurename{Figure}?><label>Figure 12</label><caption><p id="d1e9677">Benchmark case of <xref ref-type="bibr" rid="bib1.bibx115" id="text.157"/> with strain-rate- and  pressure-dependent Drucker–Prager rheology. Solution fields, including
velocity, strain rate, viscosity and <inline-formula><mml:math id="M367" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">α</mml:mi><mml:mtext>SPD</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> (see Eq. <xref ref-type="disp-formula" rid="Ch1.E43"/>), are shown for the case with inflow velocity <inline-formula><mml:math id="M368" display="inline"><mml:mrow><mml:msub><mml:mi>U</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">5</mml:mn></mml:mrow></mml:math></inline-formula> mm yr<inline-formula><mml:math id="M369" display="inline"><mml:msup><mml:mi/><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:math></inline-formula>, <inline-formula><mml:math id="M370" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">24</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> Pa s and a friction angle of <inline-formula><mml:math id="M371" display="inline"><mml:mrow><mml:mi mathvariant="italic">α</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">30</mml:mn><mml:msup><mml:mi/><mml:mo>∘</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula>  in the left panel. The top-right and bottom-right panels show convergence of the residual in the Picard and Newton solvers applied to the <inline-formula><mml:math id="M372" display="inline"><mml:mrow><mml:msub><mml:mi>U</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2.5</mml:mn></mml:mrow></mml:math></inline-formula> mm yr<inline-formula><mml:math id="M373" display="inline"><mml:msup><mml:mi/><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:math></inline-formula>, <inline-formula><mml:math id="M374" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">23</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> Pa s case and the <inline-formula><mml:math id="M375" display="inline"><mml:mrow><mml:msub><mml:mi>U</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">5</mml:mn></mml:mrow></mml:math></inline-formula> mm yr<inline-formula><mml:math id="M376" display="inline"><mml:msup><mml:mi/><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:math></inline-formula>, <inline-formula><mml:math id="M377" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">24</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> Pa s case respectively. Both cases are run with a number of initial Picard iterations, as indicated in the legend, before switching to either the full unmodified Newton method (solid lines) or the stabilised method with modifications as proposed in <xref ref-type="bibr" rid="bib1.bibx44" id="text.158"/> (dots). In the former case, the unmodified Newton method clearly performs best, with the stabilised method showing some degradation towards the Picard method (purple line). In the latter case, the unmodified Newton method fails to converge, whereas the stabilised method continues to converge slowly but not much faster than the Picard method, before stalling altogether. These results are generally consistent with those in <xref ref-type="bibr" rid="bib1.bibx44" id="text.159"/>.</p></caption>
        <?xmltex \igopts{width=483.69685pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-f12.png"/>

      </fig>

      <p id="d1e9861">To support these statements and further demonstrate the potential of the framework in exploring challenging non-linear problems, we briefly consider the non-linear benchmark case of <xref ref-type="bibr" rid="bib1.bibx115" id="text.160"/>, with a strain-rate- and pressure-dependent Drucker–Prager rheology. In <xref ref-type="bibr" rid="bib1.bibx44" id="text.161"/>, a number of solution strategies are explored for this case (amongst others), with the study advocating the use of two modifications to the Jacobian: (i) adding an additional term to Eq. (<xref ref-type="disp-formula" rid="Ch1.E32"/>) that is the transpose of the second term, thus restoring the symmetry of <inline-formula><mml:math id="M378" display="inline"><mml:mi mathvariant="bold">K</mml:mi></mml:math></inline-formula>, and (ii) scaling those terms associated with <inline-formula><mml:math id="M379" display="inline"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">η</mml:mi><mml:mo>/</mml:mo><mml:mo>∂</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow></mml:math></inline-formula> by a spatially varying <inline-formula><mml:math id="M380" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">α</mml:mi><mml:mtext>SPD</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>, calculated at the Gauss points according to
          <disp-formula id="Ch1.E43" content-type="numbered"><label>43</label><mml:math id="M381" display="block"><mml:mrow><?xmltex \hack{\hbox\bgroup\fontsize{9.5}{9.5}\selectfont$\displaystyle}?><mml:mtable rowspacing="0.2ex" class="split" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:msub><mml:mi mathvariant="italic">α</mml:mi><mml:mtext>SPD</mml:mtext></mml:msub><mml:mo>=</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mfenced open="{" close=""><mml:mtable class="cases" rowspacing="0.2ex" columnspacing="1em" columnalign="left left" framespacing="0em"><mml:mtr><mml:mtd><mml:mn mathvariant="normal">1</mml:mn></mml:mtd><mml:mtd><mml:mrow><mml:mtext> if </mml:mtext><mml:msup><mml:mfenced open="[" close="]"><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mi>a</mml:mi><mml:mo>:</mml:mo><mml:mi>b</mml:mi></mml:mrow><mml:mrow><mml:mo>‖</mml:mo><mml:mi>a</mml:mi><mml:mo>‖</mml:mo><mml:mo>‖</mml:mo><mml:mi>b</mml:mi><mml:mo>‖</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mstyle></mml:mrow></mml:mfenced><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mo>&lt;</mml:mo><mml:msub><mml:mi>c</mml:mi><mml:mtext>safety</mml:mtext></mml:msub><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">η</mml:mi><mml:mo>(</mml:mo><mml:mover accent="true"><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mo mathvariant="normal">˙</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi>c</mml:mi><mml:mtext>safety</mml:mtext></mml:msub><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">η</mml:mi><mml:mo>(</mml:mo><mml:mover accent="true"><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mo mathvariant="normal">˙</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:msup><mml:mfenced close="]" open="["><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:mi>a</mml:mi><mml:mo>:</mml:mo><mml:mi>b</mml:mi></mml:mrow><mml:mrow><mml:mo>‖</mml:mo><mml:mi>a</mml:mi><mml:mo>‖</mml:mo><mml:mo>‖</mml:mo><mml:mi>b</mml:mi><mml:mo>‖</mml:mo></mml:mrow></mml:mfrac></mml:mrow></mml:mfenced><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:mfrac></mml:mstyle></mml:mstyle></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mtext>otherwise</mml:mtext><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mfenced></mml:mrow></mml:mtd></mml:mtr></mml:mtable><?xmltex \hack{$\egroup}?></mml:mrow></mml:math></disp-formula>
        where <inline-formula><mml:math id="M382" display="inline"><mml:mrow><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mover accent="true"><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mo mathvariant="normal">˙</mml:mo></mml:mover></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M383" display="inline"><mml:mrow><mml:mi>b</mml:mi><mml:mo>=</mml:mo><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">η</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mover accent="true"><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mo mathvariant="normal">˙</mml:mo></mml:mover></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:math></inline-formula>. This rescaling acts as a stabilisation, ensuring that <inline-formula><mml:math id="M384" display="inline"><mml:mi mathvariant="bold">K</mml:mi></mml:math></inline-formula> remains positive definite. It should be noted that the pressure dependence of the Drucker–Prager rheology also leads to additional terms in the top-right block of the Stokes Jacobian matrix, in addition to <inline-formula><mml:math id="M385" display="inline"><mml:mi mathvariant="bold">G</mml:mi></mml:math></inline-formula> in Eq. (<xref ref-type="disp-formula" rid="Ch1.E28"/>), making the overall system
asymmetric regardless.</p>
      <p id="d1e10127">In traditional codes, the implementation of such additional terms in the Jacobian and the proposed modifications (stabilisation) require significant development. Analytical expressions for <inline-formula><mml:math id="M386" display="inline"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">η</mml:mi><mml:mo>/</mml:mo><mml:mo>∂</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M387" display="inline"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">η</mml:mi><mml:mo>/</mml:mo><mml:mo>∂</mml:mo><mml:mi>p</mml:mi></mml:mrow></mml:math></inline-formula> must be derived for each specific rheological relationship analysed (as is done in the appendices of <xref ref-type="bibr" rid="bib1.bibx44" id="altparen.162"/>), and the assembly of any additional terms may require a significant overhaul of existing code and data structures as, for example, sparsity structures may change. In Firedrake, the full Jacobian is derived symbolically and the code for its assembly generated automatically, making the entire process automatic, even for highly complex rheologies. We were able to implement the Jacobian modifications proposed in <xref ref-type="bibr" rid="bib1.bibx44" id="text.163"/> in only seven lines of Python code (the full Python script for this case is available in the repository accompanying this paper) and, as illustrated in Fig. <xref ref-type="fig" rid="Ch1.F19"/>, we obtain similar results. As indicated in <xref ref-type="bibr" rid="bib1.bibx44" id="text.164"/>, the convergence of the problem gets more challenging with increased resolution, and although a reasonably converged result can be obtained for the case shown in Fig. <xref ref-type="fig" rid="Ch1.F19"/> at a resolution of <inline-formula><mml:math id="M388" display="inline"><mml:mrow><mml:mn mathvariant="normal">1024</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">512</mml:mn></mml:mrow></mml:math></inline-formula>, this is insufficient to resolve the details of the unstructured mesh domain used in <xref ref-type="bibr" rid="bib1.bibx115" id="text.165"/>, who reported non-convergence for this case. Firedrake's ability to choose from a large variety of discretisation types, including unstructured meshes, and its flexibility to adapt and experiment with the solution strategy open up numerous avenues to further investigate the challenges in this and other highly non-linear problems.</p>
      <p id="d1e10191">It is important to point out that some common components of geodynamical models have not been showcased herein and, to our knowledge, have not yet been explored within the Firedrake framework. These include, for example, a free-surface boundary condition and the ability to model multiple-material flows, often implemented in geodynamical models using the particle-in-cell technique. Our goal for this paper is to provide solid foundations for future work in Firedrake that we, and others in the geodynamical modelling community, can build upon. Nonetheless, we see no fundamental reason why any component of other geodynamical modelling tools cannot be incorporated within Firedrake. For example, the TerraFERMA framework of <xref ref-type="bibr" rid="bib1.bibx134" id="text.166"/>, which is built on FEniCS, has been able to match the free-surface benchmarks of <xref ref-type="bibr" rid="bib1.bibx75" id="text.167"/> – a similar implementation would be straightforward in Firedrake. For multi-material flows, solving an advection equation, for example with a discontinuous Galerkin scheme and appropriate limiters <xref ref-type="bibr" rid="bib1.bibx56" id="paren.168"><named-content content-type="pre">e.g.</named-content></xref>, would be straightforward. In addition, particle-in-cell schemes have been successfully developed and tested with FEniCS <xref ref-type="bibr" rid="bib1.bibx87" id="paren.169"/>, and we see no fundamental reason that such functionality cannot be incorporated within Firedrake. Finally, Firedrake's flexibility would make exploring different advection schemes straightforward, rendering it very well-suited to level-set approaches <xref ref-type="bibr" rid="bib1.bibx59" id="paren.170"><named-content content-type="pre">e.g.</named-content></xref>.</p>
      <p id="d1e10213">We note that the automated approach underpinning Firedrake has the potential to revolutionise the use of adjoints and other inverse schemes in geodynamics. Adjoint models have made an enormous impact in fields such as meteorology and oceanography. However, despite significant progress (e.g. <xref ref-type="bibr" rid="bib1.bibx22 bib1.bibx84 bib1.bibx83 bib1.bibx28 bib1.bibx48 bib1.bibx50" id="altparen.171"/>), their use in other scientific fields, including geodynamics, has been hampered by the practical difficulty of their derivation and implementation. In contrast to developing a model directly in Fortran or C++, high-level systems, such as Firedrake, allow the developer to express the variational problems to be solved in near-mathematical notation through the UFL. As such, these systems have a key advantage: since the mathematical structure of the problem is preserved, they are more amenable to automated analysis and manipulation, which can be exploited to automate the derivation of adjoints <xref ref-type="bibr" rid="bib1.bibx41 bib1.bibx93" id="paren.172"><named-content content-type="pre">e.g.</named-content></xref> and the generation of the low-level code for the derived models. Exploring the use of such an approach in geodynamics will be an important avenue for future research.</p>
      <p id="d1e10224">Finally, given the importance of reproducibility in the computational geosciences, we note that Firedrake integrates with Zenodo and GitHub to provide users with the ability to generate a set of DOIs corresponding to the exact set of Firedrake components used to conduct a particular set of simulations. In providing our input scripts and a DOI for the version of Firedrake used herein, we ensure traceable provenance of model data, in full compliance with FAIR principles.</p>
</sec>
<sec id="Ch1.S9" sec-type="conclusions">
  <label>9</label><title>Conclusions</title>
      <p id="d1e10235">Firedrake is a next-generation system for solving variational problems using the finite-element method (e.g. <xref ref-type="bibr" rid="bib1.bibx105 bib1.bibx51" id="altparen.173"/>). It treats finite-element problems as a composition of several abstract processes, using separate and open-source software components for each. Firedrake's overarching goal is to save users from manually writing low-level code for assembling the systems of equations that discretise their model physics. It is written completely in Python and exploits automatic code-generation techniques to apply sophisticated performance optimisations. Firedrake creates a separation of concerns between employing the finite-element method and implementing it: this is a game changer, as it opens up these problems to a new class of user and developer.</p>
      <p id="d1e10241">In this paper, we have confirmed Firedrake's applicability for geodynamical simulation by configuring and validating model predictions against a series of benchmark and analytical cases of systematically increasing complexity. In all cases, Firedrake has been shown to be <italic>accurate</italic> and <italic>efficient</italic>, and we have also demonstrated that it is <italic>flexible</italic> and easily <italic>extensible</italic>: by leveraging the UFL and PETSc, it can be effortlessly applied to problems involving different physical approximations (e.g. incompressible and compressible flow, isoviscous and more complex non-linear rheologies), even if they require distinct solution strategies. We have illustrated how Firedrake's built-in mesh generation utilities and extrusion functionality provide a straightforward mechanism for examining problems in different geometries (2-D and 3-D Cartesian, 2-D cylindrical and 3-D spherical shells) and how its fully programmable solver dictionary and customisable preconditioner interface, both of which are seamlessly coupled to PETSc, facilitate straightforward configuration of different solution approaches. Parallel <italic>scalability</italic> has been demonstrated on up to 12 288 compute cores. Finally, using a more representative simulation of global mantle dynamics, where the distribution of heterogeneity is governed by imposed plate motion histories <xref ref-type="bibr" rid="bib1.bibx97" id="paren.174"/>, we have confirmed Firedrake's suitability for tackling challenges at the very forefront of geodynamical research. We note that all simulation data presented herein have traceable provenance: in providing our input scripts and a DOI for the exact set of Firedrake components employed, Firedrake facilitates <italic>transparency</italic> and <italic>reproducibility</italic>, in full compliance with FAIR principles.</p>
</sec>

      
      </body>
    <back><app-group>

<app id="App1.Ch1.S1">
  <?xmltex \currentcnt{A}?><label>Appendix A</label><title>Governing equations under the anelastic liquid approximation</title>
      <p id="d1e10280">Density changes across Earth's mantle result primarily from hydrostatic compression, with density increasing by <inline-formula><mml:math id="M389" display="inline"><mml:mrow><mml:mo>≈</mml:mo><mml:mn mathvariant="normal">65</mml:mn></mml:mrow></mml:math></inline-formula> % from the surface to the core–mantle boundary (CMB) <xref ref-type="bibr" rid="bib1.bibx109" id="paren.175"><named-content content-type="pre">e.g.</named-content></xref>. Variations in density associated with local temperature and pressure perturbations are small in comparison to the spherically averaged density. For a chemically homogeneous mantle, it is therefore appropriate to assume a linearised equation of state of the form

              <disp-formula specific-use="align" content-type="numbered"><mml:math id="M390" display="block"><mml:mtable displaystyle="true"><mml:mtr><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mo>=</mml:mo><mml:mover accent="true"><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mover accent="true"><mml:mi>T</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mo>,</mml:mo><mml:mover accent="true"><mml:mi>p</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:msup><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mlabeledtr id="App1.Ch1.S1.E44"><mml:mtd><mml:mtext>A1</mml:mtext></mml:mtd><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>=</mml:mo><mml:mover accent="true"><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mover accent="true"><mml:mi>T</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mo>,</mml:mo><mml:mover accent="true"><mml:mi>p</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mover accent="true"><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:msub><mml:mover accent="true"><mml:mi mathvariant="italic">χ</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:msub><mml:mi/><mml:mi>T</mml:mi></mml:msub></mml:msub><mml:msup><mml:mi>p</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>-</mml:mo><mml:mover accent="true"><mml:mi mathvariant="italic">α</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:msup><mml:mi>T</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>)</mml:mo><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mlabeledtr></mml:mtable></mml:math></disp-formula>

          Here <inline-formula><mml:math id="M391" display="inline"><mml:mi mathvariant="italic">ρ</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M392" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M393" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M394" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">χ</mml:mi><mml:msub><mml:mi/><mml:mi>T</mml:mi></mml:msub></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M395" display="inline"><mml:mi mathvariant="italic">α</mml:mi></mml:math></inline-formula> denote density, pressure, temperature, isothermal compressibility and the coefficient of thermal expansion respectively, whilst overbars refer to a reference state and primes to departures from it:
          <disp-formula id="App1.Ch1.S1.E45" content-type="numbered"><label>A2</label><mml:math id="M396" display="block"><mml:mrow><mml:mi>T</mml:mi><mml:mo>=</mml:mo><mml:mover accent="true"><mml:mi>T</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mo>+</mml:mo><mml:msup><mml:mi>T</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>,</mml:mo><mml:mspace linebreak="nobreak" width="1em"/><mml:mi>p</mml:mi><mml:mo>=</mml:mo><mml:mover accent="true"><mml:mi>p</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mo>+</mml:mo><mml:msup><mml:mi>p</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
        It is convenient to take the reference state as motionless and steady. Accordingly, for the purposes of the compressible case examined herein, we will assume that the reference state varies as a function of depth, <inline-formula><mml:math id="M397" display="inline"><mml:mi>z</mml:mi></mml:math></inline-formula>, only. The reference state pressure thus satisfies the hydrostatic approximation:
          <disp-formula id="App1.Ch1.S1.E46" content-type="numbered"><label>A3</label><mml:math id="M398" display="block"><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mover accent="true"><mml:mi>p</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mover accent="true"><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mover accent="true"><mml:mi mathvariant="bold-italic">g</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mo>⋅</mml:mo><mml:mover accent="true"><mml:mi mathvariant="bold-italic">k</mml:mi><mml:mo mathvariant="normal" stretchy="false">^</mml:mo></mml:mover><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        where <inline-formula><mml:math id="M399" display="inline"><mml:mi mathvariant="bold">g</mml:mi></mml:math></inline-formula> is the acceleration of gravity and <inline-formula><mml:math id="M400" display="inline"><mml:mover accent="true"><mml:mi mathvariant="bold-italic">k</mml:mi><mml:mo stretchy="false" mathvariant="normal">^</mml:mo></mml:mover></mml:math></inline-formula> is the unit vector in the direction opposite to gravity. On Earth, <inline-formula><mml:math id="M401" display="inline"><mml:mi mathvariant="bold-italic">g</mml:mi></mml:math></inline-formula> is a function of position; however, for simplicity, it will be assumed constant for the compressible case examined herein. Following <xref ref-type="bibr" rid="bib1.bibx68" id="text.176"/>, the reference density and reference temperature are described through an adiabatic Adams–Williamson equation of state <xref ref-type="bibr" rid="bib1.bibx16" id="paren.177"/>, where
          <disp-formula id="App1.Ch1.S1.E47" content-type="numbered"><label>A4</label><mml:math id="M402" display="block"><mml:mrow><mml:mover accent="true"><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mi>z</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mspace width="0.25em" linebreak="nobreak"/><mml:mi mathvariant="normal">exp</mml:mi><mml:mo mathsize="1.5em">(</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi mathvariant="italic">α</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:msub><mml:mi>g</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi mathvariant="italic">γ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:msub><mml:mi>c</mml:mi><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mi>z</mml:mi><mml:mo mathsize="1.5em">)</mml:mo></mml:mrow></mml:math></disp-formula>
        and
          <disp-formula id="App1.Ch1.S1.E48" content-type="numbered"><label>A5</label><mml:math id="M403" display="block"><mml:mrow><mml:mover accent="true"><mml:mi>T</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mi>z</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mi mathvariant="normal">s</mml:mi></mml:msub><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mi mathvariant="normal">exp</mml:mi><mml:mo mathsize="1.5em">(</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi mathvariant="italic">α</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:msub><mml:mi>g</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>c</mml:mi><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mi>z</mml:mi><mml:mo mathsize="1.5em">)</mml:mo><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>
        Here, <inline-formula><mml:math id="M404" display="inline"><mml:mrow><mml:msub><mml:mi>c</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M405" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mi mathvariant="normal">s</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> represent the specific heat capacity at constant pressure and surface temperature respectively, whilst <inline-formula><mml:math id="M406" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">γ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> denotes the Grüneisen parameter, given by
          <disp-formula id="App1.Ch1.S1.E49" content-type="numbered"><label>A6</label><mml:math id="M407" display="block"><mml:mrow><mml:msub><mml:mi mathvariant="italic">γ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi mathvariant="italic">α</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:msub><mml:mi>c</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="normal">v</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:msub><mml:msub><mml:mi mathvariant="italic">χ</mml:mi><mml:msub><mml:mi/><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:msub></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        where <inline-formula><mml:math id="M408" display="inline"><mml:mrow><mml:msub><mml:mi>c</mml:mi><mml:mi mathvariant="normal">v</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> denotes the specific heat capacity at constant volume. Variables with a subscript <inline-formula><mml:math id="M409" display="inline"><mml:mn mathvariant="normal">0</mml:mn></mml:math></inline-formula> are constants, used in defining the reference state. Here, they are defined at the domain's upper surface.</p>
      <p id="d1e10807">Assuming a linearised equation of state (Eq. <xref ref-type="disp-formula" rid="App1.Ch1.S1.E44"/>), the dimensionless form of the conservation of mass equation under the anelastic liquid approximation (ALA) can be expressed as <xref ref-type="bibr" rid="bib1.bibx109" id="paren.178"><named-content content-type="pre">e.g.</named-content></xref>:
          <disp-formula id="App1.Ch1.S1.E50" content-type="numbered"><label>A7</label><mml:math id="M410" display="block"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mo>(</mml:mo><mml:mover accent="true"><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        where <inline-formula><mml:math id="M411" display="inline"><mml:mi mathvariant="bold-italic">u</mml:mi></mml:math></inline-formula> is the velocity. Neglecting inertial terms, the force balance equation becomes
          <disp-formula id="App1.Ch1.S1.E51" content-type="numbered"><label>A8</label><mml:math id="M412" display="block"><mml:mtable class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>⋅</mml:mo><mml:mfenced close="]" open="["><mml:mrow><mml:mi mathvariant="italic">μ</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:msup><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mi>T</mml:mi></mml:msup><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">2</mml:mn><mml:mn mathvariant="normal">3</mml:mn></mml:mfrac></mml:mstyle><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mi mathvariant="bold">I</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:msup><mml:mi>p</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>-</mml:mo><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mover accent="true"><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mover accent="true"><mml:mi mathvariant="bold-italic">k</mml:mi><mml:mo stretchy="false" mathvariant="normal">^</mml:mo></mml:mover><mml:mover accent="true"><mml:mi mathvariant="italic">α</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:msup><mml:mi>T</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi>D</mml:mi><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:msub><mml:mi mathvariant="italic">γ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi>c</mml:mi><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>c</mml:mi><mml:mrow><mml:msub><mml:mi>v</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mover accent="true"><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mover accent="true"><mml:mi mathvariant="bold-italic">k</mml:mi><mml:mo stretchy="false" mathvariant="normal">^</mml:mo></mml:mover><mml:msub><mml:mover accent="true"><mml:mi mathvariant="italic">χ</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:msub><mml:mi/><mml:mi>T</mml:mi></mml:msub></mml:msub><mml:msup><mml:mi>p</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
        where <inline-formula><mml:math id="M413" display="inline"><mml:mi mathvariant="italic">μ</mml:mi></mml:math></inline-formula> denotes the dynamic viscosity, <inline-formula><mml:math id="M414" display="inline"><mml:mi mathvariant="bold">I</mml:mi></mml:math></inline-formula> the identity tensor, <inline-formula><mml:math id="M415" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi></mml:mrow></mml:math></inline-formula> the Rayleigh number, and <inline-formula><mml:math id="M416" display="inline"><mml:mrow><mml:mi>D</mml:mi><mml:mi>i</mml:mi></mml:mrow></mml:math></inline-formula> the dissipation number given by respectively
          <disp-formula id="App1.Ch1.S1.E52" content-type="numbered"><label>A9</label><mml:math id="M417" display="block"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:msub><mml:mi mathvariant="italic">α</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>T</mml:mi><mml:msub><mml:mi>g</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:msup><mml:mi>d</mml:mi><mml:mn mathvariant="normal">3</mml:mn></mml:msup></mml:mrow><mml:mrow><mml:msub><mml:mi mathvariant="italic">μ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:msub><mml:mi mathvariant="italic">κ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>;</mml:mo><mml:mspace width="0.25em" linebreak="nobreak"/><mml:mspace linebreak="nobreak" width="1em"/><mml:mi>D</mml:mi><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi mathvariant="italic">α</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:msub><mml:mi>g</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub><mml:mi>d</mml:mi></mml:mrow><mml:mrow><mml:msub><mml:mi>c</mml:mi><mml:mrow><mml:msub><mml:mi>p</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        with <inline-formula><mml:math id="M418" display="inline"><mml:mi mathvariant="italic">κ</mml:mi></mml:math></inline-formula> denoting the thermal diffusivity, <inline-formula><mml:math id="M419" display="inline"><mml:mi>d</mml:mi></mml:math></inline-formula> the length scale and <inline-formula><mml:math id="M420" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>T</mml:mi></mml:mrow></mml:math></inline-formula> the temperature scale. Note that the last but one term in Eq. (<xref ref-type="disp-formula" rid="App1.Ch1.S1.E51"/>) is expressed in terms of the temperature perturbation, <inline-formula><mml:math id="M421" display="inline"><mml:mrow><mml:msup><mml:mi>T</mml:mi><mml:mo>′</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula> (sometimes called the potential temperature). Finally, in the absence of internal heating, conservation of energy is expressed as
          <disp-formula id="App1.Ch1.S1.E53" content-type="numbered"><label>A10</label><mml:math id="M422" display="block"><mml:mtable class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:mover accent="true"><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:msub><mml:mover accent="true"><mml:mi>c</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo mathsize="2.0em">(</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msup><mml:mi>T</mml:mi><mml:mo>′</mml:mo></mml:msup></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>+</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:msup><mml:mi>T</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo mathsize="2.0em">)</mml:mo><mml:mo>-</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mo mathsize="1.5em">[</mml:mo><mml:mover accent="true"><mml:mi>k</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>(</mml:mo><mml:mover accent="true"><mml:mi>T</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mo>+</mml:mo><mml:msup><mml:mi>T</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>)</mml:mo><mml:mo mathsize="1.5em">]</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>+</mml:mo><mml:mi>D</mml:mi><mml:mi>i</mml:mi><mml:mover accent="true"><mml:mi mathvariant="italic">α</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mover accent="true"><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mover accent="true"><mml:mi mathvariant="bold-italic">g</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:mover><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">u</mml:mi><mml:msup><mml:mi>T</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi>D</mml:mi><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mi mathvariant="normal">Φ</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
        where <inline-formula><mml:math id="M423" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> is the thermal conductivity and <inline-formula><mml:math id="M424" display="inline"><mml:mi mathvariant="normal">Φ</mml:mi></mml:math></inline-formula> denotes viscous dissipation.</p>

<?xmltex \floatpos{h!}?><table-wrap id="App1.Ch1.S1.T2"><?xmltex \hack{\hsize\textwidth}?><?xmltex \currentcnt{A1}?><label>Table A1</label><caption><p id="d1e11336">Highest-resolution results from the benchmark cases analysed herein. DOF: degrees of freedom for velocity (<inline-formula><mml:math id="M425" display="inline"><mml:mi mathvariant="bold-italic">u</mml:mi></mml:math></inline-formula>), pressure (<inline-formula><mml:math id="M426" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula>) and temperature (<inline-formula><mml:math id="M427" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula>). <inline-formula><mml:math id="M428" display="inline"><mml:mrow><mml:mi>N</mml:mi><mml:mi>u</mml:mi></mml:mrow></mml:math></inline-formula>: surface Nusselt number.</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="8">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="left"/>
     <oasis:colspec colnum="3" colname="col3" align="right"/>
     <oasis:colspec colnum="4" colname="col4" align="right"/>
     <oasis:colspec colnum="5" colname="col5" align="right"/>
     <oasis:colspec colnum="6" colname="col6" align="right"/>
     <oasis:colspec colnum="7" colname="col7" align="right"/>
     <oasis:colspec colnum="8" colname="col8" align="right"/>
     <oasis:thead>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1">Case</oasis:entry>
         <oasis:entry colname="col2">Discretisation</oasis:entry>
         <oasis:entry colname="col3">Resolution</oasis:entry>
         <oasis:entry colname="col4">DOF (<inline-formula><mml:math id="M429" display="inline"><mml:mi mathvariant="bold-italic">u</mml:mi></mml:math></inline-formula>)</oasis:entry>
         <oasis:entry colname="col5">DOF (<inline-formula><mml:math id="M430" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula>)</oasis:entry>
         <oasis:entry colname="col6">DOF (<inline-formula><mml:math id="M431" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula>)</oasis:entry>
         <oasis:entry colname="col7"><inline-formula><mml:math id="M432" display="inline"><mml:mrow><mml:mi>N</mml:mi><mml:mi>u</mml:mi></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col8"><inline-formula><mml:math id="M433" display="inline"><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mtext>RMS</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1">Base case (<inline-formula><mml:math id="M434" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">4</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>)</oasis:entry>
         <oasis:entry colname="col2">Q2Q1 : Q2</oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M435" display="inline"><mml:mrow><mml:mn mathvariant="normal">320</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">320</mml:mn></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col4">821 762</oasis:entry>
         <oasis:entry colname="col5">103 041</oasis:entry>
         <oasis:entry colname="col6">410 881</oasis:entry>
         <oasis:entry colname="col7">4.885</oasis:entry>
         <oasis:entry colname="col8">42.86</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Base case (<inline-formula><mml:math id="M436" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">5</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>)</oasis:entry>
         <oasis:entry colname="col2">Q2Q1 : Q2</oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M437" display="inline"><mml:mrow><mml:mn mathvariant="normal">320</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">320</mml:mn></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col4">821 762</oasis:entry>
         <oasis:entry colname="col5">103 041</oasis:entry>
         <oasis:entry colname="col6">410 881</oasis:entry>
         <oasis:entry colname="col7">10.54</oasis:entry>
         <oasis:entry colname="col8">193.21</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Base case (<inline-formula><mml:math id="M438" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">5</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>)</oasis:entry>
         <oasis:entry colname="col2">Q2P<inline-formula><mml:math id="M439" display="inline"><mml:msub><mml:mi/><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mtext>DG</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula> : Q2</oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M440" display="inline"><mml:mrow><mml:mn mathvariant="normal">320</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">320</mml:mn></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col4">821 762</oasis:entry>
         <oasis:entry colname="col5">307 200</oasis:entry>
         <oasis:entry colname="col6">410 881</oasis:entry>
         <oasis:entry colname="col7">10.54</oasis:entry>
         <oasis:entry colname="col8">193.21</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Base case (<inline-formula><mml:math id="M441" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">6</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>)</oasis:entry>
         <oasis:entry colname="col2">Q2Q1 : Q2</oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M442" display="inline"><mml:mrow><mml:mn mathvariant="normal">320</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">320</mml:mn></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col4">821 762</oasis:entry>
         <oasis:entry colname="col5">103 041</oasis:entry>
         <oasis:entry colname="col6">410 881</oasis:entry>
         <oasis:entry colname="col7">22.03</oasis:entry>
         <oasis:entry colname="col8">833.99</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Base case (<inline-formula><mml:math id="M443" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">6</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>)</oasis:entry>
         <oasis:entry colname="col2">Q2Q1 : Q1</oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M444" display="inline"><mml:mrow><mml:mn mathvariant="normal">320</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">320</mml:mn></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col4">821 762</oasis:entry>
         <oasis:entry colname="col5">103 041</oasis:entry>
         <oasis:entry colname="col6">103 041</oasis:entry>
         <oasis:entry colname="col7">21.86</oasis:entry>
         <oasis:entry colname="col8">834.10</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Compressible</oasis:entry>
         <oasis:entry colname="col2">Q2Q1 : Q2</oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M445" display="inline"><mml:mrow><mml:mn mathvariant="normal">320</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">320</mml:mn></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col4">821 762</oasis:entry>
         <oasis:entry colname="col5">103 041</oasis:entry>
         <oasis:entry colname="col6">410 881</oasis:entry>
         <oasis:entry colname="col7">7.575</oasis:entry>
         <oasis:entry colname="col8">155.09</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Viscoplastic</oasis:entry>
         <oasis:entry colname="col2">Q2Q1 : Q2</oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M446" display="inline"><mml:mrow><mml:mn mathvariant="normal">320</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">320</mml:mn></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col4">821 762</oasis:entry>
         <oasis:entry colname="col5">103 041</oasis:entry>
         <oasis:entry colname="col6">410 881</oasis:entry>
         <oasis:entry colname="col7">6.617</oasis:entry>
         <oasis:entry colname="col8">79.09</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">3-D Cartesian</oasis:entry>
         <oasis:entry colname="col2">Q2Q1 : Q2</oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M447" display="inline"><mml:mrow><mml:mn mathvariant="normal">60</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">60</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">60</mml:mn></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col4">3 294 225</oasis:entry>
         <oasis:entry colname="col5">141 398</oasis:entry>
         <oasis:entry colname="col6">1 098 075</oasis:entry>
         <oasis:entry colname="col7">3.539</oasis:entry>
         <oasis:entry colname="col8">41.00</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">2-D cylindrical shell</oasis:entry>
         <oasis:entry colname="col2">Q2Q1 : Q2</oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M448" display="inline"><mml:mrow><mml:mn mathvariant="normal">2048</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">512</mml:mn></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col4">8 396 800</oasis:entry>
         <oasis:entry colname="col5">1 050 624</oasis:entry>
         <oasis:entry colname="col6">4 198 400</oasis:entry>
         <oasis:entry colname="col7">9.541</oasis:entry>
         <oasis:entry colname="col8">193.26</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">3-D spherical shell – isoviscous</oasis:entry>
         <oasis:entry colname="col2">Q2Q1 : Q2</oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M449" display="inline"><mml:mrow><mml:mn mathvariant="normal">98</mml:mn><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mn mathvariant="normal">304</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col4">152 175 366</oasis:entry>
         <oasis:entry colname="col5">6 389 890</oasis:entry>
         <oasis:entry colname="col6">50 725 122</oasis:entry>
         <oasis:entry colname="col7">3.506</oasis:entry>
         <oasis:entry colname="col8">32.62</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">3-D spherical shell – <inline-formula><mml:math id="M450" display="inline"><mml:mrow><mml:mi mathvariant="italic">μ</mml:mi><mml:mo>(</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2">Q2Q1 : Q2</oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M451" display="inline"><mml:mrow><mml:mn mathvariant="normal">98</mml:mn><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mn mathvariant="normal">304</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col4">152 175 366</oasis:entry>
         <oasis:entry colname="col5">6 389 890</oasis:entry>
         <oasis:entry colname="col6">50 725 122</oasis:entry>
         <oasis:entry colname="col7">2.922</oasis:entry>
         <oasis:entry colname="col8">22.99</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

<?xmltex \hack{\clearpage}?><?xmltex \floatpos{h!}?><fig id="App1.Ch1.S1.F20"><?xmltex \currentcnt{A1}?><?xmltex \def\figurename{Figure}?><label>Figure A1</label><caption><p id="d1e12027">Convergence for 2-D cylindrical shell cases with zero-slip <bold>(a–b)</bold> and free-slip <bold>(c–d)</bold> boundary conditions using a Q2Q1 finite-element pair for the Stokes system, driven by a delta-function forcing at different wave numbers, <inline-formula><mml:math id="M452" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula>, as indicated in the legend <xref ref-type="bibr" rid="bib1.bibx76" id="paren.179"><named-content content-type="pre">see</named-content><named-content content-type="post">for further details</named-content></xref>. Convergence rate is indicated by dashed lines, with the order of convergence provided in the legend. For the cases plotted, the series of meshes start at refinement level 1, where the mesh consists of 1024 divisions in the tangential direction and 64 radial layers. At each subsequent level the mesh is refined by doubling resolution in both directions.</p></caption>
        <?xmltex \hack{\hsize\textwidth}?>
        <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-f13.png"/>

      </fig>

      <?xmltex \floatpos{h!}?><fig id="App1.Ch1.S1.F21"><?xmltex \currentcnt{A2}?><?xmltex \def\figurename{Figure}?><label>Figure A2</label><caption><p id="d1e12060">Convergence for 2-D cylindrical shell cases with zero-slip <bold>(a–b)</bold> and free-slip <bold>(c–d)</bold> boundary conditions using a Q2P<inline-formula><mml:math id="M453" display="inline"><mml:msub><mml:mi/><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mtext>DG</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula> finite-element pair for the Stokes system, driven by a delta-function forcing at different wave numbers, <inline-formula><mml:math id="M454" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula>, as indicated in the legend <xref ref-type="bibr" rid="bib1.bibx76" id="paren.180"><named-content content-type="pre">see</named-content><named-content content-type="post">for further details</named-content></xref>. Convergence rate is indicated by dashed lines, with the order of convergence provided in the legend. For the cases plotted, the series of meshes start at refinement level 1, where the mesh consists of 1024 divisions in the tangential direction and 64 radial layers. At each subsequent level the mesh is refined by doubling resolution in both directions.</p></caption>
        <?xmltex \hack{\hsize\textwidth}?>
        <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/15/5127/2022/gmd-15-5127-2022-f14.png"/>

      </fig>

<?xmltex \hack{\clearpage}?>
</app>
  </app-group><notes notes-type="codedataavailability"><title>Code and data availability</title>

      <p id="d1e12110">Minor adjustments to the Firedrake code base required to successfully run the cases in this paper have been merged into the open-source software associated with the Firedrake project. For the specific components of the Firedrake project used in this paper, see <ext-link xlink:href="https://doi.org/10.5281/zenodo.6522930" ext-link-type="DOI">10.5281/zenodo.6522930</ext-link>  <xref ref-type="bibr" rid="bib1.bibx42" id="paren.181"/>. For the input files of all examples and benchmarks presented, see <ext-link xlink:href="https://doi.org/10.5281/zenodo.6762752" ext-link-type="DOI">10.5281/zenodo.6762752</ext-link> <xref ref-type="bibr" rid="bib1.bibx37" id="paren.182"/>.</p>
  </notes><notes notes-type="authorcontribution"><title>Author contributions</title>

      <p id="d1e12128">DRD and SCK conceived this study, with all the authors having significant input on the design, development and validation of the examples and cases presented. All the authors contributed towards writing the manuscript.</p>
  </notes><notes notes-type="competinginterests"><title>Competing interests</title>

      <p id="d1e12134">The contact author has declared that neither they nor their co-authors have any competing interests.</p>
  </notes><notes notes-type="disclaimer"><title>Disclaimer</title>

      <p id="d1e12140">Publisher's note: Copernicus Publications remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.</p>
  </notes><ack><title>Acknowledgements</title><p id="d1e12146">Numerical simulations were undertaken at the NCI National Facility in Canberra, Australia, which is supported by the Australian Commonwealth Government. The authors are grateful to the entire Firedrake development team, particularly David Ham, for support and advice at various points of this research. We are also grateful to seven reviewers, including Cedric Thieulot, Marcus Mohr, Wolfgang Bangerth and Carsten Burstedde: their careful and constructive feedback helped to clarify and improve this contribution.</p></ack><notes notes-type="financialsupport"><title>Financial support</title>

      <p id="d1e12151">This research has been supported by the Australian
Research Data Commons (ARDC), AuScope, Geosciences Australia and the National Computational Infrastructure (NCI) under G-Adopt platform grant PL031. It was also supported by the Australian Research Council under grant no. DP170100058.</p>
  </notes><notes notes-type="reviewstatement"><title>Review statement</title>

      <p id="d1e12157">This paper was edited by Rohitash Chandra and reviewed by Marcus Mohr, Cedric Thieulot, Wolfgang Bangerth, Carsten Burstedde, and three anonymous referees.</p>
  </notes><ref-list>
    <title>References</title>

      <ref id="bib1.bibx1"><?xmltex \def\ref@label{{Ahrens et~al.(2005)Ahrens, Geveci, and Law}}?><label>Ahrens et al.(2005)Ahrens, Geveci, and Law</label><?label Ahrens_2005?><mixed-citation>Ahrens, J., Geveci, B., and Law, C.: Paraview: An End-User Tool for Large Data Visualization, The Visualization Handbook, Elsevier,  717–731,
<ext-link xlink:href="https://doi.org/10.1016/B978-012387582-2/50038-1" ext-link-type="DOI">10.1016/B978-012387582-2/50038-1</ext-link>, 2005.</mixed-citation></ref>
      <ref id="bib1.bibx2"><?xmltex \def\ref@label{{Alisic et~al.(2010)Alisic, Gurnis, Stadler, Burstedde, Wilcox, and
Ghattas}}?><label>Alisic et al.(2010)Alisic, Gurnis, Stadler, Burstedde, Wilcox, and
Ghattas</label><?label Alisic_2011?><mixed-citation>Alisic, L., Gurnis, M., Stadler, G., Burstedde, C., Wilcox, L. C., and Ghattas, O.:  Slab stress and strain rate as constraints on global mantle flow, Geophys. Res. Lett., 37, L22308, <ext-link xlink:href="https://doi.org/10.1029/2010GL045312" ext-link-type="DOI">10.1029/2010GL045312</ext-link>, 2010.</mixed-citation></ref>
      <ref id="bib1.bibx3"><?xmltex \def\ref@label{{Alnes et~al.(2014)Alnes, Logg, Olgaard, Rognes, and
Wells}}?><label>Alnes et al.(2014)Alnes, Logg, Olgaard, Rognes, and
Wells</label><?label Alnes_2014?><mixed-citation>
Alnes, M. S., Logg, A., Olgaard, K. B., Rognes, M. E., and Wells, G. N.:
Unified Form Language: A domain-specific language for weak formulations of
partial differential equations, ACM T. Math. Softw.,
40, 2–9, 2014.</mixed-citation></ref>
      <ref id="bib1.bibx4"><?xmltex \def\ref@label{{Amestoy et~al.(2001)Amestoy, Duff, Koster, and L'Excellent}}?><label>Amestoy et al.(2001)Amestoy, Duff, Koster, and L'Excellent</label><?label Mumps_1?><mixed-citation>
Amestoy, P., Duff, I. S., Koster, J., and L'Excellent, J.-Y.: A Fully
Asynchronous Multifrontal Solver Using Distributed Dynamic Scheduling, SIAM
J. Matrix Anal. A., 23, 15–41, 2001.</mixed-citation></ref>
      <ref id="bib1.bibx5"><?xmltex \def\ref@label{{Amestoy et~al.(2019)Amestoy, Buttari, L'Excellent, and
Mary}}?><label>Amestoy et al.(2019)Amestoy, Buttari, L'Excellent, and
Mary</label><?label Mumps_2?><mixed-citation>
Amestoy, P., Buttari, A., L'Excellent, J.-Y., and Mary, T.: Performance and
Scalability of the Block Low-Rank Multifrontal Factorization on Multicore
Architectures, ACM T. Math. Softw. 45, 2:1–2:26,
2019.</mixed-citation></ref>
      <ref id="bib1.bibx6"><?xmltex \def\ref@label{{Austermann et~al.(2014)Austermann, Kaye, Mitrovica, and
Huybers}}?><label>Austermann et al.(2014)Austermann, Kaye, Mitrovica, and
Huybers</label><?label Austermann_2014?><mixed-citation>Austermann, J., Kaye, B., Mitrovica, J., and Huybers, P.: A statistical
analysis of the correlation between large igneous provinces and lower mantle
seismic structure, Geophys. J. Int., 197, 1–9, <ext-link xlink:href="https://doi.org/10.1093/gji/ggt500" ext-link-type="DOI">10.1093/gji/ggt500</ext-link>,
2014.</mixed-citation></ref>
      <ref id="bib1.bibx7"><?xmltex \def\ref@label{{Balay et~al.(1997)Balay, Gropp, {McInnes}, and
Smith}}?><label>Balay et al.(1997)Balay, Gropp, McInnes, and
Smith</label><?label balay_efficient_1997?><mixed-citation>Balay, S., Gropp, W. D., McInnes, L. C., and Smith, B. F.: Efficient
management of parallelism in object-oriented numerical software libraries,
in: Modern software tools for scientific computing,  Birkhauser
Boston Inc., 163–202, <ext-link xlink:href="https://doi.org/10.1007/978-1-4612-1986-6_8" ext-link-type="DOI">10.1007/978-1-4612-1986-6_8</ext-link>, 1997.</mixed-citation></ref>
      <ref id="bib1.bibx8"><?xmltex \def\ref@label{{Balay et~al.(2021{\natexlab{a}})Balay, Abhyankar, Adams, Brown,
Brune, Buschelman, Dalcin, Dener, Eijkhout, Gropp, Karpeyev, Kaushik,
Knepley, May, McInnes, Mills, Munson, Rupp, Sanan, Smith, Zampini, Zhang, and
Zhang}}?><label>Balay et al.(2021a)Balay, Abhyankar, Adams, Brown,
Brune, Buschelman, Dalcin, Dener, Eijkhout, Gropp, Karpeyev, Kaushik,
Knepley, May, McInnes, Mills, Munson, Rupp, Sanan, Smith, Zampini, Zhang, and
Zhang</label><?label petsc-user-ref?><mixed-citation>Balay, S., Abhyankar, S., Adams, M. F., Brown, J., Brune, P., Buschelman, K.,
Dalcin, L., Dener, A., Eijkhout, V., Gropp, W. D., Karpeyev, D., Kaushik, D.,
Knepley, M. G., May, D. A., McInnes, L. C., Mills, R. T., Munson, T., Rupp,
K., Sanan, P., Smith, B. F., Zampini, S., Zhang, H., and Zhang, H.: PETSc
Users Manual, Tech. Rep. ANL-95/11 – Revision 3.15, Argonne National
Laboratory,  <uri>https://www.mcs.anl.gov/petsc</uri> (last access: 1 May 2022),
2021a.</mixed-citation></ref>
      <ref id="bib1.bibx9"><?xmltex \def\ref@label{{Balay et~al.(2021{\natexlab{b}})Balay, Abhyankar, Adams, Brown,
Brune, Buschelman, Dalcin, Dener, Eijkhout, Gropp, Karpeyev, Kaushik,
Knepley, May, McInnes, Mills, Munson, Rupp, Sanan, Smith, Zampini, Zhang, and
Zhang}}?><label>Balay et al.(2021b)Balay, Abhyankar, Adams, Brown,
Brune, Buschelman, Dalcin, Dener, Eijkhout, Gropp, Karpeyev, Kaushik,
Knepley, May, McInnes, Mills, Munson, Rupp, Sanan, Smith, Zampini, Zhang, and
Zhang</label><?label petsc-web-page?><mixed-citation>Balay, S., Abhyankar, S., Adams, M. F., Brown, J., Brune, P., Buschelman, K.,
Dalcin, L., Dener, A., Eijkhout, V., Gropp, W. D., Karpeyev, D., Kaushik, D.,
Knepley, M. G., May, D. A., McInnes, L. C., Mills, R. T., Munson, T., Rupp,
K., Sanan, P., Smith, B. F., Zampini, S., Zhang, H., and Zhang, H.: PETSc
Web page, <uri>https://www.mcs.anl.gov/petsc</uri> (last access: 1 May 2022),,
2021b.</mixed-citation></ref>
      <ref id="bib1.bibx10"><?xmltex \def\ref@label{{Bangerth et~al.(2007)Bangerth, Hartmann, and
Kanschat}}?><label>Bangerth et al.(2007)Bangerth, Hartmann, and
Kanschat</label><?label Bangerth_2007?><mixed-citation>Bangerth, W., Hartmann, R., and Kanschat, G.: deal.II – A general-purpose
object-oriented finite element library, ACM T. Math. Software, 33, 42-es,
<ext-link xlink:href="https://doi.org/10.1145/1268776.1268779" ext-link-type="DOI">10.1145/1268776.1268779</ext-link>, 2007.</mixed-citation></ref>
      <ref id="bib1.bibx11"><?xmltex \def\ref@label{{Bangerth et~al.(2020)Bangerth, Dannberg, Gassmoeller, and
Heister}}?><label>Bangerth et al.(2020)Bangerth, Dannberg, Gassmoeller, and
Heister</label><?label aspect-doi-v2.2.0?><mixed-citation>Bangerth, W., Dannberg, J., Gassmoeller, R., and Heister, T.: ASPECT v2.2.0,
Zenodo [code], <ext-link xlink:href="https://doi.org/10.5281/zenodo.3924604" ext-link-type="DOI">10.5281/zenodo.3924604</ext-link>, 2020.</mixed-citation></ref>
      <ref id="bib1.bibx12"><?xmltex \def\ref@label{{Baumgardner(1985)}}?><label>Baumgardner(1985)</label><?label Baumgardner_1985?><mixed-citation>Baumgardner, J. R.: Three-dimensional treatment of convective flow in the
Earth's mantle, J. Stat. Phys., 39, 501–511, <ext-link xlink:href="https://doi.org/10.1007/BF01008348" ext-link-type="DOI">10.1007/BF01008348</ext-link>,
1985.</mixed-citation></ref>
      <ref id="bib1.bibx13"><?xmltex \def\ref@label{{Bercovici et~al.(1989)Bercovici, Schubert, and
Glatzmaier}}?><label>Bercovici et al.(1989)Bercovici, Schubert, and
Glatzmaier</label><?label Bercovici_1989?><mixed-citation>
Bercovici, D., Schubert, G., and Glatzmaier, G. A.: 3-D spherical models of
convection in the Earth's mantle, Science, 244, 950–955, 1989.</mixed-citation></ref>
      <ref id="bib1.bibx14"><?xmltex \def\ref@label{{Bercovici et~al.(1992)Bercovici, Schubert, and
Glatzmaier}}?><label>Bercovici et al.(1992)Bercovici, Schubert, and
Glatzmaier</label><?label Bercovici_1992?><mixed-citation>
Bercovici, D., Schubert, G., and Glatzmaier, G. A.: Three-dimensional
convection of an infinite-Prandtl-number compressible fluid in a basally
heated spherical shell, J. Fluid Mech., 239, 683–719, 1992.</mixed-citation></ref>
      <ref id="bib1.bibx15"><?xmltex \def\ref@label{{Beucher et~al.(2019)Beucher, Moresi, Giordani, Mansour, Sandiford,
Farrington, Mondy, Mallard, Rey, Duclaux, Kaluza, Laik, and
Morón}}?><label>Beucher et al.(2019)Beucher, Moresi, Giordani, Mansour, Sandiford,
Farrington, Mondy, Mallard, Rey, Duclaux, Kaluza, Laik, and
Morón</label><?label Beucher_2019?><mixed-citation>Beucher, R., Moresi, L., Giordani, J., Mansour, J., Sandiford, D., Farrington,
R., Mondy, L., Mallard, C., Rey, P., Duclaux, G., Kaluza, O., Laik, A., and
Morón, S.: UWGeodynamics: A teaching and research tool for numerical
geodynamic modelling, J. Open Source Softw., 4, 1136,
<ext-link xlink:href="https://doi.org/10.21105/joss.01136" ext-link-type="DOI">10.21105/joss.01136</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx16"><?xmltex \def\ref@label{{Birch(1952)}}?><label>Birch(1952)</label><?label Birch_1952?><mixed-citation>
Birch, F.: Elasticity and constitution of the Earth's interior, J. Geophys.
Res., 57, 227–286, 1952.</mixed-citation></ref>
      <ref id="bib1.bibx17"><?xmltex \def\ref@label{{Blankenbach et~al.(1989)Blankenbach, Busse, Christensen, Cserepes,
Gunkel, Hansen, Harder, Jarvis, Koch, Marquart, Moore, Olson, Schmeling, and
Schnaubelt}}?><label>Blankenbach et al.(1989)Blankenbach, Busse, Christensen, Cserepes,
Gunkel, Hansen, Harder, Jarvis, Koch, Marquart, Moore, Olson, Schmeling, and
Schnaubelt</label><?label Blankenbach_1989?><mixed-citation>Blankenbach, B., Busse, F., Christensen, U., Cserepes, L., Gunkel, D., Hansen,
U., Harder, H., Jarvis, G., Koch, M., Marquart, G., Moore, D., Olson, P.,
Schmeling, H., and Schnaubelt, T.: A benchmark comparison for mantle
convection codes, Geophys. J. Int., 98, 23–38,
<ext-link xlink:href="https://doi.org/10.1111/j.1365-246X.1989.tb05511.x" ext-link-type="DOI">10.1111/j.1365-246X.1989.tb05511.x</ext-link>, 1989.</mixed-citation></ref>
      <ref id="bib1.bibx18"><?xmltex \def\ref@label{{Bower et~al.(2013)Bower, Gurnis, and Seton}}?><label>Bower et al.(2013)Bower, Gurnis, and Seton</label><?label Bower_2013?><mixed-citation>Bower, D. J., Gurnis, M., and Seton, M.: Lower mantle structure from
paleogeographically constrained dynamic Earth models, Geochem. Geophy.
Geosy., 14, 44–63, <ext-link xlink:href="https://doi.org/10.1029/2012GC004267" ext-link-type="DOI">10.1029/2012GC004267</ext-link>, 2013.</mixed-citation></ref>
      <ref id="bib1.bibx19"><?xmltex \def\ref@label{{Bunge et~al.(2002)Bunge, Richards, and Baumgardner}}?><label>Bunge et al.(2002)Bunge, Richards, and Baumgardner</label><?label Bunge_2002?><mixed-citation>Bunge, H., Richards, M. A., and Baumgardner, J. R.: Mantle circulation models
with sequential data-assimilation: inferring present-day mantle structure
from plate motion histories, Philos. T. R. Soc. Lond. A, 360,
2545–2567, <ext-link xlink:href="https://doi.org/10.1098/rsta.2002.1080" ext-link-type="DOI">10.1098/rsta.2002.1080</ext-link>, 2002.</mixed-citation></ref>
      <ref id="bib1.bibx20"><?xmltex \def\ref@label{{Bunge et~al.(1996)Bunge, Richards, and Baumgardner}}?><label>Bunge et al.(1996)Bunge, Richards, and Baumgardner</label><?label Bunge_1996?><mixed-citation>Bunge, H.-P., Richards, M. A., and Baumgardner, J. R.: The effect of
depth–dependent viscosity on the planform of mantle convection, Nature, 279,
436–438, <ext-link xlink:href="https://doi.org/10.1038/379436a0" ext-link-type="DOI">10.1038/379436a0</ext-link>, 1996.</mixed-citation></ref>
      <ref id="bib1.bibx21"><?xmltex \def\ref@label{{Bunge et~al.(1997)Bunge, Richards, and Baumgardner}}?><label>Bunge et al.(1997)Bunge, Richards, and Baumgardner</label><?label Bunge_1997?><mixed-citation>Bunge, H.-P., Richards, M. A., and Baumgardner, J. R.: A sensitivity study of
3-D-spherical mantle convection at 10<inline-formula><mml:math id="M455" display="inline"><mml:msup><mml:mi/><mml:mn mathvariant="normal">8</mml:mn></mml:msup></mml:math></inline-formula> Rayleigh number: effects of
depth-dependent viscosity, heating mode and an endothermic phase change, J.
Geophys. Res., 102, 11991–12007, <ext-link xlink:href="https://doi.org/10.1029/96JB03806" ext-link-type="DOI">10.1029/96JB03806</ext-link>, 1997.</mixed-citation></ref>
      <ref id="bib1.bibx22"><?xmltex \def\ref@label{{Bunge et~al.(2003)Bunge, Hagelberg, and Travis}}?><label>Bunge et al.(2003)Bunge, Hagelberg, and Travis</label><?label Bunge_2003?><mixed-citation>Bunge, H.-P., Hagelberg, C. R., and Travis, B. J.: Mantle circulation models
with variational data assimilation: inferring past mantle flow and structure
from plate motion histories and seismic tomography, Geophys. J. Int., 152,
280–301, <ext-link xlink:href="https://doi.org/10.1046/j.1365-246X.2003.01823.x" ext-link-type="DOI">10.1046/j.1365-246X.2003.01823.x</ext-link>, 2003.</mixed-citation></ref>
      <ref id="bib1.bibx23"><?xmltex \def\ref@label{{Burstedde et~al.(2011)Burstedde, Wilcox, and
Ghattas}}?><label>Burstedde et al.(2011)Burstedde, Wilcox, and
Ghattas</label><?label BursteddeWilcoxGhattas11?><mixed-citation>Burstedde, C., Wilcox, L. C., and Ghattas, O.: <monospace>p4est</monospace>: Scalable
Algorithms for Parallel Adaptive Mesh Refinement on Forests of Octrees, SIAM
J. Sci. Comput., 33, 1103–1133, <ext-link xlink:href="https://doi.org/10.1137/100791634" ext-link-type="DOI">10.1137/100791634</ext-link>,
2011.</mixed-citation></ref>
      <ref id="bib1.bibx24"><?xmltex \def\ref@label{{Burstedde et~al.(2013)Burstedde, Stadler, Alisic, Wilcox, Tan,
Gurnis, and Ghattas}}?><label>Burstedde et al.(2013)Burstedde, Stadler, Alisic, Wilcox, Tan,
Gurnis, and Ghattas</label><?label Burstedde_2013?><mixed-citation>Burstedde, C., Stadler, G., Alisic, L., Wilcox, L. C., Tan, E., Gurnis, M., and
Ghattas, O.: Large-scale adaptive mantle convection simulation, Geophys. J.
Int., 192, 889–906, <ext-link xlink:href="https://doi.org/10.1093/gji/ggs070" ext-link-type="DOI">10.1093/gji/ggs070</ext-link>, 2013.</mixed-citation></ref>
      <ref id="bib1.bibx25"><?xmltex \def\ref@label{{Busse et~al.(1994)Busse, Christensen, Clever, Cserepes, Gable,
Giannandrea, Guillou, Houseman, Nataf, Ogawa, Parmentier, Sotin, and
Travis}}?><label>Busse et al.(1994)Busse, Christensen, Clever, Cserepes, Gable,
Giannandrea, Guillou, Houseman, Nataf, Ogawa, Parmentier, Sotin, and
Travis</label><?label Busse_1994?><mixed-citation>Busse, F. H., Christensen, U., Clever, R., Cserepes, L., Gable, C.,
Giannandrea, E., Guillou, L., Houseman, G., Nataf, H. C., Ogawa, M.,
Parmentier, M., Sotin, C., and Travis, B.: 3D convection at infinite
Prandtl number in Cartesian geometry - a benchmark comparison, Geophys.
Astro. Fluid, 75, 39–59, <ext-link xlink:href="https://doi.org/10.1080/03091929408203646" ext-link-type="DOI">10.1080/03091929408203646</ext-link>, 1994.</mixed-citation></ref>
      <ref id="bib1.bibx26"><?xmltex \def\ref@label{{Choblet et~al.(2007)Choblet, Cadek, Couturier, and
Dumoulin}}?><label>Choblet et al.(2007)Choblet, Cadek, Couturier, and
Dumoulin</label><?label Choblet_2007?><mixed-citation>Choblet, G., Cadek, O., Couturier, F., and Dumoulin, C.: OEDIPUS: a new tool
to study the dynamics of planetary interiors, Geophys. J. Int., 170, 9–30,
<ext-link xlink:href="https://doi.org/10.1111/j.1365-246X.2007.03419.x" ext-link-type="DOI">10.1111/j.1365-246X.2007.03419.x</ext-link>, 2007.</mixed-citation></ref>
      <ref id="bib1.bibx27"><?xmltex \def\ref@label{{Cockburn and Shi(2014)}}?><label>Cockburn and Shi(2014)</label><?label Cockburn_2014?><mixed-citation>Cockburn, B. and Shi, K.: Devising HDG methods for Stokes flow: An overview,
Comput. Fluids, 98, 221–229, <ext-link xlink:href="https://doi.org/10.1016/j.compfluid.2013.11.017" ext-link-type="DOI">10.1016/j.compfluid.2013.11.017</ext-link>,
2014.</mixed-citation></ref>
      <ref id="bib1.bibx28"><?xmltex \def\ref@label{{Colli et~al.(2018)Colli, Ghelichkhan, Bunge, and Oeser}}?><label>Colli et al.(2018)Colli, Ghelichkhan, Bunge, and Oeser</label><?label Colli_2018?><mixed-citation>Colli, L., Ghelichkhan, S., Bunge, H., and Oeser, J.: Retrodictions of Mid
Paleogene mantle flow and dynamic topography in the Atlantic region from
compressible high resolution adjoint mantle convection models: Sensitivity to
deep mantle viscosity and tomographic input model, Gondwana Res., 53,
252–272, <ext-link xlink:href="https://doi.org/10.1029/2018GL077338" ext-link-type="DOI">10.1029/2018GL077338</ext-link>, 2018.</mixed-citation></ref>
      <ref id="bib1.bibx29"><?xmltex \def\ref@label{{Dalcin et~al.(2011)Dalcin, Kler, Paz, and Cosimo}}?><label>Dalcin et al.(2011)Dalcin, Kler, Paz, and Cosimo</label><?label Dalcin_2011?><mixed-citation>
Dalcin, L., Kler, P. A., Paz, R. R., and Cosimo, A.: Parallel Distributed
Computing using Python, Adv. Water Res., 34, 10.1016/j.advwatres.2011.04.013,
2011.</mixed-citation></ref>
      <ref id="bib1.bibx30"><?xmltex \def\ref@label{{Davies and Davies(2009)}}?><label>Davies and Davies(2009)</label><?label Davies_2009?><mixed-citation>Davies, D. R. and Davies, J. H.: Thermally–driven mantle plumes reconcile
multiple hotspot observations, Earth Planet. Sc. Lett., 278, 50–54,
<ext-link xlink:href="https://doi.org/10.1016/j.epsl.2008.11.027" ext-link-type="DOI">10.1016/j.epsl.2008.11.027</ext-link>, 2009.</mixed-citation></ref>
      <ref id="bib1.bibx31"><?xmltex \def\ref@label{{Davies et~al.(2011)Davies, Wilson, and Kramer}}?><label>Davies et al.(2011)Davies, Wilson, and Kramer</label><?label Davies_2011?><mixed-citation>Davies, D. R., Wilson, C. R., and Kramer, S. C.: Fluidity: a fully unstructured
anisotropic adaptive mesh computational modeling framework for geodynamics,
Geochem. Geophy. Geosy., 120, Q06001, <ext-link xlink:href="https://doi.org/10.1029/2011GC003551" ext-link-type="DOI">10.1029/2011GC003551</ext-link>, 2011.</mixed-citation></ref>
      <ref id="bib1.bibx32"><?xmltex \def\ref@label{{Davies et~al.(2012)Davies, Goes, Davies, Schuberth, Bunge, and
Ritsema}}?><label>Davies et al.(2012)Davies, Goes, Davies, Schuberth, Bunge, and
Ritsema</label><?label Davies_2012?><mixed-citation>Davies, D. R., Goes, S., Davies, J. H., Schuberth, B. S. A., Bunge, H., and
Ritsema, J.: Reconciling dynamic and seismic models of Earth's lower
mantle: the dominant role of thermal heterogeneity, Earth Planet. Sc. Lett.,
353–354, 253–269, <ext-link xlink:href="https://doi.org/10.1016/j.epsl.2012.08.016" ext-link-type="DOI">10.1016/j.epsl.2012.08.016</ext-link>, 2012.</mixed-citation></ref>
      <ref id="bib1.bibx33"><?xmltex \def\ref@label{{Davies et~al.(2013)Davies, Davies, Bollada, Hassan, Morgan, and
Nithiarasu}}?><label>Davies et al.(2013)Davies, Davies, Bollada, Hassan, Morgan, and
Nithiarasu</label><?label Davies_2013?><mixed-citation>Davies, D. R., Davies, J. H., Bollada, P. C., Hassan, O., Morgan, K., and Nithiarasu, P.: A hierarchical mesh refinement technique for global 3-D spherical mantle convection modelling, Geosci. Model Dev., 6, 1095–1107, <ext-link xlink:href="https://doi.org/10.5194/gmd-6-1095-2013" ext-link-type="DOI">10.5194/gmd-6-1095-2013</ext-link>, 2013.</mixed-citation></ref>
      <ref id="bib1.bibx34"><?xmltex \def\ref@label{{Davies et~al.(2015{\natexlab{a}})Davies, Goes, and
Lau}}?><label>Davies et al.(2015a)Davies, Goes, and
Lau</label><?label Davies_2015_Review?><mixed-citation>Davies, D. R., Goes, S., and Lau, H. C. P.: Thermally Dominated Deep Mantle
LLSVPs: A Review, in: The Earth's Heterogeneous Mantle, edited by: Khan, A.
and Deschamps, F.,  Springer International Publishing, 441–477,
<ext-link xlink:href="https://doi.org/10.1007/978-3-319-15627-9_14" ext-link-type="DOI">10.1007/978-3-319-15627-9_14</ext-link>, 2015a.</mixed-citation></ref>
      <ref id="bib1.bibx35"><?xmltex \def\ref@label{{Davies et~al.(2015{\natexlab{b}})Davies, Goes, and
Sambridge}}?><label>Davies et al.(2015b)Davies, Goes, and
Sambridge</label><?label Davies_2015_HS?><mixed-citation>Davies, D. R., Goes, S., and Sambridge, M.: On the relationship between
volcanic hotspot locations, the reconstructed eruption sites of large igneous
provinces and deep mantle seismic structure, Earth Planet. Sc. Lett., 411,
121–130, <ext-link xlink:href="https://doi.org/10.1016/j.epsl.2014.11.052" ext-link-type="DOI">10.1016/j.epsl.2014.11.052</ext-link>, 2015b.</mixed-citation></ref>
      <ref id="bib1.bibx36"><?xmltex \def\ref@label{{Davies et~al.(2016)Davies, {Le Voci}, Goes, Kramer, and
Wilson}}?><label>Davies et al.(2016)Davies, Le Voci, Goes, Kramer, and
Wilson</label><?label Davies_2016?><mixed-citation>Davies, D. R., Le Voci, G., Goes, S., Kramer, S. C., and Wilson, C. R.: The
mantle wedge's transient 3-D flow regime and thermal structure, Geochem.
Geophy. Geosy., 17, 78–100, <ext-link xlink:href="https://doi.org/10.1002/2015GC006125" ext-link-type="DOI">10.1002/2015GC006125</ext-link>, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx37"><?xmltex \def\ref@label{Davies et al.(2022)}?><label>Davies et al.(2022)</label><?label zenodo2?><mixed-citation>Davies, D. R.,  Kramer, S.,   Ghelichkhan, S., and Gibson, A.:  g-adopt/g-adopt: v1.2.0 (v1.2.0),  Zenodo [code], <ext-link xlink:href="https://doi.org/10.5281/zenodo.6762752" ext-link-type="DOI">10.5281/zenodo.6762752</ext-link>, 2022.</mixed-citation></ref>
      <ref id="bib1.bibx38"><?xmltex \def\ref@label{{Davies(1999)}}?><label>Davies(1999)</label><?label Davies_Dynamic_1999?><mixed-citation>Davies, G. F.: Dynamic Earth: plates, plumes and mantle convection, Cambridge
University Press, <ext-link xlink:href="https://doi.org/10.1017/CBO9780511605802" ext-link-type="DOI">10.1017/CBO9780511605802</ext-link>, 1999.</mixed-citation></ref>
      <ref id="bib1.bibx39"><?xmltex \def\ref@label{{Donea and Huerta(2003)}}?><label>Donea and Huerta(2003)</label><?label Donea_2003?><mixed-citation>Donea, J. and Huerta, A.: Finite element methods for flow problems, John Wiley
&amp; Sons, Ltd, <ext-link xlink:href="https://doi.org/10.1002/0470013826" ext-link-type="DOI">10.1002/0470013826</ext-link>, 2003.</mixed-citation></ref>
      <ref id="bib1.bibx40"><?xmltex \def\ref@label{{Elman et~al.(2005)Elman, Silvester, and Wathen}}?><label>Elman et al.(2005)Elman, Silvester, and Wathen</label><?label Elman_2005?><mixed-citation>Elman, H. C., Silvester, D. J., and Wathen, A. J.: Finite elements and fast
iterative solvers: with applications in incompressible fluid dynamics, Oxford
University Press, <ext-link xlink:href="https://doi.org/10.1093/acprof:oso/9780199678792.001.0001" ext-link-type="DOI">10.1093/acprof:oso/9780199678792.001.0001</ext-link>, 2005.</mixed-citation></ref>
      <ref id="bib1.bibx41"><?xmltex \def\ref@label{{Farrell et~al.(2013)Farrell, Ham, Funke, and Rognes}}?><label>Farrell et al.(2013)Farrell, Ham, Funke, and Rognes</label><?label Farrell_2013?><mixed-citation>
Farrell, P. E., Ham, D. A., Funke, S. W., and Rognes, M. E.: Automated
derivation of the adjoint of high-level transient finite element programs,
SIAM J. Sci. Comput., 35, C369–C393, 2013.</mixed-citation></ref>
      <ref id="bib1.bibx42"><?xmltex \def\ref@label{firedrake-zenodo(2022)}?><label>firedrake-zenodo(2022)</label><?label zenodo1?><mixed-citation>firedrake-zenodo:  Software used in “Towards Automatic Finite Element Methods for Geodynamics via Firedrake” (Firedrake_20220506.0), Zenodo [code], <ext-link xlink:href="https://doi.org/10.5281/zenodo.6522930" ext-link-type="DOI">10.5281/zenodo.6522930</ext-link>, 2022.</mixed-citation></ref>
      <ref id="bib1.bibx43"><?xmltex \def\ref@label{{Flament et~al.(2022)Flament, Bodur, Williams, and
Merdith}}?><label>Flament et al.(2022)Flament, Bodur, Williams, and
Merdith</label><?label flament2022assembly?><mixed-citation>
Flament, N., Bodur, Ö. F., Williams, S. E., and Merdith, A. S.: Assembly
of the basal mantle structure beneath Africa, Nature, 603, 846–851, 2022.</mixed-citation></ref>
      <ref id="bib1.bibx44"><?xmltex \def\ref@label{{Fraters et~al.(2019)Fraters, Bangerth, Thieulot, Glerum, and
Spakman}}?><label>Fraters et al.(2019)Fraters, Bangerth, Thieulot, Glerum, and
Spakman</label><?label Fraters_2019?><mixed-citation>
Fraters, M. R., Bangerth, W., Thieulot, C., Glerum, A., and Spakman, W.:
Efficient and practical Newton solvers for non-linear Stokes systems in
geodynamic problems, Geophys. J. Int., 218, 873–894, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx45"><?xmltex \def\ref@label{{French and Romanowicz(2015)}}?><label>French and Romanowicz(2015)</label><?label French_2015?><mixed-citation>French, S. W. and Romanowicz, B.: Broad plumes rooted at the base of the
Earth's mantle beneath major hotspots, Nature, 525, 95–99,
<ext-link xlink:href="https://doi.org/10.1038/nature14876" ext-link-type="DOI">10.1038/nature14876</ext-link>, 2015.</mixed-citation></ref>
      <ref id="bib1.bibx46"><?xmltex \def\ref@label{{Garel et~al.(2014)Garel, Goes, Davies, Davies, Kramer, and
Wilson}}?><label>Garel et al.(2014)Garel, Goes, Davies, Davies, Kramer, and
Wilson</label><?label Garel_2014?><mixed-citation>Garel, F., Goes, S., Davies, D. R., Davies, J. H., Kramer, S. C., and Wilson,
C. R.: Interaction of subducted slabs with the mantle transition-zone: A
regime diagram from 2-D thermo-mechanical models with a mobile trench and
an overriding plate, Geochem. Geophy. Geosy., 15, 1739–1765,
<ext-link xlink:href="https://doi.org/10.1002/2014GC005257" ext-link-type="DOI">10.1002/2014GC005257</ext-link>, 2014.</mixed-citation></ref>
      <ref id="bib1.bibx47"><?xmltex \def\ref@label{{Gassmoller et~al.(2020)Gassmoller, Dannberg, Bangerth, Heister, and
Myhill}}?><label>Gassmoller et al.(2020)Gassmoller, Dannberg, Bangerth, Heister, and
Myhill</label><?label Gassmoller_2020?><mixed-citation>Gassmoller, R., Dannberg, J., Bangerth, W., Heister, T., and Myhill, R.: On
formulations of compressible mantle convection, Geophys. J. Int., 221,
1264–1280, <ext-link xlink:href="https://doi.org/10.1093/gji/ggaa078" ext-link-type="DOI">10.1093/gji/ggaa078</ext-link>, 2020.</mixed-citation></ref>
      <ref id="bib1.bibx48"><?xmltex \def\ref@label{{Ghelichkhan and Bunge(2018)}}?><label>Ghelichkhan and Bunge(2018)</label><?label Ghelichkhan_2018_twin?><mixed-citation>Ghelichkhan, S. and Bunge, H.: The adjoint equations for thermochemical
compressible mantle convection: derivation and verification by twin
experiments, Proc. Roy. Soc. A, 474, 20180329,
<ext-link xlink:href="https://doi.org/10.1098/rspa.2018.0329" ext-link-type="DOI">10.1098/rspa.2018.0329</ext-link>, 2018.</mixed-citation></ref>
      <ref id="bib1.bibx49"><?xmltex \def\ref@label{{Ghelichkhan et~al.(2018)Ghelichkhan, Murbock, Colli, Pail, and
Bunge}}?><label>Ghelichkhan et al.(2018)Ghelichkhan, Murbock, Colli, Pail, and
Bunge</label><?label Ghelichkhan_2018_grav?><mixed-citation>Ghelichkhan, S., Murbock, M., Colli, L., Pail, R., and Bunge, H.: On the
observability of epeirogenic movement in current and future gravity missions,
Gondwana Res., 53, 273–284, <ext-link xlink:href="https://doi.org/10.1016/j.gr.2017.04.016" ext-link-type="DOI">10.1016/j.gr.2017.04.016</ext-link>, 2018.</mixed-citation></ref>
      <ref id="bib1.bibx50"><?xmltex \def\ref@label{{Ghelichkhan et~al.(2020)Ghelichkhan, Bunge, and
Oeser}}?><label>Ghelichkhan et al.(2020)Ghelichkhan, Bunge, and
Oeser</label><?label Ghelichkhan_2020?><mixed-citation>Ghelichkhan, S., Bunge, H., and Oeser, J.: Global mantle flow retrodictions for
the early Cenozoic using an adjoint method: evolving dynamic topographies,
deep mantle structures, flow trajectories and sublithospheric stresses,
Geophys. J. Int., 226, 1432–1460, <ext-link xlink:href="https://doi.org/10.1093/gji/ggab108" ext-link-type="DOI">10.1093/gji/ggab108</ext-link>, 2020.</mixed-citation></ref>
      <ref id="bib1.bibx51"><?xmltex \def\ref@label{{Gibson et~al.(2019)Gibson, {McRae}, Cotter, Mitchell, and
Ham}}?><label>Gibson et al.(2019)Gibson, McRae, Cotter, Mitchell, and
Ham</label><?label Gibson_2019?><mixed-citation>Gibson, T. H., McRae, A. T. T., Cotter, C. J., Mitchell, L., and Ham, D. A.:
Compatible Finite Element Methods for Geophysical Flows: Automation and
Implementation using Firedrake, Springer International Publishing,
<ext-link xlink:href="https://doi.org/10.1007/978-3-030-23957-2" ext-link-type="DOI">10.1007/978-3-030-23957-2</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx52"><?xmltex \def\ref@label{{Glatzmaier(1988)}}?><label>Glatzmaier(1988)</label><?label Glatzmaier_1988?><mixed-citation>
Glatzmaier, G. A.: Numerical simulations of mantle convection-time dependent,
3-dimensional, compressible, spherical-shell, Geophys. Astro. Fluid,
43, 223–264, 1988.</mixed-citation></ref>
      <ref id="bib1.bibx53"><?xmltex \def\ref@label{{Gurnis et~al.(2012)Gurnis, Yang, Cannon, Turner, Williams, Flament,
and M{\"{u}}ller}}?><label>Gurnis et al.(2012)Gurnis, Yang, Cannon, Turner, Williams, Flament,
and Müller</label><?label Gurnis_2012?><mixed-citation>Gurnis, M., Yang, T., Cannon, J., Turner, M., Williams, S., Flament, N., and
Müller, R. D.: Global tectonic reconstructions with continuously
deforming and evolving rigid plates, Comput. Geosci., 116, 32–41,
<ext-link xlink:href="https://doi.org/10.1016/j.cageo.2018.04.007" ext-link-type="DOI">10.1016/j.cageo.2018.04.007</ext-link>, 2012.</mixed-citation></ref>
      <ref id="bib1.bibx54"><?xmltex \def\ref@label{{Ham et~al.(2009)Ham, Farrell, Gorman, Maddison, Wilson, Kramer,
Shipton, Collins, Cotter, and Piggott}}?><label>Ham et al.(2009)Ham, Farrell, Gorman, Maddison, Wilson, Kramer,
Shipton, Collins, Cotter, and Piggott</label><?label Ham_2009?><mixed-citation>Ham, D. A., Farrell, P. E., Gorman, G. J., Maddison, J. R., Wilson, C. R., Kramer, S. C., Shipton, J., Collins, G. S., Cotter, C. J., and Piggott, M. D.: Spud 1.0: generalising and automating the user interfaces of scientific computer models, Geosci. Model Dev., 2, 33–42, <ext-link xlink:href="https://doi.org/10.5194/gmd-2-33-2009" ext-link-type="DOI">10.5194/gmd-2-33-2009</ext-link>, 2009.</mixed-citation></ref>
      <ref id="bib1.bibx55"><?xmltex \def\ref@label{{Hassan et~al.(2015)Hassan, Flament, Gurnis, Bowe, and
M{\"{u}}ller}}?><label>Hassan et al.(2015)Hassan, Flament, Gurnis, Bowe, and
Müller</label><?label Hassan_2015?><mixed-citation>Hassan, R., Flament, N., Gurnis, M., Bowe, D. J., and Müller, R. D.:
Provenance of plumes in global convection models, Geochem. Geophy. Geosy.,
16, 1465–1489, <ext-link xlink:href="https://doi.org/10.1002/2015GC005751" ext-link-type="DOI">10.1002/2015GC005751</ext-link>, 2015.</mixed-citation></ref>
      <ref id="bib1.bibx56"><?xmltex \def\ref@label{{He et~al.(2017)He, Puckett, and Billen}}?><label>He et al.(2017)He, Puckett, and Billen</label><?label He_2017?><mixed-citation>
He, Y., Puckett, E. G., and Billen, M. I.: A Discontinuous Galerkin method
with a bound preserving limiter for the advection of non-diffusive fields in
solid Earth geodynamics, Phys. Earth Planet. In., 263, 23–37, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx57"><?xmltex \def\ref@label{{Heister et~al.(2017)Heister, Dannberg, Gassmoller, and
Bangerth}}?><label>Heister et al.(2017)Heister, Dannberg, Gassmoller, and
Bangerth</label><?label Heister_2017?><mixed-citation>Heister, T., Dannberg, J., Gassmoller, R., and Bangerth, W.: High accuracy
mantle convection simulation through modern numerical methods – II:
Realistic models and problems, Geophys. J. Int., 210, 833–851,
<ext-link xlink:href="https://doi.org/10.1093/gji/ggx195" ext-link-type="DOI">10.1093/gji/ggx195</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx58"><?xmltex \def\ref@label{{Heroux et~al.(2005)Heroux, Bartlett, Howle, Hoekstra, Hu, Kolda,
Lehoucq, Long, Pawlowski, Phipps, Salinger, Thornquist, Tuminaro,
Willenbring, Williams, and Stanlet}}?><label>Heroux et al.(2005)Heroux, Bartlett, Howle, Hoekstra, Hu, Kolda,
Lehoucq, Long, Pawlowski, Phipps, Salinger, Thornquist, Tuminaro,
Willenbring, Williams, and Stanlet</label><?label Heroux_2005?><mixed-citation>Heroux, M. A., Bartlett, R. A., Howle, V. E., Hoekstra, R. J., Hu, J. J.,
Kolda, T. G., Lehoucq, R. B., Long, K. R., Pawlowski, R. P., Phipps, E. T.,
Salinger, A. G., Thornquist, H. K., Tuminaro, R. S., Willenbring, J. M.,
Williams, A., and Stanlet, K. S.: An overview of the Trilinos project, ACM
T. Math. Software, 31, 397–423, <ext-link xlink:href="https://doi.org/10.1145/1089014.1089021" ext-link-type="DOI">10.1145/1089014.1089021</ext-link>, 2005.</mixed-citation></ref>
      <ref id="bib1.bibx59"><?xmltex \def\ref@label{{Hillebrand et~al.(2014)Hillebrand, Thieulot, Geenen, Van Den~Berg,
and Spakman}}?><label>Hillebrand et al.(2014)Hillebrand, Thieulot, Geenen, Van Den Berg,
and Spakman</label><?label hillebrand2014using?><mixed-citation>Hillebrand, B., Thieulot, C., Geenen, T., van den Berg, A. P., and Spakman, W.: Using the level set method in geodynamical modeling of multi-material flows and Earth's free surface, Solid Earth, 5, 1087–1098, <ext-link xlink:href="https://doi.org/10.5194/se-5-1087-2014" ext-link-type="DOI">10.5194/se-5-1087-2014</ext-link>, 2014.</mixed-citation></ref>
      <ref id="bib1.bibx60"><?xmltex \def\ref@label{{Hillewaert(2013)}}?><label>Hillewaert(2013)</label><?label hillewaert_2013?><mixed-citation>
Hillewaert, K.: Development of the discontinuous Galerkin method for
high-resolution, large scale CFD and acoustics in industrial geometries, PhD
Thesis, Université de Louvain, 2013.</mixed-citation></ref>
      <ref id="bib1.bibx61"><?xmltex \def\ref@label{{Homolya et~al.(2018)Homolya, Mitchell, Luporini, and
Ham.}}?><label>Homolya et al.(2018)Homolya, Mitchell, Luporini, and
Ham.</label><?label Homolya_2018?><mixed-citation>Homolya, M., Mitchell, L., Luporini, F., and Ham, D.: Tsfc: a
structure-preserving form compiler, SIAM J. Sci. Comput., 40, 401–428,
<ext-link xlink:href="https://doi.org/10.1137/17M1130642" ext-link-type="DOI">10.1137/17M1130642</ext-link>, 2018.</mixed-citation></ref>
      <ref id="bib1.bibx62"><?xmltex \def\ref@label{{Hunt et~al.(2012)Hunt, Davies, Walker, {McCormack}, Wills, Dobson,
and Li}}?><label>Hunt et al.(2012)Hunt, Davies, Walker, McCormack, Wills, Dobson,
and Li</label><?label Hunt_2012?><mixed-citation>Hunt, S. A., Davies, D. R., Walker, A. M., McCormack, R. J., Wills, A. S.,
Dobson, D. P., and Li, L.: On the increase in thermal diffusivity caused by
the perovskite to post-perovskite phase transition and its implications for
mantle dynamics, Earth Planet. Sc. Lett., 319, 96–103,
<ext-link xlink:href="https://doi.org/10.1016/j.epsl.2011.12.009" ext-link-type="DOI">10.1016/j.epsl.2011.12.009</ext-link>, 2012.</mixed-citation></ref>
      <ref id="bib1.bibx63"><?xmltex \def\ref@label{{Jadamec(2016)}}?><label>Jadamec(2016)</label><?label jadamec2016insights?><mixed-citation>
Jadamec, M. A.: Insights on slab-driven mantle flow from advances in
three-dimensional modelling, J. Geodynam., 100, 51–70, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx64"><?xmltex \def\ref@label{{Jadamec and Billen(2010)}}?><label>Jadamec and Billen(2010)</label><?label jadamec2010reconciling?><mixed-citation>
Jadamec, M. A. and Billen, M. I.: Reconciling surface plate motions with rapid
three-dimensional mantle flow around a slab edge, Nature, 465, 338–341,
2010.</mixed-citation></ref>
      <ref id="bib1.bibx65"><?xmltex \def\ref@label{{Jarvis(1993)}}?><label>Jarvis(1993)</label><?label Jarvis_1993?><mixed-citation>
Jarvis, G. T.: Effects of curvature on two–dimensional models of mantle
convection: cylindrical polar coordinates, J. Geophys. Res., 98, 4477–4485,
1993.</mixed-citation></ref>
      <ref id="bib1.bibx66"><?xmltex \def\ref@label{{Jarvis and {McKenzie}(1980)}}?><label>Jarvis and McKenzie(1980)</label><?label Jarvis_1980?><mixed-citation>Jarvis, G. T. and McKenzie, D. P.: Convection in a compressible fluid with
infinite Prandtl number, J. Fluid Mech., 96, 515–583,
<ext-link xlink:href="https://doi.org/10.1017/S002211208000225X" ext-link-type="DOI">10.1017/S002211208000225X</ext-link>, 1980.</mixed-citation></ref>
      <ref id="bib1.bibx67"><?xmltex \def\ref@label{{Katz and Weatherley(2012)}}?><label>Katz and Weatherley(2012)</label><?label Katz_2012?><mixed-citation>Katz, R. F. and Weatherley, S. M.: Consequences of mantle heterogeneity for
melt extraction at mid-ocean ridges, Earth Planet. Sc. Lett., 335, 226–237,
<ext-link xlink:href="https://doi.org/10.1016/j.epsl.2012.04.042" ext-link-type="DOI">10.1016/j.epsl.2012.04.042</ext-link>, 2012.</mixed-citation></ref>
      <ref id="bib1.bibx68"><?xmltex \def\ref@label{{King et~al.(2010)King, Lee, {van Keken}, Leng, Zhong, Tan, Tosi, and
Kameyama}}?><label>King et al.(2010)King, Lee, van Keken, Leng, Zhong, Tan, Tosi, and
Kameyama</label><?label king_2010?><mixed-citation>
King, S. D., Lee, C., van Keken, P. E., Leng, W., Zhong, S., Tan, E., Tosi,
N., and Kameyama, M. C.: A community benchmark for 2-D Cartesian
compressible convection in Earth's mantle, Geophys. J. Int., 179, 1–11,
2010.</mixed-citation></ref>
      <ref id="bib1.bibx69"><?xmltex \def\ref@label{{Kirby(2004)}}?><label>Kirby(2004)</label><?label Kirby_2004?><mixed-citation>
Kirby, R. C.: Algorithm 839: FIAT, a new paradigm for computing finite
element basis functions, ACM T. Math. Software, 30, 502–516, 2004.</mixed-citation></ref>
      <ref id="bib1.bibx70"><?xmltex \def\ref@label{{Kirby and Mitchell(2018)}}?><label>Kirby and Mitchell(2018)</label><?label Kirby_2018?><mixed-citation>Kirby, R. C. and Mitchell, L.: Solver Composition Across the PDE/Linear
Algebra Barrier, SIAM J. Sci. Comput., 40, 76–98, <ext-link xlink:href="https://doi.org/10.1137/17M1133208" ext-link-type="DOI">10.1137/17M1133208</ext-link>,
2018.</mixed-citation></ref>
      <ref id="bib1.bibx71"><?xmltex \def\ref@label{{Kirby and Mitchell(2019)}}?><label>Kirby and Mitchell(2019)</label><?label Kirby_2019?><mixed-citation>
Kirby, R. C. and Mitchell, L.: Code generation for generally mapped finite
elements, ACM T. Math. Software, 45, 1–23, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx72"><?xmltex \def\ref@label{{Knepley and Karpeev(2009)}}?><label>Knepley and Karpeev(2009)</label><?label Knepley_2009?><mixed-citation>
Knepley, M. G. and Karpeev, D. A.: Mesh Algorithms for PDE with Sieve I: Mesh
Distribution, Sci. Program., 17, 215–230, 2009.</mixed-citation></ref>
      <ref id="bib1.bibx73"><?xmltex \def\ref@label{{Koelemeijer et~al.(2018)Koelemeijer, Schuberth, Davies, Deuss, and
Ritsema}}?><label>Koelemeijer et al.(2018)Koelemeijer, Schuberth, Davies, Deuss, and
Ritsema</label><?label Koelemeijer_2018?><mixed-citation>
Koelemeijer, P. J., Schuberth, B. S. A., Davies, D. R., Deuss, A., and Ritsema,
J.: Constraints on the presence of post-perovskite in Earth's lowermost
mantle from tomographic-geodynamic model comparisons, Geophys. J. Int., 494,
226–238, 2018.</mixed-citation></ref>
      <ref id="bib1.bibx74"><?xmltex \def\ref@label{{Kramer et~al.(2010)Kramer, Cotter, and Pain}}?><label>Kramer et al.(2010)Kramer, Cotter, and Pain</label><?label Kramer_2010?><mixed-citation>
Kramer, S. C., Cotter, C. J., and Pain, C. C.: Solving the Poisson equation on
small aspect ratio domains using unstructured meshes, Ocean Model., 35,
253–263, 2010.</mixed-citation></ref>
      <ref id="bib1.bibx75"><?xmltex \def\ref@label{{Kramer et~al.(2012)Kramer, Wilson, and Davies}}?><label>Kramer et al.(2012)Kramer, Wilson, and Davies</label><?label Kramer_2012?><mixed-citation>Kramer, S. C., Wilson, C. R., and Davies, D. R.: An implicit free-surface
algorithm for geodynamical simulations, Phys. Earth Planet. In., 194,
25–37, <ext-link xlink:href="https://doi.org/10.1016/j.pepi.2012.01.001" ext-link-type="DOI">10.1016/j.pepi.2012.01.001</ext-link>, 2012.</mixed-citation></ref>
      <ref id="bib1.bibx76"><?xmltex \def\ref@label{{Kramer et~al.(2021{\natexlab{a}})Kramer, Davies, and
Wilson}}?><label>Kramer et al.(2021a)Kramer, Davies, and
Wilson</label><?label Kramer_2021?><mixed-citation>Kramer, S. C., Davies, D. R., and Wilson, C. R.: Analytical solutions for mantle flow in cylindrical and spherical shells, Geosci. Model Dev., 14, 1899–1919, <ext-link xlink:href="https://doi.org/10.5194/gmd-14-1899-2021" ext-link-type="DOI">10.5194/gmd-14-1899-2021</ext-link>, 2021a.</mixed-citation></ref>
      <ref id="bib1.bibx77"><?xmltex \def\ref@label{{Kramer et~al.(2021{\natexlab{b}})Kramer, Wilson, Davies, Mathews,
Gibson, Dubernay, Greaves, Candy, Cotter, Percival, Mouradian, Bhutani,
Avdis, Gorman, Piggott, and Ham}}?><label>Kramer et al.(2021b)Kramer, Wilson, Davies, Mathews,
Gibson, Dubernay, Greaves, Candy, Cotter, Percival, Mouradian, Bhutani,
Avdis, Gorman, Piggott, and Ham</label><?label fluidity-zenodo?><mixed-citation>Kramer, S. C., Wilson, C., Davies, D. R., Mathews, C., Gibson, A., Dubernay,
T., Greaves, T., Candy, A., Cotter, C. J., Percival, J., Mouradian, S.,
Bhutani, G., Avdis, A., Gorman, G., Piggott, M., and Ham, D.:
FluidityProject/fluidity: Zenodo release, Zenodo [code], <ext-link xlink:href="https://doi.org/10.5281/zenodo.3924604" ext-link-type="DOI">10.5281/zenodo.3924604</ext-link>,
2021b.</mixed-citation></ref>
      <ref id="bib1.bibx78"><?xmltex \def\ref@label{{Kronbichler et~al.(2012)Kronbichler, Heister, and
Bangerth}}?><label>Kronbichler et al.(2012)Kronbichler, Heister, and
Bangerth</label><?label Kronbichler_2012?><mixed-citation>Kronbichler, M., Heister, T., and Bangerth, W.: High accuracy mantle convection
simulation through modern numerical methods, Geophys. J. Int., 191, 12–29,
<ext-link xlink:href="https://doi.org/10.1111/j.1365-246X.2012.05609.x" ext-link-type="DOI">10.1111/j.1365-246X.2012.05609.x</ext-link>, 2012.</mixed-citation></ref>
      <ref id="bib1.bibx79"><?xmltex \def\ref@label{{Kärnä et~al.(2018)Kärnä, Kramer, Mitchell, Ham, Piggott, and
Baptista}}?><label>Kärnä et al.(2018)Kärnä, Kramer, Mitchell, Ham, Piggott, and
Baptista</label><?label Karna_2018?><mixed-citation>Kärnä, T., Kramer, S. C., Mitchell, L., Ham, D. A., Piggott, M. D., and Baptista, A. M.: Thetis coastal ocean model: discontinuous Galerkin discretization for the three-dimensional hydrostatic equations, Geosci. Model Dev., 11, 4359–4382, <ext-link xlink:href="https://doi.org/10.5194/gmd-11-4359-2018" ext-link-type="DOI">10.5194/gmd-11-4359-2018</ext-link>, 2018.</mixed-citation></ref>
      <ref id="bib1.bibx80"><?xmltex \def\ref@label{{Lange et~al.(2016)Lange, Mitchell, Knepley, and Gorman}}?><label>Lange et al.(2016)Lange, Mitchell, Knepley, and Gorman</label><?label Lange_2016?><mixed-citation>Lange, M., Mitchell, L., Knepley, M. G., and Gorman, G. J.: Efficient mesh
management in Firedrake using PETSc-DMPlex, SIAM J. Sci.
Comput., 38, S143–S155, <ext-link xlink:href="https://doi.org/10.1137/15M1026092" ext-link-type="DOI">10.1137/15M1026092</ext-link>, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx81"><?xmltex \def\ref@label{{Le~Voci et~al.(2014)Le~Voci, Davies, Goes, Kramer, and
Wilson}}?><label>Le Voci et al.(2014)Le Voci, Davies, Goes, Kramer, and
Wilson</label><?label Levoci_2014a?><mixed-citation>Le Voci, G., Davies, D. R., Goes, S., Kramer, S. C., and Wilson, C. R.: A
systematic 2-D investigation into the mantle wedge's transient flow regime
and thermal structure: complexities arising from a hydrated rheology and
thermal buoyancy, Geochem. Geophy. Geosy., 15, 28–51,
<ext-link xlink:href="https://doi.org/10.1002/2013GC005022" ext-link-type="DOI">10.1002/2013GC005022</ext-link>, 2014.</mixed-citation></ref>
      <ref id="bib1.bibx82"><?xmltex \def\ref@label{{Leng and Zhong(2008)}}?><label>Leng and Zhong(2008)</label><?label Leng_Comp_2008?><mixed-citation>
Leng, W. and Zhong, S.: Viscous heating, adiabatic heating and energetic
consistency in compressible mantle convection, Geophys. J. Int., 173,
693–702, 2008.</mixed-citation></ref>
      <ref id="bib1.bibx83"><?xmltex \def\ref@label{{Li et~al.(2017)Li, Gurnis, and Stadler}}?><label>Li et al.(2017)Li, Gurnis, and Stadler</label><?label Li_2017?><mixed-citation>Li, D., Gurnis, M., and Stadler, G.: Towards adjoint-based inversion of
time-dependent mantle convection with nonlinear viscosity, Geophys. J. Int.,
209, 86–105, <ext-link xlink:href="https://doi.org/10.1093/gji/ggw493" ext-link-type="DOI">10.1093/gji/ggw493</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx84"><?xmltex \def\ref@label{{Liu et~al.(2008)Liu, Spasojevic, and Gurnis}}?><label>Liu et al.(2008)Liu, Spasojevic, and Gurnis</label><?label Liu_2008?><mixed-citation>Liu, L., Spasojevic, S., and Gurnis, M.: Reconstructing Farallon Plate
Subduction Beneath North America Back to the Late Cretaceous, Science,
322, 934–938, <ext-link xlink:href="https://doi.org/10.1126/science.1162921" ext-link-type="DOI">10.1126/science.1162921</ext-link>, 2008.</mixed-citation></ref>
      <ref id="bib1.bibx85"><?xmltex \def\ref@label{{Liu and King(2019)}}?><label>Liu and King(2019)</label><?label Liu_2019?><mixed-citation>
Liu, S. and King, S. D.: A benchmark study of incompressible Stokes flow in a
3-D spherical shell using ASPECT, Geophys. J. Int., 217, 650–667, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx86"><?xmltex \def\ref@label{{Logg et~al.(2012)Logg, Mardal, and Wells}}?><label>Logg et al.(2012)Logg, Mardal, and Wells</label><?label Logg_2012?><mixed-citation>Logg, A., Mardal, K.-A., and Wells, G.: Automated Solution of Differential
Equations by the Finite Element Method: The FEniCS Book, Lecture Notes in
Computational Science and Engineering vol. 84, Springer, Berlin,
<ext-link xlink:href="https://doi.org/10.1007/978-3-642-23099-8" ext-link-type="DOI">10.1007/978-3-642-23099-8</ext-link>, 2012.</mixed-citation></ref>
      <ref id="bib1.bibx87"><?xmltex \def\ref@label{{Maljaars et~al.(2021)Maljaars, Richardson, and
Sime}}?><label>Maljaars et al.(2021)Maljaars, Richardson, and
Sime</label><?label maljaars2021leopart?><mixed-citation>
Maljaars, J. M., Richardson, C. N., and Sime, N.: LEoPart: A particle library
for FEniCS, Comp. Math. Appl., 81, 289–315, 2021.</mixed-citation></ref>
      <ref id="bib1.bibx88"><?xmltex \def\ref@label{{Markall et~al.(2013)Markall, Rathgeber, Mitchell, Loriant, Bertolli,
Ham, and Kelly}}?><label>Markall et al.(2013)Markall, Rathgeber, Mitchell, Loriant, Bertolli,
Ham, and Kelly</label><?label Markall_2013?><mixed-citation>Markall, G. R., Rathgeber, F., Mitchell, L., Loriant, N., Bertolli, C., Ham,
D. A., and Kelly, P. H. J.: Performance-Portable Finite Element Assembly
Using PyOP2 and FEniCS, in: 28th International Supercomputing Conference,
ISC, Proceedings, edited by: Kunkel, J. M., Ludwig, T., and Meuer, H. W., vol.
7905 of  Lecture Notes in Computer Science,  Springer, 279–289,
<ext-link xlink:href="https://doi.org/10.1007/978-3-642-38750-0_21" ext-link-type="DOI">10.1007/978-3-642-38750-0_21</ext-link>, 2013.</mixed-citation></ref>
      <ref id="bib1.bibx89"><?xmltex \def\ref@label{{May and Moresi(2008)}}?><label>May and Moresi(2008)</label><?label May_2008?><mixed-citation>May, D. and Moresi, L.: Preconditioned iterative methods for Stokes flow
problems arising in computational geodynamics, Phys. Earth Planet. In., 171,
33–47, <ext-link xlink:href="https://doi.org/10.1016/j.pepi.2008.07.036" ext-link-type="DOI">10.1016/j.pepi.2008.07.036</ext-link>, 2008.</mixed-citation></ref>
      <ref id="bib1.bibx90"><?xmltex \def\ref@label{{{McKenzie}(1969)}}?><label>McKenzie(1969)</label><?label Mckenzie_1969?><mixed-citation>
McKenzie, D.: Speculations on consequences and causes of plate motions,
Geophys. J. Roy. Astr. S., 18, 1–18, 1969.</mixed-citation></ref>
      <ref id="bib1.bibx91"><?xmltex \def\ref@label{{{McKenzie} et~al.(1973){McKenzie}, Roberts, and
Weiss}}?><label>McKenzie et al.(1973)McKenzie, Roberts, and
Weiss</label><?label Mckenzie_1973?><mixed-citation>McKenzie, D. P., Roberts, J. M., and Weiss, N. O.: Numerical models of
convection in the Earth's mantle, Tectonophys., 19, 89–103,
<ext-link xlink:href="https://doi.org/10.1016/0040-1951(73)90034-6" ext-link-type="DOI">10.1016/0040-1951(73)90034-6</ext-link>, 1973.</mixed-citation></ref>
      <ref id="bib1.bibx92"><?xmltex \def\ref@label{{Minear and Toksoz(1970)}}?><label>Minear and Toksoz(1970)</label><?label Minear_1970?><mixed-citation>
Minear, J. and Toksoz, M.: Thermal regime of a downgoing slab and new global
tectonics, J. Geophys. Res., 75, 1397–1419, 1970.</mixed-citation></ref>
      <ref id="bib1.bibx93"><?xmltex \def\ref@label{{Mitush et~al.(2019)Mitush, Funke, and Dokken}}?><label>Mitush et al.(2019)Mitush, Funke, and Dokken</label><?label Mitusch_2019?><mixed-citation>Mitush, S. K., Funke, S. W., and Dokken, J. S.: dolfin-adjoint 2018.1:
automated adjoints for FEniCS and Firedrake, J. Open Source Softw., 4, 1292, <ext-link xlink:href="https://doi.org/10.21105/joss.01292" ext-link-type="DOI">10.21105/joss.01292</ext-link>,
2019.</mixed-citation></ref>
      <ref id="bib1.bibx94"><?xmltex \def\ref@label{{Moresi et~al.(2002)Moresi, Dufour, and Muhlhaus}}?><label>Moresi et al.(2002)Moresi, Dufour, and Muhlhaus</label><?label Moresi_2002?><mixed-citation>
Moresi, L., Dufour, F., and Muhlhaus, H.: Mantle convection modeling with
viscoelastic/brittle lithosphere: Numerical methodology and plate tectonic
modeling, Pure Appl. Geophys., 159, 2335–2356, 2002.</mixed-citation></ref>
      <ref id="bib1.bibx95"><?xmltex \def\ref@label{{Moresi et~al.(2007)Moresi, Quenette, Lemiale, Meriaux, Appelbe, and
Muhlhaus}}?><label>Moresi et al.(2007)Moresi, Quenette, Lemiale, Meriaux, Appelbe, and
Muhlhaus</label><?label Moresi_2007?><mixed-citation>Moresi, L., Quenette, S., Lemiale, V., Meriaux, C., Appelbe, B., and Muhlhaus,
H.-B.: Computational approaches to studying non-linear dynamics of the crust
and mantle, Phys. Earth Planet. In., 163, 69–82,
<ext-link xlink:href="https://doi.org/10.1016/j.pepi.2007.06.009" ext-link-type="DOI">10.1016/j.pepi.2007.06.009</ext-link>, 2007.</mixed-citation></ref>
      <ref id="bib1.bibx96"><?xmltex \def\ref@label{{Moresi and Solomatov(1995)}}?><label>Moresi and Solomatov(1995)</label><?label Moresi_1995?><mixed-citation>Moresi, L. N. and Solomatov, V. S.: Numerical investigations of 2D convection
with extremely large viscosity variations, Phys. Fluid, 7, 2154–2162,
<ext-link xlink:href="https://doi.org/10.1063/1.868465" ext-link-type="DOI">10.1063/1.868465</ext-link>, 1995.</mixed-citation></ref>
      <ref id="bib1.bibx97"><?xmltex \def\ref@label{{M{\"{u}}ller et~al.(2016)M{\"{u}}ller, Seton, Zahirovic, Williams,
Matthews, Wright, Shephard, Maloney, {Barnett-Moore}, Hosseinpour, Bower, and
Cannon}}?><label>Müller et al.(2016)Müller, Seton, Zahirovic, Williams,
Matthews, Wright, Shephard, Maloney, Barnett-Moore, Hosseinpour, Bower, and
Cannon</label><?label Muller_2016_Review?><mixed-citation>Müller, R. D., Seton, M., Zahirovic, S., Williams, S. E., Matthews, K. J.,
Wright, N. M., Shephard, G. E., Maloney, K. T., Barnett-Moore, N.,
Hosseinpour, M., Bower, D. J., and Cannon, J.: Ocean Basin Evolution and
Global-Scale Plate Reorganization Events Since Pangea Breakup, Annu. Rev.
Earth Pl. Sc., 44, 107–138, <ext-link xlink:href="https://doi.org/10.1146/annurev-earth-060115-012211" ext-link-type="DOI">10.1146/annurev-earth-060115-012211</ext-link>,
2016.</mixed-citation></ref>
      <ref id="bib1.bibx98"><?xmltex \def\ref@label{{M{\"{u}}ller et~al.(2018)M{\"{u}}ller, Cannon, Qin, Watson, Gurnis,
Williams, Pfaffelmoser, Seton, Russell, and Zahirovic}}?><label>Müller et al.(2018)Müller, Cannon, Qin, Watson, Gurnis,
Williams, Pfaffelmoser, Seton, Russell, and Zahirovic</label><?label Muller_2018?><mixed-citation>Müller, R. D., Cannon, J., Qin, X., Watson, R. J., Gurnis, M., Williams,
S., Pfaffelmoser, T., Seton, M., Russell, S. H. J., and Zahirovic, S.:
GPlates: Building a Virtual Earth Through Deep Time, Geochem. Geophy.
Geosy., 19, 2243–2261, <ext-link xlink:href="https://doi.org/10.1029/2018GC007584" ext-link-type="DOI">10.1029/2018GC007584</ext-link>, 2018.</mixed-citation></ref>
      <ref id="bib1.bibx99"><?xmltex \def\ref@label{{Nakagawa et~al.(2009)Nakagawa, Tackley, Deschamps, and
Connolly}}?><label>Nakagawa et al.(2009)Nakagawa, Tackley, Deschamps, and
Connolly</label><?label Nakagawa_2009?><mixed-citation>Nakagawa, T., Tackley, P. J., Deschamps, F., and Connolly, J. A. D.:
Incorporating self–consistently calculated mineral physics into
thermo–chemical mantle convection simulations in a 3-D spherical shell and
its influence on seismic anomalies in Earth's mantle, Geochem. Geophy.
Geosy., 10, Q3304, <ext-link xlink:href="https://doi.org/10.1029/2008GC002280" ext-link-type="DOI">10.1029/2008GC002280</ext-link>, 2009.</mixed-citation></ref>
      <ref id="bib1.bibx100"><?xmltex \def\ref@label{{Nerlich et~al.(2016)Nerlich, Colli, Ghelichkhan, B.Schuberth, and
Bunge}}?><label>Nerlich et al.(2016)Nerlich, Colli, Ghelichkhan, B.Schuberth, and
Bunge</label><?label Nerlich_2016?><mixed-citation>Nerlich, R., Colli, L., Ghelichkhan, S., Schuberth, B., and Bunge, H.-P.:
Constraining entral Neo-Tethys Ocean reconstructions with mantle convection
models, Geophys. Res. Lett., 43, 9595–9603, <ext-link xlink:href="https://doi.org/10.1002/2016GL070524" ext-link-type="DOI">10.1002/2016GL070524</ext-link>,
2016.</mixed-citation></ref>
      <ref id="bib1.bibx101"><?xmltex \def\ref@label{{Nitsche(1971)}}?><label>Nitsche(1971)</label><?label Nitsche_1971?><mixed-citation>Nitsche, J.: Über ein Variationsprinzip zur Lösung von
Dirichlet-Problemen bei Verwendung von Teilräumen, die keinen
Randbedingungen unterworfen sind, in: Abhandlungen aus dem mathematischen
Seminar der Universität Hamburg,    Springer, vol. 36, 9–15,
<ext-link xlink:href="https://doi.org/10.1007/BF02995904" ext-link-type="DOI">10.1007/BF02995904</ext-link>, 1971.</mixed-citation></ref>
      <ref id="bib1.bibx102"><?xmltex \def\ref@label{{Quenette et~al.(2007)Quenette, Moresi, Appelbe, and
Sunter}}?><label>Quenette et al.(2007)Quenette, Moresi, Appelbe, and
Sunter</label><?label Quenette_2007?><mixed-citation>Quenette, S., Moresi, L., Appelbe, B. F., and Sunter, P. D.: Explaining
StGermain: an aspect oriented environment for building extensible
computational mechanics modeling software, IEEE International Parallel and
Distributed Processing Symposium, IEEE New York,  210 pp.,
<ext-link xlink:href="https://doi.org/10.1109/IPDPS.2007.370400" ext-link-type="DOI">10.1109/IPDPS.2007.370400</ext-link>, 2007.</mixed-citation></ref>
      <ref id="bib1.bibx103"><?xmltex \def\ref@label{{Ratcliff et~al.(1996)Ratcliff, Schubert, and Zebib}}?><label>Ratcliff et al.(1996)Ratcliff, Schubert, and Zebib</label><?label Ratcliff_1996?><mixed-citation>Ratcliff, J. T., Schubert, G., and Zebib, A.: Steady tetrahedral and cubic
patterns of spherical shell convection with temperature-dependent viscosity,
J. Geophys. Res., 101, 25473–25484, <ext-link xlink:href="https://doi.org/10.1029/96JB02097" ext-link-type="DOI">10.1029/96JB02097</ext-link>, 1996.</mixed-citation></ref>
      <ref id="bib1.bibx104"><?xmltex \def\ref@label{{Rathgeber et~al.(2012)Rathgeber, Markall, Mitchell, Loriant, Ham,
Bertolli, and Kelly}}?><label>Rathgeber et al.(2012)Rathgeber, Markall, Mitchell, Loriant, Ham,
Bertolli, and Kelly</label><?label Rathgeber_2012?><mixed-citation>Rathgeber, F., Markall, G. R., Mitchell, L., Loriant, N., Ham, D. A., Bertolli,
C., and Kelly, P. H. J.: PyOP2: A High-Level Framework for
Performance-Portable Simulations on Unstructured Meshes, in: High Performance
Computing, Networking Storage and Analysis, SC Companion,
IEEE Computer Society, Los Alamitos, CA, USA, 1116–1123,
<ext-link xlink:href="https://doi.org/10.1109/SC.Companion.2012.134" ext-link-type="DOI">10.1109/SC.Companion.2012.134</ext-link>, 2012.</mixed-citation></ref>
      <ref id="bib1.bibx105"><?xmltex \def\ref@label{{Rathgeber et~al.(2016)Rathgeber, Ham, Mitchell, Lange, Luporini,
Mcrae, Bercea, Markall, and Kelly}}?><label>Rathgeber et al.(2016)Rathgeber, Ham, Mitchell, Lange, Luporini,
Mcrae, Bercea, Markall, and Kelly</label><?label Rathgeber_2016?><mixed-citation>Rathgeber, F., Ham, D. A., Mitchell, L., Lange, M., Luporini, F., Mcrae, A.
T. T., Bercea, G.-T., Markall, G. R., and Kelly, P. H. J.: Firedrake:
Automating the Finite Element Method by Composing Abstractions, ACM T.
Math. Softw., 43, 1–27, <ext-link xlink:href="https://doi.org/10.1145/2998441" ext-link-type="DOI">10.1145/2998441</ext-link>, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx106"><?xmltex \def\ref@label{{Ritsema et~al.(2011)Ritsema, Deuss, van Heijst, and
Woodhouse}}?><label>Ritsema et al.(2011)Ritsema, Deuss, van Heijst, and
Woodhouse</label><?label Ritsema_2011?><mixed-citation>Ritsema, J., Deuss, A., van Heijst, H. J., and Woodhouse, J. H.: S40RTS: a
degree-40 shear-velocity model for the mantle from new Rayleigh wave
dispersion, teleseismic traveltime and normal-mode splitting function
measurements, Geophys. J. Int., 184, 1223–1236,
<ext-link xlink:href="https://doi.org/10.1111/j.1365-246X.2010.04884.x" ext-link-type="DOI">10.1111/j.1365-246X.2010.04884.x</ext-link>, 2011.</mixed-citation></ref>
      <ref id="bib1.bibx107"><?xmltex \def\ref@label{{Rubey et~al.(2017)Rubey, Brune, Heine, Davies, Williams, and
M{\"{u}}ller}}?><label>Rubey et al.(2017)Rubey, Brune, Heine, Davies, Williams, and
Müller</label><?label Rubey_2017?><mixed-citation>Rubey, M., Brune, S., Heine, C., Davies, D. R., Williams, S. E., and Müller, R. D.: Global patterns in Earth's dynamic topography since the Jurassic: the role of subducted slabs, Solid Earth, 8, 899–919, <ext-link xlink:href="https://doi.org/10.5194/se-8-899-2017" ext-link-type="DOI">10.5194/se-8-899-2017</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx108"><?xmltex \def\ref@label{{Saad(1993)}}?><label>Saad(1993)</label><?label Saad_1993?><mixed-citation>
Saad, Y.: A flexible inner-outer preconditioned GMRES algorithm, SIAM J.
Sci. Comput., 14, 461–469, 1993.</mixed-citation></ref>
      <ref id="bib1.bibx109"><?xmltex \def\ref@label{{Schubert et~al.(2001)Schubert, Turcotte, and Olson}}?><label>Schubert et al.(2001)Schubert, Turcotte, and Olson</label><?label Schubert_2001?><mixed-citation>Schubert, G., Turcotte, D. L., and Olson, P.: Mantle convection in the Earth
and planets, Cambridge University Press, <ext-link xlink:href="https://doi.org/10.1017/CBO9780511612879" ext-link-type="DOI">10.1017/CBO9780511612879</ext-link>, 2001.</mixed-citation></ref>
      <ref id="bib1.bibx110"><?xmltex \def\ref@label{{Schuberth et~al.(2009)Schuberth, {H.-P. Bunge}, {Steinle-Neumann},
Moder, and Oeser}}?><label>Schuberth et al.(2009)Schuberth, H.-P. Bunge, Steinle-Neumann,
Moder, and Oeser</label><?label Schuberth_2009a?><mixed-citation>Schuberth, B. S. A., H.-P. Bunge, Steinle-Neumann, G., Moder, C., and
Oeser, J.: Thermal versus elastic heterogeneity in high-resolution mantle
circulation models with pyrolite composition: high plume excess temperatures
in the lowermost mantle, Geochem. Geophy. Geosy., 10, Q01W01,
<ext-link xlink:href="https://doi.org/10.1029/2008GC002235" ext-link-type="DOI">10.1029/2008GC002235</ext-link>, 2009.</mixed-citation></ref>
      <ref id="bib1.bibx111"><?xmltex \def\ref@label{{Shahbazi(2005)}}?><label>Shahbazi(2005)</label><?label shahbazi_2005?><mixed-citation>
Shahbazi, K.: An explicit expression for the penalty parameter of the interior
penalty method, J. Comput. Phys., 205, 401–407, 2005.</mixed-citation></ref>
      <ref id="bib1.bibx112"><?xmltex \def\ref@label{{Shapero et~al.(2021)Shapero, Badgeley, Hoffmann, and
Joughin}}?><label>Shapero et al.(2021)Shapero, Badgeley, Hoffmann, and
Joughin</label><?label Shapero_2021?><mixed-citation>Shapero, D. R., Badgeley, J. A., Hoffman, A. O., and Joughin, I. R.: icepack: a new glacier flow modeling package in Python, version 1.0, Geosci. Model Dev., 14, 4593–4616, <ext-link xlink:href="https://doi.org/10.5194/gmd-14-4593-2021" ext-link-type="DOI">10.5194/gmd-14-4593-2021</ext-link>, 2021.</mixed-citation></ref>
      <ref id="bib1.bibx113"><?xmltex \def\ref@label{{Shih et~al.(2021)Shih, Stadler, and Wechsung}}?><label>Shih et al.(2021)Shih, Stadler, and Wechsung</label><?label Shih_2021?><mixed-citation>Shih, Y., Stadler, G., and Wechsung, F.: Robust multigrid techniques for
augmented Lagrangian preconditioning of incompressible Stokes equations with
extreme viscosity variations, arXiv [preprint], <ext-link xlink:href="https://arxiv.org/abs/2107.00820">arXiv:2107.00820</ext-link>, 2021.</mixed-citation></ref>
      <ref id="bib1.bibx114"><?xmltex \def\ref@label{{Shipton et~al.(2018)Shipton, Gibson, and Cotter}}?><label>Shipton et al.(2018)Shipton, Gibson, and Cotter</label><?label Shipton_2018?><mixed-citation>Shipton, J., Gibson, T., and Cotter, C.: Higher-order compatible finite element
schemes for the nonlinear rotating shallow water equations on the sphere, J. Comput. Phys.,
375, 1121–1137, <ext-link xlink:href="https://doi.org/10.1016/j.jcp.2018.08.027" ext-link-type="DOI">10.1016/j.jcp.2018.08.027</ext-link>, 2018.</mixed-citation></ref>
      <ref id="bib1.bibx115"><?xmltex \def\ref@label{{Spiegelman et~al.(2016)Spiegelman, May, and Wilson}}?><label>Spiegelman et al.(2016)Spiegelman, May, and Wilson</label><?label Spiegelman_2016?><mixed-citation>Spiegelman, M., May, D. A., and Wilson, C. R.: On the solvability of
incompressible Stokes with viscoplastic rheologies in geodynamics,
Geochem.  Geophy. Geosy., 17, 2213–2238,
<ext-link xlink:href="https://doi.org/10.1002/2015GC006228" ext-link-type="DOI">10.1002/2015GC006228</ext-link>, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx116"><?xmltex \def\ref@label{{Stadler et~al.(2010)Stadler, Gurnis, Burstedde, Wilcox, Alisic, and
Ghattas}}?><label>Stadler et al.(2010)Stadler, Gurnis, Burstedde, Wilcox, Alisic, and
Ghattas</label><?label Stadler_2010?><mixed-citation>Stadler, G., Gurnis, M., Burstedde, C., Wilcox, L. C., Alisic, L., and Ghattas,
O.: The dynamics of plate tectonics and mantle flow: from local to global
scales, Science, 329, 1033–1038, <ext-link xlink:href="https://doi.org/10.1126/science.1191223" ext-link-type="DOI">10.1126/science.1191223</ext-link>, 2010.</mixed-citation></ref>
      <ref id="bib1.bibx117"><?xmltex \def\ref@label{{Stemmer et~al.(2006)Stemmer, Harder, and Hansen}}?><label>Stemmer et al.(2006)Stemmer, Harder, and Hansen</label><?label Stemmer_2006?><mixed-citation>Stemmer, K., Harder, H., and Hansen, U.: A new method to simulate convection
with strongly temperature- and pressure-dependent viscosity in a spherical
shell: Applications to the Earth's mantle, Phys. Earth Planet. In., 157,
223–249, <ext-link xlink:href="https://doi.org/10.1016/j.pepi.2006.04.007" ext-link-type="DOI">10.1016/j.pepi.2006.04.007</ext-link>, 2006.</mixed-citation></ref>
      <ref id="bib1.bibx118"><?xmltex \def\ref@label{{Styles et~al.(2011)Styles, Davies, and Goes}}?><label>Styles et al.(2011)Styles, Davies, and Goes</label><?label Styles_2011?><mixed-citation>Styles, E., Davies, D. R., and Goes, S.: Mapping spherical seismic into
physical structure: biases from 3-D phase-transition and thermal
boundary-layer heterogeneity, Geophys. J. Int., 184, 1371–1378,
<ext-link xlink:href="https://doi.org/10.1111/j.1365-246X.2010.04914.x" ext-link-type="DOI">10.1111/j.1365-246X.2010.04914.x</ext-link>, 2011.</mixed-citation></ref>
      <ref id="bib1.bibx119"><?xmltex \def\ref@label{{Tackley(1996)}}?><label>Tackley(1996)</label><?label Tackley_1996?><mixed-citation>Tackley, P. J.: Effects of strongly variable viscosity on three–dimensional
compressible convection in planetary mantles, J. Geophys. Res., 101,
3311–3332, <ext-link xlink:href="https://doi.org/10.1029/95JB03211" ext-link-type="DOI">10.1029/95JB03211</ext-link>, 1996.</mixed-citation></ref>
      <ref id="bib1.bibx120"><?xmltex \def\ref@label{{Tackley(2000)}}?><label>Tackley(2000)</label><?label Tackley_2000?><mixed-citation>
Tackley, P. J.: Mantle convection and plate tectonics: towards and integrated
physical and chemical theory, Science, 288, 2002–2007, 2000.</mixed-citation></ref>
      <ref id="bib1.bibx121"><?xmltex \def\ref@label{{Tackley(2008)}}?><label>Tackley(2008)</label><?label Tackley_2008?><mixed-citation>Tackley, P. J.: Modelling compressible mantle convection with large viscosity
contrasts in a three-dimensional spherical shell using the Yin-Yang grid,
Phys. Earth Planet. In., 171, 7–18, <ext-link xlink:href="https://doi.org/10.1016/j.pepi.2008.08.005" ext-link-type="DOI">10.1016/j.pepi.2008.08.005</ext-link>, 2008.</mixed-citation></ref>
      <ref id="bib1.bibx122"><?xmltex \def\ref@label{{Tackley and Xie(2002)}}?><label>Tackley and Xie(2002)</label><?label Tackley_Xie_2002?><mixed-citation>
Tackley, P. J. and Xie, S.: The thermo-chemical structure and evolution of
Earth's mantle: constraints and numerical models, Philos. T. R. Soc.
Lond. A., 360, 2593–2609, 2002.</mixed-citation></ref>
      <ref id="bib1.bibx123"><?xmltex \def\ref@label{{Tackley et~al.(1993)Tackley, Stevenson, Glatzmaier, and
Schubert}}?><label>Tackley et al.(1993)Tackley, Stevenson, Glatzmaier, and
Schubert</label><?label Tackley_1993?><mixed-citation>Tackley, P. J., Stevenson, D. J., Glatzmaier, G. A., and Schubert, G.: Effects
of an endothermic phase transition at 670 km depth in a spherical model of
convection in the Earth's mantle, Nature, 361, 699–704,
<ext-link xlink:href="https://doi.org/10.1038/361699a0" ext-link-type="DOI">10.1038/361699a0</ext-link>, 1993.</mixed-citation></ref>
      <ref id="bib1.bibx124"><?xmltex \def\ref@label{{Thieulot and Bangerth(2022)}}?><label>Thieulot and Bangerth(2022)</label><?label thieulot2022choice?><mixed-citation>Thieulot, C. and Bangerth, W.: On the choice of finite element for applications in geodynamics, Solid Earth, 13, 229–249, <ext-link xlink:href="https://doi.org/10.5194/se-13-229-2022" ext-link-type="DOI">10.5194/se-13-229-2022</ext-link>, 2022.</mixed-citation></ref>
      <ref id="bib1.bibx125"><?xmltex \def\ref@label{{Torrance and Turcotte(1971)}}?><label>Torrance and Turcotte(1971)</label><?label Torrance_1971?><mixed-citation>
Torrance, K. E. and Turcotte, D. L.: Thermal convection with large viscosity
variations, J. Fluid Mech., 47, 113–125, 1971.</mixed-citation></ref>
      <ref id="bib1.bibx126"><?xmltex \def\ref@label{{Tosi et~al.(2015)Tosi, Stein, Noack, H{\"{u}}ttig, Maierov{\'{a}},
Samuel, Davies, Wilson, Kramer, Thieulot, Glerum, Fraters, Spakman, Rozel,
and Tackley}}?><label>Tosi et al.(2015)Tosi, Stein, Noack, Hüttig, Maierová,
Samuel, Davies, Wilson, Kramer, Thieulot, Glerum, Fraters, Spakman, Rozel,
and Tackley</label><?label Tosi_2015?><mixed-citation>Tosi, N., Stein, C., Noack, L., Hüttig, C., Maierová, P., Samuel, H.,
Davies, D. R., Wilson, C. R., Kramer, S. C., Thieulot, C., Glerum, A.,
Fraters, M., Spakman, W., Rozel, A., and Tackley, P. J.: A community
benchmark for viscoplastic thermal convection in a 2-D square box,
Geochem. Geophy. Geosy., 16, 2175–2196,
<ext-link xlink:href="https://doi.org/10.1002/2015GC005807" ext-link-type="DOI">10.1002/2015GC005807</ext-link>, 2015.</mixed-citation></ref>
      <ref id="bib1.bibx127"><?xmltex \def\ref@label{{{T}rilinos~{P}roject {T}eam()}}?><label>Trilinos Project Team()</label><?label trilinos-website?><mixed-citation>Trilinos Project Team, T.: The Trilinos Project Website, <uri>https://trilinos.github.io</uri>, last access: 22 May 2020.</mixed-citation></ref>
      <ref id="bib1.bibx128"><?xmltex \def\ref@label{{Trompert and Hansen(1998)}}?><label>Trompert and Hansen(1998)</label><?label Trompert_1998?><mixed-citation>
Trompert, R. and Hansen, U.: Mantle convection simulations with rheologies that
generate plate-like behaviour, Nature, 395, 686–689, 1998.</mixed-citation></ref>
      <ref id="bib1.bibx129"><?xmltex \def\ref@label{{van Keken(1997)}}?><label>van Keken(1997)</label><?label van_keken_evolution_1997?><mixed-citation>van Keken, P.: Evolution of starting mantle plumes: a comparison between
numerical and laboratory models, Earth Planet. Sc. Lett., 148, 1–11,
<ext-link xlink:href="https://doi.org/10.1016/S0012-821X(97)00042-3" ext-link-type="DOI">10.1016/S0012-821X(97)00042-3</ext-link>, 1997.</mixed-citation></ref>
      <ref id="bib1.bibx130"><?xmltex \def\ref@label{{{van Keken} and Ballentine(1998)}}?><label>van Keken and Ballentine(1998)</label><?label VanKeken_1998?><mixed-citation>
van Keken, P. E. and Ballentine, C. J.: Whole–mantle versus layered mantle
convection and the role of a high–viscosity lower mantle in terrestrial
volatile evolution, Earth Planet. Sc. Lett., 156, 19–32, 1998.</mixed-citation></ref>
      <ref id="bib1.bibx131"><?xmltex \def\ref@label{{Vanek et~al.(1996)Vanek, Mandel, and Brezina}}?><label>Vanek et al.(1996)Vanek, Mandel, and Brezina</label><?label Vanek_1996?><mixed-citation>Vanek, P., Mandel, J., and Brezina, M.: Algebraic multigrid by smoothed
aggregation for second and fourth order elliptic problems, Computing, 56,
179–196, <ext-link xlink:href="https://doi.org/10.1007/BF02238511" ext-link-type="DOI">10.1007/BF02238511</ext-link>, 1996.</mixed-citation></ref>
      <ref id="bib1.bibx132"><?xmltex \def\ref@label{{Vynnytska et~al.(2013)Vynnytska, Rognes, and Clark}}?><label>Vynnytska et al.(2013)Vynnytska, Rognes, and Clark</label><?label Vynnystka_2012?><mixed-citation>Vynnytska, L., Rognes, M. E., and Clark, S. R.: Benchmarking FEniCS for
mantle convection simulations, Compu. Geosci., 50, 95–105,
<ext-link xlink:href="https://doi.org/10.1016/j.cageo.2012.05.012" ext-link-type="DOI">10.1016/j.cageo.2012.05.012</ext-link>, 2013.</mixed-citation></ref>
      <ref id="bib1.bibx133"><?xmltex \def\ref@label{{Wilson et~al.(2014)Wilson, Spiegelman, van Keken, and
R.}}?><label>Wilson et al.(2014)Wilson, Spiegelman, van Keken, and
R.</label><?label Wilson_2014?><mixed-citation>Wilson, C. R., Spiegelman, M., van Keken, P. E., and R., H. B.: Fluid flow in
subduction zones: The role of solid rheology and compaction pressure, Earth
Planet. Sc. Lett., 401, 261–274, <ext-link xlink:href="https://doi.org/10.1016/j.epsl.2014.05.052" ext-link-type="DOI">10.1016/j.epsl.2014.05.052</ext-link>, 2014.</mixed-citation></ref>
      <ref id="bib1.bibx134"><?xmltex \def\ref@label{{Wilson et~al.(2017)Wilson, Spiegelman, and van Keken}}?><label>Wilson et al.(2017)Wilson, Spiegelman, and van Keken</label><?label Wilson_2017?><mixed-citation>Wilson, C. R., Spiegelman, M., and van Keken, P. E.: TerraFERMA: The
Transparent Finite Element Rapid Model Assembler for multiphysics problems in
Earth sciences, Geochem. Geophy. Geosy., 18, 769–810,
<ext-link xlink:href="https://doi.org/10.1002/2016GC006702" ext-link-type="DOI">10.1002/2016GC006702</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx135"><?xmltex \def\ref@label{{Wolstencroft et~al.(2009)Wolstencroft, Davies, and
Davies}}?><label>Wolstencroft et al.(2009)Wolstencroft, Davies, and
Davies</label><?label Wolstencroft_2009?><mixed-citation>Wolstencroft, M., Davies, J. H., and Davies, D. R.: Nusselt-Rayleigh number
scaling for spherical shell Earth mantle simulation up to a Rayleigh
number of <inline-formula><mml:math id="M456" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">9</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>, Phys. Earth Planet. In., 176, 132–141,
<ext-link xlink:href="https://doi.org/10.1016/j.pepi.2009.05.002" ext-link-type="DOI">10.1016/j.pepi.2009.05.002</ext-link>, 2009.
</mixed-citation></ref><?xmltex \hack{\newpage}?>
      <ref id="bib1.bibx136"><?xmltex \def\ref@label{{Yoshida and Kageyama(2004)}}?><label>Yoshida and Kageyama(2004)</label><?label Yoshida_2004?><mixed-citation>Yoshida, M. and Kageyama, A.: Application of the Yin-Yang grid to a thermal
convection of a Boussinesq fluid with infinite Prandtl number in a
three-dimensional spherical shell, Geophys. Res. Lett., 31, L12609,
<ext-link xlink:href="https://doi.org/10.1029/2004GL019970" ext-link-type="DOI">10.1029/2004GL019970</ext-link>, 2004.</mixed-citation></ref>
      <ref id="bib1.bibx137"><?xmltex \def\ref@label{{Zhong et~al.(2000)Zhong, Zuber, Moresi, and Gurnis}}?><label>Zhong et al.(2000)Zhong, Zuber, Moresi, and Gurnis</label><?label Zhong_2000?><mixed-citation>Zhong, S., Zuber, M. T., Moresi, L., and Gurnis, M.: Role of
temperature-dependent viscosity and surface plates in spherical shell models
of mantle convection, J. Geophys. Res., 105,  11063–11082,
<ext-link xlink:href="https://doi.org/10.1029/2000JB900003" ext-link-type="DOI">10.1029/2000JB900003</ext-link>, 2000.</mixed-citation></ref>
      <ref id="bib1.bibx138"><?xmltex \def\ref@label{{Zhong et~al.(2008)Zhong, {McNamara}, Tan, Moresi, and
Gurnis}}?><label>Zhong et al.(2008)Zhong, McNamara, Tan, Moresi, and
Gurnis</label><?label Zhong_2008?><mixed-citation>Zhong, S., McNamara, A., Tan, E., Moresi, L., and Gurnis, M.: A benchmark
study on mantle convection in a 3-D spherical shell using CitcomS,
Geochem. Geophy. Geosy., 9, Q10017, <ext-link xlink:href="https://doi.org/10.1029/2008GC002048" ext-link-type="DOI">10.1029/2008GC002048</ext-link>, 2008.</mixed-citation></ref>
      <ref id="bib1.bibx139"><?xmltex \def\ref@label{{Zienkiewicz et al.(2005)}}?><label>Zienkiewicz et al.(2005)</label><?label zfe_1991?><mixed-citation>
Zienkiewicz, O. C.,  Taylor, R. L., and  Zhu, J. Z.:  The finite element method: its basis and fundamentals, Elsevier, ISBN 9780080472775, 2005.</mixed-citation></ref>

  </ref-list></back>
    <!--<article-title-html>Towards automatic finite-element methods for  geodynamics via Firedrake</article-title-html>
<abstract-html/>
<ref-html id="bib1.bib1"><label>Ahrens et al.(2005)Ahrens, Geveci, and Law</label><mixed-citation>
Ahrens, J., Geveci, B., and Law, C.: Paraview: An End-User Tool for Large Data Visualization, The Visualization Handbook, Elsevier,  717–731,
<a href="https://doi.org/10.1016/B978-012387582-2/50038-1" target="_blank">https://doi.org/10.1016/B978-012387582-2/50038-1</a>, 2005.
</mixed-citation></ref-html>
<ref-html id="bib1.bib2"><label>Alisic et al.(2010)Alisic, Gurnis, Stadler, Burstedde, Wilcox, and
Ghattas</label><mixed-citation>
Alisic, L., Gurnis, M., Stadler, G., Burstedde, C., Wilcox, L. C., and Ghattas, O.:  Slab stress and strain rate as constraints on global mantle flow, Geophys. Res. Lett., 37, L22308, <a href="https://doi.org/10.1029/2010GL045312" target="_blank">https://doi.org/10.1029/2010GL045312</a>, 2010.
</mixed-citation></ref-html>
<ref-html id="bib1.bib3"><label>Alnes et al.(2014)Alnes, Logg, Olgaard, Rognes, and
Wells</label><mixed-citation>
Alnes, M. S., Logg, A., Olgaard, K. B., Rognes, M. E., and Wells, G. N.:
Unified Form Language: A domain-specific language for weak formulations of
partial differential equations, ACM T. Math. Softw.,
40, 2–9, 2014.
</mixed-citation></ref-html>
<ref-html id="bib1.bib4"><label>Amestoy et al.(2001)Amestoy, Duff, Koster, and L'Excellent</label><mixed-citation>
Amestoy, P., Duff, I. S., Koster, J., and L'Excellent, J.-Y.: A Fully
Asynchronous Multifrontal Solver Using Distributed Dynamic Scheduling, SIAM
J. Matrix Anal. A., 23, 15–41, 2001.
</mixed-citation></ref-html>
<ref-html id="bib1.bib5"><label>Amestoy et al.(2019)Amestoy, Buttari, L'Excellent, and
Mary</label><mixed-citation>
Amestoy, P., Buttari, A., L'Excellent, J.-Y., and Mary, T.: Performance and
Scalability of the Block Low-Rank Multifrontal Factorization on Multicore
Architectures, ACM T. Math. Softw. 45, 2:1–2:26,
2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib6"><label>Austermann et al.(2014)Austermann, Kaye, Mitrovica, and
Huybers</label><mixed-citation>
Austermann, J., Kaye, B., Mitrovica, J., and Huybers, P.: A statistical
analysis of the correlation between large igneous provinces and lower mantle
seismic structure, Geophys. J. Int., 197, 1–9, <a href="https://doi.org/10.1093/gji/ggt500" target="_blank">https://doi.org/10.1093/gji/ggt500</a>,
2014.
</mixed-citation></ref-html>
<ref-html id="bib1.bib7"><label>Balay et al.(1997)Balay, Gropp, McInnes, and
Smith</label><mixed-citation>
Balay, S., Gropp, W. D., McInnes, L. C., and Smith, B. F.: Efficient
management of parallelism in object-oriented numerical software libraries,
in: Modern software tools for scientific computing,  Birkhauser
Boston Inc., 163–202, <a href="https://doi.org/10.1007/978-1-4612-1986-6_8" target="_blank">https://doi.org/10.1007/978-1-4612-1986-6_8</a>, 1997.
</mixed-citation></ref-html>
<ref-html id="bib1.bib8"><label>Balay et al.(2021a)Balay, Abhyankar, Adams, Brown,
Brune, Buschelman, Dalcin, Dener, Eijkhout, Gropp, Karpeyev, Kaushik,
Knepley, May, McInnes, Mills, Munson, Rupp, Sanan, Smith, Zampini, Zhang, and
Zhang</label><mixed-citation>
Balay, S., Abhyankar, S., Adams, M. F., Brown, J., Brune, P., Buschelman, K.,
Dalcin, L., Dener, A., Eijkhout, V., Gropp, W. D., Karpeyev, D., Kaushik, D.,
Knepley, M. G., May, D. A., McInnes, L. C., Mills, R. T., Munson, T., Rupp,
K., Sanan, P., Smith, B. F., Zampini, S., Zhang, H., and Zhang, H.: PETSc
Users Manual, Tech. Rep. ANL-95/11 – Revision 3.15, Argonne National
Laboratory,  <a href="https://www.mcs.anl.gov/petsc" target="_blank"/> (last access: 1 May 2022),
2021a.
</mixed-citation></ref-html>
<ref-html id="bib1.bib9"><label>Balay et al.(2021b)Balay, Abhyankar, Adams, Brown,
Brune, Buschelman, Dalcin, Dener, Eijkhout, Gropp, Karpeyev, Kaushik,
Knepley, May, McInnes, Mills, Munson, Rupp, Sanan, Smith, Zampini, Zhang, and
Zhang</label><mixed-citation>
Balay, S., Abhyankar, S., Adams, M. F., Brown, J., Brune, P., Buschelman, K.,
Dalcin, L., Dener, A., Eijkhout, V., Gropp, W. D., Karpeyev, D., Kaushik, D.,
Knepley, M. G., May, D. A., McInnes, L. C., Mills, R. T., Munson, T., Rupp,
K., Sanan, P., Smith, B. F., Zampini, S., Zhang, H., and Zhang, H.: PETSc
Web page, <a href="https://www.mcs.anl.gov/petsc" target="_blank"/> (last access: 1 May 2022),,
2021b.
</mixed-citation></ref-html>
<ref-html id="bib1.bib10"><label>Bangerth et al.(2007)Bangerth, Hartmann, and
Kanschat</label><mixed-citation>
Bangerth, W., Hartmann, R., and Kanschat, G.: deal.II – A general-purpose
object-oriented finite element library, ACM T. Math. Software, 33, 42-es,
<a href="https://doi.org/10.1145/1268776.1268779" target="_blank">https://doi.org/10.1145/1268776.1268779</a>, 2007.
</mixed-citation></ref-html>
<ref-html id="bib1.bib11"><label>Bangerth et al.(2020)Bangerth, Dannberg, Gassmoeller, and
Heister</label><mixed-citation>
Bangerth, W., Dannberg, J., Gassmoeller, R., and Heister, T.: ASPECT v2.2.0,
Zenodo [code], <a href="https://doi.org/10.5281/zenodo.3924604" target="_blank">https://doi.org/10.5281/zenodo.3924604</a>, 2020.
</mixed-citation></ref-html>
<ref-html id="bib1.bib12"><label>Baumgardner(1985)</label><mixed-citation>
Baumgardner, J. R.: Three-dimensional treatment of convective flow in the
Earth's mantle, J. Stat. Phys., 39, 501–511, <a href="https://doi.org/10.1007/BF01008348" target="_blank">https://doi.org/10.1007/BF01008348</a>,
1985.
</mixed-citation></ref-html>
<ref-html id="bib1.bib13"><label>Bercovici et al.(1989)Bercovici, Schubert, and
Glatzmaier</label><mixed-citation>
Bercovici, D., Schubert, G., and Glatzmaier, G. A.: 3-D spherical models of
convection in the Earth's mantle, Science, 244, 950–955, 1989.
</mixed-citation></ref-html>
<ref-html id="bib1.bib14"><label>Bercovici et al.(1992)Bercovici, Schubert, and
Glatzmaier</label><mixed-citation>
Bercovici, D., Schubert, G., and Glatzmaier, G. A.: Three-dimensional
convection of an infinite-Prandtl-number compressible fluid in a basally
heated spherical shell, J. Fluid Mech., 239, 683–719, 1992.
</mixed-citation></ref-html>
<ref-html id="bib1.bib15"><label>Beucher et al.(2019)Beucher, Moresi, Giordani, Mansour, Sandiford,
Farrington, Mondy, Mallard, Rey, Duclaux, Kaluza, Laik, and
Morón</label><mixed-citation>
Beucher, R., Moresi, L., Giordani, J., Mansour, J., Sandiford, D., Farrington,
R., Mondy, L., Mallard, C., Rey, P., Duclaux, G., Kaluza, O., Laik, A., and
Morón, S.: UWGeodynamics: A teaching and research tool for numerical
geodynamic modelling, J. Open Source Softw., 4, 1136,
<a href="https://doi.org/10.21105/joss.01136" target="_blank">https://doi.org/10.21105/joss.01136</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib16"><label>Birch(1952)</label><mixed-citation>
Birch, F.: Elasticity and constitution of the Earth's interior, J. Geophys.
Res., 57, 227–286, 1952.
</mixed-citation></ref-html>
<ref-html id="bib1.bib17"><label>Blankenbach et al.(1989)Blankenbach, Busse, Christensen, Cserepes,
Gunkel, Hansen, Harder, Jarvis, Koch, Marquart, Moore, Olson, Schmeling, and
Schnaubelt</label><mixed-citation>
Blankenbach, B., Busse, F., Christensen, U., Cserepes, L., Gunkel, D., Hansen,
U., Harder, H., Jarvis, G., Koch, M., Marquart, G., Moore, D., Olson, P.,
Schmeling, H., and Schnaubelt, T.: A benchmark comparison for mantle
convection codes, Geophys. J. Int., 98, 23–38,
<a href="https://doi.org/10.1111/j.1365-246X.1989.tb05511.x" target="_blank">https://doi.org/10.1111/j.1365-246X.1989.tb05511.x</a>, 1989.
</mixed-citation></ref-html>
<ref-html id="bib1.bib18"><label>Bower et al.(2013)Bower, Gurnis, and Seton</label><mixed-citation>
Bower, D. J., Gurnis, M., and Seton, M.: Lower mantle structure from
paleogeographically constrained dynamic Earth models, Geochem. Geophy.
Geosy., 14, 44–63, <a href="https://doi.org/10.1029/2012GC004267" target="_blank">https://doi.org/10.1029/2012GC004267</a>, 2013.
</mixed-citation></ref-html>
<ref-html id="bib1.bib19"><label>Bunge et al.(2002)Bunge, Richards, and Baumgardner</label><mixed-citation>
Bunge, H., Richards, M. A., and Baumgardner, J. R.: Mantle circulation models
with sequential data-assimilation: inferring present-day mantle structure
from plate motion histories, Philos. T. R. Soc. Lond. A, 360,
2545–2567, <a href="https://doi.org/10.1098/rsta.2002.1080" target="_blank">https://doi.org/10.1098/rsta.2002.1080</a>, 2002.
</mixed-citation></ref-html>
<ref-html id="bib1.bib20"><label>Bunge et al.(1996)Bunge, Richards, and Baumgardner</label><mixed-citation>
Bunge, H.-P., Richards, M. A., and Baumgardner, J. R.: The effect of
depth–dependent viscosity on the planform of mantle convection, Nature, 279,
436–438, <a href="https://doi.org/10.1038/379436a0" target="_blank">https://doi.org/10.1038/379436a0</a>, 1996.
</mixed-citation></ref-html>
<ref-html id="bib1.bib21"><label>Bunge et al.(1997)Bunge, Richards, and Baumgardner</label><mixed-citation>
Bunge, H.-P., Richards, M. A., and Baumgardner, J. R.: A sensitivity study of
3-D-spherical mantle convection at 10<sup>8</sup> Rayleigh number: effects of
depth-dependent viscosity, heating mode and an endothermic phase change, J.
Geophys. Res., 102, 11991–12007, <a href="https://doi.org/10.1029/96JB03806" target="_blank">https://doi.org/10.1029/96JB03806</a>, 1997.
</mixed-citation></ref-html>
<ref-html id="bib1.bib22"><label>Bunge et al.(2003)Bunge, Hagelberg, and Travis</label><mixed-citation>
Bunge, H.-P., Hagelberg, C. R., and Travis, B. J.: Mantle circulation models
with variational data assimilation: inferring past mantle flow and structure
from plate motion histories and seismic tomography, Geophys. J. Int., 152,
280–301, <a href="https://doi.org/10.1046/j.1365-246X.2003.01823.x" target="_blank">https://doi.org/10.1046/j.1365-246X.2003.01823.x</a>, 2003.
</mixed-citation></ref-html>
<ref-html id="bib1.bib23"><label>Burstedde et al.(2011)Burstedde, Wilcox, and
Ghattas</label><mixed-citation>
Burstedde, C., Wilcox, L. C., and Ghattas, O.: <span style="" class="text typewriter">p4est</span>: Scalable
Algorithms for Parallel Adaptive Mesh Refinement on Forests of Octrees, SIAM
J. Sci. Comput., 33, 1103–1133, <a href="https://doi.org/10.1137/100791634" target="_blank">https://doi.org/10.1137/100791634</a>,
2011.
</mixed-citation></ref-html>
<ref-html id="bib1.bib24"><label>Burstedde et al.(2013)Burstedde, Stadler, Alisic, Wilcox, Tan,
Gurnis, and Ghattas</label><mixed-citation>
Burstedde, C., Stadler, G., Alisic, L., Wilcox, L. C., Tan, E., Gurnis, M., and
Ghattas, O.: Large-scale adaptive mantle convection simulation, Geophys. J.
Int., 192, 889–906, <a href="https://doi.org/10.1093/gji/ggs070" target="_blank">https://doi.org/10.1093/gji/ggs070</a>, 2013.
</mixed-citation></ref-html>
<ref-html id="bib1.bib25"><label>Busse et al.(1994)Busse, Christensen, Clever, Cserepes, Gable,
Giannandrea, Guillou, Houseman, Nataf, Ogawa, Parmentier, Sotin, and
Travis</label><mixed-citation>
Busse, F. H., Christensen, U., Clever, R., Cserepes, L., Gable, C.,
Giannandrea, E., Guillou, L., Houseman, G., Nataf, H. C., Ogawa, M.,
Parmentier, M., Sotin, C., and Travis, B.: 3D convection at infinite
Prandtl number in Cartesian geometry - a benchmark comparison, Geophys.
Astro. Fluid, 75, 39–59, <a href="https://doi.org/10.1080/03091929408203646" target="_blank">https://doi.org/10.1080/03091929408203646</a>, 1994.
</mixed-citation></ref-html>
<ref-html id="bib1.bib26"><label>Choblet et al.(2007)Choblet, Cadek, Couturier, and
Dumoulin</label><mixed-citation>
Choblet, G., Cadek, O., Couturier, F., and Dumoulin, C.: OEDIPUS: a new tool
to study the dynamics of planetary interiors, Geophys. J. Int., 170, 9–30,
<a href="https://doi.org/10.1111/j.1365-246X.2007.03419.x" target="_blank">https://doi.org/10.1111/j.1365-246X.2007.03419.x</a>, 2007.
</mixed-citation></ref-html>
<ref-html id="bib1.bib27"><label>Cockburn and Shi(2014)</label><mixed-citation>
Cockburn, B. and Shi, K.: Devising HDG methods for Stokes flow: An overview,
Comput. Fluids, 98, 221–229, <a href="https://doi.org/10.1016/j.compfluid.2013.11.017" target="_blank">https://doi.org/10.1016/j.compfluid.2013.11.017</a>,
2014.
</mixed-citation></ref-html>
<ref-html id="bib1.bib28"><label>Colli et al.(2018)Colli, Ghelichkhan, Bunge, and Oeser</label><mixed-citation>
Colli, L., Ghelichkhan, S., Bunge, H., and Oeser, J.: Retrodictions of Mid
Paleogene mantle flow and dynamic topography in the Atlantic region from
compressible high resolution adjoint mantle convection models: Sensitivity to
deep mantle viscosity and tomographic input model, Gondwana Res., 53,
252–272, <a href="https://doi.org/10.1029/2018GL077338" target="_blank">https://doi.org/10.1029/2018GL077338</a>, 2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib29"><label>Dalcin et al.(2011)Dalcin, Kler, Paz, and Cosimo</label><mixed-citation>
Dalcin, L., Kler, P. A., Paz, R. R., and Cosimo, A.: Parallel Distributed
Computing using Python, Adv. Water Res., 34, 10.1016/j.advwatres.2011.04.013,
2011.
</mixed-citation></ref-html>
<ref-html id="bib1.bib30"><label>Davies and Davies(2009)</label><mixed-citation>
Davies, D. R. and Davies, J. H.: Thermally–driven mantle plumes reconcile
multiple hotspot observations, Earth Planet. Sc. Lett., 278, 50–54,
<a href="https://doi.org/10.1016/j.epsl.2008.11.027" target="_blank">https://doi.org/10.1016/j.epsl.2008.11.027</a>, 2009.
</mixed-citation></ref-html>
<ref-html id="bib1.bib31"><label>Davies et al.(2011)Davies, Wilson, and Kramer</label><mixed-citation>
Davies, D. R., Wilson, C. R., and Kramer, S. C.: Fluidity: a fully unstructured
anisotropic adaptive mesh computational modeling framework for geodynamics,
Geochem. Geophy. Geosy., 120, Q06001, <a href="https://doi.org/10.1029/2011GC003551" target="_blank">https://doi.org/10.1029/2011GC003551</a>, 2011.
</mixed-citation></ref-html>
<ref-html id="bib1.bib32"><label>Davies et al.(2012)Davies, Goes, Davies, Schuberth, Bunge, and
Ritsema</label><mixed-citation>
Davies, D. R., Goes, S., Davies, J. H., Schuberth, B. S. A., Bunge, H., and
Ritsema, J.: Reconciling dynamic and seismic models of Earth's lower
mantle: the dominant role of thermal heterogeneity, Earth Planet. Sc. Lett.,
353–354, 253–269, <a href="https://doi.org/10.1016/j.epsl.2012.08.016" target="_blank">https://doi.org/10.1016/j.epsl.2012.08.016</a>, 2012.
</mixed-citation></ref-html>
<ref-html id="bib1.bib33"><label>Davies et al.(2013)Davies, Davies, Bollada, Hassan, Morgan, and
Nithiarasu</label><mixed-citation>
Davies, D. R., Davies, J. H., Bollada, P. C., Hassan, O., Morgan, K., and Nithiarasu, P.: A hierarchical mesh refinement technique for global 3-D spherical mantle convection modelling, Geosci. Model Dev., 6, 1095–1107, <a href="https://doi.org/10.5194/gmd-6-1095-2013" target="_blank">https://doi.org/10.5194/gmd-6-1095-2013</a>, 2013.
</mixed-citation></ref-html>
<ref-html id="bib1.bib34"><label>Davies et al.(2015a)Davies, Goes, and
Lau</label><mixed-citation>
Davies, D. R., Goes, S., and Lau, H. C. P.: Thermally Dominated Deep Mantle
LLSVPs: A Review, in: The Earth's Heterogeneous Mantle, edited by: Khan, A.
and Deschamps, F.,  Springer International Publishing, 441–477,
<a href="https://doi.org/10.1007/978-3-319-15627-9_14" target="_blank">https://doi.org/10.1007/978-3-319-15627-9_14</a>, 2015a.
</mixed-citation></ref-html>
<ref-html id="bib1.bib35"><label>Davies et al.(2015b)Davies, Goes, and
Sambridge</label><mixed-citation>
Davies, D. R., Goes, S., and Sambridge, M.: On the relationship between
volcanic hotspot locations, the reconstructed eruption sites of large igneous
provinces and deep mantle seismic structure, Earth Planet. Sc. Lett., 411,
121–130, <a href="https://doi.org/10.1016/j.epsl.2014.11.052" target="_blank">https://doi.org/10.1016/j.epsl.2014.11.052</a>, 2015b.
</mixed-citation></ref-html>
<ref-html id="bib1.bib36"><label>Davies et al.(2016)Davies, Le Voci, Goes, Kramer, and
Wilson</label><mixed-citation>
Davies, D. R., Le Voci, G., Goes, S., Kramer, S. C., and Wilson, C. R.: The
mantle wedge's transient 3-D flow regime and thermal structure, Geochem.
Geophy. Geosy., 17, 78–100, <a href="https://doi.org/10.1002/2015GC006125" target="_blank">https://doi.org/10.1002/2015GC006125</a>, 2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib37"><label>Davies et al.(2022)</label><mixed-citation>
Davies, D. R.,  Kramer, S.,   Ghelichkhan, S., and Gibson, A.:  g-adopt/g-adopt: v1.2.0 (v1.2.0),  Zenodo [code], <a href="https://doi.org/10.5281/zenodo.6762752" target="_blank">https://doi.org/10.5281/zenodo.6762752</a>, 2022.
</mixed-citation></ref-html>
<ref-html id="bib1.bib38"><label>Davies(1999)</label><mixed-citation>
Davies, G. F.: Dynamic Earth: plates, plumes and mantle convection, Cambridge
University Press, <a href="https://doi.org/10.1017/CBO9780511605802" target="_blank">https://doi.org/10.1017/CBO9780511605802</a>, 1999.
</mixed-citation></ref-html>
<ref-html id="bib1.bib39"><label>Donea and Huerta(2003)</label><mixed-citation>
Donea, J. and Huerta, A.: Finite element methods for flow problems, John Wiley
&amp; Sons, Ltd, <a href="https://doi.org/10.1002/0470013826" target="_blank">https://doi.org/10.1002/0470013826</a>, 2003.
</mixed-citation></ref-html>
<ref-html id="bib1.bib40"><label>Elman et al.(2005)Elman, Silvester, and Wathen</label><mixed-citation>
Elman, H. C., Silvester, D. J., and Wathen, A. J.: Finite elements and fast
iterative solvers: with applications in incompressible fluid dynamics, Oxford
University Press, <a href="https://doi.org/10.1093/acprof:oso/9780199678792.001.0001" target="_blank">https://doi.org/10.1093/acprof:oso/9780199678792.001.0001</a>, 2005.
</mixed-citation></ref-html>
<ref-html id="bib1.bib41"><label>Farrell et al.(2013)Farrell, Ham, Funke, and Rognes</label><mixed-citation>
Farrell, P. E., Ham, D. A., Funke, S. W., and Rognes, M. E.: Automated
derivation of the adjoint of high-level transient finite element programs,
SIAM J. Sci. Comput., 35, C369–C393, 2013.
</mixed-citation></ref-html>
<ref-html id="bib1.bib42"><label>firedrake-zenodo(2022)</label><mixed-citation>
firedrake-zenodo:  Software used in “Towards Automatic Finite Element Methods for Geodynamics via Firedrake” (Firedrake_20220506.0), Zenodo [code], <a href="https://doi.org/10.5281/zenodo.6522930" target="_blank">https://doi.org/10.5281/zenodo.6522930</a>, 2022.
</mixed-citation></ref-html>
<ref-html id="bib1.bib43"><label>Flament et al.(2022)Flament, Bodur, Williams, and
Merdith</label><mixed-citation>
Flament, N., Bodur, Ö. F., Williams, S. E., and Merdith, A. S.: Assembly
of the basal mantle structure beneath Africa, Nature, 603, 846–851, 2022.
</mixed-citation></ref-html>
<ref-html id="bib1.bib44"><label>Fraters et al.(2019)Fraters, Bangerth, Thieulot, Glerum, and
Spakman</label><mixed-citation>
Fraters, M. R., Bangerth, W., Thieulot, C., Glerum, A., and Spakman, W.:
Efficient and practical Newton solvers for non-linear Stokes systems in
geodynamic problems, Geophys. J. Int., 218, 873–894, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib45"><label>French and Romanowicz(2015)</label><mixed-citation>
French, S. W. and Romanowicz, B.: Broad plumes rooted at the base of the
Earth's mantle beneath major hotspots, Nature, 525, 95–99,
<a href="https://doi.org/10.1038/nature14876" target="_blank">https://doi.org/10.1038/nature14876</a>, 2015.
</mixed-citation></ref-html>
<ref-html id="bib1.bib46"><label>Garel et al.(2014)Garel, Goes, Davies, Davies, Kramer, and
Wilson</label><mixed-citation>
Garel, F., Goes, S., Davies, D. R., Davies, J. H., Kramer, S. C., and Wilson,
C. R.: Interaction of subducted slabs with the mantle transition-zone: A
regime diagram from 2-D thermo-mechanical models with a mobile trench and
an overriding plate, Geochem. Geophy. Geosy., 15, 1739–1765,
<a href="https://doi.org/10.1002/2014GC005257" target="_blank">https://doi.org/10.1002/2014GC005257</a>, 2014.
</mixed-citation></ref-html>
<ref-html id="bib1.bib47"><label>Gassmoller et al.(2020)Gassmoller, Dannberg, Bangerth, Heister, and
Myhill</label><mixed-citation>
Gassmoller, R., Dannberg, J., Bangerth, W., Heister, T., and Myhill, R.: On
formulations of compressible mantle convection, Geophys. J. Int., 221,
1264–1280, <a href="https://doi.org/10.1093/gji/ggaa078" target="_blank">https://doi.org/10.1093/gji/ggaa078</a>, 2020.
</mixed-citation></ref-html>
<ref-html id="bib1.bib48"><label>Ghelichkhan and Bunge(2018)</label><mixed-citation>
Ghelichkhan, S. and Bunge, H.: The adjoint equations for thermochemical
compressible mantle convection: derivation and verification by twin
experiments, Proc. Roy. Soc. A, 474, 20180329,
<a href="https://doi.org/10.1098/rspa.2018.0329" target="_blank">https://doi.org/10.1098/rspa.2018.0329</a>, 2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib49"><label>Ghelichkhan et al.(2018)Ghelichkhan, Murbock, Colli, Pail, and
Bunge</label><mixed-citation>
Ghelichkhan, S., Murbock, M., Colli, L., Pail, R., and Bunge, H.: On the
observability of epeirogenic movement in current and future gravity missions,
Gondwana Res., 53, 273–284, <a href="https://doi.org/10.1016/j.gr.2017.04.016" target="_blank">https://doi.org/10.1016/j.gr.2017.04.016</a>, 2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib50"><label>Ghelichkhan et al.(2020)Ghelichkhan, Bunge, and
Oeser</label><mixed-citation>
Ghelichkhan, S., Bunge, H., and Oeser, J.: Global mantle flow retrodictions for
the early Cenozoic using an adjoint method: evolving dynamic topographies,
deep mantle structures, flow trajectories and sublithospheric stresses,
Geophys. J. Int., 226, 1432–1460, <a href="https://doi.org/10.1093/gji/ggab108" target="_blank">https://doi.org/10.1093/gji/ggab108</a>, 2020.
</mixed-citation></ref-html>
<ref-html id="bib1.bib51"><label>Gibson et al.(2019)Gibson, McRae, Cotter, Mitchell, and
Ham</label><mixed-citation>
Gibson, T. H., McRae, A. T. T., Cotter, C. J., Mitchell, L., and Ham, D. A.:
Compatible Finite Element Methods for Geophysical Flows: Automation and
Implementation using Firedrake, Springer International Publishing,
<a href="https://doi.org/10.1007/978-3-030-23957-2" target="_blank">https://doi.org/10.1007/978-3-030-23957-2</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib52"><label>Glatzmaier(1988)</label><mixed-citation>
Glatzmaier, G. A.: Numerical simulations of mantle convection-time dependent,
3-dimensional, compressible, spherical-shell, Geophys. Astro. Fluid,
43, 223–264, 1988.
</mixed-citation></ref-html>
<ref-html id="bib1.bib53"><label>Gurnis et al.(2012)Gurnis, Yang, Cannon, Turner, Williams, Flament,
and Müller</label><mixed-citation>
Gurnis, M., Yang, T., Cannon, J., Turner, M., Williams, S., Flament, N., and
Müller, R. D.: Global tectonic reconstructions with continuously
deforming and evolving rigid plates, Comput. Geosci., 116, 32–41,
<a href="https://doi.org/10.1016/j.cageo.2018.04.007" target="_blank">https://doi.org/10.1016/j.cageo.2018.04.007</a>, 2012.
</mixed-citation></ref-html>
<ref-html id="bib1.bib54"><label>Ham et al.(2009)Ham, Farrell, Gorman, Maddison, Wilson, Kramer,
Shipton, Collins, Cotter, and Piggott</label><mixed-citation>
Ham, D. A., Farrell, P. E., Gorman, G. J., Maddison, J. R., Wilson, C. R., Kramer, S. C., Shipton, J., Collins, G. S., Cotter, C. J., and Piggott, M. D.: Spud 1.0: generalising and automating the user interfaces of scientific computer models, Geosci. Model Dev., 2, 33–42, <a href="https://doi.org/10.5194/gmd-2-33-2009" target="_blank">https://doi.org/10.5194/gmd-2-33-2009</a>, 2009.
</mixed-citation></ref-html>
<ref-html id="bib1.bib55"><label>Hassan et al.(2015)Hassan, Flament, Gurnis, Bowe, and
Müller</label><mixed-citation>
Hassan, R., Flament, N., Gurnis, M., Bowe, D. J., and Müller, R. D.:
Provenance of plumes in global convection models, Geochem. Geophy. Geosy.,
16, 1465–1489, <a href="https://doi.org/10.1002/2015GC005751" target="_blank">https://doi.org/10.1002/2015GC005751</a>, 2015.
</mixed-citation></ref-html>
<ref-html id="bib1.bib56"><label>He et al.(2017)He, Puckett, and Billen</label><mixed-citation>
He, Y., Puckett, E. G., and Billen, M. I.: A Discontinuous Galerkin method
with a bound preserving limiter for the advection of non-diffusive fields in
solid Earth geodynamics, Phys. Earth Planet. In., 263, 23–37, 2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib57"><label>Heister et al.(2017)Heister, Dannberg, Gassmoller, and
Bangerth</label><mixed-citation>
Heister, T., Dannberg, J., Gassmoller, R., and Bangerth, W.: High accuracy
mantle convection simulation through modern numerical methods – II:
Realistic models and problems, Geophys. J. Int., 210, 833–851,
<a href="https://doi.org/10.1093/gji/ggx195" target="_blank">https://doi.org/10.1093/gji/ggx195</a>, 2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib58"><label>Heroux et al.(2005)Heroux, Bartlett, Howle, Hoekstra, Hu, Kolda,
Lehoucq, Long, Pawlowski, Phipps, Salinger, Thornquist, Tuminaro,
Willenbring, Williams, and Stanlet</label><mixed-citation>
Heroux, M. A., Bartlett, R. A., Howle, V. E., Hoekstra, R. J., Hu, J. J.,
Kolda, T. G., Lehoucq, R. B., Long, K. R., Pawlowski, R. P., Phipps, E. T.,
Salinger, A. G., Thornquist, H. K., Tuminaro, R. S., Willenbring, J. M.,
Williams, A., and Stanlet, K. S.: An overview of the Trilinos project, ACM
T. Math. Software, 31, 397–423, <a href="https://doi.org/10.1145/1089014.1089021" target="_blank">https://doi.org/10.1145/1089014.1089021</a>, 2005.
</mixed-citation></ref-html>
<ref-html id="bib1.bib59"><label>Hillebrand et al.(2014)Hillebrand, Thieulot, Geenen, Van Den Berg,
and Spakman</label><mixed-citation>
Hillebrand, B., Thieulot, C., Geenen, T., van den Berg, A. P., and Spakman, W.: Using the level set method in geodynamical modeling of multi-material flows and Earth's free surface, Solid Earth, 5, 1087–1098, <a href="https://doi.org/10.5194/se-5-1087-2014" target="_blank">https://doi.org/10.5194/se-5-1087-2014</a>, 2014.
</mixed-citation></ref-html>
<ref-html id="bib1.bib60"><label>Hillewaert(2013)</label><mixed-citation>
Hillewaert, K.: Development of the discontinuous Galerkin method for
high-resolution, large scale CFD and acoustics in industrial geometries, PhD
Thesis, Université de Louvain, 2013.
</mixed-citation></ref-html>
<ref-html id="bib1.bib61"><label>Homolya et al.(2018)Homolya, Mitchell, Luporini, and
Ham.</label><mixed-citation>
Homolya, M., Mitchell, L., Luporini, F., and Ham, D.: Tsfc: a
structure-preserving form compiler, SIAM J. Sci. Comput., 40, 401–428,
<a href="https://doi.org/10.1137/17M1130642" target="_blank">https://doi.org/10.1137/17M1130642</a>, 2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib62"><label>Hunt et al.(2012)Hunt, Davies, Walker, McCormack, Wills, Dobson,
and Li</label><mixed-citation>
Hunt, S. A., Davies, D. R., Walker, A. M., McCormack, R. J., Wills, A. S.,
Dobson, D. P., and Li, L.: On the increase in thermal diffusivity caused by
the perovskite to post-perovskite phase transition and its implications for
mantle dynamics, Earth Planet. Sc. Lett., 319, 96–103,
<a href="https://doi.org/10.1016/j.epsl.2011.12.009" target="_blank">https://doi.org/10.1016/j.epsl.2011.12.009</a>, 2012.
</mixed-citation></ref-html>
<ref-html id="bib1.bib63"><label>Jadamec(2016)</label><mixed-citation>
Jadamec, M. A.: Insights on slab-driven mantle flow from advances in
three-dimensional modelling, J. Geodynam., 100, 51–70, 2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib64"><label>Jadamec and Billen(2010)</label><mixed-citation>
Jadamec, M. A. and Billen, M. I.: Reconciling surface plate motions with rapid
three-dimensional mantle flow around a slab edge, Nature, 465, 338–341,
2010.
</mixed-citation></ref-html>
<ref-html id="bib1.bib65"><label>Jarvis(1993)</label><mixed-citation>
Jarvis, G. T.: Effects of curvature on two–dimensional models of mantle
convection: cylindrical polar coordinates, J. Geophys. Res., 98, 4477–4485,
1993.
</mixed-citation></ref-html>
<ref-html id="bib1.bib66"><label>Jarvis and McKenzie(1980)</label><mixed-citation>
Jarvis, G. T. and McKenzie, D. P.: Convection in a compressible fluid with
infinite Prandtl number, J. Fluid Mech., 96, 515–583,
<a href="https://doi.org/10.1017/S002211208000225X" target="_blank">https://doi.org/10.1017/S002211208000225X</a>, 1980.
</mixed-citation></ref-html>
<ref-html id="bib1.bib67"><label>Katz and Weatherley(2012)</label><mixed-citation>
Katz, R. F. and Weatherley, S. M.: Consequences of mantle heterogeneity for
melt extraction at mid-ocean ridges, Earth Planet. Sc. Lett., 335, 226–237,
<a href="https://doi.org/10.1016/j.epsl.2012.04.042" target="_blank">https://doi.org/10.1016/j.epsl.2012.04.042</a>, 2012.
</mixed-citation></ref-html>
<ref-html id="bib1.bib68"><label>King et al.(2010)King, Lee, van Keken, Leng, Zhong, Tan, Tosi, and
Kameyama</label><mixed-citation>
King, S. D., Lee, C., van Keken, P. E., Leng, W., Zhong, S., Tan, E., Tosi,
N., and Kameyama, M. C.: A community benchmark for 2-D Cartesian
compressible convection in Earth's mantle, Geophys. J. Int., 179, 1–11,
2010.
</mixed-citation></ref-html>
<ref-html id="bib1.bib69"><label>Kirby(2004)</label><mixed-citation>
Kirby, R. C.: Algorithm 839: FIAT, a new paradigm for computing finite
element basis functions, ACM T. Math. Software, 30, 502–516, 2004.
</mixed-citation></ref-html>
<ref-html id="bib1.bib70"><label>Kirby and Mitchell(2018)</label><mixed-citation>
Kirby, R. C. and Mitchell, L.: Solver Composition Across the PDE/Linear
Algebra Barrier, SIAM J. Sci. Comput., 40, 76–98, <a href="https://doi.org/10.1137/17M1133208" target="_blank">https://doi.org/10.1137/17M1133208</a>,
2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib71"><label>Kirby and Mitchell(2019)</label><mixed-citation>
Kirby, R. C. and Mitchell, L.: Code generation for generally mapped finite
elements, ACM T. Math. Software, 45, 1–23, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib72"><label>Knepley and Karpeev(2009)</label><mixed-citation>
Knepley, M. G. and Karpeev, D. A.: Mesh Algorithms for PDE with Sieve I: Mesh
Distribution, Sci. Program., 17, 215–230, 2009.
</mixed-citation></ref-html>
<ref-html id="bib1.bib73"><label>Koelemeijer et al.(2018)Koelemeijer, Schuberth, Davies, Deuss, and
Ritsema</label><mixed-citation>
Koelemeijer, P. J., Schuberth, B. S. A., Davies, D. R., Deuss, A., and Ritsema,
J.: Constraints on the presence of post-perovskite in Earth's lowermost
mantle from tomographic-geodynamic model comparisons, Geophys. J. Int., 494,
226–238, 2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib74"><label>Kramer et al.(2010)Kramer, Cotter, and Pain</label><mixed-citation>
Kramer, S. C., Cotter, C. J., and Pain, C. C.: Solving the Poisson equation on
small aspect ratio domains using unstructured meshes, Ocean Model., 35,
253–263, 2010.
</mixed-citation></ref-html>
<ref-html id="bib1.bib75"><label>Kramer et al.(2012)Kramer, Wilson, and Davies</label><mixed-citation>
Kramer, S. C., Wilson, C. R., and Davies, D. R.: An implicit free-surface
algorithm for geodynamical simulations, Phys. Earth Planet. In., 194,
25–37, <a href="https://doi.org/10.1016/j.pepi.2012.01.001" target="_blank">https://doi.org/10.1016/j.pepi.2012.01.001</a>, 2012.
</mixed-citation></ref-html>
<ref-html id="bib1.bib76"><label>Kramer et al.(2021a)Kramer, Davies, and
Wilson</label><mixed-citation>
Kramer, S. C., Davies, D. R., and Wilson, C. R.: Analytical solutions for mantle flow in cylindrical and spherical shells, Geosci. Model Dev., 14, 1899–1919, <a href="https://doi.org/10.5194/gmd-14-1899-2021" target="_blank">https://doi.org/10.5194/gmd-14-1899-2021</a>, 2021a.
</mixed-citation></ref-html>
<ref-html id="bib1.bib77"><label>Kramer et al.(2021b)Kramer, Wilson, Davies, Mathews,
Gibson, Dubernay, Greaves, Candy, Cotter, Percival, Mouradian, Bhutani,
Avdis, Gorman, Piggott, and Ham</label><mixed-citation>
Kramer, S. C., Wilson, C., Davies, D. R., Mathews, C., Gibson, A., Dubernay,
T., Greaves, T., Candy, A., Cotter, C. J., Percival, J., Mouradian, S.,
Bhutani, G., Avdis, A., Gorman, G., Piggott, M., and Ham, D.:
FluidityProject/fluidity: Zenodo release, Zenodo [code], <a href="https://doi.org/10.5281/zenodo.3924604" target="_blank">https://doi.org/10.5281/zenodo.3924604</a>,
2021b.
</mixed-citation></ref-html>
<ref-html id="bib1.bib78"><label>Kronbichler et al.(2012)Kronbichler, Heister, and
Bangerth</label><mixed-citation>
Kronbichler, M., Heister, T., and Bangerth, W.: High accuracy mantle convection
simulation through modern numerical methods, Geophys. J. Int., 191, 12–29,
<a href="https://doi.org/10.1111/j.1365-246X.2012.05609.x" target="_blank">https://doi.org/10.1111/j.1365-246X.2012.05609.x</a>, 2012.
</mixed-citation></ref-html>
<ref-html id="bib1.bib79"><label>Kärnä et al.(2018)Kärnä, Kramer, Mitchell, Ham, Piggott, and
Baptista</label><mixed-citation>
Kärnä, T., Kramer, S. C., Mitchell, L., Ham, D. A., Piggott, M. D., and Baptista, A. M.: Thetis coastal ocean model: discontinuous Galerkin discretization for the three-dimensional hydrostatic equations, Geosci. Model Dev., 11, 4359–4382, <a href="https://doi.org/10.5194/gmd-11-4359-2018" target="_blank">https://doi.org/10.5194/gmd-11-4359-2018</a>, 2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib80"><label>Lange et al.(2016)Lange, Mitchell, Knepley, and Gorman</label><mixed-citation>
Lange, M., Mitchell, L., Knepley, M. G., and Gorman, G. J.: Efficient mesh
management in Firedrake using PETSc-DMPlex, SIAM J. Sci.
Comput., 38, S143–S155, <a href="https://doi.org/10.1137/15M1026092" target="_blank">https://doi.org/10.1137/15M1026092</a>, 2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib81"><label>Le Voci et al.(2014)Le Voci, Davies, Goes, Kramer, and
Wilson</label><mixed-citation>
Le Voci, G., Davies, D. R., Goes, S., Kramer, S. C., and Wilson, C. R.: A
systematic 2-D investigation into the mantle wedge's transient flow regime
and thermal structure: complexities arising from a hydrated rheology and
thermal buoyancy, Geochem. Geophy. Geosy., 15, 28–51,
<a href="https://doi.org/10.1002/2013GC005022" target="_blank">https://doi.org/10.1002/2013GC005022</a>, 2014.
</mixed-citation></ref-html>
<ref-html id="bib1.bib82"><label>Leng and Zhong(2008)</label><mixed-citation>
Leng, W. and Zhong, S.: Viscous heating, adiabatic heating and energetic
consistency in compressible mantle convection, Geophys. J. Int., 173,
693–702, 2008.
</mixed-citation></ref-html>
<ref-html id="bib1.bib83"><label>Li et al.(2017)Li, Gurnis, and Stadler</label><mixed-citation>
Li, D., Gurnis, M., and Stadler, G.: Towards adjoint-based inversion of
time-dependent mantle convection with nonlinear viscosity, Geophys. J. Int.,
209, 86–105, <a href="https://doi.org/10.1093/gji/ggw493" target="_blank">https://doi.org/10.1093/gji/ggw493</a>, 2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib84"><label>Liu et al.(2008)Liu, Spasojevic, and Gurnis</label><mixed-citation>
Liu, L., Spasojevic, S., and Gurnis, M.: Reconstructing Farallon Plate
Subduction Beneath North America Back to the Late Cretaceous, Science,
322, 934–938, <a href="https://doi.org/10.1126/science.1162921" target="_blank">https://doi.org/10.1126/science.1162921</a>, 2008.
</mixed-citation></ref-html>
<ref-html id="bib1.bib85"><label>Liu and King(2019)</label><mixed-citation>
Liu, S. and King, S. D.: A benchmark study of incompressible Stokes flow in a
3-D spherical shell using ASPECT, Geophys. J. Int., 217, 650–667, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib86"><label>Logg et al.(2012)Logg, Mardal, and Wells</label><mixed-citation>
Logg, A., Mardal, K.-A., and Wells, G.: Automated Solution of Differential
Equations by the Finite Element Method: The FEniCS Book, Lecture Notes in
Computational Science and Engineering vol. 84, Springer, Berlin,
<a href="https://doi.org/10.1007/978-3-642-23099-8" target="_blank">https://doi.org/10.1007/978-3-642-23099-8</a>, 2012.
</mixed-citation></ref-html>
<ref-html id="bib1.bib87"><label>Maljaars et al.(2021)Maljaars, Richardson, and
Sime</label><mixed-citation>
Maljaars, J. M., Richardson, C. N., and Sime, N.: LEoPart: A particle library
for FEniCS, Comp. Math. Appl., 81, 289–315, 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib88"><label>Markall et al.(2013)Markall, Rathgeber, Mitchell, Loriant, Bertolli,
Ham, and Kelly</label><mixed-citation>
Markall, G. R., Rathgeber, F., Mitchell, L., Loriant, N., Bertolli, C., Ham,
D. A., and Kelly, P. H. J.: Performance-Portable Finite Element Assembly
Using PyOP2 and FEniCS, in: 28th International Supercomputing Conference,
ISC, Proceedings, edited by: Kunkel, J. M., Ludwig, T., and Meuer, H. W., vol.
7905 of  Lecture Notes in Computer Science,  Springer, 279–289,
<a href="https://doi.org/10.1007/978-3-642-38750-0_21" target="_blank">https://doi.org/10.1007/978-3-642-38750-0_21</a>, 2013.
</mixed-citation></ref-html>
<ref-html id="bib1.bib89"><label>May and Moresi(2008)</label><mixed-citation>
May, D. and Moresi, L.: Preconditioned iterative methods for Stokes flow
problems arising in computational geodynamics, Phys. Earth Planet. In., 171,
33–47, <a href="https://doi.org/10.1016/j.pepi.2008.07.036" target="_blank">https://doi.org/10.1016/j.pepi.2008.07.036</a>, 2008.
</mixed-citation></ref-html>
<ref-html id="bib1.bib90"><label>McKenzie(1969)</label><mixed-citation>
McKenzie, D.: Speculations on consequences and causes of plate motions,
Geophys. J. Roy. Astr. S., 18, 1–18, 1969.
</mixed-citation></ref-html>
<ref-html id="bib1.bib91"><label>McKenzie et al.(1973)McKenzie, Roberts, and
Weiss</label><mixed-citation>
McKenzie, D. P., Roberts, J. M., and Weiss, N. O.: Numerical models of
convection in the Earth's mantle, Tectonophys., 19, 89–103,
<a href="https://doi.org/10.1016/0040-1951(73)90034-6" target="_blank">https://doi.org/10.1016/0040-1951(73)90034-6</a>, 1973.
</mixed-citation></ref-html>
<ref-html id="bib1.bib92"><label>Minear and Toksoz(1970)</label><mixed-citation>
Minear, J. and Toksoz, M.: Thermal regime of a downgoing slab and new global
tectonics, J. Geophys. Res., 75, 1397–1419, 1970.
</mixed-citation></ref-html>
<ref-html id="bib1.bib93"><label>Mitush et al.(2019)Mitush, Funke, and Dokken</label><mixed-citation>
Mitush, S. K., Funke, S. W., and Dokken, J. S.: dolfin-adjoint 2018.1:
automated adjoints for FEniCS and Firedrake, J. Open Source Softw., 4, 1292, <a href="https://doi.org/10.21105/joss.01292" target="_blank">https://doi.org/10.21105/joss.01292</a>,
2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib94"><label>Moresi et al.(2002)Moresi, Dufour, and Muhlhaus</label><mixed-citation>
Moresi, L., Dufour, F., and Muhlhaus, H.: Mantle convection modeling with
viscoelastic/brittle lithosphere: Numerical methodology and plate tectonic
modeling, Pure Appl. Geophys., 159, 2335–2356, 2002.
</mixed-citation></ref-html>
<ref-html id="bib1.bib95"><label>Moresi et al.(2007)Moresi, Quenette, Lemiale, Meriaux, Appelbe, and
Muhlhaus</label><mixed-citation>
Moresi, L., Quenette, S., Lemiale, V., Meriaux, C., Appelbe, B., and Muhlhaus,
H.-B.: Computational approaches to studying non-linear dynamics of the crust
and mantle, Phys. Earth Planet. In., 163, 69–82,
<a href="https://doi.org/10.1016/j.pepi.2007.06.009" target="_blank">https://doi.org/10.1016/j.pepi.2007.06.009</a>, 2007.
</mixed-citation></ref-html>
<ref-html id="bib1.bib96"><label>Moresi and Solomatov(1995)</label><mixed-citation>
Moresi, L. N. and Solomatov, V. S.: Numerical investigations of 2D convection
with extremely large viscosity variations, Phys. Fluid, 7, 2154–2162,
<a href="https://doi.org/10.1063/1.868465" target="_blank">https://doi.org/10.1063/1.868465</a>, 1995.
</mixed-citation></ref-html>
<ref-html id="bib1.bib97"><label>Müller et al.(2016)Müller, Seton, Zahirovic, Williams,
Matthews, Wright, Shephard, Maloney, Barnett-Moore, Hosseinpour, Bower, and
Cannon</label><mixed-citation>
Müller, R. D., Seton, M., Zahirovic, S., Williams, S. E., Matthews, K. J.,
Wright, N. M., Shephard, G. E., Maloney, K. T., Barnett-Moore, N.,
Hosseinpour, M., Bower, D. J., and Cannon, J.: Ocean Basin Evolution and
Global-Scale Plate Reorganization Events Since Pangea Breakup, Annu. Rev.
Earth Pl. Sc., 44, 107–138, <a href="https://doi.org/10.1146/annurev-earth-060115-012211" target="_blank">https://doi.org/10.1146/annurev-earth-060115-012211</a>,
2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib98"><label>Müller et al.(2018)Müller, Cannon, Qin, Watson, Gurnis,
Williams, Pfaffelmoser, Seton, Russell, and Zahirovic</label><mixed-citation>
Müller, R. D., Cannon, J., Qin, X., Watson, R. J., Gurnis, M., Williams,
S., Pfaffelmoser, T., Seton, M., Russell, S. H. J., and Zahirovic, S.:
GPlates: Building a Virtual Earth Through Deep Time, Geochem. Geophy.
Geosy., 19, 2243–2261, <a href="https://doi.org/10.1029/2018GC007584" target="_blank">https://doi.org/10.1029/2018GC007584</a>, 2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib99"><label>Nakagawa et al.(2009)Nakagawa, Tackley, Deschamps, and
Connolly</label><mixed-citation>
Nakagawa, T., Tackley, P. J., Deschamps, F., and Connolly, J. A. D.:
Incorporating self–consistently calculated mineral physics into
thermo–chemical mantle convection simulations in a 3-D spherical shell and
its influence on seismic anomalies in Earth's mantle, Geochem. Geophy.
Geosy., 10, Q3304, <a href="https://doi.org/10.1029/2008GC002280" target="_blank">https://doi.org/10.1029/2008GC002280</a>, 2009.
</mixed-citation></ref-html>
<ref-html id="bib1.bib100"><label>Nerlich et al.(2016)Nerlich, Colli, Ghelichkhan, B.Schuberth, and
Bunge</label><mixed-citation>
Nerlich, R., Colli, L., Ghelichkhan, S., Schuberth, B., and Bunge, H.-P.:
Constraining entral Neo-Tethys Ocean reconstructions with mantle convection
models, Geophys. Res. Lett., 43, 9595–9603, <a href="https://doi.org/10.1002/2016GL070524" target="_blank">https://doi.org/10.1002/2016GL070524</a>,
2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib101"><label>Nitsche(1971)</label><mixed-citation>
Nitsche, J.: Über ein Variationsprinzip zur Lösung von
Dirichlet-Problemen bei Verwendung von Teilräumen, die keinen
Randbedingungen unterworfen sind, in: Abhandlungen aus dem mathematischen
Seminar der Universität Hamburg,    Springer, vol. 36, 9–15,
<a href="https://doi.org/10.1007/BF02995904" target="_blank">https://doi.org/10.1007/BF02995904</a>, 1971.
</mixed-citation></ref-html>
<ref-html id="bib1.bib102"><label>Quenette et al.(2007)Quenette, Moresi, Appelbe, and
Sunter</label><mixed-citation>
Quenette, S., Moresi, L., Appelbe, B. F., and Sunter, P. D.: Explaining
StGermain: an aspect oriented environment for building extensible
computational mechanics modeling software, IEEE International Parallel and
Distributed Processing Symposium, IEEE New York,  210 pp.,
<a href="https://doi.org/10.1109/IPDPS.2007.370400" target="_blank">https://doi.org/10.1109/IPDPS.2007.370400</a>, 2007.
</mixed-citation></ref-html>
<ref-html id="bib1.bib103"><label>Ratcliff et al.(1996)Ratcliff, Schubert, and Zebib</label><mixed-citation>
Ratcliff, J. T., Schubert, G., and Zebib, A.: Steady tetrahedral and cubic
patterns of spherical shell convection with temperature-dependent viscosity,
J. Geophys. Res., 101, 25473–25484, <a href="https://doi.org/10.1029/96JB02097" target="_blank">https://doi.org/10.1029/96JB02097</a>, 1996.
</mixed-citation></ref-html>
<ref-html id="bib1.bib104"><label>Rathgeber et al.(2012)Rathgeber, Markall, Mitchell, Loriant, Ham,
Bertolli, and Kelly</label><mixed-citation>
Rathgeber, F., Markall, G. R., Mitchell, L., Loriant, N., Ham, D. A., Bertolli,
C., and Kelly, P. H. J.: PyOP2: A High-Level Framework for
Performance-Portable Simulations on Unstructured Meshes, in: High Performance
Computing, Networking Storage and Analysis, SC Companion,
IEEE Computer Society, Los Alamitos, CA, USA, 1116–1123,
<a href="https://doi.org/10.1109/SC.Companion.2012.134" target="_blank">https://doi.org/10.1109/SC.Companion.2012.134</a>, 2012.
</mixed-citation></ref-html>
<ref-html id="bib1.bib105"><label>Rathgeber et al.(2016)Rathgeber, Ham, Mitchell, Lange, Luporini,
Mcrae, Bercea, Markall, and Kelly</label><mixed-citation>
Rathgeber, F., Ham, D. A., Mitchell, L., Lange, M., Luporini, F., Mcrae, A.
T. T., Bercea, G.-T., Markall, G. R., and Kelly, P. H. J.: Firedrake:
Automating the Finite Element Method by Composing Abstractions, ACM T.
Math. Softw., 43, 1–27, <a href="https://doi.org/10.1145/2998441" target="_blank">https://doi.org/10.1145/2998441</a>, 2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib106"><label>Ritsema et al.(2011)Ritsema, Deuss, van Heijst, and
Woodhouse</label><mixed-citation>
Ritsema, J., Deuss, A., van Heijst, H. J., and Woodhouse, J. H.: S40RTS: a
degree-40 shear-velocity model for the mantle from new Rayleigh wave
dispersion, teleseismic traveltime and normal-mode splitting function
measurements, Geophys. J. Int., 184, 1223–1236,
<a href="https://doi.org/10.1111/j.1365-246X.2010.04884.x" target="_blank">https://doi.org/10.1111/j.1365-246X.2010.04884.x</a>, 2011.
</mixed-citation></ref-html>
<ref-html id="bib1.bib107"><label>Rubey et al.(2017)Rubey, Brune, Heine, Davies, Williams, and
Müller</label><mixed-citation>
Rubey, M., Brune, S., Heine, C., Davies, D. R., Williams, S. E., and Müller, R. D.: Global patterns in Earth's dynamic topography since the Jurassic: the role of subducted slabs, Solid Earth, 8, 899–919, <a href="https://doi.org/10.5194/se-8-899-2017" target="_blank">https://doi.org/10.5194/se-8-899-2017</a>, 2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib108"><label>Saad(1993)</label><mixed-citation>
Saad, Y.: A flexible inner-outer preconditioned GMRES algorithm, SIAM J.
Sci. Comput., 14, 461–469, 1993.
</mixed-citation></ref-html>
<ref-html id="bib1.bib109"><label>Schubert et al.(2001)Schubert, Turcotte, and Olson</label><mixed-citation>
Schubert, G., Turcotte, D. L., and Olson, P.: Mantle convection in the Earth
and planets, Cambridge University Press, <a href="https://doi.org/10.1017/CBO9780511612879" target="_blank">https://doi.org/10.1017/CBO9780511612879</a>, 2001.
</mixed-citation></ref-html>
<ref-html id="bib1.bib110"><label>Schuberth et al.(2009)Schuberth, H.-P. Bunge, Steinle-Neumann,
Moder, and Oeser</label><mixed-citation>
Schuberth, B. S. A., H.-P. Bunge, Steinle-Neumann, G., Moder, C., and
Oeser, J.: Thermal versus elastic heterogeneity in high-resolution mantle
circulation models with pyrolite composition: high plume excess temperatures
in the lowermost mantle, Geochem. Geophy. Geosy., 10, Q01W01,
<a href="https://doi.org/10.1029/2008GC002235" target="_blank">https://doi.org/10.1029/2008GC002235</a>, 2009.
</mixed-citation></ref-html>
<ref-html id="bib1.bib111"><label>Shahbazi(2005)</label><mixed-citation>
Shahbazi, K.: An explicit expression for the penalty parameter of the interior
penalty method, J. Comput. Phys., 205, 401–407, 2005.
</mixed-citation></ref-html>
<ref-html id="bib1.bib112"><label>Shapero et al.(2021)Shapero, Badgeley, Hoffmann, and
Joughin</label><mixed-citation>
Shapero, D. R., Badgeley, J. A., Hoffman, A. O., and Joughin, I. R.: icepack: a new glacier flow modeling package in Python, version 1.0, Geosci. Model Dev., 14, 4593–4616, <a href="https://doi.org/10.5194/gmd-14-4593-2021" target="_blank">https://doi.org/10.5194/gmd-14-4593-2021</a>, 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib113"><label>Shih et al.(2021)Shih, Stadler, and Wechsung</label><mixed-citation>
Shih, Y., Stadler, G., and Wechsung, F.: Robust multigrid techniques for
augmented Lagrangian preconditioning of incompressible Stokes equations with
extreme viscosity variations, arXiv [preprint], <a href="https://arxiv.org/abs/2107.00820" target="_blank">arXiv:2107.00820</a>, 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib114"><label>Shipton et al.(2018)Shipton, Gibson, and Cotter</label><mixed-citation>
Shipton, J., Gibson, T., and Cotter, C.: Higher-order compatible finite element
schemes for the nonlinear rotating shallow water equations on the sphere, J. Comput. Phys.,
375, 1121–1137, <a href="https://doi.org/10.1016/j.jcp.2018.08.027" target="_blank">https://doi.org/10.1016/j.jcp.2018.08.027</a>, 2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib115"><label>Spiegelman et al.(2016)Spiegelman, May, and Wilson</label><mixed-citation>
Spiegelman, M., May, D. A., and Wilson, C. R.: On the solvability of
incompressible Stokes with viscoplastic rheologies in geodynamics,
Geochem.  Geophy. Geosy., 17, 2213–2238,
<a href="https://doi.org/10.1002/2015GC006228" target="_blank">https://doi.org/10.1002/2015GC006228</a>, 2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib116"><label>Stadler et al.(2010)Stadler, Gurnis, Burstedde, Wilcox, Alisic, and
Ghattas</label><mixed-citation>
Stadler, G., Gurnis, M., Burstedde, C., Wilcox, L. C., Alisic, L., and Ghattas,
O.: The dynamics of plate tectonics and mantle flow: from local to global
scales, Science, 329, 1033–1038, <a href="https://doi.org/10.1126/science.1191223" target="_blank">https://doi.org/10.1126/science.1191223</a>, 2010.
</mixed-citation></ref-html>
<ref-html id="bib1.bib117"><label>Stemmer et al.(2006)Stemmer, Harder, and Hansen</label><mixed-citation>
Stemmer, K., Harder, H., and Hansen, U.: A new method to simulate convection
with strongly temperature- and pressure-dependent viscosity in a spherical
shell: Applications to the Earth's mantle, Phys. Earth Planet. In., 157,
223–249, <a href="https://doi.org/10.1016/j.pepi.2006.04.007" target="_blank">https://doi.org/10.1016/j.pepi.2006.04.007</a>, 2006.
</mixed-citation></ref-html>
<ref-html id="bib1.bib118"><label>Styles et al.(2011)Styles, Davies, and Goes</label><mixed-citation>
Styles, E., Davies, D. R., and Goes, S.: Mapping spherical seismic into
physical structure: biases from 3-D phase-transition and thermal
boundary-layer heterogeneity, Geophys. J. Int., 184, 1371–1378,
<a href="https://doi.org/10.1111/j.1365-246X.2010.04914.x" target="_blank">https://doi.org/10.1111/j.1365-246X.2010.04914.x</a>, 2011.
</mixed-citation></ref-html>
<ref-html id="bib1.bib119"><label>Tackley(1996)</label><mixed-citation>
Tackley, P. J.: Effects of strongly variable viscosity on three–dimensional
compressible convection in planetary mantles, J. Geophys. Res., 101,
3311–3332, <a href="https://doi.org/10.1029/95JB03211" target="_blank">https://doi.org/10.1029/95JB03211</a>, 1996.
</mixed-citation></ref-html>
<ref-html id="bib1.bib120"><label>Tackley(2000)</label><mixed-citation>
Tackley, P. J.: Mantle convection and plate tectonics: towards and integrated
physical and chemical theory, Science, 288, 2002–2007, 2000.
</mixed-citation></ref-html>
<ref-html id="bib1.bib121"><label>Tackley(2008)</label><mixed-citation>
Tackley, P. J.: Modelling compressible mantle convection with large viscosity
contrasts in a three-dimensional spherical shell using the Yin-Yang grid,
Phys. Earth Planet. In., 171, 7–18, <a href="https://doi.org/10.1016/j.pepi.2008.08.005" target="_blank">https://doi.org/10.1016/j.pepi.2008.08.005</a>, 2008.
</mixed-citation></ref-html>
<ref-html id="bib1.bib122"><label>Tackley and Xie(2002)</label><mixed-citation>
Tackley, P. J. and Xie, S.: The thermo-chemical structure and evolution of
Earth's mantle: constraints and numerical models, Philos. T. R. Soc.
Lond. A., 360, 2593–2609, 2002.
</mixed-citation></ref-html>
<ref-html id="bib1.bib123"><label>Tackley et al.(1993)Tackley, Stevenson, Glatzmaier, and
Schubert</label><mixed-citation>
Tackley, P. J., Stevenson, D. J., Glatzmaier, G. A., and Schubert, G.: Effects
of an endothermic phase transition at 670&thinsp;km depth in a spherical model of
convection in the Earth's mantle, Nature, 361, 699–704,
<a href="https://doi.org/10.1038/361699a0" target="_blank">https://doi.org/10.1038/361699a0</a>, 1993.
</mixed-citation></ref-html>
<ref-html id="bib1.bib124"><label>Thieulot and Bangerth(2022)</label><mixed-citation>
Thieulot, C. and Bangerth, W.: On the choice of finite element for applications in geodynamics, Solid Earth, 13, 229–249, <a href="https://doi.org/10.5194/se-13-229-2022" target="_blank">https://doi.org/10.5194/se-13-229-2022</a>, 2022.
</mixed-citation></ref-html>
<ref-html id="bib1.bib125"><label>Torrance and Turcotte(1971)</label><mixed-citation>
Torrance, K. E. and Turcotte, D. L.: Thermal convection with large viscosity
variations, J. Fluid Mech., 47, 113–125, 1971.
</mixed-citation></ref-html>
<ref-html id="bib1.bib126"><label>Tosi et al.(2015)Tosi, Stein, Noack, Hüttig, Maierová,
Samuel, Davies, Wilson, Kramer, Thieulot, Glerum, Fraters, Spakman, Rozel,
and Tackley</label><mixed-citation>
Tosi, N., Stein, C., Noack, L., Hüttig, C., Maierová, P., Samuel, H.,
Davies, D. R., Wilson, C. R., Kramer, S. C., Thieulot, C., Glerum, A.,
Fraters, M., Spakman, W., Rozel, A., and Tackley, P. J.: A community
benchmark for viscoplastic thermal convection in a 2-D square box,
Geochem. Geophy. Geosy., 16, 2175–2196,
<a href="https://doi.org/10.1002/2015GC005807" target="_blank">https://doi.org/10.1002/2015GC005807</a>, 2015.
</mixed-citation></ref-html>
<ref-html id="bib1.bib127"><label>Trilinos Project Team()</label><mixed-citation>
Trilinos Project Team, T.: The Trilinos Project Website, <a href="https://trilinos.github.io" target="_blank"/>, last access: 22 May 2020.
</mixed-citation></ref-html>
<ref-html id="bib1.bib128"><label>Trompert and Hansen(1998)</label><mixed-citation>
Trompert, R. and Hansen, U.: Mantle convection simulations with rheologies that
generate plate-like behaviour, Nature, 395, 686–689, 1998.
</mixed-citation></ref-html>
<ref-html id="bib1.bib129"><label>van Keken(1997)</label><mixed-citation>
van Keken, P.: Evolution of starting mantle plumes: a comparison between
numerical and laboratory models, Earth Planet. Sc. Lett., 148, 1–11,
<a href="https://doi.org/10.1016/S0012-821X(97)00042-3" target="_blank">https://doi.org/10.1016/S0012-821X(97)00042-3</a>, 1997.
</mixed-citation></ref-html>
<ref-html id="bib1.bib130"><label>van Keken and Ballentine(1998)</label><mixed-citation>
van Keken, P. E. and Ballentine, C. J.: Whole–mantle versus layered mantle
convection and the role of a high–viscosity lower mantle in terrestrial
volatile evolution, Earth Planet. Sc. Lett., 156, 19–32, 1998.
</mixed-citation></ref-html>
<ref-html id="bib1.bib131"><label>Vanek et al.(1996)Vanek, Mandel, and Brezina</label><mixed-citation>
Vanek, P., Mandel, J., and Brezina, M.: Algebraic multigrid by smoothed
aggregation for second and fourth order elliptic problems, Computing, 56,
179–196, <a href="https://doi.org/10.1007/BF02238511" target="_blank">https://doi.org/10.1007/BF02238511</a>, 1996.
</mixed-citation></ref-html>
<ref-html id="bib1.bib132"><label>Vynnytska et al.(2013)Vynnytska, Rognes, and Clark</label><mixed-citation>
Vynnytska, L., Rognes, M. E., and Clark, S. R.: Benchmarking FEniCS for
mantle convection simulations, Compu. Geosci., 50, 95–105,
<a href="https://doi.org/10.1016/j.cageo.2012.05.012" target="_blank">https://doi.org/10.1016/j.cageo.2012.05.012</a>, 2013.
</mixed-citation></ref-html>
<ref-html id="bib1.bib133"><label>Wilson et al.(2014)Wilson, Spiegelman, van Keken, and
R.</label><mixed-citation>
Wilson, C. R., Spiegelman, M., van Keken, P. E., and R., H. B.: Fluid flow in
subduction zones: The role of solid rheology and compaction pressure, Earth
Planet. Sc. Lett., 401, 261–274, <a href="https://doi.org/10.1016/j.epsl.2014.05.052" target="_blank">https://doi.org/10.1016/j.epsl.2014.05.052</a>, 2014.
</mixed-citation></ref-html>
<ref-html id="bib1.bib134"><label>Wilson et al.(2017)Wilson, Spiegelman, and van Keken</label><mixed-citation>
Wilson, C. R., Spiegelman, M., and van Keken, P. E.: TerraFERMA: The
Transparent Finite Element Rapid Model Assembler for multiphysics problems in
Earth sciences, Geochem. Geophy. Geosy., 18, 769–810,
<a href="https://doi.org/10.1002/2016GC006702" target="_blank">https://doi.org/10.1002/2016GC006702</a>, 2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib135"><label>Wolstencroft et al.(2009)Wolstencroft, Davies, and
Davies</label><mixed-citation>
Wolstencroft, M., Davies, J. H., and Davies, D. R.: Nusselt-Rayleigh number
scaling for spherical shell Earth mantle simulation up to a Rayleigh
number of 10<sup>9</sup>, Phys. Earth Planet. In., 176, 132–141,
<a href="https://doi.org/10.1016/j.pepi.2009.05.002" target="_blank">https://doi.org/10.1016/j.pepi.2009.05.002</a>, 2009.

</mixed-citation></ref-html>
<ref-html id="bib1.bib136"><label>Yoshida and Kageyama(2004)</label><mixed-citation>
Yoshida, M. and Kageyama, A.: Application of the Yin-Yang grid to a thermal
convection of a Boussinesq fluid with infinite Prandtl number in a
three-dimensional spherical shell, Geophys. Res. Lett., 31, L12609,
<a href="https://doi.org/10.1029/2004GL019970" target="_blank">https://doi.org/10.1029/2004GL019970</a>, 2004.
</mixed-citation></ref-html>
<ref-html id="bib1.bib137"><label>Zhong et al.(2000)Zhong, Zuber, Moresi, and Gurnis</label><mixed-citation>
Zhong, S., Zuber, M. T., Moresi, L., and Gurnis, M.: Role of
temperature-dependent viscosity and surface plates in spherical shell models
of mantle convection, J. Geophys. Res., 105,  11063–11082,
<a href="https://doi.org/10.1029/2000JB900003" target="_blank">https://doi.org/10.1029/2000JB900003</a>, 2000.
</mixed-citation></ref-html>
<ref-html id="bib1.bib138"><label>Zhong et al.(2008)Zhong, McNamara, Tan, Moresi, and
Gurnis</label><mixed-citation>
Zhong, S., McNamara, A., Tan, E., Moresi, L., and Gurnis, M.: A benchmark
study on mantle convection in a 3-D spherical shell using CitcomS,
Geochem. Geophy. Geosy., 9, Q10017, <a href="https://doi.org/10.1029/2008GC002048" target="_blank">https://doi.org/10.1029/2008GC002048</a>, 2008.
</mixed-citation></ref-html>
<ref-html id="bib1.bib139"><label>Zienkiewicz et al.(2005)</label><mixed-citation>
Zienkiewicz, O. C.,  Taylor, R. L., and  Zhu, J. Z.:  The finite element method: its basis and fundamentals, Elsevier, ISBN 9780080472775, 2005.
</mixed-citation></ref-html>--></article>
