List of keywords, by module

Numerical methods and mathematical models of Elmer
Rich_B
Posts: 431
Joined: 24 Aug 2009, 20:18

Re: List of keywords, by module

Post by Rich_B »

Wow, that's a lot to consider!

Just a few notes:

For Peter's note #1, would it be relatively easy to upgrade old code such as the model parser to use parse-able constructs such as GetLogical? This would allow the static code analysis to work with the older code. I know touching old code is usually off limits, but with 700 plus consistency tests to find any issues, it should be fairly safe?

Regarding ElmerGUI, there are about (150) F90 modules, and (34) ElmerGUI edf menu files, so ElmerGUI covers a sub-set (about 20%) of the solvers. The edf menu files also only cover a sub-set of keyword commands for each solver. Having solver specific keyword files, such as FlowSolve.KEYWORDS, HeatSolve.KEYWORDS, opens up the possibility to add more keyword commands to the edf menu files. Some kind of a tool that would generate suggested keyword entries that could be added manually to edf menu files would allow the edf menu files to be more complete, or at least more accurate. Alternatively, using static code analysis to compare the solver specific keywords against the edf menu file keywords, might help point out errors or suggest missing elements.

Constructing edf menu files has always been a tedious and error prone task, so having a keywords suggestion tool (combined with generous use of free text input boxes) would help make creating new edf menu files a little easier.

Just my three cents,

Rich.
wiesi
Posts: 27
Joined: 12 Apr 2011, 21:29
Antispam: Yes

Re: List of keywords, by module

Post by wiesi »

Yeah, there are quite some details to it. I also underestimated the work required for the static code analysis. It went from "I'll have a look at it this afternoon" to a few days of work.

Regarding Peter's #1: If those keywords are only a few and no new ones of this style will be added, they are no real issue. Either document them and leave them alone, add special cases in the keyword extractor if you want to find them without touching the Elmer code or change the Elmer code if one dares.

From the keyword extractor perspective, a sufficient Elmer code change would be to wrap them in a "GetOldKeyword" wrapper function (or one per type). In the most simple case this function would have a single string parameter (the keyword name) which it just returns. Then, add GetOldKeyword() to the KWreaders list of the keyword extractor and voila, it should find the occurrences.

wiesi
Rich_B
Posts: 431
Joined: 24 Aug 2009, 20:18

Re: List of keywords, by module

Post by Rich_B »

Your suggestion about "GetOldKeyword" makes sense, simple enough yet effective.

The other side regarding point #1, will be how best to create future solvers. Having a recommended method of adding keywords while building a new solver should be helpful and should help keep the keyword documentation up to date. Maybe describe the recommended method in the ElmerProgrammersTutorial pdf or maybe in a sticky forum post?

Rich.
FFF
Posts: 36
Joined: 11 Jun 2021, 11:00
Antispam: Yes

Re: List of keywords, by module

Post by FFF »

Hi

Thank you for this nice tool!
I had some difficulties (even though everything is perfectly described in the ReadMe of the git) in generating the keywords.html and it took me some time to understand and apply the correct terminal commands. Below are the commands which led me to success.

Code: Select all

	git clone https://github.com/ElmerCSC/elmerfem.git
	cd elmerkeywordextractor-main/
	python3  ElmerKeywordExtractor.py -i ../elmerfem/fem/src/ -o keywords.html -k ../elmerfem/fem/src/SOLVER.KEYWORDS
	iconv -f ISO-8859-1 -t UTF-8 ../elmerfem/fem/src/modules/contrib/ShellMultiSolver/ShellMultiSolver.F90 > ../elmerfem/fem/src/modules/contrib/ShellMultiSolver/ShellMultiSolver.F90
	python3  ElmerKeywordExtractor.py -i ../elmerfem/fem/src/ -o keywords.html -k ../elmerfem/fem/src/SOLVER.KEYWORDS
	firefox keywords.html
Here is the output file:
keywords.zip
(215.89 KiB) Downloaded 18 times
Post Reply