text:
\section{Introduction} \label{sec:introduction}
A structured numerical grid is generated
by the (numerical) coordinate transformation of a rectangular ``computational
domain'' to the ``physical domain'' of interest~\cite{Thompson, Grid, Liseikin}.
Compared to unstructured grids a structured grid allows for an easier and
computationally cheaper implementation of derivatives since the computational
domain is a tensor product grid (a rectangle).
Generally, the same numerical techniques as in a Cartesian
coordinate system can be used.
Still, a structured grid must fulfill certain qualities in order to be useful
for practical numerical computations.
Among others are smooth and nonoverlapping coordinate lines, boundary orthogonality
and a homogeneous distributions of cells across the domain.
The latter condition is important in advection schemes. Too small
cells deteriorate the CFL condition in explicit schemes and the
condition number of the discretization matrix in implicit schemes, while large
cells deteriorate the accuracy.
Boundary orthogonality is important in order to implement Neumann boundary
conditions.
As Reference~\cite{Thompson} pointed out it is
desirable for the grid to be at least near-orthogonal to the boundary. Although
it is possible to represent Neumann boundary conditions in a curvilinear grid, the
accuracy of the discretization deteriorates and the implementation is more involved
than in a boundary-orthogonal grid.

In the literature on grid generation it has been established that elliptic grids
are the ones that best fulfill these qualities~\cite{Thompson, Grid, Liseikin}.
These grids are generated by a coordinate transformation that fulfills
an elliptic equation.
However, the generation of these grids based on the algorithm proposed by Thompson, Thames and Mastin (TTM) is numerically involved~\cite{Thompson1977, Liseikin}.
A special class of elliptic grids is generated by conformal mappings.
The coordinates obey the Cauchy--Riemann differential equations
\begin{align}
\frac{\partial u}{\partial x} = \frac{\partial v }{\partial y} \quad
\frac{\partial u}{\partial y} = -\frac{\partial v }{\partial x}
\label{eq:CR}
\end{align}
They are orthogonal, smooth, and preserve the aspect ratio of the
cells from the computational into the physical space.
There are many methods to numerically construct a conformal mapping~\cite{Papamichael}, e.g. boundary integral element methods, however their implementation can be tricky.
Among further improvements to the original TTM method are grid adaption methods and
the monitor metric approach~\cite{Glasser2006, Vaseva2009, Liseikin}.
Both of these approaches modify the elliptic equation used
to construct the coordinate system to a more suitable form.
By choosing specific forms the distribution of grid cells is controlled, which
makes the coordinate transformation more flexible than conformal mappings.
The main numerical difficulty in these techniques is the solution of
the nonlinear inverted Beltrami equation.
This is required because a (not yet constructed) numerical grid is needed in order to
discretize and solve the elliptic equation directly. If the boundary lines
are e.g.~given by a parametric representation, this conundrum
cannot be easily solved.
In this contribution we show how this problem can be avoided if the
boundary lines of the physical domain are given by a two-dimensional
function.

One important application, where this is indeed the case, are tokamaks.
These are magnetic fusion devices that use nearly
axisymmetric magnetic fields to confine a plasma~\cite{Wesson}.
In a two-dimensional plane of
fixed toroidal angle the magnetic field-lines, in the idealized case, lie within so-called flux-surfaces.
These surfaces are in fact the isosurfaces of the poloidal magnetic flux $\psi(x,y)$ described by the Grad-Shafranov equation.
A typical numerical modelling scenario involves the study of plasma
dynamics between two flux-surfaces $\psi_0$ and $\psi_1$.
Structured and unstructured numerical grids have been proposed
for the numerical discretization of this region~\cite{hamada62, boozer80, boozer81, Grimm1983, cheng92, park08, Czarny2008, Ribeiro2010}.
Let us emphasize, however, that the algorithms developed are in no way
restricted to magnetic fusion applications. In particular, the monitor
metric approach gives sufficient flexibility to handle large classes
of problems. For example, in certain pollution models a system of
diffusion-advection-reaction equations have to be solved for a given
velocity field (the velocity field is determined by analytic modeling,
measurements, or computer simulation). In this case the stream
function corresponding to the velocity field takes on the role of
$\psi$~\cite{Oliver2012}.
A popular choice for tokamak magnetic fields are so-called flux or magnetic coordinates~\cite{haeseleer}, in which the magnetic flux $\psi$ or a function of it is the first coordinate.
One particular class of such coordinate systems is known as PEST coordinates \cite{Grimm1983}. In this case, the geometric toroidal angle \(\varphi\) is the third coordinate, while a poloidal angle-like coordinate is constructed implicitly by choosing the volume form
of the coordinate transformation.
Other choices of flux coordinates exist, where the geometric toroidal angle \(\varphi\) differs from the toroidal flux angle \(\varphi_f\).
For example, Boozer~\cite{boozer80,boozer81} and Hamada~\cite{hamada62} coordinates. In general, a flux aligned coordinate system is not orthogonal however.
Flux aligned grids are commonly constructed by
integrating the streamlines of the vector field tangential to the isosurfaces of $\psi$~\cite{haeseleer, scott_2001}.
Reference~\cite{Ribeiro2010} constructed a near-conformal coordinate system that
is aligned to the magnetic flux-surfaces in this way.
The coordinates are near-conformal in the sense that the grid-deformation is small.
Unfortunately, the coordinate lines are not orthogonal.

The previous examples show that it is possible to construct a
structured grid of a domain defined by the contour lines of a two-dimensional function $\psi(x,y)$ (the flux).
Now recall that this is exactly the requirement for the discretization
of an elliptic equation on this domain. The inverted Beltrami equation
in the TTM and related methods is no longer needed.

We therefore propose to construct an elliptic grid in three steps.
First, a flux aligned grid is constructed by one of the methods that have been
proposed in the literature.
Then in a second step a suitably chosen elliptic equation is transformed to,
discretized and solved in this coordinate system.
We investigate the simple Laplace equation, the
adapted equation and the
elliptic equation with monitor metric suggested by References~\cite{Liseikin, Glasser2006, Vaseva2009}.
Finally, we treat the solution of the elliptic
equation as a new flux function. We can therefore use an adapted version
of the algorithm in the first step to construct a second coordinate transformation
from the $\psi$-aligned coordinates to coordinates aligned to the solution of
the second step.
The final transformation then consists of the two consecutive coordinate
transformations from the first and the third step.

In Section~\ref{sec:geometry} we derive our algorithm by using methods
from differential geometry. We first explain the approach of streamline integration
by exemplarily constructing an orthogonal flux aligned grid.
Then we show how to
construct the conformal grid, the adapted grid and the grid using
a monitor metric with our new method.
In Section~\ref{sec:numerics}
we numerically show that with our algorithm the coordinate map and its derivatives can be computed efficiently and up to machine precision.
Furthermore, we plot example grids for a domain relevant in
magnetic confinement fusion,
which are suitable for edge turbulence simulations.
We compare the grids to
flux aligned grids and assess the quality of our grids with two different solutions
of an elliptic equation and the computation of maximal and minimal cell sizes.
We conclude in Section~\ref{sec:conclusion}.

\section{High precision elliptic grid generation} \label{sec:geometry}

Given is a function $\psi(x,y)$ in Cartesian coordinates.
We want to construct a grid on the region
bounded by the two lines
$\psi(x,y) = \psi_0$ and $\psi(x,y)=\psi_1$ with $\psi_0\neq\psi_1$.
The derivative of the function $\psi$ may not vanish within this region and on the boundary and
we further assume that the region is topologically a ring.
Note here that this excludes the description of domains with an X-point or O-point.
The numerical grid is described by a mapping of the discretization of the rectangular
computational domain $(u,v) \in [0,u_1]\times[0,2\pi]$ to the physical domain $(x,y)$. $u_1$ is an unknown, which the grid generation process has to provide.

\begin{figure}[htbp]
\centering
\includegraphics[trim = 0px 0px 0px 0px, clip, scale=1.0]{./drawing_magenta}
\caption{
  Sketch of the coordinate systems, coordinate lines and basis vector fields
  involved in our method.
}
\label{fig:sketch}
\end{figure}
As mentioned in the introduction and illustrated in Fig.~\ref{fig:sketch} the idea of our algorithm are two consecutive coordinate transformations constructed by streamline integration.
We denote the first transformation with $x(\zeta, \eta)$, $y(\zeta, \eta)$, where
the $\zeta$ coordinate is aligned with $\psi$ and $\eta$ is an angle-like coordinate. The solution of the
elliptic equation on this flux-aligned coordinate system is denoted with $\bar u(\zeta, \eta)$.
The second coordinate transformation is then denoted $\zeta(u,v)$, $\eta(u,v)$ with $u$ aligned to $\bar u$.

When deriving the algorithm we use basic methods and notational
conventions of differential geometry.
Here, we recommend the excellent Reference~\cite{Frankel} as an introduction to the topic.
We do so since in this approach the separate roles of the metric tensor,
the coordinate system and its base vector fields are very clear. This is
paramount for a concise description of our method.

In this Section we first show how the
basis vector fields can be integrated to construct coordinate lines
 with the example of orthogonal coordinates in Section~\ref{sec:orthogonal}. This follows
an introduction of some helpful quantities, our notation and streamlines
in Section~\ref{sec:preliminaries}.
In the next step we transform, discretize and solve an elliptic equation on the flux aligned
coordinate system.
The solution $\bar u(\zeta, \eta)$ then takes the role of a new flux function in the flux aligned coordinates.
We can therefore repeat the streamline integration method in the flux aligned
coordinate system in order to construct coordinate lines of the final $u,v$ coordinates.
We discuss three examples of this method.
In
Section~\ref{sec:conformal} we consider the simple Laplace and the Cauchy-Riemann equations~\eqref{eq:CR}
in order to construct conformal coordinates.
In Section~\ref{sec:adaption} we modifiy the elliptic equation to allow grid adaption, before
we introduce the monitor metric in Section~\ref{sec:metric}.
Finally, we present our algorithm in Section~\ref{sec:elliptic}.

\subsection{Preliminaries} \label{sec:preliminaries}
In a curvilinear
coordinate system $(\zeta,\eta)$ the components of the metric tensor and its inverse
take the form
\begin{align}
  \vec g(\zeta,\eta) = \begin{pmatrix}
    g_{\zeta\zeta} & g_{\zeta\eta}  \\
    g_{\zeta\eta} & g_{\eta\eta}
  \end{pmatrix}
  \quad
  \vec g^{-1}(\zeta,\eta) = \begin{pmatrix}
    g^{\zeta\zeta} & g^{\zeta\eta}  \\
    g^{\zeta\eta} & g^{\eta\eta}
  \end{pmatrix}
  \label{}
\end{align}
We denote $g = \det{\vec g} = g_{\zeta\zeta}g_{\eta\eta}-g_{\zeta\eta}^2$.
For Cartesian coordinates $(x,y)$ the elements of the inverse metric tensor are
transformed by
\begin{subequations}
\begin{align}
  g^{\zeta\zeta} &=  \zeta_x^2+\zeta_y^2\\
  g^{\zeta\eta} &=  \zeta_x \eta_x+\zeta_y \eta_y\\
  g^{\eta\eta} &=  \eta_x^2+\eta_y^2
  \label{}
\end{align}
\end{subequations}
since $g^{xx}=g^{yy}=1$ and $g^{xy}=0$.
Given $\zeta(x,y)$, $\eta(x,y)$ and its inverse $x(\zeta,\eta)$, $y(\zeta,\eta)$ recall that their Jacobian matrices are related by
\begin{align}
  \begin{pmatrix}
    x_\zeta & x_\eta \\
    y_\zeta & y_\eta
  \end{pmatrix} \bigg\rvert_{\zeta(x,y),\eta(x,y)}
  =
  \frac{1}{\zeta_x\eta_y - \zeta_y\eta_x }\begin{pmatrix}
    \eta_y & -\zeta_y \\
    -\eta_x & \zeta_x
  \end{pmatrix}\bigg\rvert_{x,y}
  \label{eq:inverse}
\end{align}
With the rules of tensor transformation it is easy to prove that the element of the volume form $\sqrt{g}$ is related to the Jacobian via
\begin{align}

\sqrt{g} = (x_\zeta y_\eta-y_\zeta x_\eta) = (\eta_y\zeta_x -\eta_x\zeta_y)^{-1}
  \label{eq:vol}
\end{align}
The components of the gradient operator and the divergence in an arbitrary coordinate
system read
\begin{subequations}
\begin{align}
  \left( \nabla f \right)^i &= g^{ij}\partial_j f \\
  \nabla \cdot \vec A &= \frac{1}{\sqrt g}\partial_i \left( \sqrt{g} A^i  \right),
\end{align}
  \label{eq:arbitrary}
\end{subequations}
where we sum over repeated indices $i,j\in\{\zeta,\eta\}$ and define $\partial_\zeta \equiv \partial/\partial \zeta$, $\partial_\eta \equiv \partial/\partial \eta$.
Finally, we introduce the
geometrical poloidal angle
\begin{align}
  \theta (x,y) = \begin{cases}
    +\arccos\left( \frac{x-x_0}{\sqrt{(x-x_0)^2 + (y-y_0)^2}} \right) \text{ for } y\geq y_0 \\
    -\arccos\left( \frac{x-x_0}{\sqrt{(x-x_0)^2 + (y-y_0)^2}} \right) \text{ for } y< y_0
  \end{cases}
  \label{eq:deftheta}
\end{align}
such that the differential 1-form
\begin{align}
  \d \theta =
    -\frac{y-y_0}{(x-x_0)^2+(y-y_0)^2} \d x
    +\frac{x-x_0}{(x-x_0)^2+(y-y_0)^2} \d y,
  \label{eq:theta}
\end{align}
where $(x_0,y_0)$ is any point inside the region bounded by $\psi_0$.

Streamline integration is the central part of our algorithm. Recall that
given a vector field $v(x,y)=v^x(x,y)\partial_x + v^y(x,y)\partial_y$ its streamlines are given by the equation
\begin{subequations}
\begin{align}
  \frac{\d x}{\d t } = v^x(x,y)|_{x(t), y(t)} \\
  \frac{\d y}{\d t } = v^y(x,y)|_{x(t), y(t)}
\end{align}
\label{eq:streamlines}
\end{subequations}
where $t$ is a parameter. Recall here that in differential geometry
the directional derivatives $\partial_x$ and
$\partial_y$ are the base vector fields of the coordinate system\footnote{
  Some textbooks (e.g.~\cite{haeseleer}) introduce the notation $\vec e_i := \partial \vec x /\partial x^i$
  and $\vec e^i := \nabla x^i$.
  While this formulation is suitable in many situations we refrain from
  using it since it mixes the metric into the basis vectors through the use of
  the gradient (cf. Eq.~\eqref{eq:arbitrary}), which is unpractical for our purposes.}.
Now recall that if we have a function $f(x,y)$
such that $f(x(t), y(t))$ is a one-to-one map from $t$ to $f$ we can re-parameterize
Eq.~\eqref{eq:streamlines} by
\begin{subequations}
\begin{align}
  \frac{\d x}{\d f } = \frac{\d x/\d t|_{t(f)}}{\d f/\d t|_{t(f)}} =
  \frac{v^x(x,y) }{ (v^x\partial_xf + v^y\partial_yf)(x,y) }\bigg |_{x(f), y(f)}\\
  \frac{\d y}{\d f } = \frac{\d y/\d t|_{t(f)}}{\d f/\d t|_{t(f)}} =
  \frac{v^y(x,y) }{ (v^x\partial_xf + v^y\partial_yf)(x,y) }\bigg |_{x(f), y(f)}
\end{align}
\label{eq:reparameter}
\end{subequations}
Furthermore, the derivative of any function $g(x,y)$ along the streamlines of $v$
parameterized by $f$ reads
\begin{align}
  \frac{\d g}{\d f }\bigg |_{x(f),y(f)} =
  \frac{(v^x\partial_x g + v^y\partial_y g)(x,y) }{ (v^x\partial_xf + v^y\partial_yf)(x,y) }\bigg |_{x(f),y(f)}
  \label{}
\end{align}

Figuratively, in any coordinate system $(\zeta,\eta)$ the 1-forms $\d \zeta$ and $\d \eta$ (the contravariant basis) are visualized by the lines (surfaces in higher dimensions)
of constant $\zeta$ and $\eta$.
At the same time the streamlines of the vector fields $\partial_\zeta$ and $\partial_\eta$ (the covariant basis)
give the coordinate lines of $\zeta$ and $\eta$ (cf. Fig.~\ref{fig:sketch}).
For example, if we hold $\eta$ constant and vary $\zeta$, we go along a streamline of
$\partial_\zeta$. This implies that in two dimensions $\d \eta$ and $\partial_\zeta$
trace the same line. The vector fields $\nabla \zeta$ and $\nabla \eta$ are associated to
$\d \zeta$ and $\d \eta$ through the metric tensor by Eq.~\eqref{eq:arbitrary} and are the vector fields that
are everywhere perpendicular to the lines of constant $\zeta$ and $\eta$, respectively.
It is important to realize that in general curvilinear coordinates the vector
fields $\nabla \zeta$ and $\nabla \eta$ point in
different directions than $\partial_\zeta$ and $\partial_\eta$.
The central point in our algorithm is the realization that once we can
express $\partial_\zeta$ and $\partial_\eta$ in terms of $\partial_x$ and
$\partial_y$ we can immediately construct the coordinate transformation
by integrating
streamlines of $\partial_\zeta$ and $\partial_\eta$ using Eq.~\eqref{eq:streamlines}. This
holds true even if $(x,y)$ were curvilinear coordinates. The components of the
one-forms $\d \zeta$ and $\d\eta$ in terms of $\d x$ and $\d y$ form
the elements of the Jacobian matrix of the transformation. These
are also necessary in order to transform any tensor (including the metric)
from the old to the new coordinate system.

\subsection{Orthogonal coordinates} \label{sec:orthogonal}
In general, orthogonal coordinates $\zeta, \eta$ with $\zeta$ aligned to $\psi$ are described by
\begin{subequations}
\begin{align}
  \d \zeta & = \zeta_x\d x +\zeta_y\d y =  f(\psi)(\psi_x \d x + \psi_y \d y) \\
  \d \eta  & = \eta_x \d x + \eta_y \d y = h(x,y) ( -\psi_y \d x + \psi_x \d y)
\end{align}
  \label{eq:orthogonal}
\end{subequations}
With Eq.~\eqref{eq:orthogonal} we have $g^{\zeta\eta} = \zeta_x\eta_x + \zeta_y\eta_y = 0$,
$g^{\zeta\zeta} = (\nabla\psi)^2 f^2$, $g^{\eta\eta} = (\nabla\psi)^2h^2$ and $\sqrt{g}^{\,-1} = (\nabla\psi)^2 h f$.
From Eq.~\eqref{eq:inverse} we directly see that the basis vector fields are
\begin{subequations}
\begin{align}
  \partial_\zeta&= x_\zeta\partial_x + y_\zeta\partial_y = \frac{1}{(\nabla\psi)^2f} (\psi_x \partial_x + \psi_y\partial_y) \\
  \partial_\eta &=  x_\eta\partial_x + y_\eta\partial_y =  \frac{1}{(\nabla\psi)^2h} (-\psi_y \partial_x + \psi_x\partial_y)
\label{eq:orthogonal_linesb}
\end{align}
\label{eq:orthogonal_lines}
\end{subequations}
i.e. $\partial_\zeta$ points into the direction of the gradient of $\psi$ and $\partial_\eta$ into the direction of constant $\psi=\text{const}$ surfaces.
Now, the coordinate system is defined up to the functions $f(\psi)$ and $h(x,y)$.
Note that $f$ must be a function of $\psi$ only since the restriction $\d(\d \zeta)=0$ must hold.
Furthermore, $f(\psi) = \d\zeta/ \d\psi \neq 0 $ is in principle an arbitrary function, yet we choose $f(\psi) = f_0 = \text{const}$.
With this choice we directly get
\begin{align}
  \zeta(x,y) = f_0(\psi(x,y)-\psi_0)
  \label{eq:zeta}
\end{align}
Note that $\zeta_0=0$ and $\zeta_1=f_0(\psi_1-\psi_0)$.
The up to now undefined function $h(x,y)$ is not arbitrary since $\d(\d \eta) = 0$ must hold. This is the requirement that $\d \eta$ must be
a closed form in order for the potential $\eta$ to exist.
We can express this as
\begin{align}
  (\psi_x\partial_x + \psi_y\partial_y) h = f(\nabla\psi)^2 \partial_\zeta h= -h\Delta \psi
  \label{eq:hequation}
\end{align}
where $\Delta \psi = \psi_{xx} + \psi_{yy}$ is the two-dimensional Laplacian.
Let us remark here that Eq.~\eqref{eq:hequation} can be written as $\nabla\cdot\left( h\nabla\psi \right)=0$, which makes the orthogonal grid an elliptic grid
with adaption function $h$ as becomes evident later.
In order to integrate this equation we need an initial condition for $h$.
We choose to first discretize the line given by $\psi(x,y) = \psi_0$.

As already mentioned $\partial_\eta$ is the vector field the streamlines of which give the
coordinate lines for $\eta$. We choose $h(x,y) = \text{const}$ on $\psi_0$. To this end
we parameterize the coordinate line by $\theta$ (cf. Eq.~\eqref{eq:reparameter})
\begin{subequations}
\begin{align}
  \left . \frac{\d x}{\d \theta}\right|_{\zeta=0}=\frac{x_\eta}{\theta_\eta} = \frac{-\psi_y}{\psi_x\theta_y - \psi_y \theta_x}\\
  \left . \frac{\d y}{\d \theta}\right|_{\zeta=0}=\frac{y_\eta}{\theta_\eta} = \frac{\psi_x}{\psi_x\theta_y - \psi_y \theta_x}\\
  \left . \frac{\d \eta}{\d \theta}\right|_{\zeta=0}=\frac{1}{\theta_\eta} = \frac{(\nabla\psi)^2h(\psi_0)}{\psi_x\theta_y - \psi_y \theta_x}
\end{align}
  \label{eq:etaline}
\end{subequations}
Let us define $h(\psi_0)$ such that $\eta \in [0,2\pi]$, that is,
\[ 2\pi = \oint_{\psi=\psi_0}\d \eta = \oint_0^{2\pi} \frac{\d \eta}{\d\theta}\bigg|_{\zeta=0}\d \theta \nonumber \]
  or
\begin{align}
  f_0 := h(\psi_0) = \frac{2\pi}{\int_0^{2\pi}\d\theta \frac{(\nabla\psi)^2}{\psi_x\theta_y - \psi_y \theta_x}}
  \label{eq:definef}
\end{align}
Here, we also fixed the constant $f_0$ such that our coordinate system $\zeta, \eta$ fulfills the Cauchy--Riemann condition on the boundary line $\psi_0$.
As initial point for the integration of Eq.~\eqref{eq:etaline} we can use any point with $\psi(x,y) = \psi_0$.
We then use $h(\psi_0)$ on the flux-surface $\psi_0$ as initial condition for the integration
of Eq.~\eqref{eq:hequation}.

We obtain coordinate lines by integrating the vector fields $\partial_\zeta$ and $\partial_\eta$ given in \eqref{eq:orthogonal_lines}. We start the construction by integrating $\partial_\eta$ for $\psi = \psi_0$, i.e. $\zeta=0$. This can be done since $h|_{\psi_0}$ is known.
The obtained points serve as starting points for the integration of $\partial_\zeta = f_0^{-1} \partial_\psi$.
In order to get $h$ we simply integrate Eq.~\eqref{eq:hequation}
\begin{subequations}
\begin{align}
    \left .\frac{\d x}{\d \zeta}\right |_{\eta=\text{const}} &= \frac{\psi_x}{f_0(\nabla\psi)^2}\\
    \left .\frac{\d y}{\d \zeta}\right|_{\eta=\text{const}} &= \frac{\psi_y}{f_0(\nabla\psi)^2}\\

    \left .\frac{\d h}{\d \zeta}\right|_{\eta=\text{const}} &= - \frac{\Delta \psi}{f_0(\nabla\psi)^2}

\end{align}
  \label{eq:etacoordinates}
\end{subequations}
Note that if $\Delta\psi=0$, we directly get a conformal grid with this algorithm. This can be seen as then $h(\zeta,\eta) = f_0$. In~\ref{app:conf-field}
we briefly study the class of functions $\psi$ that are solutions of the Grad--Shafranov equation and satisfy $\Delta \psi=0$. This, however, is not true in general.

Let us further remark on the sign of $f_0$. It is our goal to construct a right handed
coordinate system and to have $\zeta_1>\zeta_0=0$.
The curves of constant $\theta$ surround $x_0, y_0$ in a mathematically positive direction.
That means that Eq.~\eqref{eq:definef} implies that $f_0>0$ if $\nabla \psi$ points away from $x_0, y_0$. If this is not the case, we obtain $f_0 < 0$.
On the other hand if $\zeta$ should increase from $\psi_0$ to $\psi_1$, we
need $f_0 <0$ for $\psi_1<\psi_0$ and $f_0>0$ for $\psi_1>\psi_0$.
We thus simply take the absolute value of Eq.~\eqref{eq:definef} and multiply
by $-1$ if $\psi_1<\psi_0$.
For ease of notation we do so also in the following without further notice.

Let us finally summarize the grid generation in the following algorithm; we
assume that the $\zeta$ space is discretized by a list of
not necessarily equidistant values $\zeta_i$ with $i = 0,1,\dots N_\zeta-1$
and $\eta$ is discretized by a list of $\eta_j$ with $j = 0,1,\dots N_\eta-1$:
\begin{enumerate}
  \item Find an arbitrary point $(x,y)$ with $\psi(x,y) = \psi_0$
    and a point $x_0, y_0$ within the region bound by $\psi(x,y) = \psi_0$ for the definition of $\theta$ in Eq.~\eqref{eq:deftheta}
  \item Integrate Eq.~\eqref{eq:etaline} with $h=1$ over $\Theta=[0,2\pi]$ and use Eq.~\eqref{eq:definef} to compute $f \equiv f_0$ and $h(\psi_0)$.
    Use any convenient method for the integration of ordinary differential equations.
  \item Integrate one streamline of Eq.~\eqref{eq:orthogonal_linesb} with $h=f_0$
    from $\eta = 0..\eta_j$ for all $j$.
    The result is a list of $N_\eta$ coordinates $x_j, y_j$ on the $\psi_0$ surface.
  \item Using this list as starting values integrate Eq.~\eqref{eq:etacoordinates}
    from $\zeta=0\dots\zeta_i$ for all $i$. This gives the map $x(\zeta_i, \eta_j), y(\zeta_i, \eta_j)$ for all $i$ and $j$.
  \item Last, using the resulting list of coordinates and
    Eq.~\eqref{eq:orthogonal} evaluate the derivatives
    $\zeta_x(\zeta_i,\eta_j)$, $\zeta_y(\zeta_i, \eta_j)$, $\eta_x(\zeta_i,\eta_j)$, and $\eta_y(\zeta_i, \eta_j)$ for all $i$ and $j$.
\end{enumerate}

\subsection{Conformal coordinates} \label{sec:conformal}
A conformal mapping $u(x,y), v(x,y)$ has to satisfy the Cauchy--Riemann equations given in Eq.~\eqref{eq:CR}.
A direct consequence is that $u$ and $v$ are harmonic functions
\begin{align}
  \Delta u = \Delta v = 0
  \label{eq:harmonic}
\end{align}
Here, $\Delta=\nabla^2$ is the two-dimensional Laplacian with the divergence
and gradient operators defined in~\eqref{eq:arbitrary}.
First, we note that Eq.~\eqref{eq:harmonic} holds in every coordinate system.
Let us assume that we have constructed flux aligned  coordinates $(\zeta, \eta)$. These can be, but not necessarily have to be,
the orthogonal coordinates introduced in the last section.
Now, in order to construct conformal coordinates $u$, $v$ we first define
\begin{align}
u(\zeta,\eta):=c_0(\bar u(\zeta,\eta)-\psi_0)
  \label{eq:ubar}
\end{align}
and thus
\begin{align}

  \Delta \bar u(\zeta,\eta) = 0

  \label{eq:ubar_harmonic}
\end{align}
where $\bar u( 0, \eta) = \psi_0$ and $\bar u( \zeta_1, \eta) =\psi_1$ fulfills Dirichlet boundary conditions in $\zeta$.
In $\eta$ we have periodic boundary conditions.

Note the analogy between Eq.~\eqref{eq:ubar} and Eq.~\eqref{eq:zeta}. Now, $\bar u$ is
equal to $\psi$ at the boundaries and its Laplacian vanishes in between.
In fact, $\bar u$ takes the role of $\psi$ in the following coordinate
transformation.
We introduce $c_0$ as a normalization constant with the same role as $f_0$ in the orthogonal coordinate transformation.
Having $\bar u(\zeta, \eta)$,
our idea is to construct the basis one-forms $\d u$ and $\d v$  in terms
of $\d \zeta$ and $\d \eta$ by transforming the Cauchy-Riemann equations to the
$\zeta, \eta$ coordinate system. Analogues to the algorithm in Section~\ref{sec:orthogonal} we can then construct the basis vector fields $\partial_u$ and $\partial_v$, appropriately choose a normalization and then use streamline
integration in the $\zeta, \eta$ coordinate system to construct the coordinates.
From the basis one-forms $\d u$ and $\d v$ we get the elements of the Jacobian
matrix of the transformation.
Before we do this in detail however, let us first discuss some alternative elliptic
equations to the simple Eq.~\eqref{eq:harmonic}.

\subsection{Grid adaption} \label{sec:adaption}
Although the conformal grid is advantageous for elliptic equations (due to the vanishing metric
coefficients) the cell distribution is not very flexible; once the boundary is set
the conformal map is unique. We therefore have little control over the
distribution of cells.
We can use grid adaption techniques to overcome this restriction.
The idea is to modify the elliptic equations that $u$ and $v$ have
to fulfill. That is, we choose
\begin{align}
\nabla\cdot\left( \frac{\nabla u}{w}\right) = \nabla\cdot\left( w \nabla v\right) = 0
\label{eq:adaption}
\end{align}
where $w$ is an appropriately chosen weight function. The
cell size will be small in regions where $w$ is large and spread out in regions
where $w$ is small.
The Cauchy--Riemann equations~\eqref{eq:CR} are changed accordingly to
\begin{align}
v_x = -\frac{u_y}{w}\quad v_y = \frac{u_x}{w}
\label{eq:CR_adaption}
\end{align}
Let us remark here that it is straightforward to implement the weight function in the orthogonal grid generation.
In Section~\ref{sec:orthogonal} we simply replace the function $h$ by $h/w$.
Then we have
\begin{subequations}
\begin{align}
\partial_\zeta &= \frac{1}{f_0(\nabla\psi)^2} (\psi_x\partial_x + \psi_y \partial_y)\\
\partial_\eta &= \frac{w}{h(\nabla\psi)^2} (-\psi_y\partial_x + \psi_x \partial_y)
\end{align}
\end{subequations}
and $\nabla \psi\cdot \nabla (h/w) = -h/w \Delta\psi$.
A suitable choice for $w$ is
\begin{align}
w = |\nabla\psi|
\label{eq:weight_adaption}
\end{align}
as then the angle-like coordinate $\eta$ becomes the arc length on the $\psi_0$ line.

\subsection{Monitor metric and the heat conduction tensor} \label{sec:metric}
We follow Reference~\cite{Liseikin, Glasser2006, Vaseva2009} and replace the canonical metric tensor $\vec g$ by
a specifically tailored tensor $\vec G$ that takes the form
\begin{align}
\vec G(x,y) = \vec T \vec T + k^2\vec N \vec N + \varepsilon(x,y)\vec I
\label{eq:metric}
\end{align}
with $\vec T = (-\psi_y, \psi_x)$ and $\vec N = -(\psi_x, \psi_y)$.
The vector $\vec T$ is tangential to the contour lines of $\psi$ while $\vec N$ is
normal to it.
We have
\begin{align}
  \sqrt{G} = \left[(\varepsilon+k^2(\psi_x^2+\psi_y^2))(\varepsilon+(\psi_x^2+\psi_y^2))\right]^{-1/2}
  \label{}
\end{align}
where $k<1$ is a constant and $\varepsilon$ is a function that is nonzero in the neighborhood
of singularities, i.e.~where $\nabla \psi(x,y)=0$.
In our work we choose $k=0.1$ and $\varepsilon(x,y)\equiv\varepsilon =0.001$.
Note that the scalar product induced by $\vec G$ conserves perpendicularity
with respect to $\vec T$, i.e.~if
and only if
 any vector $\vec v \perp \vec T$ in the canonical metric, then it is also perpendicular to $\vec T$ in $\vec G$.
In our application this is important at the boundary.\\
Now, we consider the elliptic equation
\begin{align}
  \nabla\cdot(\sqrt{G}\vec G \nabla u) = 0\nonumber\\
  \partial_x(\sqrt{G} (G^{xx}\partial_x u + G^{xy}\partial_y u )) + \partial_y(\sqrt{G}(G^{yx}\partial_x u + G^{yy}\partial_y u )) = 0
  \label{eq:elliptic}
\end{align}
with Dirichlet boundary conditions.
The resulting grid coordinate $u$ is almost perfectly aligned in regions
far away from singularities and breaks the alignment in regions where $|\nabla\psi|$ is small or vanishes.

We now take a slightly more general approach and rewrite Eq.~\eqref{eq:elliptic}
\begin{align}
  \nabla\cdot(\vec \chi \nabla u) = 0
  \label{eq:elliptic_mod}
\end{align}
where $\chi(x,y)$ is a symmetric positive-definite contravariant tensor.
Then the conformal grid from Section~\ref{sec:conformal}, the grid adaption from Section~\ref{sec:adaption} as
well as the monitor metric can be considered special cases.
The grid adaption is recovered by setting $\vec \chi = 1/w\vec I$,
while the monitor metric is simply $\vec \chi = \sqrt{G}\vec G$.
The true conformal case is, of course, recovered by setting $\vec \chi = \vec I$.

This allows us to provide a commonly known physical interpretation of Eq.~\eqref{eq:elliptic_mod}.
If $u$ is a temperature, then the Dirichlet boundary condition
fixes a temperature at the boundary of our domain. The tensor $\vec \chi(x,y)$ is
then the anisotropic heat conduction tensor and the coordinate lines for $u$ are
the isothermal lines of the steady state solution to the heat diffusion problem.
This interpretation allows us to intuitively estimate how the
coordinate lines look like when a specific $\vec\chi$ is chosen.
In the case of grid adaption, if the weight function is large, the heat conduction
is low resulting in small temperature gradients and thus closely spaced grid cells.
On the other hand, let us reconsider Eq.~\eqref{eq:metric} for the case $\varepsilon=0$.
Then we can write
\begin{align}
\vec \chi = \frac{1}{k}\hat t\hat t + k \hat n\hat n
= \chi_\parallel \hat t \hat t + \chi_\perp \hat n \hat n
  \label{eq:heat_conduction}
\end{align}
which for $k<1$ simply means that the heat conduction parallel to the magnetic field
is far stronger than perpendicular to it, which is in fact the case in an actual
fusion reactor.
The coordinate lines will thus tend to align with the magnetic flux
surfaces with the degree of alignment given by $k$ resulting
in an almost aligned grid.
In the limit of vanishing $k$ the alignment should be perfect.
If $|\nabla\psi|$ vanishes, the tensor~\eqref{eq:metric} reduces to $\vec \chi = \vec I$.

\subsection{The elliptic grids} \label{sec:elliptic}
Suppose that we have constructed a boundary aligned grid $(\zeta,\eta)$, which
may but not necessarily has to be the orthogonal grid from Section~\ref{sec:orthogonal}.
Now, we solve the general elliptic equation
\begin{align}
 \nabla\cdot(\vec \chi \nabla \bar u) = \partial_i(\sqrt{g} \chi^{ij}\partial_j \bar u) = 0
  \label{eq:general_elliptic}
\end{align}
in the transformed coordinate system with boundary conditions $\bar u|_{\partial\Omega}=\psi$. We set $u=c_0(\bar u -\psi_0)$. This means that we have to
transform the conduction tensor $\chi$ from Cartesian to flux coordinates,
which is done by the well known rules of tensor transformation
\begin{subequations}
\begin{align}
  \chi^{\zeta\zeta}(\zeta, \eta) &= (\zeta_x\zeta_x \chi^{xx} + 2\zeta_x\zeta_y\chi^{xy} + \zeta_y\zeta_y \chi^{yy})|_{x(\zeta,\eta), y(\zeta,\eta)}\\
  \chi^{\zeta\eta}(\zeta, \eta) &= (\zeta_x\eta_x \chi^{xx} + (\zeta_x\eta_y + \eta_x\zeta_y)\chi^{xy} + \zeta_y\eta_y \chi^{yy})|_{x(\zeta,\eta), y(\zeta,\eta)}\\
  \chi^{\eta\eta} (\zeta, \eta) &= (\eta_x\eta_x \chi^{xx} + 2\eta_x\eta_y\chi^{xy} + \eta_y\eta_y \chi^{yy}))|_{x(\zeta,\eta), y(\zeta,\eta)}
\end{align}
\label{eq:transformationChi}
\end{subequations}
The equivalent of the Cauchy--Riemann equations in this formulation reads
\begin{subequations}
\begin{align}
  v_\zeta = -\sqrt{g}(\chi^{\eta\zeta}u_\zeta + \chi^{\eta\eta}u_\eta)\\
  v_\eta = +\sqrt{g}(\chi^{\zeta\zeta}u_\zeta + \chi^{\zeta\eta}u_\eta)
\end{align}
  \label{eq:hodge_dual}
\end{subequations}
These are constructed such that
 $\nabla\cdot((\vec \chi/ \det \chi) \nabla v) = 0$.
The interested reader might notice that Eq.~\eqref{eq:hodge_dual} just
defines the components of the Hodge dual $\d v = \star\d u$
if $\chi$  is interpreted as a metric.
We note that these equations are now valid for any grid that
we use to solve Eq.~\eqref{eq:general_elliptic}. If we find a boundary
aligned grid analytically, we can start the grid construction
directly with the solution of Eq.~\eqref{eq:general_elliptic}
and then proceed with the conformal grid generation.

The relevant equations for the streamline integration now read
\begin{subequations}
\begin{align}
    \d u &= c_0(\bar u_\zeta\d \zeta + \bar u_\eta \d \eta) \\
    \d v &= c_0\sqrt{g}(-(\chi^{\eta\zeta}\bar u_\zeta + \chi^{\eta\eta}\bar u_\eta)\d \zeta + (\chi^{\zeta\zeta}\bar u_\zeta + \chi^{\zeta\eta}\bar u_\eta)\d \eta)
\end{align}
\label{eq:contravariant_monitor}
\end{subequations}
which just means that $v$
is orthogonal to $u$ in the scalar product
generated by the symmetric tensor $\vec \chi$, which we denote by $\langle . , .\rangle$.
We have
$J=c_0^2 \sqrt{g} \langle \nabla \bar u,\nabla \bar u \rangle
  := c_0^2\sqrt{g} (\bar u_\zeta^2\chi^{\zeta\zeta} + 2 \bar u_\zeta \bar u_\eta \chi^{\zeta\eta} + \bar u_\eta^2\chi^{\eta\eta})$
and
\begin{subequations}
\begin{align}
  \partial_u &= \frac{1}{c_0\langle\nabla \bar u,\nabla \bar u\rangle}
        (\chi^{\zeta\zeta}\bar u_\zeta + \chi^{\zeta\eta}\bar u_\eta)\partial_\zeta +
        (\chi^{\eta\zeta}\bar u_\zeta + \chi^{\eta\eta}\bar u_\eta)\partial_\eta\label{eq:basis_monitora}\\
  \partial_v &= \frac{1}{c_0\sqrt{g}\langle\nabla \bar u,\nabla \bar u\rangle}
          (-\bar u_\eta \partial_\zeta + \bar u_\zeta\partial_\eta)
  \label{eq:basis_monitorb}
\end{align}
\label{eq:basis_monitor}
\end{subequations}
As for the orthogonal coordinates we have to integrate these two vector fields to construct our coordinates.
We begin with the integration of $\partial_v$ along the $\zeta=0$ line.
It is important to note that $\bar u_\eta|_{\zeta=0} = 0$ and thus
\begin{align}
  \eta_v(0, \eta) = \left( c_0\sqrt{g}\bar u_\zeta \chi^{\zeta\zeta} \right)|_{\zeta= 0, \eta}
  \label{eq:normalize}
\end{align}
We can use Eq.~\eqref{eq:normalize} to define $c_0$ such that $v\in[0,2\pi]$.
In order to do so we simply integrate
\begin{align}
  v_1 = \int_0^{2\pi} \left .\frac{\d v}{\d \eta}\right|_{\zeta=0} \d \eta = \int_0^{2\pi} \frac{1}{\eta_v}\d \eta = c_0 \int_0^{2\pi} \sqrt{g}\chi^{\zeta\zeta}\bar u_\zeta(0,\eta) \d \eta := 2\pi
  \label{eq:computec0}
\end{align}
 with $v_0 = 0$ and choose $c_0$ such that $v_1=2\pi$. This is the analogues
 equation to Eq.~\eqref{eq:definef}, with the difference that we can integrate
 Eq.~\eqref{eq:computec0} directly using numerical quadrature.
Having done this we integrate, analog to Section~\ref{sec:orthogonal},
$\partial_v $ on $\zeta=0$ to get starting points for the integration of $\partial_u$
from $\bar u_0 = 0$ to $\bar u_1= c_0 \zeta_1$.
Note, that we can compute the components of $\d u$ and $\d v$ in terms of $\d x$ and $\d y$ by using the transformation
\begin{subequations}
\begin{align}
  u_x(\zeta, \eta)  &= u_\zeta \zeta_x + u_\eta\eta_x,\ u_y(\zeta, \eta) = u_\zeta \zeta_y + u_\eta\eta_y\\
  v_x(\zeta, \eta)  &= v_\zeta \zeta_x + v_\eta\eta_x,\ v_y(\zeta, \eta) = v_\zeta \zeta_y + v_\eta\eta_y
\end{align}
  \label{eq:chain_rule}
\end{subequations}
as soon as the constant $c_0$ becomes available.

Note that the resulting grid will, in general, not be orthogonal
in the Euclidean metric. However, for all the cases we discuss
in this paper, the grid is orthogonal at the boundary.

The final algorithm now reads, assuming that $u$ is discretized
by not necessarily equidistant points $u_i$ for $i=0,1,\dots N_u-1$ and
$v$ by $v_j$ with $j=0,1,\dots N_v-1$ and that $x(\zeta,\eta)$, $y(\zeta, \eta)$
as well as the components of the Jacobian $\zeta_x(\zeta,\eta)$, $\zeta_y(\zeta,\eta)$, $\eta_x(\zeta,\eta)$ and $\eta_y(\zeta,\eta)$ are available from the first coordinate transformation (e.g. Section~\ref{sec:orthogonal}):
\begin{enumerate}
  \item Choose either $\vec \chi = \vec I$, $\vec \chi=1/w\vec I$ or $\vec \chi = \sqrt{G}\vec G$ depening on whether a conformal, adapted or monitor grid is desired.
  \item Discretize and solve the elliptic equation~\eqref{eq:general_elliptic} on the $\zeta,\eta$ grid for $\bar u(\zeta, \eta)$ with any
    method that converges.
    Use Eq.~\eqref{eq:transformationChi} to transform $\chi$ from Cartesian
    to the $\zeta, \eta$ coordinate system.
    The chosen resolution
    determines the accuracy of the subsequent streamline integration.
  \item Numerically compute the derivatives $\bar u_\zeta$ and $\bar u_\eta$
    and construct $\eta_v^{-1}(0, \eta)$ using Eq.~\eqref{eq:normalize} for $c_0=1$
  \item Integrate Eq.~\eqref{eq:computec0} to determine $c_0$.
  \item On the $\zeta, \eta$ grid compute $\eta_v$, $\zeta_u$ and $\zeta_v$ according to Eq.~\eqref{eq:basis_monitor} as well as $u_\zeta$, $u_\eta$, $v_\zeta$ and
    $v_\eta$ according to Eq.~\eqref{eq:contravariant_monitor}. Use Eq.~\eqref{eq:chain_rule} and the Jacobian of the $\zeta, \eta$ coordinates to compute $u_x$, $u_y$, $v_x$ and $v_y$.
  \item Integrate the streamline of $\partial_v$ for $\zeta=0$
    from $v=0\dots v_j$ for all $j$ on the $\zeta, \eta$ grid using the normalized component $\eta_v$.
    Interpolate $\eta_v(\zeta, \eta)$ when necessary.
  \item Using the resulting points as start values integrate $\partial_u$ from
    $u=0\dots u_i$ for all $i$ and all points. The result is the list
    of coordinates $\zeta(u_i, v_j)$, $\eta(u_i, v_j)$ for all $i$ and $j$.
  \item Interpolate $x\left( \zeta,\eta \right)$, $y\left( \zeta, \eta \right)$,
    $u_x(\zeta, \eta)$, $u_y(\zeta, \eta)$, $v_x(\zeta, \eta)$ and $v_y(\zeta, \eta)$ on this list.
\end{enumerate}
There are two differences in this algorithm from the one presented in
Section~\ref{sec:orthogonal}:
For the integration of the vector fields Eq.~\eqref{eq:basis_monitor} and the evaluation of derivatives Eq.~\eqref{eq:contravariant_monitor} we need to evaluate its components at arbitrary points.
An interpolation method is thus needed.
In order to avoid out-of-bound errors we can artificially make the $\zeta,\eta$ box periodic.
Second, the existence of the coordinate $v$ is guaranteed by the Cauchy--Riemann equations
and thus the $h$ function does not appear.

A suitable test for the implementation is e.g. the volume/area of the domain.
Being an invariant
the volume must be the same regardless of the coordinate system in use.

\section{Numerical tests \label{sec:numerics}}
We extend our numerical library FELTOR ({\url{www.github.com/feltor-dev/feltor}}) \cite{FELTORv3.1}
with a geometry package that can handle the various grids discussed in Section~\ref{sec:geometry}.
For our implementation we choose high order explicit Runge--Kutta methods (see, for example, \cite{hairer93}) to integrate the necessary ordinary differential equations
and discontinuous Galerkin (dG) methods~\cite{Cockburn2001, Held2016} for
the elliptic equations and the interpolation.
The grid points and metric elements are thus available up to machine precision.
Note here that each point of the grids we discussed
in Section~\ref{sec:geometry} can be computed independently from each
other, which provides a trivial parallelization option.

We perform the computationally intensive inversion of the elliptic
equation~\eqref{eq:general_elliptic} on a GPU with a conjugate gradient method.
On a single CPU a direct solver might be
preferable but the assembly of the elliptic operator is not straightforward due
to the presence of the metric elements.
The advantage in an iterative method is that
we do not need to assemble the whole matrix
we only need to implement the
application to a vector.

As already discussed in the introduction in all structured grids derivatives are pulled back to a rectangular grid (the computational space).
The computational space is a product space, i.e.~the discretization
of the derivatives is one-dimensional (cf. \cite{Einkemmer2014, Held2016}).
This reduces the stencil of the
discretization compared to a discretization using an unstructured two-dimensional grid and simplifies the communication pattern in a parallel implementation.
Furthermore, the matrices have a block-diagonal form with two side bands,
where each block has the size $P\times P$ with $P$ the number of polynomial
coefficients in each cell.
Apart from the corner entries all blocks on the diagonals are equal.
This further reduces the storage requirements and
in our experience increases the performance of matrix-vector multiplications by
a factor of $2-3$ compared to a sparse matrix format (like the compressed sparse row format) that stores all non-zero elements explicitly.

In the following we will use the function $\psi$ that is given
by Reference~\cite{Cerfon2010} as an analytical solution to the Grad-Shafranov equation. This
function is used in practice for turbulence simulations in tokamaks.
The values of the $12$ coefficients in $\psi$ can be found in \ref{app:coeff-psi}. Furthermore,
all programs used for this work can be found in the latest
release of FELTOR~\cite{FELTORv3.1}.
\subsection{Convergence of $\bar u$}
We first check that the numerical solution of Eq.~\eqref{eq:general_elliptic} converges as expected.
As we do not have an analytical solution we compute the difference in the $L2$ norm of the computational space
between two consecutive solutions $\bar u_{\text{num}}^1$ and $\bar u_{\text{num}}^2$.
We thus define the numerical error
\begin{align}
  \varepsilon_{\bar u} = \left(\frac{\int_{\zeta_0}^{\zeta_1} d \zeta\int_0^{2\pi}\d \eta (\bar u_{\text{num}}^1 - \bar u_{\text{num}}^2)^2}{ \int_{\zeta_0}^{\zeta_1} d \zeta\int_0^{2\pi}\d \eta(\bar u_{\text{num}}^1)^2}\right)^{1/2}.
\label{eq:error_1}
\end{align}
\input{table_convergence_u.tex}
In Table~\ref{tab:convergence_u} we show the results for different high order polynomials to test the
convergence of the general elliptic equation with monitor metric~\eqref{eq:general_elliptic}.
The region is bounded by $\psi_0 = -20$ and $\psi_1=-1$.
We use a fluxgrid with the angle-like coordinate defined as the arc length to discretize this region~\cite{Grimm1983}. The advantage
is that this grid is quickly generated and has,
other than the orthogonal grids discussed in Section~\ref{sec:orthogonal},
a fairly homogeneous distribution
of cells throughout the domain. As we use Dirichlet boundary conditions
the nonorthogonality is not an issue.
We observe a quick convergence until a relative error of around $10^{-12}$ is reached. This apparent upper bound is due to the accuracy of the residuum in the
conjugate gradient solver at $10^{-11}$.
Let us note that we observe similar convergence rates for the
conformal and adapted grids.

\subsection{Grid quality}
Now we construct our elliptic grids and compare them to
the near-conformal grid suggested by Reference~\cite{Ribeiro2010} as a reference grid for existing flux aligned grids.
Note that in this section by orthogonal grid we always mean the adapted orthogonal grid discussed in Section~\ref{sec:adaption}.
\begin{figure}[htbp]
\centering
\subfloat[orthogonal $\psi_0=-20$]{\includegraphics[trim = 0px 0px 0px 0px, clip, scale=0.3]{./Xorthogonal_adapted_inner}\label{fig:three_gridsa}}
\subfloat[orthogonal $\psi_0=-1$]{\includegraphics[trim = 0px 0px 0px 0px, clip, scale=0.3]{./Xorthogonal_adapted_outer}\label{fig:three_gridsb}}
\subfloat[near conformal]{\includegraphics[trim = 0px 0px 0px 0px, clip, scale=0.3]{./Xribeiro_grid}\label{fig:three_gridsc}}
\caption{
  Orthogonal grid with $\psi_0=-20$, $\psi_1=-1$ (a), orthogonal grid with $\psi_0=-1$, $\psi_1=-20$  (b) both with $w=|\nabla\psi|$ and near conformal grid with $\psi_0=-20$, $\psi_1=-1$ (c) with equal number of grid points
  $P=1$, $N_\zeta=8$, $N_\eta=80$.
Note that the nodes represent cell centers and not the actual cell boundaries.
The grey lines denote the actual grid boundaries at $\psi=-20$ and $\psi=-1$. For
the sake of orientation we also plot the line $\psi=0$ to indicate the X-point.
}
\label{fig:three_grids}
\end{figure}
In Fig.~\ref{fig:three_grids} we plot the orthogonal grid described in Section \ref{sec:geometry} with the function $h$ chosen once on the
inner boundary~\ref{fig:three_gridsa} and once on the outer boundary~\ref{fig:three_gridsb}
(in both cases adaption is used), and the near conformal grid proposed by Reference~\cite{Ribeiro2010} in~\ref{fig:three_gridsc}.
In the orthogonal grids, we have an equidistant discretization at the inner respectively outer boundary. Each of these grids is aligned with the magnetic flux function
$\psi$.
The orthogonal grids \ref{fig:three_gridsa} and \ref{fig:three_gridsb} distribute equally spaced cells evenly in the region around $Z=0$,
where the contour lines are almost straight.
The cell size in the radial direction decreases as we go from the inner to the outer boundary.
However, when the curvature of the
contour lines increases (this is the case in the region around $R=500$), the cells are either
 prolongated or compressed in the direction of the angle-like coordinate $\eta$.
 This effect results in cells with very large aspect ratio of the cells in the
 orthogonal grids.

 The near-conformal grid~\ref{fig:three_gridsc} is near-conformal in the sense that the conformal deformation $g^{\zeta\zeta}/g^{\eta\eta}$ is small. Note, however, that this grid is
completely aligned to the function $\psi$.
This means that the aspect ratio of the cells remains
as constant as possible.
The downside of this grid is that it is clearly non-orthogonal especially close to the boundary and thus Neumann boundary conditions are difficult to implement.

\begin{figure}[htbp]
\centering
\subfloat[true conformal grid]{\includegraphics[trim = 0px 0px 0px 0px, clip, scale=0.3]{./Xconformal_grid}\label{fig:modified_gridsa}}
\subfloat[grid adaption]{\includegraphics[trim = 0px 0px 0px 0px, clip, scale=0.3]{./Xconformal_adapted}\label{fig:modified_gridsb}}
\subfloat[monitor metric]{\includegraphics[trim = 0px 0px 0px 0px, clip, scale=0.3]{./Xconformal_monitor001}\label{fig:modified_gridsc}}
\caption{
  Truly conformal grid (a), adapted grid with $w=|\nabla\psi|$ (b) and monitor grid with $k=0.1$ and $\varepsilon=0.001$ (c) with equal number of grid points
  $P=1$, $N_\zeta=8$, $N_\eta=80$. We choose $\psi_0 = -20$ and $\psi_1 = -1$.
Note that the nodes represent cell centers and not the actual cell boundaries.
The grey lines denote the actual grid boundaries at $\psi=-20$ and $\psi=-1$. For
the sake of orientation we also plot the line $\psi=0$ to indicate the X-point.
}
\label{fig:modified_grids}
\end{figure}

In Fig.~\ref{fig:modified_grids} we plot the results from
our elliptic grid generation processes. We show a
true conformal grid~\ref{fig:modified_gridsa}, an elliptic grid with adaption~\ref{fig:modified_gridsb} and
one constructed with a monitor metric~\ref{fig:modified_gridsc}. The last grid is clearly
non-orthogonal while the conformal and adapted grids are orthogonal in the whole domain.
All three grids are orthogonal at the boundary (which facilitates the implementation of Neumann boundary conditions).
The conformal grid~\ref{fig:modified_gridsa} suffers from large cells in the upper
and lower regions of the domain. This is cured
by either performing grid adaption~\ref{fig:modified_gridsb} or by employing a monitor metric~\ref{fig:modified_gridsc}.
Both result in cells of similar size. The difference
between these grids is the degree of flux alignment, which is clearly superior
in the monitor grid in the region close to the X-point (Reference~\cite{Glasser2006} provides a more quantitative investigation of the degree of alignment).

We assess the quality of our grids using an analytic solution of the following elliptic equation
\begin{equation}
    \nabla\cdot\left( \chi\nabla f \right) = \rho, \label{eq:analytic}
\end{equation}
where we either choose a flux aligned solution
\begin{subequations}
\begin{align}
f_{\text{ana}}(x,y)=& 0.1(\psi-\psi_0)(\psi-2\psi_1+\psi_0) \\
\chi(x,y) =& \frac{x_0}{x} \sqrt{1 +(\nabla \psi)^2}
  \label{}
\end{align}
\label{eq:analytic_field}
\end{subequations}
or a localized solution
\begin{subequations}
\begin{align}
f_{\text{ana}}(x,y)=&
\begin{cases}
0 \text{ if } \left( \frac{x-x_b}{\sigma} \right)^2+\left( \frac{y-y_b}{\sigma} \right)^2 > 1 \\
\exp \left[ 1+\left( \left( \frac{x-x_b}{\sigma} \right)^2+\left( \frac{y-y_b}{\sigma} \right)^2 - 1 \right)^{-1} \right] \text{ else }
\end{cases} \\
\chi(x,y) =& \frac{x_0}{x} \sqrt{1 +(\nabla \psi)^2}(1+0.5\sin(\theta(x,y))).
  \label{}
\end{align}
\label{eq:analytic_local}
\end{subequations}
The corresponding parameters are as follows: $x_0 = 550$, $\psi_0 = -20$ and $\psi_1=-1$, $x_b=440$, $y_b=-220$ and $\sigma=40$.
The position of the blob corresponds to the lower left corner of the domain. In this region the grids differ the most.
Also note that the flux aligned solution~\eqref{eq:analytic_field}
has a Neumann boundary condition at $\psi=\psi_1$ and a Dirichlet
boundary at $\psi=\psi_0$. For the localized solution~\eqref{eq:analytic_local} we choose
Dirichlet conditions at both boundaries.
In order to numerically solve Eq.~\eqref{eq:analytic} we first have to transform the metric
and the involved functions to the coordinate system that we use (cf. Reference~\cite{Einkemmer2014, Held2016} on how the derivatives are discretized).
It might seem that the conformal and orthogonal grids have a
performance advantage over the curvilinear grids because the non-diagonal elements
of the metric vanish.
However, the number of necessary matrix-vector multiplications is four in all cases and only the number of vector-vector multiplications is different. Consequently, we only observe minor differences in performance.

The relative errors are computed in the $L2$ norm via
\begin{align}
  \varepsilon = \left(\frac{\int_{u_0}^{u_1}\d u \int_0^{2\pi}\d v \sqrt{g} (f_{\text{num}} - f_{\text{ana}})^2 }
  {\int_{u_0}^{u_1}\d u \int_0^{2\pi}\d v \sqrt{g} f_{\text{ana}}^2 }\right)^{1/2}
  \label{eq:error_norm}
\end{align}
where $\sqrt{g}\d u \d v$ is the correct volume form in the $u,v$ coordinate system.
The ratio of $N_v/N_u$ is chosen such that the aspect
ratio of the resulting cells is approximately unity.

\input{table_fluxaligned.tex}
Let us point out first that if we choose a function $f_{\text{ana}}=f_{\text{ana}}(\psi)$ the
flux aligned grids produce errors that can be orders of magnitude lower
than those of the non-aligned grids. This is observed in Table~\ref{tab:fluxaligned}.
The orthogonal grid has much better errors than the elliptic grids.
However, while the conformal and adapted grids have similar errors the monitor grid shows smaller errors for all resolutions.
This is due to the fact that the degree of alignment is higher in case of the monitor grid (see, for example, \cite{Glasser2006} for a discussion).
If due to some physical reasons the solution is expected to be flux aligned,
the aligned grids are thus preferable.
From the dG method we expect convergence of order $P$~\cite{Arnold2001}.
This is achieved only in ideal cases, however. We observe more irregular behaviour. The orthogonal grid shows approximate orders of $3.5$ and $4.5$, while
the remaining grids show orders mostly between $2.0$ and $3.5$.
Since the discretization method itself is equal in all four cases this
irregularity is most likely due to the different metric elements in the
four coordinate systems.

In actual turbulence simulations we expect localized structures and eddies
as exemplified by the localized solution given in Eq.~\eqref{eq:analytic_local}.
\input{table_elliptic.tex}
In Table \ref{tab:elliptic} we show the resulting convergence for a forward discretization on the orthogonal grid, the truly conformal grid, the near conformal grid,
and the elliptic grid with monitor metric.

Note that we again observe irregular convergence behaviour for all grids. Nonetheless we ordered the
grids from mostly high to lower errors from left to right.
The grid constructed with the monitor metric has the lowest error. The worst grids are the orthogonal and the true conformal
grids, which have the largest cell sizes at the location,
where the blob was placed.
The errors from the adapted grid are
approximately between the near conformal grid and the grid
with monitor metric.

The performance of these grids can be more clearly understood by comparing their maximal and minimal cell sizes for a fixed number of cells. Recall that the arc length of a curve is the integral over the norm
of the tangent vector of the curve. In the case of the coordinate
lines the tangent vectors are just the basis vectors $\partial_u$ and $\partial_v$.
If we assume that the computational space is discretized in equidistant
cells with cell size $h_u$ and $h_v$ respectively,
we define
\begin{subequations}
\begin{align}
  l_u := \sqrt{g_{uu}} h_u = \sqrt{g}\sqrt{ g^{vv}} h_u \\
  l_v := \sqrt{g_{vv}} h_v = \sqrt{g}\sqrt{ g^{uu}} h_v
\end{align}
  \label{eq:cellsize}
\end{subequations}
Furthermore we define the ratio of maximal to minimal cell size by
\begin{align}
  a_u := \frac{\max l_u}{\min l_u} \quad
  a_v := \frac{\max l_v}{\min l_v}
  \label{eq:ratios}
\end{align}
\input{table_gridsize.tex}
In Table~\ref{tab:gridsize} we compute the maximum and minimum cell
sizes of the various grids.
For completeness we also computed the values for the orthogonal grid with the
first line being the $\psi_0=-1$ line, which is plotted in Fig.~\ref{fig:three_grids}.
We expect that if the maximal cell size is small, then the error committed by this grid is also small.
In fact, this explains the results that were obtained in Table \ref{tab:elliptic}.
That is, the monitor grid and the near conformal grid are better in terms of accuracy compared to the conformal and orthogonal grids.
Note that the orthogonal grid with $\psi_0=-20$ as the fist line has quite long cells in the $v$ direction but smaller cells than all the other grids in the $u$ direction.

The accuracy obtained is an important consideration.
However, it has to be seen in the context that this elliptic equation will eventually be coupled to an evolution equation.
In this case the minimal grid size is an important characteristics as it determines the CFL condition of explicit solvers and the
condition number of the discretization matrix in implicit schemes
and thus the computational efficiency of the grid used.
Consider the minimal grid size in the $v$ direction of the orthogonal grid with $\psi_0=-1$ as the first line. It is $50$ times  smaller than the cell in the monitor grid.
Thus, this grid is clearly not efficient for a practical numerical simulation.

The values of $a_u$ and $a_v$ are a measure of how well a grid performs.
Small values indicate small errors in the elliptic equation and a large
minimal cell size, which is advantageous for advection schemes.
Overall we thus find that the monitor grid gives the best accuracy as well as the least stringent CFL condition among the grids we have considered here.
This is expressed by a minimal value of $a_v$ and the $a_u$ value second only to
the near conformal grid.

\section{Conclusion} \label{sec:conclusion}
All in all, we show that we are able to construct various elliptic grids by the method
of streamline integration combined with the solution of a suitably chosen elliptic equation.
Compared to the TTM and related methods~\cite{Thompson1977, Glasser2006, Vaseva2009} we significantly simplify the construction and
accuracy of the method. Compared to the flux-aligned grids suggested in the literature
on magnetic fusion problems~\cite{Ribeiro2010} we improve the distribution of cells across the
domain and enable boundary orthogonality.

In our example implementation we discretize the approach laid out in Section~\ref{sec:geometry} with high order Runge Kutta and dG methods.
Our grids are suitable but not limited to the discretization of the edge region of magnetically
confined plasmas as proved in Section~\ref{sec:numerics}. We explicitly show convergence of two solutions for a general elliptic
equation that appears in typical physical models of plasma turbulence.
Our orthogonal grids are flux aligned but show the largest
variation in cell size of all the grids we investigated.
The conformal grid to a lesser extent suffers from the same problem.
In conclusion we find that the adaptive grid and even more the monitor metric approach yield the best grids in terms of small error and homogeneous cell distribution.

In the future we intend to investigate the possibility to include the X-point into
the domain of interest. The difficulty encountered with our algorithm at
an X-point or O-point is the vanishing gradient $\nabla\psi$. The Jacobian of
any flux aligned coordinate system thus has a singularity at this point
and the convergence of elliptic equations significantly deteriorates or even
vanishes. Numerical methods that can handle singularities might solve the problem.
Furthermore, a generalization of our algorithm to
three dimensions might be feasible.

redpajama_set_name: RedPajamaArXiv


text:
Category Archives: NHL
Buffalo Sabers, Colin Cambell, ESPN, Florida Panthers, NHL, Richard Zednik
Zednik in stable condition after being sliced on neck by skate
February 11, 2008 sahyder1	Leave a comment
BUFFALO, N.Y. — Panthers forward Richard Zednik had blood gushing from a deep cut on the right side of his neck after being struck by a teammate's skate during the third period of Florida's 5-3 loss to Buffalo on Sunday night.
Zednik was behind the play and skating into the right corner of the Sabres' zone, when teammate Olli Jokinen was upended by Sabres defenseman Brian Campbell. Jokinen fell head-first to the ice, and his right leg flew up and struck Zednik directly on the side of the neck.
Clutching his neck, Zednik immediately raced to the Florida bench, leaving a long trail of blood. A Sabres trainer jumped on the ice to apply a towel across the player's neck, and Zednik was immediately escorted to the Panthers' dressing room.
Players and coaches on both benches looked on in shock, and a silent hush fell over the crowd at HSBC Arena. The game was delayed for more than 15 minutes as crews scraped the blood from the ice.
"Richard Zednik is in stable condition and on his way to a Buffalo hospital," was the announcement over the loudspeaker.
The crowd stood in applause during the announcement.
Prior to resuming the game, referee Bill McCreary and Panthers coach Jacques Martin consulted in the tunnel outside the Panthers' dressing room.
Sabres general manager Darcy Regier was also spotted talking with NHL vice president Colin Campbell. Campbell, the league's director of hockey operations, attended the game in part because his son, Gregory Campbell, plays for the Panthers.
Credit ESPN. It really is amazing that things like this don't happen more often. The video really is a scary sight to see as it could've been a lot worse.
Canadian Elections, Chicago White Sox, Cricket, Los Angeles Angels of Anaheim, NHL, Pakistan, Reggie Bush, San Francisco 49ers, Toronto Raptors, Vince Carter
November 30, 2005 sahyder1	Leave a comment
Yeah, it is that time of the year again when I promise that I'll start updating this thing and then forget again. Or maybe this time will be different.
Let's see presently I'm occupied following the Pakistan/England series. Annoyed at the way my Angels lost to Chicago. No idea what to think of my Raptors…..I hope all the idiots who wanted VC gone are satisfied. Still getting used to the new NHL. There are far too many goals for my liking but this hockey is better then no hockey. What can I say about the 9ers? It looks like we're gonna miss out on Bush too.
Oh yeah, the Canadian Elections are coming on January 23rd. Remember to vote NDP.
The new NHL
September 23, 2005 sahyder1	2 Comments
These high scoring games are kind of depressing me. Now I'm all for a wide open fast game but these 8-6 games are gonna get boring fast. Hopefully it tunes as the season progresses.
CBA, Lockout, NHL, NHLPA
NHL talks ongoing; deal to be done today
July 13, 2005 sahyder1	Leave a comment
TSN.ca Staff
The NHL's long awaited new CBA will be completed today, sources close to the talks told TSN Wednesday.
An extended session between the NHL and NHL Players' Association, which started at Noon et on Tuesday, is apparently continuing and should soon produce the agreement that would be the catalyst to ending the 301-day labour dispute, the longest in the history of North American professional sports.
It has become painfully evident that the two sides have had to do more than dot i's and cross t's and satisfy legal requirements in the last few days. Mind you, there has unquestionably been a lot of that to do. But there has also been back and forth negotiations on some final unresolved issues.
Sources say there's nothing left on the table that is likely significant enough to derail the entire process, which is now in its final hours, but more time is required to finish off these items to the satisfaction of the league and the union.
Today is the 10th consecutive day the two sides have been engaged in marathon talks and the appearance seems to be that they are now prepared to meet for as long as it takes to get an agreement.
The wait should be over before the end of the day.
All I can say is…..it's about damn time.
Lockout, NHL, NHLPA, Salary Cap
Report: NHL, NHLPA agree on cap formula
June 8, 2005 sahyder1	Leave a comment
TSN.ca Staff with CP, Globe and Mail files
The Globe and Mail reports that the NHL and NHL Players' Association have agreed on a formula for a salary-cap system based on team-by-team revenue.
The salary-cap issue was seen as the biggest hurdle in talks for a new collective bargaining agreement.
According to the Globe's league and player sources, a salary floor and cap will based on a percentage of each NHL team's revenue. The paper adds that in the first year – based on revenue projections by both sides – the salary cap will range from $34 million to $36 million US, with the floor from $22 million to $24 million US.
The Globe also reports that the formula calls for a dollar-for-dollar luxury tax to kick in at the halfway mark between the floor and the cap. If the floor of the lowest team is $22 million US and the cap on the highest team is $36 million US, then the 'tax level' will be $29 million US.
The formula would allow wealthier teams to spend a bit more money, but would also bridge the large gaps in spending between higher payroll teams and lower payroll teams.
Small group labour talks between both sides ended late Tuesday night and resume today in New York with a larger group meeting.
Both sides have carried over the momentum from last week when 34 hours of talks were described as 'progressive' from both sides.
There are several issues to iron out, but sources in both camps believe there's a chance a deal could be done before July. Still, both sides also concede there are potential pitfalls that could prevent an agreement from being reached.
Today's session is the 21st meeting between the two sides since the season was cancelled Feb. 16.
NHL vice-president and chief legal officer Bill Daly and NHLPA senior director Ted Saskin declined to confirm or deny anything to The Globe and Mail.
Files from CP and The Globe and Mail were used for this report.
Bob Goodenow is a damn fool. I wanna see how quickly he gets the axe after these negotiations end. They could've agreed to the $42 million in January and we'd have had ourselves something to watch.
Bob Goodenow, Lockout, MLB, NBC, NHL
No Hockey
February 5, 2005 sahyder1	Leave a comment
Yeah, so barring an absolute last second miracle there will be absolutely no NHL this year. I have to say Goodenow is an idiot…….but the owners are no saints here either. Everyone knows the union will end accepting a cap at some point, it's just unfortunate that the idiots can't see that right now. They'll agree to a deal sometime next January……a deal they probably could've had months ago. This one isn't gonna end looking good. There's no way for the losing side to save face. They can't brush it up like the MLB negotiations because these negotiations boil down to just one issue…..is there a hard cap or not? There' s not gonna be a middle line and that pretty much kills any hopes for a smooth sailing in negotiations from now on. Ofcourse the owners have their share of the blame too. If these idiots could just control themselves a bit we wouldn't have these ridiculously high salaries. It's unfortunate that we could lose franchises because of this (let's hope the Devils are the first to go). The Players Union needs to wake up fast. If the last TV contract wasn't a wakeup call, I don't know if there will ever be one. The NHL is making NO guaranteed money from it's deal with NBC. Granted NBC is gonna be great for hockey….but it's not instant money for the NHL. Leave me your thoughts on this. You have any solutions that are realistic? I mean do we really wanna be stuck watching only basketball for the next 2-3 months?

redpajama_set_name: RedPajamaCommonCrawl


There is currently a growing disquiet in the military by some soldiers purported to be loyal to governing New Patriotic Party (NPP) who feel they have been used and dumped by the party whilst their colleagues who did nothing towards the 2016 election victory are enjoying.
Maverick politician and businessman, Kennedy Agyapong who is mad at the development alleges that these persons are rather being victimized because persons aligned to the opposition National Democratic Congress (NDC) have been given juicy positions which they are using to bully the others.
He wondered what kind of consultation was done by the Defense Minister before making such appointments indicating that if Dominic Aduna Bingab Nitiwul is not aware he should seek information because the party used the soldiers to their advantage in averting what was planned by the NDC prior to, during and after the 2016 elections.


text:
An Interview with Rami Hilmi a.k.a. Ryan Hunter, Star of A Killer Conversation
by Mike Haberfelner
Films starring Ryan Hunter on (re)Search my Trash
Ars�ne Lupin
Your upcoming film A Killer Conversation - what is it about, and what can you tell us about your character?
A bizarre black comedy feature centred around 3 characters - Karl: Once a romantic charming fellow, now Mr. Nobody, a drifter in life... The Burglar: A well-mannered gentleman who's robbing Karl of his money and valuable belongings... and Pauline: Karl's ex-girlfriend, a stuck-up upper class snobby bitch who has no regards for people and things, is oblivious to all things happening in front of her.
This is not your average burgling story, those characters when they interact with one another it produces some bizarre, weird and interesting moments and conversations that you'd not expect to happen! The type of film that would make you go: "Hang on, they didn't just do or say that? Did I see what I just saw? I need to watch this again."
Karl is a very simple, easy-going guy, living life from day to day, no ambitions, no goals, no future, a drifter, a stick in the ocean controlled by its current taking him to wherever it wants, he ONLY started to think more about life and how it's precious and valuable when he's getting burgled and being a matter of life and death situation!
How did you get involved with the project in the first place, and what convinced you to do it?
The director David V.G. Davies [David V.G. Davies interview - click here], who I�ve worked with before on other projects, called me and mentioned the film to me. Luckily I had just returned and completed a film shoot, so I was free again. When I got the message about the film I was in the middle of reading another feature film script that I've been asked to do but I haven't given my word to do the film till I finish reading the script, but when Dave called me and pitched A Killer Conversation to me, it sounded such a cool story, so I asked him to send me the script, I stopped reading the other one and jumped quickly on reading A Killer Conversation - and I was hooked! I couldn't let the script down till I completed it, I loved it, I was laughing so much by just reading the screenplay! I fell in love with the story, the characters and how unique and clever the script was, but what convinced me the most to do it was the fact that David was involved in the film. I�ve worked with David before so I was very happy and pleased to get back on set with him knowing he's directing the film as I know his film sets usually are great and fun to work on, plus he's a smashing director and I love working with him, his attention to details and vision is unbelievable.
You are known mostly for your roles in action movies, and yet you spend almost all of A Killer Conversation tied to a chair and very limited in movements. Did that at all feel odd?
Absolutely, it felt very odd. I was toying with that in my mind when I was reading the script and knowing my character will be tied up, so of course when you have limited body movement and you're tied up to a chair during most of the film, you have to find another way of pushing the character out there and be believable, so I knew my only key was working the heavy driven dialogue with my speech tones, my facial expressions, looks, actions and reactions - I'm hoping this has worked for the character.
How did you approach your role in the first place?
I usually adopt the Konstantin Sergeyevich Stanislavski�s Method, especially when I approach strong character-driven stories in films. It�s a well known approach for actors, now it�s known as Method Acting around the world: You have to have 1. An Objective: The final goal the character wants to achieve, 2. Obstacles: Things that will prevent or complicate the achievements of the character�s objective, 3. Tools or Methods: The means a character will use to overcome obstacles and achieve his objective, 4. Units & Bits: Smaller objectives and methods which build towards a larger goal, 5. Actions: Mini-objectives for each line the character says.
With A Killer Conversation being a comedy - to what degree could you relate to the movie's a tad absurd brand of humour, and do you consider yourself a humourous person?
It has the perfect balance of tension, drama, suspense with surreal comedy moments that I think the majority of comedy films seems to lack these days. I do consider myself a humorous person, I seem to make people laugh and get in stitches sometime, so I guess I am :) Now I hope the audience will think so too when they watch the film.
You have worked with A Killer Conversation's director Davd V.G. Davies [David V.G. Davies interview - click here] before, right? What can you tell us about him, and what are your collaborations usually like?
Ryan Hunter in David V.G. Davies'
David V.G. Davies is one of those rare directors you find in today's world of cinema... He has the immense talent and vision of the legends of the past such as Alfred Hitchcock / William Wyler and the knowledge and expertise of today's legends such as John Carpenter / Stanley Kubrick / Robert Zemeckis. His films are usually full of unique twists and characters, his stories have a wonderful balance of tension and suspense that keep you on the edge and keep you guessing.
Regarding our collaborations, well every time I�m offered a role and knowing I�m working with David, I get extremely excited, as I do love the way he directs, and his sets are always fun and pleasant to work on, he has the perfect scale measure of how to work with his cast and crew and get the best work out of them all. I see David as the 1st director who completely understood my capability as a versatile actor. When I�m working with him, he offers me the strong, deep, sometimes emotional and challenging leading roles, which have big impact on driving the story forward, they are all very different from one another. Only a handful of other directors offer me those roles at this present time, so I�m very grateful to play them to show what I can really do as an actor, and it pushes me to strive further as a performer, as I really dislike being complacent by playing roles that are just too easy to get into and don�t have impact and change much of the story. But David V. G. Davies sees the full potential his actors have and he knows how to bring that out of them for the benefit of the film.
Rudy Barrow, Ryan Hunter, Melanie Denholme
A few words about your co-stars Melanie Denholme [Melanie Denholme interview - click here] and Rudy Barrow [Rudy Barrow interview - click here], and what was it like working with them?
Melanie Denholme and Rudy Barrow were absolutely fantastic to work with, they are extremely talented actors, I felt we�ve built the chemistry between our characters in no time. Extremely fast, I was bouncing from their performances really well and we had such a great time working together, they were two of the best actors I had the pleasure to work with. I am so looking forward to work with both of them again, I hope on a few more future projects.
I just happen to know that the writer of A Killer Conversation, Michael Haberfelner [yes, that's actually me] [Michael Haberfelner interview - click here], was on set for the entire shoot. Was this at all helpful, or just my and the director's egos clashing over every little detail?
Ryan Hunter, Michael Haberfelner, Rudy Barrow
I have to admit at the very beginning I was a little worried, as I know how much this feature script meant to the writer Michael Haberfelner, it's his baby and it's been with him for 20 years I believe - so naturally I worried to screw it up by not delivering the performance needed and doing the character justice. But then it proved to be a blessing to have him on set and working closely with the director David, the crew and us the cast. I thought we all gelled and worked so well together under the pressure of completing the film within the time limit we�ve had. Michael was brilliant and by him being on set it helped us to develop the characters even better, the director�s and the writer�s visions have helped adding the extra needed ingredients, spices and herbs to the scenes.
A Killer Conversation was shot in a mere three days - what kind of strain did this put on you as an actor, and what can you tell us about the on-set atmosphere? And any on-set anecdotes you'd like to share?
As I�ve mentioned on the previous question, time was very limited for such a heavy dialogue- and character-driven film, but the key points that worked for us and made it possible were that we were all ready to work under pressure, long hours and giving everything we�ve got to make the film special, the swift director�s work and direction, the chemistry that us, the actors, seemed to have straight away with each other, the wonderful crew�s talent and getting the director�s vision rapidly and putting their creative work to place. I remember one night after viewing the scenes left to shoot and realized the time is creeping on us fast, David, Rudy and myself decided to carry on shooting the next big scene between my character and Rudy�s through the night to save time and be on schedule again, we finished around early hours in the morning, and then we only had about a couple of hours sleep the 3 of us, but the next morning we weren�t complaining, we were very happy and rearing to go, we felt fine as our minds were focused on the job we have on hand.
Melanie Denholme, Rudy Barrow, Ryan Hunter, Michael Haberfelner, Paul Hobday, David V.G. Davies, Adam Lanfranchi
Despite the pressure though it was plenty of fun and laughter on set between us all. The atmosphere on set was happy, positive, creative and full of energy. And there were plenty of anecdotes on set, two particular I remember very well that put a smile on my face: Rudy goes over the top action man stamping the floor, and Melanie comes back up as if nothing just happened to her� it was brilliant.
Even during the shoot of A Killer Conversation, someone (it wasn't me) suggested a sequel. Seriously, did you initially think this was a good idea or even doable?
Well I didn�t take it seriously at first, I thought it was just a talk thing as people suggest and talk about sequels for films all the time, but the majority never happen, they are just ideas that fade away, and then when the writer Michael send us a synopsis of his idea for the sequel I was like �whaaattt!! Really!!� - though I thought the synopsis was pretty interesting and clever, I still couldn�t see how the sequel could work (I can�t give too much of my thoughts here as it relates to our current film), but then Michael said he�s half way through writing it, I got even more intrigued and interested, as I wanted to see which direction is he going to take it.
Then after a month and a bit here it goes, the writer SENDS us the sequel screenplay! I couldn�t wait to read it, here I am half way though reading it, and then� BOOM! It got me so excited, it was unbelievable! Again another remarkable piece of work from the writer, in fact I thought the sequel script even funnier than A Killer Conversation, and now I can�t wait to re-unite with the cast & crew and start filming it.
Let's go back to the beginnings of your career: What got you into acting in the first place, and did you receive any formal education on the subject?
My original interest and what I wanted to be was a pilot, a captain flying airplanes like 747 or Concorde, I love aircrafts and it always fascinated me such huge machines like these can be lifted up in the air and fly thousands of feet above ground. I even thought about Space Shuttles and being an astronaut, I loved space and the idea of setting foot on the moon or on another planet and watch the earth from there, but those were jobs that required a lot of time for studies, training and plenty of money to do them, which I didn�t have of course. Then I realized that from such a young age as 6 years old I had always been a performer and had made friends and family laugh, imitating characters from films and being silly. I started performing in kindergarten shows and liked it, so performing was something I realised is part of me and I loved it, and also being all the jobs I can�t be in one lifetime, as every role is different and take on a new persona with a new profession on every film. So I did study Drama, Film Studies, Theatre Studies and Performing Arts, I performed in many college shows and outside theatre companies, then I did Drama School and moved on to do acting for TV and film.
Can you still remember your first time in front of a movie camera, and what can you tell us about that experience?
Yes I do, my background was in theatre, which I loved very much as it keeps you on the edge when you are in front of a live audience - but the magic of film and the camera fascinated me and I wanted to know how to perform for the lens, so I studied and then, many years ago, I started working on an amateur TV soap showing on a Sky Channel. I�ve played a regular character, but I remember the first few episodes were really hard to watch for me, it was odd seeing myself on screen, I didn�t like watching myself, I hated seeing my scenes and acting on screen, till after some time I got used to it and started to see myself as the character I�m playing. I felt I was atrocious and sucked as an actor, I have always been very critical of my own performances, but at the same time I had a strong passion and desire for film / TV acting, and because I have always persisted and never quit, I had to find ways to swiftly keep on improving and getting stronger and better as an actor, and so I did. Also when I get criticised for my performances by film critics, I I'm not disappointed, I take them on board with open arms. The reasons WHY they didn�t like something help me polish the mistakes and never fall for them again - hopefully. I always take on board some good key points and advices from directors and other fellow actors� etc. I listen to their thoughts and ideas, because constructive criticism helps you progress and develop as a true believable versatile actor. We can never ever stop learning, there are neve- ending ways to approach your profession, finding different angles and new fresh ways to do them.
You have also directed a short called Hush. What can you tell us about that one, and about Ryan Hunter the director?
Hush was a 5 minute comedy written and produced by a friend of mine, he asked me to direct it and I agreed, it was a good fun little project, only a handful of us cast and crew working closely on the project and everyone did a brilliant job. I�m happy it had really good reviews and it was shown on a Sky Channel a number of times, but it doesn�t define me as a director yet, I have films I�ve written and one day in the not too distant future I probably will start directing features, but before that I have to keep my focus on my career as an actor, then when I�m certain I can do the film, I can do it justice and there are pros with no cons, then I�ll go for it, because I want to make sure my feature film is going to be strong and will have a positive impact in the industry if my name is attached to it as a director.
Directors who pop up in your filmography time and again include Jason Impey [Jason Impey interview - click here], Kemal Yildirim [Kemal Yildirim interview - click here], and Russ Diapper. What can you tell us about these men and the films you made with them?
Directors in their own right! Yes I have worked with each of them on numerous projects and they are good to work with, Jason Impey and Kemal Yildirim are among the directors who see me as a versatile actor and the roles they offer in their films do vary from one another. Also each of them has another special skill they excel at, Jason is a superb DOP, Kemal is a fantastic Light Designer, and Russ is an outstanding Music Composer.
You also play an uncredited role in Ridley Scott's Body of Lies. How does working on a big budget film of this kind compare to working on an indie film like, let's say, A Killer Conversation?
Originally I was cast as a credited character in the film, but the unfortunate delays on some shoots (which does happen on sets frequently) meant there was no time to film a couple of scenes which I originally had with Leonardo, but Mr. Scott asked me to fill in on another scene, which was a really small one, but the experience working on big budget film sets is excellent, it�s the same as what we do on an indie film except on a much bigger scale.
I remember it was really fun to work on V for Vendetta as one of the V army members marching on the soldiers in London, a fantastic 3 nights shoot, I was in the front of Vs line that had to jump over barriers and be more physical. I did it for the experience back then, observing and watching the crew and their work on those sets.
I also did voice over and ADR work in English and Arabic languages for two other big budget films Prince of Persia: The Sands of Time and the new feature coming out to cinemas soon, Black Gold, working closely in Pinewood Studios with one of my favourite directors, Jean-Jacques Annaud - he was such a cool and down-to-earth person, it was a valuable experience and I learned a lot from him.
But the one BIG difference between working on a blockbuster budget film and an indie small budget film is on the indie sets you get to know everyone quickly and create a good bond and sometimes you feel like you have made a homely family feel between yourself and the other cast and crew members, you have the chance to work with them closely and know them well. Now on the big film sets it�s a lot harder to know everyone and remember everyone�s name and make strong connections with them, because there is a huge number of cast and crew running around busy always, unless of course you are working on that film for few months then gradually you will be able to.
Any other films of yours you'd like to talk about, any future projects?
Currently I am in the middle of filming a new thriller feature called The Dossier playing a lead role called Deniz Celik (The Governor), directed by Jennifer Hookway and produced by Malcolm Karpeta, so far it's been going so well, again another superb film I�m working on, we have such an excellent team, all the cast and crew full of energy, enthusiasm and talent, the locations planned for the film are amazing with so much attention to detail and work been put in to it, Malcolm has done months of preparation and wonderful work on it before we started filming, and Jennifer is an extremely talented director who�s turning the script to pure magic with her ideas and suggestions, making each scene turn from good to perfection.
I also will start filming a new war WWII/horror film called 44 Kills directed by Rick Roberts, though it�s still early days to talk about it. Not to forget the sequel of A Killer Conversation that I am also looking forward to immensely. Now the other films in the pipeline are too early to talk about.
During your career, you have also done a lot of stunting and fight choreography. What can you tell us about that aspect of your career, and what kind of training do you need to properly do that even?
It's something that seems to come natural to me, to be honest I�ve never thought I�d be involved as a stunt coordinator and fight choreographer on films, my heart has always been into acting from the start, but I just seem to pick up positions to cover on films when it's needed. I guess it helps when you have a solid background in various martial arts, I have studied various forms of martial arts from the age of 6 years old and it�s my other passion. I have trained on a variety of weapons and arms, I also took bodyguard courses. I used to teach martial arts back then and I was head of security and a bodyguard team for key political figures. But of course I gave them up to put my full focus into my film career which I love the most and use my expertise and knowledge from the many years of training and experience for the benefit of the films I work on when I�m asked to do so.
How would you describe yourself as an actor?
A constant and never ending improving versatile actor, who seeks more knowledge, learning new skills, researching to perfect myself and having a deep understanding and meaning to each of the characters I portray.
Actors who inspire you?
Talented actors such as Humphrey Bogart, Gregory Peck, James Cagney, James Stewart, Grace Kelly, Audrey Hepburn, Cary Grant, Gene Kelly, Bruce Lee, Clint Eastwood, Michael J. Fox and Joe Pesci for their unique performances on screen.
Your favourite movies?
I have too many to name here, I�ll give you few titles of my list of favourites: Enter the Dragon, The Good The Bad & The Ugly, Back to The Future, Halloween, Bound by Honour, The Shawshank Redemption, Forrest Gump, My Cousin Vinny, Casablanca, Ratatouille, Enemy at the Gates, The Man from Earth, Taken, Breakfast at Tiffany�s, Roman Holiday, Amelie, The Birds, It�s a Wonderful Life, Falling Down, Dial M for Murder, Donnie Brasco, Howl�s Moving Castle, Angels with Dirty Faces... etc.
... and of course, films you really deplore?
Feeling lucky ?
any of my partnershops yourself
for more, better results ?
The links below
will take you
just there!!!
Find Rami Hilmi
Find Rami Hilmi here ...
find Rami Hilmi at adultvideouniverse.com
Nope, sorry I don�t talk about or mention anything negative, I have no right to deplore or question other people's work and creativity, everyone of us have a different opinion of what we like or don�t like, and if we don�t have things we don�t like, then we wouldn�t have things we love and adore, right?
Your website, Facebook, whatever else?
I had a website before, I designed it myself during my early stage of the career then took it down, as now my CV is available on IMDb and Spotlight for casting directors and directors to see. I also have a Facebook page set up to add and communicate with cast & crew I work with in the film business and of course friends.
Anything else you are dying to mention and I have merely forgotten to ask?
I think I�ve jabbered long enough, I don�t want to bore people any longer than I�ve already done ;) - but I like to say a big THANK YOU for all my friends out there who have supported me and followed my career and journey so far and I hope I can continue to do so, I also like to THANK all the wonderful casts and crews who I�ve worked with over the years, and the good advices and the positive words from some of my humble friends in the business such as: Matt Damon, Pierce Brosnan, Jeff Goldblum & Phil Charette.
THANK YOU, the pleasure was mine.
� by Mike Haberfelner
Legal note: (re)Search my Trash cannot
and shall not be held responsible for
content of sites from a third party.


text:
Liberia international striker William Jebor celebrates after scoring his first and crucial equalizer for Al Nassr
Liberian international striker William Jebor over the weekend came off the bench to end his goal drought after heading in a late equalizer to recuse his new club Al Nassr against Al Ahli at the Jeddah stadium.
Since scoring his last goal on May 12 for his former club Wydad Casablanca against Cotonsport in the CAF Champions League, the 25-year-old has for the past months struggled to register his name on the score sheet.
The Liberian striker got his first goal for his new club in the Saudi Arabian Pro League after netting a stunning header in the 84th minute to secure a draw for the two-time Saudi Arabian Pro League winners.
After conceding an earlier goal in the 8th minute, Al Nassr tried to get an equalizer, but was held up by the lone goal up to the 80th minute. Jebor was introduced at the right time after sending in teammate Mohammad Al Sahlawi's cross from the left flank through a diving header.
After enjoying a remarkable season with Moroccan club Wydad Casablanca during the 2016-17 league season where he won the Botola Pro league, and scored the league's highest goal at the end of the season with 19 goals, the 25-year-old Liberian striker's performance caught the attention of some European clubs including English Premier League side Stock City and French League clubs Rennes and Metz, but the former Wydad Casablanca top goal scorer finally made his decision to join the Saudi Arabian club on July 9, 2017 after signing a three-year deal.
With a huge task on his shoulder to perform for his new club after an incredible season in the Moroccan league, Jebor began his season with his new club on a disappointing note after making four appearances without a goal.
The weekend goal brought back relief for the goal puncher and his fans as he got back on his goal scoring path. Jebor in a thankful mode took to his official social media pages including Facebook and Twitter thanking God.
"To God be the glory, Amen. It is written: Blessed are the meek: for they shall inherit the earth. It is written again: Blessed are ye, when men shall revile you, and persecute you, and shall say all manner of evil against you falsely, rejoice, and be exceeding glad," Jebor posted on his social media pages.
The draw for Al Nassr put them in the 5th position on the league table after collecting five points from its first three matches.
Source: Daily Observer