Skip to content

Instantly share code, notes, and snippets.

@dineshadepu
dineshadepu / l2norm.py
Last active November 27, 2017 07:15
l2 norm implemented in Rust and Python
x = array([1, 2, 3, 4, 5, 6])
y = np.arange(0, 6, 1)
np.linalg.norm(x-y, ord=2)
# 2.4494897427831779
import matplotlib.pyplot as plt
import numpy as np
class CubicKernel:
def __init__(self, dim):
self.dim = dim
if dim == 1:
self.sigma = 2. / 3.
elif dim == 1:
# deb cdrom:[Ubuntu 16.04.3 LTS _Xenial Xerus_ - Release amd64 (20170801)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ xenial main restricted
deb-src ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ xenial universe multiverse restricted main
## Major bug fix updates produced after the final release of the
## distribution.
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ xenial-updates main restricted
@dineshadepu
dineshadepu / .bashrc
Created June 10, 2019 08:37
My bashrc file
# ~/.bashrc: executed by bash(1) for \non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@dineshadepu
dineshadepu / rsync
Last active June 25, 2019 15:14
sync between lab desktop to gpu computer
rsync -arv --exclude={_output,target/,.vtk,_output,target/,.pyc,.o,.c,.cpp,~,.so,.orig,.npz,.log,.npz,.pyd,test.pyx,.egg-info/,build/,dist/,.tox/,.out,*_output,cpp,emacs,softwares,papers} ~/phd/ dinesh@10.101.62.141:~/phd/
\section{The SPH method}
\label{sec:sph}
Smoothed particle hydrodynamics starts with representing a function at a point
as an integral by taking a convolution with the Dirac delta function,
%
\begin{equation}
\label{eq:func:approx}
f(\ten{x}) = \int_{V} f(\ten{y}) \delta(\ten{x} - \ten{y}) d\ten{y}
\end{equation}
%
@dineshadepu
dineshadepu / kokkos_silo_parallel_hdf5_cabana_ubuntu_22_installation.md
Created July 20, 2023 17:53
Installation of `Kokkos`, `Silo`, parallel `hdf5`, `Cabana` on Ubuntu machine

Kokkos installation

add the following to the bashrc file

  1. Add the following line to the bashrc

export KOKKOS_INSTALL_DIR=/home/dinesh/post_doc/softwares/kokkos/build/install

  1. Execute the following in the terminal
@dineshadepu
dineshadepu / rb_cabana.cpp
Last active July 22, 2023 15:14
Rigid body implementation ouline with Cabana software framework
/****************************************************************************
* Copyright (c) 2018-2022 by the Cabana authors *
* All rights reserved. *
* *
* This file is part of the Cabana library. Cabana is distributed under a *
* BSD 3-clause license. For the licensing terms see the LICENSE file in *
* the top-level directory. *
* *
* SPDX-License-Identifier: BSD-3-Clause *
****************************************************************************/
@dineshadepu
dineshadepu / images_to_movies.sh
Created July 24, 2023 11:31
Make movies with images ffmpeg
ffmpeg -framerate 10 -pattern_type glob -i '*.png' -vcodec libx264 -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -r 24 -y -an video.mp4