Difference between revisions of "Creating Setting up Windows 10 for OF use by Franco Otaola"

From OpenFOAM Wiki
Jump to navigation Jump to search
Line 21: Line 21:
  
 
<TT>
 
<TT>
1. Install ExectTi (to be able to modify the registry of windows with the highest privilege)
+
* Install ExectTi (to be able to modify the registry of windows with the highest privilege)
  
2. Run regedit.exe -m (this will open the regedit)
+
* Run regedit.exe -m (this will open the regedit)
  
3. Go to HKEY_CLASSES_ROOT\Directory\shell\WSL
+
* Go to HKEY_CLASSES_ROOT\Directory\shell\WSL
  
4. Remove the "Extended" value right click>delete
+
* Remove the "Extended" value right click>delete
  
5. Go to HKEY_CLASSES_ROOT\Directory\Background\shell\WSL
+
* Go to HKEY_CLASSES_ROOT\Directory\Background\shell\WSL
  
6. Remove the "Extended" value right click>delete
+
* Remove the "Extended" value right click>delete
  
7. Restart your computer if necessary
+
* Restart your computer if necessary
 
</TT>
 
</TT>
  
 
These steps, will put the "open linux shell here" directly in the right click menu that can be helpful, all the credits for this tutorial to [https://winaero.com/make-open-linux-shell-always-visible this page].
 
These steps, will put the "open linux shell here" directly in the right click menu that can be helpful, all the credits for this tutorial to [https://winaero.com/make-open-linux-shell-always-visible this page].
 +
 +
'''New text editor:'''
 +
 +
Frequently in linux base system, the default text editors are more powerful than the windows default app, notepad, being able to automatically detect the language that the file is and highlighting the keywords. This utility can be quiet helpful for the modification of dictionary files as it allow us to see comments, vectors, loops, conditionals highlighted. The default windows app, is rather featureless, while it does the job, there are better suited free options out there. Notepad ++ (https://notepad-plus-plus.org/) is an excellent tool for an windows 10 OF user, it give us some life improvents when editing scripts and dictionaries, such as:
 +
 +
* Line numbers, this can be rather helpful, a lot of times we need to know specifically the line number of an option inside an specific dictionary.
 +
 +
* It can open several files at the same time in one windows in a tab-like style
 +
 +
* Text highlight depending in the language (language > select specific language), at least from my experience, an OF user will at least use: C++ for the dictionaries and shell/python for scripting. It is possible to define a default language (Settings>New Document>Default language) I personally set up shell as I commonly find myself editing this type of files.
 +
 +
* It can follow a log file (automatic update) while it is being generated. For this, open the log file in notepad++ and go to view>Monitoring (tail -f) or by clicking in the small eye icon. This as the brackets mentions will do exactly the same thing as using tail -f log.file in a terminal.
 +
 +
Some last tips about Notepad++, by default it, the software "saves" the session, this meaning when we close the window and we re open it, it will open all the files that were previously opened. To change this behavior, we need to go to Settings>Preferences>Backup and turn it off. One last tip in setting up Notepad++, is to turn on the auto update file option, this will update the files each X minutes if it has been modified by and external source, to turn on this option we need to go to settings>preferences>MISC. and turn on "Update silently", "Scroll to last line after update". While we are here you can turn on Document switcher (Ctrl+Tab), with this we can add the Alt+Tab windows behavior but for the different files opened inside Notepad++.

Revision as of 05:17, 18 June 2021

Go back to Collection by authors.

Go back to [1].

Setting up Windows 10 for OF use

In this tutorial some helpful tips for the setting up of a Windows 10 machine will be given. This steps are not essential for the use of OF in Windows but rather an improvement in usability and a speed improvement for the case setups. This tutorial will not touch the installation of OF in windows but rather steps to follow after its installation, for installation of OF in windows please refer to Installing OpenFOAM in Windows 10

Setting up Windows 10

Open linux shell here:

One option that I missed a lot from my linux computer was to navigate with the file explorer to my case and then simply by right click we can open the terminal in that folder location, without the need of "cd path". Once you installed your WSL in Windows 10 exists too, by default, we need to use Shift+right click in the folder, this will give us the “advanced” version of the contextual menu, give us more choices (and having the open linux shell here). For people that really want to use only the right click, we can add this option to the classic contextual menu of windows. For this, we need to install ExectTI (ExectTI) and then follow the steps:

  • Install ExectTi (to be able to modify the registry of windows with the highest privilege)
  • Run regedit.exe -m (this will open the regedit)
  • Go to HKEY_CLASSES_ROOT\Directory\shell\WSL
  • Remove the "Extended" value right click>delete
  • Go to HKEY_CLASSES_ROOT\Directory\Background\shell\WSL
  • Remove the "Extended" value right click>delete
  • Restart your computer if necessary

These steps, will put the "open linux shell here" directly in the right click menu that can be helpful, all the credits for this tutorial to this page.

New text editor:

Frequently in linux base system, the default text editors are more powerful than the windows default app, notepad, being able to automatically detect the language that the file is and highlighting the keywords. This utility can be quiet helpful for the modification of dictionary files as it allow us to see comments, vectors, loops, conditionals highlighted. The default windows app, is rather featureless, while it does the job, there are better suited free options out there. Notepad ++ (https://notepad-plus-plus.org/) is an excellent tool for an windows 10 OF user, it give us some life improvents when editing scripts and dictionaries, such as:

  • Line numbers, this can be rather helpful, a lot of times we need to know specifically the line number of an option inside an specific dictionary.
  • It can open several files at the same time in one windows in a tab-like style
  • Text highlight depending in the language (language > select specific language), at least from my experience, an OF user will at least use: C++ for the dictionaries and shell/python for scripting. It is possible to define a default language (Settings>New Document>Default language) I personally set up shell as I commonly find myself editing this type of files.
  • It can follow a log file (automatic update) while it is being generated. For this, open the log file in notepad++ and go to view>Monitoring (tail -f) or by clicking in the small eye icon. This as the brackets mentions will do exactly the same thing as using tail -f log.file in a terminal.

Some last tips about Notepad++, by default it, the software "saves" the session, this meaning when we close the window and we re open it, it will open all the files that were previously opened. To change this behavior, we need to go to Settings>Preferences>Backup and turn it off. One last tip in setting up Notepad++, is to turn on the auto update file option, this will update the files each X minutes if it has been modified by and external source, to turn on this option we need to go to settings>preferences>MISC. and turn on "Update silently", "Scroll to last line after update". While we are here you can turn on Document switcher (Ctrl+Tab), with this we can add the Alt+Tab windows behavior but for the different files opened inside Notepad++.