|
[Sponsors] |
[PyFoam] Using pyFoamPlotWatcher.py To Plot Residuals |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 3, 2017, 08:36 |
Using pyFoamPlotWatcher.py To Plot Residuals
|
#1 | |
Member
Matt Ridzon
Join Date: Jun 2014
Posts: 91
Rep Power: 12 |
Reading through OpenFoam Technology Primer, it seems that "pyFoamPlotWatcher" can be used to monitor residuals during an OpenFoam solution. With the simple cavity model, I issued:
Code:
icoFoam > log1 & pyFoamPlotWatcher.py log1 Quote:
Thanks in advance, M Ridzon |
||
June 3, 2017, 11:44 |
|
#2 |
Senior Member
|
||
June 3, 2017, 16:47 |
|
#3 |
Senior Member
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 203
Rep Power: 18 |
hello m_ridzon,
it looks to me that you did not install pyFoam and/or swak4foam. hope this helps Wouter |
|
June 10, 2017, 08:11 |
|
#4 | |
Member
Matt Ridzon
Join Date: Jun 2014
Posts: 91
Rep Power: 12 |
Unfortunately, adding a dot didn't help.
Quote:
Thanks in advance, M Ridzon |
||
June 10, 2017, 15:44 |
|
#5 |
Senior Member
khedar
Join Date: Oct 2016
Posts: 111
Rep Power: 10 |
run following on command line
Code:
pyFoamPlotWatcher.py --version Code:
pyFoamPlotWatcher.py 0.6.6 https://openfoamwiki.net/index.php/C...m#Installation |
|
June 17, 2017, 09:12 |
|
#6 | |
Member
Matt Ridzon
Join Date: Jun 2014
Posts: 91
Rep Power: 12 |
Quote:
Code:
If 'pyFoamPlotWatcher.py' is not a typo you can use command-not-found to lookup the package that contains it, like this: cnf pyFoamPlotWatcher.py Code:
sudo pip install PyFoam Thanks again! M Ridzon |
||
June 17, 2017, 13:41 |
cblas.h?
|
#7 |
New Member
Maryam
Join Date: Dec 2015
Posts: 13
Rep Power: 10 |
Maybe you need to install OpenBLAS first. Follow this link for installation instructions: http://www.openblas.net/
|
|
June 19, 2017, 05:02 |
|
#8 | ||
Member
Ricky
Join Date: Jul 2014
Location: Germany
Posts: 78
Rep Power: 12 |
It seems that some of the packages required for the installation is not installed on your system.
As per your error, and I quote: Quote:
hope this helps! Regards, Ricky Quote:
__________________
If it is easy, then something is fishy! |
|||
June 24, 2017, 09:47 |
|
#9 | ||
Member
Matt Ridzon
Join Date: Jun 2014
Posts: 91
Rep Power: 12 |
I noticed this error also:
Quote:
Code:
Matt@LinuxBox:~> sudo zypper install python-devel root's password: Loading repository data... Warning: Repository 'openSUSE-13.2-Update' appears to be outdated. Consider using a different mirror or server. Warning: Repository 'openSUSE-13.2-Update-Non-Oss' appears to be outdated. Consider using a different mirror or server. Reading installed packages... 'python-devel' is already installed. No update candidate for 'python-devel-2.7.12-3.1.x86_64'. The highest available version is already installed. Resolving package dependencies... Nothing to do. Matt@LinuxBox:~> sudo zypper install python-setuptools Loading repository data... Warning: Repository 'openSUSE-13.2-Update' appears to be outdated. Consider using a different mirror or server. Warning: Repository 'openSUSE-13.2-Update-Non-Oss' appears to be outdated. Consider using a different mirror or server. Reading installed packages... Resolving package dependencies... The following NEW package is going to be installed: python-setuptools 1 new package to install. Overall download size: 310.4 KiB. Already cached: 0 B After the operation, additional 1.3 MiB will be used. Continue? [y/n/? shows all options] (y): y Retrieving package python-setuptools-5.4.1-2.1.4.noarch (1/1), 310.4 KiB ( 1.3 MiB unpacked) Retrieving: python-setuptools-5.4.1-2.1.4.noarch.rpm .....................[done] Checking for file conflicts: .............................................[done] (1/1) Installing: python-setuptools-5.4.1-2.1.4 ..........................[done] Quote:
I again issued: Code:
sudo pip install PyFoam Any thoughts? Thanks again! M Ridzon |
|||
June 25, 2017, 08:30 |
|
#10 |
Member
Matt Ridzon
Join Date: Jun 2014
Posts: 91
Rep Power: 12 |
As I continue to try and debug this, I issued this:
Code:
pyFoamVersion.py Code:
Machine info: Linux | LinuxBox | 3.16.7-21-desktop | #1 SMP PREEMPT Tue Apr 14 07:11:37 UTC 2015 (93c1539) | x86_64 | x86_64 Python version: 3.4.5 (default, Jul 03 2016, 13:55:08) [GCC] Python executable: /usr/bin/python3 Python 3 is supported with PyFoam PYTHONPATH is not set Location of this utility: /usr/bin/pyFoamVersion.py PyFoam WARNING on line 201 of file /usr/lib/python3.4/site-packages/PyFoam/FoamInformation.py : Basedir /home/Matt/foam for fork extend does not exist or is not a directory Version 4.0 (reported as number 4.0 )Fork openfoam of the installed 3 versions: openfoam-2.3.1 : /home/Matt/OpenFOAM/OpenFOAM-2.3.1 openfoam-2.4.0 : /home/Matt/OpenFOAM/OpenFOAM-2.4.0 openfoam-4.0 : /home/Matt/OpenFOAM/OpenFOAM-4.0 pyFoam-Version: 0.6.7 Path where PyFoam was found (PyFoam.__path__) is ['/usr/lib/python3.4/site-packages/PyFoam'] Configuration search path: [('file', '/etc/pyFoam/pyfoamrc'), ('directory', '/etc/pyFoam/pyfoamrc.d'), ('file', '/home/Matt/.pyFoam/pyfoamrc'), ('directory', '/home/Matt/.pyFoam/pyfoamrc.d')] Configuration files (used): [] Installed libraries: cython : No Not used. Maybe will by used later to spped up parts of PyFoam cProfile : Yes docutils : No Not necessary. Needed for RestructuredText to HTML conversion Gnuplot : No Not a problem. Version from ThirdParty is used hotshot : No Not a problem. Can't profile using this library line_profiler : No Not a problem. Can't profile using this library ipdb : No Not necessary. Only makes debugging more comfortable IPython : No Not necessary. But the interactive shell may be more comfortable matplotlib : No Only Gnuplot-plotting possible mercurial : No Not a problem. Used for experimental case handling pytest : No Only needed for running the unit-tests (developers only) numpy : No Plotting and data comparison won't work numpypy : No This workaround for PyPy does not work openpyxl : No Not a problem. Only used for exporting pandas-data to Excel-files (advanced). If xlsxwriter is installed it will handle this (xlsxwriter is recommended anyway) xlsxwriter : No Not a problem. Only used for exporting pandas-data to XLSX-files (advanced). If openpyxl is installed then this module can handle that pandas : No Not a problem. Only used for handling of advanced data-handling ply : No Not a problem. Version from ThirdParty is used profile : Yes psyco : No Not a problem. Acceleration not possible PyQt4 : No Only some experimental GUI-stuff relies on this PyQt4.Qwt5 : No Only an alternate plotting back-end scipy : No Not yet used. Possibly use signal-fitting etc Tkinter : No Not a problem. Used for the old version of DisplayBlockmesh and some matplotlib-implementations twisted : No Not yet used. Possibly reimplement MetaServer with it vtk : No Not a problem. Only used for some utilities xlwt : No Not a problem. Only used for exporting pandas-data to Excel-files xlrd : No Not a problem. Only used for importing Excel-files to pandas-data requests : No Not a problem. Currently only needed for the blink(1)-support PyFoam.ThirdParty.ply.yacc : Yes version: 3.9 PyFoam.ThirdParty.Gnuplot : No This is our own. If it is not found we've got problems PyFoam.ThirdParty.tqdm : Yes version: 4.8.4 PyFoam.ThirdParty.IPy : Syntax Error This is our own. If it is not found we've got problems PyFoam.ThirdParty.pyratemp : Yes version: 0.2.0 PyFoam.ThirdParty.six : Yes version: 1.10.0 PyFoam.ThirdParty.winhacks : Yes Library locations cProfile : /usr/lib64/python3.4/cProfile.py profile : /usr/lib64/python3.4/profile.py PyFoam.ThirdParty.ply.yacc : /usr/lib/python3.4/site-packages/PyFoam/ThirdParty/ply/yacc.py PyFoam.ThirdParty.pyratemp : /usr/lib/python3.4/site-packages/PyFoam/ThirdParty/pyratemp.py PyFoam.ThirdParty.six : /usr/lib/python3.4/site-packages/PyFoam/ThirdParty/six.py PyFoam.ThirdParty.tqdm : /usr/lib/python3.4/site-packages/PyFoam/ThirdParty/tqdm/__init__.py PyFoam.ThirdParty.winhacks : /usr/lib/python3.4/site-packages/PyFoam/ThirdParty/winhacks.py Checking additional envirnoment variables Checking for PYFOAM_DIR : Location of the PyFoam-installation. Not strictly necessary PYFOAM_DIR missing from environment Checking for PYFOAM_SITE_DIR : Location of non-PyFoam-disctributions script. Set and used by some Foam-distributions PYFOAM_SITE_DIR missing from environment User information Temporary directory: /tmp/PyFoam_Matt Code:
pyFoamPlotWatcher.py --version Code:
Traceback (most recent call last): File "/usr/lib/python3.4/site-packages/PyFoam/ThirdParty/Gnuplot/PlotItems.py", line 28, in <module> import numpy ImportError: No module named 'numpy' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/bin/pyFoamPlotWatcher.py", line 3, in <module> from PyFoam.Applications.PlotWatcher import PlotWatcher File "/usr/lib/python3.4/site-packages/PyFoam/Applications/PlotWatcher.py", line 6, in <module> from PyFoam.Execution.GnuplotRunner import GnuplotWatcher File "/usr/lib/python3.4/site-packages/PyFoam/Execution/GnuplotRunner.py", line 4, in <module> from .StepAnalyzedCommon import StepAnalyzedCommon File "/usr/lib/python3.4/site-packages/PyFoam/Execution/StepAnalyzedCommon.py", line 6, in <module> from PyFoam.Execution.AnalyzedCommon import AnalyzedCommon File "/usr/lib/python3.4/site-packages/PyFoam/Execution/AnalyzedCommon.py", line 7, in <module> from PyFoam.Basics.PlotTimelinesFactory import createPlotTimelines,createPlotTimelinesDirect File "/usr/lib/python3.4/site-packages/PyFoam/Basics/PlotTimelinesFactory.py", line 4, in <module> from PyFoam.Basics.GnuplotTimelines import GnuplotTimelines,validTerminals File "/usr/lib/python3.4/site-packages/PyFoam/Basics/GnuplotTimelines.py", line 4, in <module> from PyFoam.ThirdParty.Gnuplot import Gnuplot,Data,gp File "/usr/lib/python3.4/site-packages/PyFoam/ThirdParty/Gnuplot/__init__.py", line 166, in <module> from .PlotItems import PlotItem, Func, File, Data, GridData File "/usr/lib/python3.4/site-packages/PyFoam/ThirdParty/Gnuplot/PlotItems.py", line 31, in <module> import numpypy ImportError: No module named 'numpypy' Code:
sudo zypper install python-numpy Code:
Loading repository data... Warning: Repository 'openSUSE-13.2-Update' appears to be outdated. Consider using a different mirror or server. Warning: Repository 'openSUSE-13.2-Update-Non-Oss' appears to be outdated. Consider using a different mirror or server. Reading installed packages... 'python-numpy' is already installed. No update candidate for 'python-numpy-1.9.0-1.6.x86_64'. The highest available version is already installed. Resolving package dependencies... Nothing to do. Any ideas? Thanks again, M Ridzon |
|
July 1, 2017, 10:20 |
|
#11 |
Member
Matt Ridzon
Join Date: Jun 2014
Posts: 91
Rep Power: 12 |
Update. I think I found it. I installed numpy-devel, since it looked like it was missing. I re-ran the installation for PyFoam and got this:
Code:
Matt@LinuxBox:~> sudo pip install PyFoam root's password: Requirement already satisfied (use --upgrade to upgrade): PyFoam in /usr/lib/python3.4/site-packages Requirement already satisfied (use --upgrade to upgrade): numpy in /usr/lib64/python3.4/site-packages (from PyFoam) Cleaning up... Matt@LinuxBox:~> pyFoamPlotWatcher.py --version pyFoamPlotWatcher.py 0.6.7 Thanks, M Ridzon |
|
January 22, 2021, 05:55 |
pyFoam installation issue
|
#12 |
New Member
Join Date: Dec 2020
Posts: 26
Rep Power: 5 |
Hi,
I went through your process but unfortunately that didn't work for me # $ sudo pip install PyFoam sudo: pip: command not found $ sudo pip3 install PyFoam Requirement already satisfied: PyFoam in /usr/local/lib/python3.8/dist-packages/PyFoam-2020.5-py3.8.egg (2020.5) Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from PyFoam) (1.17.4) $ pyFoamPlotWatcher.py --version Traceback (most recent call last): File "/usr/local/bin/pyFoamPlotWatcher.py", line 4, in <module> __import__('pkg_resources').run_script('PyFoam==20 20.5', 'pyFoamPlotWatcher.py') File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 667, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1452, in run_script raise ResolutionError( pkg_resources.ResolutionError: Script 'scripts/pyFoamPlotWatcher.py' not found in metadata at '/home/<USER>/.local/lib/python3.8/site-packages/PyFoam-2020.5.dist-info' # would you have any idea of what coul be the problem ? I am running OFv2012 on Unbuntu 20.04 LTS wl2 many thanks |
|
January 24, 2021, 19:11 |
|
#13 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Hm. Strange. pkg_resource is never used in the PyFoam-sources so the script at /usr/local/bin/pyFoamPlotWatcher.py seems to be an automatically generated script that calls the original. I can't reproduce this on my Ubuntu 18.04 with Python 3.8 so it seems to by a 20.04 problem (probably Canonical trying to reinvent the wheel in an improved way) Does pyFoamVersion.py work and what is the output of that (PLEASE use the CODE-environment when adding computer output to your posts here. It makes things easier to read as it won't be reformatted)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
January 25, 2021, 02:50 |
|
#14 |
New Member
Join Date: Dec 2020
Posts: 26
Rep Power: 5 |
Hi,
I can see the pyFoam installed version here below: # $ pip3 install pyFoam > Requirement already satisfied: pyFoam in ./.local/lib/python3.8/site-packages (2020.5) Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from pyFoam) (1.17.4) # but if I run 'pyFoamVersion.py' then I get the following: # $ pyFoamVersion.py > Traceback (most recent call last): File "/usr/local/bin/pyFoamVersion.py", line 4, in <module> __import__('pkg_resources').run_script('PyFoam==20 20.5', 'pyFoamVersion.py') File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 667, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1452, in run_script raise ResolutionError( pkg_resources.ResolutionError: Script 'scripts/pyFoamVersion.py' not found in metadata at '/home/<USER>/.local/lib/python3.8/site-packages/PyFoam-2020.5.dist-info' # sorry but I don't know what you mean by using the the CODE-environment. ... could you kindly explain me how to do that ? thank you |
|
January 25, 2021, 06:23 |
|
#15 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Problem seems to be that in the sources most PyFoam-scripts look like this Code:
#! /usr/bin/env python from PyFoam.Applications.PlotWatcher import PlotWatcher PlotWatcher() Code:
#! /usr/bin/python38 from PyFoam.Applications.PlotWatcher import PlotWatcher PlotWatcher() Could you post the content of your /usr/local/bin/pyFoamVersion.py (only the first few lines if it is longer than 10 lines)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
January 25, 2021, 06:44 |
|
#16 |
New Member
Join Date: Dec 2020
Posts: 26
Rep Power: 5 |
here is the content of pyFoamVersion.py:
#!/usr/bin/python3 # EASY-INSTALL-SCRIPT: 'PyFoam==2020.5','pyFoamVersion.py' __requires__ = 'PyFoam==2020.5' __import__('pkg_resources').run_script('PyFoam==20 20.5', 'pyFoamVersion.py') |
|
January 25, 2021, 07:54 |
|
#17 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
That would have been a good example to demonstrate that you understood the CODE-tag Anyway: that is strange. This script looks like it was installed with easy_install (which is old tech) not pip. You did not try to install it with a different way before you tried pip?
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
January 25, 2021, 09:40 |
|
#18 | ||
New Member
Join Date: Dec 2020
Posts: 26
Rep Power: 5 |
well,
apologies again for the CODE-tag. I don't remember having tried anything else than pip (or pip3 indeed) if I come back to the error then the last line quotes the following message: Quote:
Quote:
Code:
{"classifiers": ["Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", "Topic :: Scientific/Engineering", "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9"], "description_content_type": "text/markdown", "extensions": {"python.details": {"contacts": [{"email": "bgschaid@hfd-research.com", "name": "Bernhard F.W. Gschaider", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "http://openfoamwiki.net/index.php/Contrib/PyFoam"}}}, "extras": [], "generator": "bdist_wheel (0.30.0)", "keywords": ["cfd", "openfoam"], "license": "GPL", "metadata_version": "2.0", "name": "PyFoam", "run_requires": [{"requires": ["numpy"]}], "summary": "Python Utilities for OpenFOAM", "version": "2020.5"} should I uninstall pyFoam and reinstall it ? |
|||
January 25, 2021, 10:07 |
|
#19 |
New Member
Join Date: Dec 2020
Posts: 26
Rep Power: 5 |
to complete the overview I have found 7 versions of the pyFoamVersion.py file:
the one under Ubuntu-20.04\home\<USER>\PyFoam-2020.5\PyFoam-2020.5\bin quotes these first 10 lines: Code:
#!/usr/bin/env python # Original provided by Mark Olesen import os,sys from platform import uname # from __future__ import print_function try: from PyFoam.ThirdParty.six import print_ except ImportError: Code:
#!/usr/bin/python3 # EASY-INSTALL-SCRIPT: 'PyFoam==2020.5','pyFoamVersion.py' __requires__ = 'PyFoam==2020.5' __import__('pkg_resources').run_script('PyFoam==2020.5', 'pyFoamVersion.py') Code:
#!/usr/bin/python3 # Original provided by Mark Olesen import os,sys from platform import uname # from __future__ import print_function try: from PyFoam.ThirdParty.six import print_ except ImportError: Code:
#!/usr/bin/python3 # Original provided by Mark Olesen import os,sys from platform import uname # from __future__ import print_function try: from PyFoam.ThirdParty.six import print_ except ImportError: the one under Ubuntu-20.04\home\<USER>\PyFoam\bin quotes these first 10 lines: Code:
#!/usr/bin/env python # Original provided by Mark Olesen import os,sys from platform import uname # from __future__ import print_function try: from PyFoam.ThirdParty.six import print_ except ImportError: the one under Ubuntu-20.04\home\<USER>\.local\bin quotes these first 10 lines: Code:
#!/usr/bin/python3 # Original provided by Mark Olesen import os,sys from platform import uname # from __future__ import print_function try: from PyFoam.ThirdParty.six import print_ except ImportError: the one under Ubuntu-20.04\home\<USER>\dist\PyFoam-2020.5\PyFoam-2020.5\bin quotes these first 10 lines: Code:
#!/usr/bin/env python # Original provided by Mark Olesen import os,sys from platform import uname # from __future__ import print_function try: from PyFoam.ThirdParty.six import print_ except ImportError: |
|
January 25, 2021, 16:07 |
|
#20 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
They all look good except for the one that is actually used. Which could also work but looks for the script in the wrong place. Best advice I can give you: "pip uninstall PyFoam". Make sure that none of these files is present anymore. Try "pip install" again. If it doesn't work check whether all these files are there again
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Tutorials] Tutorial of how to plot residuals ! | wolle1982 | OpenFOAM Community Contributions | 171 | February 20, 2024 03:55 |
How to plot residuals vs iterations using pyFoam... | ata313ata | Visualization & Post-Processing | 1 | February 6, 2018 05:34 |
Plot the residuals over all the domain | Douglas | OpenFOAM Post-Processing | 0 | June 27, 2017 17:01 |
plot residuals | pigna | OpenFOAM Running, Solving & CFD | 2 | December 19, 2014 03:32 |
How to plot residuals of all iterations in Fluent | FJSJ | FLUENT | 4 | September 20, 2013 10:47 |