This should also be useful for other clusters where you want to use
components (e.g. MPI, compilers) from the module
system.
Start a session for building
si -N 1 -n 16 -c 1 -t 0-02:00:00 # on iris: -C broadwell or -C skylake
def lagrange_points(cell, degree): | |
"""Construct the locations of the equispaced Lagrange nodes on cell. | |
:param cell: the :class:`~.reference_elements.ReferenceCell` | |
:param degree: the degree of polynomials for which to construct nodes. | |
:returns: a rank 2 :class:`~numpy.array` whose rows are the | |
coordinates of the nodes. | |
The implementation of this function is left as an :ref:`exercise |
import numpy as np | |
import scipy as sp | |
np.set_printoptions(precision=15) | |
def maclaurin_series(n): | |
m2pi = -2 * np.pi | |
ns = np.arange(0, n) | |
xs = np.power(m2pi, ns) / sp.special.factorial(ns) |
import sys | |
# Here I make two namespaces, ns_ and A_. | |
# You can make as many as you want, probably | |
# one for every KSP/SVD/EPS in your code. | |
args = [sys.argv[0]] + """ | |
--petsc.ns_svd_type lapack | |
--petsc.A_mat_type aij | |
""".split() |
.vagrant/ |