Multiwfn official website: http://sobereva.com/multiwfn. Multiwfn forum in Chinese: http://bbs.keinsci.com/wfn
You are not logged in.
Hello
In my current directory [.] are folders named after *.mwfn generated with NTO for different excitations (S1, T1, T2...). So it is like
./compound1-S1/compound1-S1.mwfn
./compound1-T1/compound1-T1.mwfn
./compound2-S1/compound2-S1.mwfn
./compound2-T1/compound2-T1.mwfn
./compound2-T2/compound2-T2.mwfn
I need to generate CUBES for occupied and virtual orbitals for each .mwfn file. The commands sequence is:
200
3
h
2
3
l
2
0
Can you share batch code to do that? I dont know programming and doing it manually is cumbersome
Thanks
Offline
But this results in multiple Multiwfn instances being run one by one, instead of reloading.
Offline
Unfortunately, it does for me— My computer freezes and I am not able to do anything. I need to reset it
Offline
this could be overcome i files generate by multiwfn differ, e.g. by prefix, instead of being constiently l or h, this cause overwriting when i iterate
E.g. this code doesnt work:
#!/bin/bash
# Save the current directory
start_dir=$(pwd)
# Find .mwfn files and process each
find . -type f -name "*.mwfn" | sort | while read -r fullpath; do
# Extract directory and filename
dir=$(dirname "$fullpath")
file=$(basename "$fullpath")
echo "Processing $file in $dir"
# Change to the file's directory
cd "$dir" || continue
# Run Multiwfn with input commands
/Users/apm/Applications/Wineskin/Multiwfn.app/Contents/MacOS/wineskinlauncher << EOF
$file
200
3
h
2
3
l
2
0
r
EOF
# Wait 15 seconds before processing the next file
sleep 60
# Return to the original directory
cd "$start_dir" || exit
done
Last edited by andrzejek (Yesterday 14:34:22)
Offline