2.1 The Ethos of Nektar++
As with any research effort, one is required to decide on a set of guiding principles that will
drive the investigation. Similarly with a software development effort of this form, we spent
considerable time early on considering which aspects we wanted to be distinctive about
Nektar++ and also what guiding principles would be most suitable to support both
the goals and the boundaries of what we wanted to do. We did this for at least
two reasons: (1) We acknowledged then and now that there are various software
packages and open-source efforts that deal with finite element frameworks, and so we
wanted to be able to understand and express to people those things we thought
were distinctive to us – that is, our “selling points”. (2) We also acknowledged, from
our own experience on software projects, that if we did not set up some collection
of guiding principles for our work, that we would gravitate towards trying to be
“all things to all men", and in doing so be at odds with the first item. Below are a
list of the guiding principles, the “ethos”, of the Nektar++ software development
effort.
Principles:
The following are our three guiding principles for Nektar++ which respect (1) above:
- Efficiently: Nektar++ was to be a “true” high-order code. “True” is put in
quotations because we acknowledge that high-order means different things to
different communities. Based upon a review of the literature, we came to the
conclusion that part of our h-to-p philosophy should be that we accommodate
polynomial degrees ranging from zero (finite volumes) or one (traditional linear
finite elements) up to what is considered “spectral” (pseudospectral) orders of 16th
degree. As part of our early work [68], we established that in order to span this
range of polynomial degrees and attempt to maintain some level of computational
efficiency, we would need to develop order-aware algorithms: that is, we would need
to utilize different (equivalent) algorithms appropriate for a particular order. This
principle was the starting point of our h-to-p efficiently branding and continues to
be a driving principle of our work.
- Transparently: Nektar++ was to be agnostic as to what the “right” way to
discretize a partial differential equation (PDE). “Right” is put in quotations to
acknowledge that like the issue of polynomial order, there appear to be different
“camps” who hold very strong views as to which discretization method should
be used. Some might concede that continuous Galerkin methods are very natural
for elliptic and parabolic PDEs and then work very laboriously to shoehorn all
mixed-type PDEs (such as the incompressible Navier-Stokes equations) into this
form. This holds true (similarly) for finite volume and dG proponents with regards
to hyperbolic problems (and those systems that are dominated by hyperbolicity).
Our goal was to be a high-order finite element framework that allowed users
to experiment with continuous Galerkin (cG) and discontinuous Galerkin (dG)
methods. After our original developments, we incorporated Flux-Reconstruction
Methods (FR Methods) into our framework; this confirmed that generality of our
approach as our underlying library components merely needed new features added
to accommodate the FR perspective on dG methods. As stated earlier, this is in
part why we use the term spectral/hp as it allows us to capture all these various
methods (e.g., cG, dG and FR) under one common element-and-order terminology.
- Seamlessly: Nektar++ was to be a code that could run from the desktop
(or laptop) to exascale, seamlessly. It was our observation that many grand
challenge efforts target petascale and exascale computing, with the idea that in
the future what is done now on a supercomputer will be done on the desktop. The
supercomputer of today is in a rack within five years and on our desktop in ten
years. However, we also acknowledged that many of our end users were interested
in computing now. That is, following from their engineering tradition they had
an engineering or science problem to solve, and they wanted the ability to run on
machines ranging from their laptops to exascale as the problem demanded. Not
all problems fit on your laptop, and yet not all problems are exascale problems.
Like with our h-to-p efficiently approach, we wanted our algorithms and code
development to allow a range of choices in the hands of the engineer.
Based upon these principles, our long-term vision is a software framework that allows the
engineer the flexibility to make all these critical choices (elemental discretization, polynomial
order, discretization methodology, algorithms to employ, and architecture-specific details)
while at the same time having smart and adaptive defaults. That is, we want to accommodate
both the engineer that wants control over all the various knobs that must be set to
actualize a simulation run and the engineer that wants to remain at the high-level and
let the software system choose what is best in terms of discretization, polynomial
order, algorithm choice, etc. We want the flexibility to self tune, while targeting
auto-tuning.
The three items above denote the principles of our development efforts. We now present the
“guardrails”. By guardrails, we mean the guidelines we use to help steer us along towards our
goal as stated above. These are not meant to be absolutes necessarily, but are considerations
we often use to try to keep us on track in terms of respecting our three guiding principles
above.
Guardrails:
- We are principally concerned with advection-reaction-diffusion and conservation
law problems. There are many simulation codes that are deal with solid mechanics,
and we did not see ourselves as being a competitor with them. As such, we did not
initially construct our framework to inherently deal with H - div and H - curl
spaces (and their respective element types). Our perspective was to hold a system
of scalar fields and, as needed, constrain them to respect certain mathematical
properties.
- We rely heavily on the ability to do tensor-product-based quadrature. Although
our more recent additions to the Point and Basis information within our library
allows for unstructured quadrature, many of our algorithms are designed to try to
capitalize on tensor-product properties.
- As we said earlier, we have designed our code to run at a range of orders, from one
to sixteen. However, we acknowledge that for many simulation regimes, we often
do not run at the lowest and/or the highest orders. For many applications, the
sweet spot seems to be polynomials of degree four through eight. At the present
time, a reasonable amount of time and effort has been spent optimizing for this
range.
- The robustness of our testing is often dictated by the application areas that
have funded our code development. At the present time, our incompressible
Navier-Stokes solver is probably the most tested of our solvers, followed by our
ADR solver. We make every attempt to test our codes thoroughly; however we
benefit greatly from various users “stress-testing” our codes and providing feedback
on things we can improve (or better yet, suggesting coding solutions).