This file contains hidden or 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
/* compile with: | |
g++ -O3 -std=c++11 vec_dot.cpp -I/usr/include/openblas -fopenmp -lcblas | |
(or clang++) | |
NOTE: | |
- in main, comment either the OpenMP or the BLAS block! using both leads to degraded performance. | |
- on my TP X13 G3 with Intel i7-1260P, adding -march=native will lead to lower performance!! | |
- other flags like -funroll-loops -flto -finline-functions did not seem to lead to significant performance increases | |
*/ |
This file contains hidden or 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
if &compatible | |
set nocompatible | |
endif | |
filetype plugin indent on | |
" should be set before loading polyglot | |
let g:polyglot_disabled = ['yaml', 'latex'] " disable vim-polyglot | |
call plug#begin('~/.config/nvim/plugged') |
This file contains hidden or 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
""" | |
Solve a simple Poisson system with a low rank update using PETSc MatCreateLRC. | |
The low rank update is defined at 3 boundaries with different weights, Dirichlet | |
BC is applied to the other boundary. | |
https://www.mcs.anl.gov/petsc/petsc-3.13/docs/manualpages/Mat/MatCreateLRC.html | |
some hints: | |
https://fenicsproject.discourse.group/t/add-matrix-to-assembled-matrix/122/2 | |
https://lists.mcs.anl.gov/pipermail/petsc-users/2020-February/040228.html |
This file contains hidden or 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
$MeshFormat | |
2.2 0 8 | |
$EndMeshFormat | |
$Nodes | |
142 | |
1 0 0 0 | |
2 1 0 0 | |
3 1 1 0 | |
4 0 1 0 | |
5 0.09999999999981467 0 0 |
This file contains hidden or 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
#!/bin/bash | |
# Script for installing tmux on systems where you don't have root access. | |
# tmux will be installed in $HOME/.local/bin. | |
# It's assumed that wget and a C/C++ compiler are installed. | |
# exit on error | |
set -e | |
TMUX_VERSION=2.5 |
This file contains hidden or 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
# var 1 | |
for key, val in prms.items(): | |
if type(val) is dict: | |
for key2, val2 in val.items(): | |
print('\t {0}: {1}'.format(key2, val2)) | |
else: | |
print('{0}: {1}'.format(key, val)) | |
# var 2 | |
import yaml |
This file contains hidden or 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 dolfin import * | |
import numpy as np | |
import mshr | |
from IPython import embed | |
from cbcpost.utils.mpi_utils import gather, broadcast | |
def vec(x): return as_backend_type(x).vec() | |
def mat(A): return as_backend_type(A).mat() | |
class NormalRotation(PETScMatrix): |
This file contains hidden or 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
2016/01/23 09:50:46 - INFO: [package:run_job] running [u'/bin/bash', '_hashdist/build.sh'] | |
2016/01/23 09:50:46 - INFO: [package:run_job] environment: | |
2016/01/23 09:50:46 - INFO: [package:run_job] {'ARTIFACT': u'/home/dnolte/.hashdist/bld/cython/zb55xazf5kjr', | |
2016/01/23 09:50:46 - INFO: [package:run_job] 'BASH': u'/bin/bash', | |
2016/01/23 09:50:46 - INFO: [package:run_job] 'BUILD': u'/home/dnolte/.hashdist/tmp/cython-zb55xazf5kjr', | |
2016/01/23 09:50:46 - INFO: [package:run_job] 'HASHDIST_CPU_COUNT': '1', | |
2016/01/23 09:50:46 - INFO: [package:run_job] 'HDIST_CONFIG': '{"gc_roots":"/home/dnolte/.hashdist/gcroots","build_stores":[{"dir":"/home/dnolte/.hashdist/bld"}],"source_caches":[{"dir":"/home/dnolte/.hashdist/src"}],"cache":"/home/dnolte/.hashdist/cache","build_temp":"/home/dnolte/.hashdist/tmp"}', | |
2016/01/23 09:50:46 - INFO: [package:run_job] 'HDIST_IMPORT': u'patchelf/5ak23gxoswdv2qq7qsm733jx6mpknvlz python/7z56z4cdcuns2ncdbityazni6tpmprte', | |
2016/01/23 09:50:46 - INFO: [package:run_job] 'H |
This file contains hidden or 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
L = 1; | |
dx1 = 0.1*L; | |
Point(1) = {-0.5*L, -0.5*L, -0.5*L, dx1}; | |
Point(2) = { 0.5*L, -0.5*L, -0.5*L, dx1}; | |
Point(3) = { 0.5*L, -0.5*L, 0.5*L, dx1}; | |
Point(4) = {-0.5*L, -0.5*L, 0.5*L, dx1}; | |
Line(1) = {1, 2}; | |
Line(2) = {2, 3}; |
This file contains hidden or 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
L = 1; | |
dx1 = 0.05*L; | |
R = 0.398942280*L; /* radius for a circle taking half of the unit square | |
area */ | |
dx2 = dx1*2*R/L; | |
Point(1) = {-0.5*L, -0.5*L, -0.5*L, dx1}; | |
Point(2) = { 0.5*L, -0.5*L, -0.5*L, dx1}; | |
Point(3) = { 0.5*L, -0.5*L, 0.5*L, dx1}; | |
Point(4) = {-0.5*L, -0.5*L, 0.5*L, dx1}; |
NewerOlder