Another possibility is to use command "bc". The following example finds a
and c for an hexagonal lattice, given the cell volume and the c/a ratio

#!/bin/bash

# volume in A^3
for volume in 80 90 100 110 120 130
do
  # csua = c/a
  csua=1.10
  a=`echo 'e(l('$volume'*2/sqrt(3)/'$csua')/3.0)'| bc -l`
  c=`echo $a'*'$csua| bc -l`
  ...
done

On Sat, Mar 14, 2020 at 10:58 AM Lorenzo Paulatto <[email protected]> wrote:

> >     Yes it works! Thanks you very much.
> >
> Iif you need to multiply anything that is not integer, it will not work.
> In this case you can define a little function to do the math, like this:
>
> calc(){ eval awk \'BEGIN{printf \"%12.8f\\n\", $@}\'; }
>
> alat=10.2
> c_over_a=$(calc $alat/6.4)
> echo $c_over_a
>
>
> hth
>
> --
> Lorenzo Paulatto - Paris
> _______________________________________________
> Quantum ESPRESSO is supported by MaX (www.max-centre.eu/quantum-espresso)
> users mailing list [email protected]
> https://lists.quantum-espresso.org/mailman/listinfo/users



-- 
Paolo Giannozzi, Dip. Scienze Matematiche Informatiche e Fisiche,
Univ. Udine, via delle Scienze 208, 33100 Udine, Italy
Phone +39-0432-558216, fax +39-0432-558222
_______________________________________________
Quantum ESPRESSO is supported by MaX (www.max-centre.eu/quantum-espresso)
users mailing list [email protected]
https://lists.quantum-espresso.org/mailman/listinfo/users

Reply via email to