In the solution process of problems discretized using FEM, the assembly of element level tensors to the global matrix often contributes a significant amount of computational time relative to the overall process. The goal of this GSoC 2018 project is to improve the performance of the FEniCS framework in the assembly phase. To achieve this, the FEniCS Form Compiler (FFC) should be enhanced such that the generated code can fully utilize data-level
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dockerfile to build the FEniCS-X development libraries | |
# with support for Loopy and Intel OpenCL drivers | |
# | |
# Authors: | |
# Jack S. Hale <[email protected]> | |
# Lizao Li <[email protected]> | |
# Garth N. Wells <[email protected]> | |
# Jan Blechta <[email protected]> | |
# Fabian Löschner <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dolfin | |
import dolfin.cpp | |
from dolfin import * | |
from dolfin.la import PETScMatrix, PETScVector, PETScKrylovSolver | |
from dolfin.jit.jit import ffc_jit | |
import numba as nb | |
import numpy as np | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dolfin | |
import dolfin.cpp | |
from dolfin import * | |
from dolfin.la import PETScMatrix, PETScVector, PETScKrylovSolver | |
from dolfin.jit.jit import ffc_jit | |
import numba as nb | |
import numpy as np | |
import cffi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void tabulate_tensor_A( | |
double* restrict A, | |
const double* const* w, | |
const double* restrict coordinate_dofs, | |
int cell_orientation) | |
{ | |
// Precomputed values of basis functions and precomputations | |
// FE* dimensions: [entities][points][dofs] | |
// PI* dimensions: [entities][dofs][dofs] or [entities][dofs] | |
// PM* dimensions: [entities][dofs][dofs] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ufl import * | |
import ffc.compiler | |
# Define cell type we solve on | |
cell = tetrahedron | |
d = cell.geometric_dimension() | |
# The finite element function space | |
element = VectorElement("Lagrange", cell, 1, dim=d) |
Main tutorial: https://ycnrg.org/vga-passthrough-with-ovmf-vfio/
Other resources:
- https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF
- https://github.com/sk1080/nvidia-kvm-patcher
Reset issue After powering off the Windows VM, it cannot be started again without a host power-cycle. Might be related to Windows not properly resetting the device and Linux being unable to power-cycle it by itself.
Workflow:
- Node version manager on Windows: https://github.com/coreybutler/nvm-windows
- Node version manager on Linux/macOS: https://github.com/nvm-sh/nvm
- Docker and nodejs: https://hackernoon.com/a-better-way-to-develop-node-js-with-docker-cd29d3a0093
React and TypeScript:
- Create a TypeScript based React app: https://create-react-app.dev/docs/adding-typescript
- React + TypeScript cheatsheet: https://github.com/typescript-cheatsheets/react-typescript-cheatsheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use glutin::event_loop::{ControlFlow, EventLoop}; | |
use glutin::window::WindowBuilder; | |
fn main() { | |
let el = EventLoop::new(); | |
let wb = WindowBuilder::new(); | |
let windowed_context = glutin::ContextBuilder::new() | |
.build_windowed(wb, &el) | |
.unwrap(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib as mpl | |
def draw_loglog_slope(fig, ax, origin, width_inches, slope, inverted=False, color=None, polygon_kwargs=None, label=True, labelcolor=None, label_kwargs=None, zorder=None): | |
""" | |
This function draws slopes or "convergence triangles" into loglog plots. | |
@param fig: The figure | |
@param ax: The axes object to draw to | |
@param origin: The 2D origin (usually lower-left corner) coordinate of the triangle | |
@param width_inches: The width in inches of the triangle |