Arithmetic and/or user defined variables in the input file  [SOLVED]

Total energy, geometry optimization, DFT+U, spin....

Moderator: bguster

Locked
chuard
Posts: 2
Joined: Thu Oct 02, 2014 6:24 pm

Arithmetic and/or user defined variables in the input file

Post by chuard » Wed Oct 15, 2014 9:15 pm

Hi All,

I was just wondering if there is any way to declare a user variable and or do arithmetic with it from within the input file. Specifically, I am working on 2-d van der waals materials, and I often find myself setting up simulations to do several SCF runs with different layer-to-layer spacings in order to find the binding characteristics. Currently I use a script to generate new xcart values for each spacing, but it would make the input file much more legible when I come back to it a few weeks later to try and figure out what I was doing if i could write something like this:

ndtset 10 spacing: 2.6 spacing+ 0.1
xcart 2/3 1/3 0
0 0 spacing

where "spacing" would be a user defined variable that would actually end up generating 10 different xcarts.

Is there any easy way to do this that I am missing?

Thanks,
Chad

Jordan
Posts: 282
Joined: Tue May 07, 2013 9:47 am

Re: Arithmetic and/or user defined variables in the input fi  [SOLVED]

Post by Jordan » Thu Oct 16, 2014 1:50 pm

What would be the difference with

Code: Select all

ndtset 10

xcart: 2/3 1/3 0
       0   0   2.6
xcart+ 0 0 0
       0 0 0.1

?

I may not have understood your question ?

Jordan

chuard
Posts: 2
Joined: Thu Oct 02, 2014 6:24 pm

Re: Arithmetic and/or user defined variables in the input fi

Post by chuard » Sun Oct 19, 2014 5:10 pm

Yup... that is what I was looking for.

I was sure there must be an easy way to do this, but for some reason I just didn't realize you could put in zeros for the values I didn't want to change.

Thanks for the help!!

Locked