reconstructPar background script

#!/bin/bash
#+TITLE: check-reconstructPar
#+File:  check-reconstructPar.sh
#+Date: Sat Nov  9 12:23:24 HST 2019
#+Author: Albert S. Kim, albertsk@hawaii.edu
# Required package: bc
#

. ~/.bashrc 
. /home/albertsk/OpenFOAM/OpenFOAM-v1906/etc/bashrc
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

testProcessorNum=0

processor=`ls  processor${testProcessorNum}  | grep -v [a-zA-Z] | tail -n 1`
latestPWD=`ls  ./ | grep -v [a-zA-Z] | tail -n 1`

Tprocessor=$(echo $processor + 0 | bc)
TlatestPWD=$(echo $latestPWD + 0 | bc)
#
runMessage=$(grep Time log.interFoam2 | tail -n -1)

echo "The running time is" ${runMessage} 
echo "The lastest time in processor${testProcessorNum} is  ${processor}. "
echo "The lastest time in this directory is  ${latestPWD}."

dateTime=`date +"%Y-%m-%d-%H-%M-%S-%p"`
if [ "$Tprocessor" != "$TlatestPWD" ] 
then
    . /home/albertsk/OpenFOAM/OpenFOAM-v1906/etc/bashrc
    . $WM_PROJECT_DIR/bin/tools/CleanFunctions
    . $WM_PROJECT_DIR/bin/tools/RunFunctions
    echo reconstructPar -time $processor
    mv -f log.reconstructPar log.reconstructPar.$dateTime
    mv -f log.reconstructPar.log .reconstructPar.$dateTime
    reconstructPar -time $processor
    mv -f log.reconstructPar  log.reconstructPar.$dateTime
    
else
    echo "This case is laready reconstructed. reconstructPar not necessary!"
fi

exit 0
Posted in bash, OpenFOAM

Alternative to ESC in vim editor

If you have an American English keyboard, pressing Ctrl-[ (control plus left square bracket) is equivalent to pressing Esc. This provides an easy way to exit from insert mode.

https://vim.fandom.com/wiki/Avoid_the_escape_key

Posted in Uncategorized

Lyx beamer, how to align each frame top-aligned

Image | Posted on by

How to avoid warning messages from hyperref package in LaTex

\usepackage[unicode=true,pdfusetitle,
   bookmarks=true, 
   bookmarksnumbered=false, 
   bookmarksopen=false,
   breaklinks=false, 
   pdfborder={0 0 1}, 
   backref=false, 
   colorlinks=false]{hyperref}

\hypersetup{pdfauthor={Name}}

Use of hyperref package in a LaTex script makes the manuscript more visually understandable, but it often gives warning message like

Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `math shift' on input line 79.
Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `superscript' on input line 79.
Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `math shift' on input line 79.                     

Then, putting the snippet

\hypersetup{pdfauthor={Name}}

in a LaTex source file will remove the warning message or within the Lyx preamble section.

Posted in Uncategorized

command line dictionary and thesaurus

To use command line dictionary and thesaurus, execute the following command:

sudo apt-get install dict dictd dict-gcide dict-moby-thesaurus

And, try

dict fundamental

which will show the definitions and synonyms of “fundamental” on the terminal screen.

Posted in Uncategorized

How to generate a fixed format, sequential integers

The following bash script is to generate integers from 1 to 11, having 3-digit format.

#!/bin/bash
for i in `seq -f "%03g" 1 11`
do
   echo $i
done 
exit 0 

The result is as follows.

 001
 002
 003
 004
 005
 006
 007
 008
 009
 010
 011
Posted in Uncategorized | Tagged ,

Specific header settings of Emacs org-mode for LaTex export

#+LATEX_HEADER: \usepackage[margin=1.0in]{geometry}
#+LATEX_HEADER: \usepackage[numbers,sort&compress,square]{natbib}
#+latex_header: \usepackage{glossaries}
#+latex_header: \makeglossaries
#+latex_header: \usepackage{setspace} \singlespacing
#+latex_header: \usepackage{enumitem}
#+latex_header: \setlist[itemize]{noitemsep, topsep=0pt}
#+latex_header: \setlist[enumerate]{noitemsep, topsep=0pt}
#+OPTIONS: d:nil ^:nil H:2 toc:nil
  • 1st line: setting all four side margins, 1 inch.
  • 2nd line: natbib setup for numbered references of which citation is sorted and compressed, i.e., instead of [1,2,3,4] it will show [1-4].
  • 3rd and 4th: nomenclature setup
  • 5th line: linespacing setup, single and double
  • 6th and 7th lines: setting line gaps between enumerated and itemized ones zero.
Posted in Blog | Tagged , ,